"4430601","1","9023512","","2010-12-13 15:48:23","1","1492","<p>My Twitter application is based on a <strong>secured</strong> twitter account and should be able to accept or deny follower requests. At the moment I query new incoming friendship request through <code>twitterInstance.getIncomingFriendships(-1);</code>which works fine.</p><p>Now I want to accept a request. For this purpose I use <code>twitterInstance.createFriendship(friendId);</code> and my application will tell my account to follow this person <strong>but</strong> this function does not ""accept"" his following request. </p><p>What is wrong with this approach? Is there another method? </p>","504648","","","","","2012-01-26 18:42:51","Problem by accepting follower request with a secured twitter account - Twitter4j","<android><user><twitter-api><twitter4j>","1","0","","",""
"4430637","1","","","2010-12-13 15:51:10","0","130","<p>i put this question in this forum because i am not sure whether this is an eclipse error or an Android error.yesterday i created an Android application using Google Maps and GPS on Eclipse and it build and ran successfully however today i wanted to do some modification to the code so i started eclipse but it gave me an error.</p><pre><code>SDK parse failed</code></pre><p>if i try to run it. it says the apk cannot find. how can that be happened? the same application ran successfully on the same environment yesterday. i am using Ubuntu 10.04</p><p>Thanks !!</p><p><img src=""http://i.stack.imgur.com/fStXF.png"" alt=""alt text""></p>","434375","","434375","","2010-12-13 16:13:07","2010-12-14 00:19:05","Android application giving a weird error in Eclipse","<android><eclipse>","2","9","","",""
"4430701","1","4430953","","2010-12-13 15:57:40","0","140","<p>I am trying to develop an android widget that should show the latest news, but only one at a time. To see the next post the user could press arrow buttons. </p><p>I want it to look something like this:</p><p><img src=""http://i.stack.imgur.com/CsJlu.png"" alt=""alt text""></p><p>What control should I use for this??</p>","297410","","","","","2010-12-13 16:22:33","Android: Help with widget that shows news","<android><android-widget><widget>","1","1","1","",""
"4430781","1","4430854","","2010-12-13 16:05:17","4","1045","<p>How to create Vibrator object and call vibrate function? <a href=""http://developer.android.com/reference/android/os/Vibrator.html"" rel=""nofollow"">http://developer.android.com/reference/android/os/Vibrator.html</a> doesn't give much information regarding how to create the object ( no public constructors )</p>","110024","","","","","2010-12-13 16:11:55","Vibrator in android","<android>","1","0","","",""
"4430794","1","","","2010-12-13 16:06:46","0","2053","<p>HiI am making an Android app for recording a audio for 5-10 sec and store that in Database.For audio recording i follow this  <a href=""http://xhampa.pastebin.com/Yr2hie6q"" rel=""nofollow"">http://xhampa.pastebin.com/Yr2hie6q</a></p><p>But it is not working properly. What to do ?I can not record the Audio on my G1 mobile. Any suggestion welcome.</p>","412168","","","","","2012-01-23 15:48:37","How to record a audio in Android and save it in Database?","<android><audio-recording>","1","3","1","",""
"4430849","1","4431071","","2010-12-13 16:11:29","8","14895","<p>I am currently trying to write alarm manager that will make an alarm go off within a specified period of time, daily.  First I check to see if the user has had an alarm set for that for that day:</p><pre><code>      if ((User.getReminderTime(Home.this) &gt; 0)    &amp;&amp; (dt.getDate() != today.getDate() || dt.getDay() != today      .getDay())) {   AppointmentManager.setFutureAppointmentCheck(this     .getApplicationContext());   User.setLongSetting(this, ""futureappts"", today.getTime());  }</code></pre><p>Then I go and set the actual alarm to go off between 12 and 12:10 of the next day:</p><pre><code>     public static void setFutureAppointmentCheck(Context con) {  AlarmManager am = (AlarmManager) con    .getSystemService(Context.ALARM_SERVICE);  Date futureDate = new Date(new Date().getTime() + 86400000);  Random generator = new Random();  futureDate.setHours(0);  futureDate.setMinutes(generator.nextInt(10));  futureDate.setSeconds(0);  Intent intent = new Intent(con, FutureAppointmentReciever.class);  PendingIntent sender = PendingIntent.getBroadcast(con, 0, intent,    PendingIntent.FLAG_ONE_SHOT);  am.set(AlarmManager.RTC_WAKEUP, futureDate.getTime(), sender); }</code></pre><p>Now I setup a test environment for this to go off every two minutes and it seems to be working fine, however when I deploy to an actual device, the reciever does not seem to be recieving the alarms.  I thought it might be an issue with the device being asleep, so I added the power manager.  But it still does not work:</p><pre><code>      PowerManager pm = (PowerManager) context    .getSystemService(Context.POWER_SERVICE);  PowerManager.WakeLock wl = pm.newWakeLock(    PowerManager.PARTIAL_WAKE_LOCK, ""keepAlive"");  wl.acquire();  setFutureAppointments(context.getApplicationContext());  AppointmentManager.setFutureAppointmentCheck(context    .getApplicationContext());  User.setLongSetting(context.getApplicationContext(), ""futureappts"",    new Date().getTime());  wl.release();</code></pre><p>Anyone see anything I am doing blatantly wrong or am I going about this incorrectly?  thanks for any and all help.</p>","408079","","408079","","2011-02-26 06:36:39","2013-07-24 09:20:13","How to Set Recurring AlarmManager to execute code daily","<android><notifications><alarmmanager>","2","0","8","",""
"4430865","1","","","2010-12-13 16:12:49","5","1313","<p>I'd like to open up a <code>SurfaceView</code> with a icon placed in the center of the screen when an application is first started.  I'm evoking icon creation using an implementation of <code>SurfaceHolder.Callback</code> to track when the 'Canvas' object is ready.  My question is is there a better way?  Are there less cumbersome methods of starting a <code>SurfaceView</code> with some <code>Drawables</code> loaded on creation without having to resort to placing draw logic within a callback object?</p><p>Here's my code for reference.  First the object which does drawing:</p><pre><code>public class CanvasDraw{    protected final SurfaceHolder mHolder;    protected final Drawable mDrawable;    public interface DrawLogic{        void draw(Rect _surface);    }    public CanvasDraw(SurfaceView _view, Drawable _drawable){        mHolder = _view.getHolder();        mDrawable = _drawable;    }    public void draw(DrawLogic _logic){        Canvas canvas = null;        try{            canvas = mHolder.lockCanvas();            if( canvas != null ){                Log.i(""DRAWABLE"", ""Drawing "" + mDrawable.toString());                _logic.draw( mHolder.getSurfaceFrame() );                mDrawable.draw(canvas);            }            else{                Log.i(""DRAWABLE"", ""Canvas null valued"");            }        }        finally{            if( canvas != null ){                mHolder.unlockCanvasAndPost(canvas);            }        }    }}</code></pre><p>and then my private callback object:</p><pre><code>private class DrawOnceCallback implements SurfaceHolder.Callback {    private final SurfaceHolder mHolder;    public DrawOnceCallback(SurfaceHolder _holder ){        mHolder = _holder;        mHolder.addCallback(this);    }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {}    @Override    public void surfaceCreated(SurfaceHolder holder) {        Log.i(""SURFACEHOLDER"",""Surface created.  Canvas available."");        mDrawTiles.draw( new CanvasDraw.DrawLogic(){            @Override            public void draw(Rect _surface) {                mTiles.setBounds(                     _surface.centerX() - mDrawWidth/2,                    _surface.centerY() - mDrawHeight/2,                    _surface.centerX() + mDrawHeight/2,                    _surface.centerY() + mDrawHeight/2);            }        });        mHolder.removeCallback(this);    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {Log.i(""SURFACEHOLDER"",""Surface destroyed."");}}</code></pre>","178060","","","","","2011-03-21 18:31:46","Initializing SurfaceView with a Drawable","<android><drawable><surfaceview>","1","1","","",""
"4430888","1","4431052","","2010-12-13 16:14:49","5","5329","<p>I insert an image via:</p><pre><code>    ContentValues values = new ContentValues();       values.put(Images.Media.TITLE, filename);    values.put(Images.Media.DATE_ADDED, System.currentTimeMillis());     values.put(Images.Media.MIME_TYPE, ""image/jpeg"");    Uri uri = this.getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values);</code></pre><p>But when I try to delete</p><pre><code>    File f = new File(imageURI);    f.delete();</code></pre><p>The picture is no longer there but an empty placeholder is. Any ideas?</p>","427377","","","","","2014-02-18 00:17:18","Android file delete leaves empty placeholder in Gallery","<android><gallery>","4","0","1","",""
"4431101","1","4443895","","2010-12-13 16:38:51","1","1255","<p>I'm writing a program that imports our contacts into the Contacts db on the phone so they show up in the Contacts app, are available for caller id to draw from, etc. I've got it working the way we want on the emulator and the Motorola Droid. When I go to Menu --> View, I can see our application with a check box next to it, and when it's checked, our contacts show up fine. </p><p>However, when I try the same thing on the HTC Evo, the contacts don't show up in People, and I don't have our application listed in the View menu. The contacts show up when I do a search within People, and when the contact calls the phone, their contact info shows up fine.</p><p>The contacts I'm testing our application with aren't in the phone already ;-) They're special test cases with unique names; that's how I'm able to determine they are actually coming from our app.</p><p>I sort of get the feeling this is a HTC Sense issue, but I don't have a way to confirm that right now. If anyone has any ideas, I'd love to hear them.</p>","443659","","","","","2010-12-14 20:29:50","Created contacts not showing up on HTC Evo","<android><contactscontract><android-contacts>","1","0","1","",""
"4431108","1","","","2010-12-13 16:39:23","0","158","<p>I developed one android application and tested it in HTC desire (sdk 2.2), i can install it and i can work on it. But when i try to install it in lower android sdk devices like HTC EVO (SDK 2.1) or Sony xperia (sdk 1.6) it displaying ""Parser Error"". And in the manifest file i set the the following code.</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:maxSdkVersion=""8""/&gt;</code></pre><p>I dont know what is the solution for this anybody please help me if you know the answer.</p><p>Thanks and Regards,Rajapandian.K</p>","131062","","","","","2011-06-18 05:46:59","Problem in installing my android application","<android>","1","2","","",""
"4431123","1","","","2010-12-13 16:40:41","0","907","<p>I'm having some trouble getting started with Android development. I'm trying to launch the emulator from within the Android SDK and AVD Manager, but when I start a device I get an error saying that the emulator could not find the virtual device.</p><p>I've looked into this problem and found it's due to the manager saving the AVD file into one location but trying to launch from C:\User\USERNAME.android. In my case the manager is saving into C:\User\USERNAME\Downloads.android for some bizarre reason. I've tried moving the .android folder to my home directory. I've also created a new user environment variable called ANDROID_SDK_HOME and setting it to my home directory. (It shouldn't matter if I created a ""user"" environment variable as opposed to a ""system"" environment variable, right?). I even tried doing a symbolic link but the manager still creates files in my Downloads directory.</p><p>I am at a loss as to what could be happening. My only guess is that there might have been a change in the recent revision that voids the old fixes. Any suggestions?</p>","540787","","","","","2011-01-27 20:54:18","Android emulator cannot find AVD file (even when setting ANDROID_SDK_HOME)","<android><mobile><android-emulator>","1","1","","",""
"4431172","1","4431249","","2010-12-13 16:45:47","0","1767","<p>i have a DatePicker d; and i need to get the miliseconds value of the date. (the miliseconds since 1970 value)</p><p>how can i do it?</p>","479886","","","","","2010-12-13 16:52:46","Can i get miliseconds date value from a datepicker ? (the miliseconds since 1970 value)","<android><datepicker>","2","0","","",""
"4431181","1","4431239","","2010-12-13 16:46:42","2","268","<p>Good morning,</p><p>I am using the following code so that my app shows up when the user chooses a Share option on an image:</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>I am unable to figure out how to get the image or a Uri to the image when the user chooses my app.</p><p>Any help is appreciated.</p>","349398","","","","","2010-12-13 16:52:03","How do get a reference to the file chosen in a action.SEND","<android><intentfilter>","1","0","1","",""
"4431307","1","4431442","","2010-12-13 16:57:17","0","2342","<p>How to turn on GPS and Internet on Android, with code? </p>","472537","","445543","","2011-10-05 04:57:55","2011-10-05 04:57:55","Android turn on GPS and Internet","<android><gps><internet>","1","1","","",""
"4431321","1","4486190","","2010-12-13 16:58:37","0","123","<p>I upgraded to the 2.3 sdk today, and then changed my project build target to 2.3 and did a clean and build. When I run it on a 2.2 device I get a null pointer exception on this line:</p><pre><code>mSoundPool.play(index, streamVolume, streamVolume, 1, 0, speed);</code></pre><p>Which worked fine with the 2.2 sdk, is the something I'm doing wrong or not doing that I need to in order to properly upgrade my project's build target?</p><p>This is how it's initialized:</p><pre><code>mSoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);</code></pre>","353674","","353674","","2010-12-13 19:18:00","2010-12-20 01:24:30","Android, upgraded existing project to sdk2.3, now get null pointer","<android><build><sdk>","2","0","","",""
"4431334","1","","","2010-12-13 16:59:59","0","918","<p>I'm messing about with Fingerpaint.java in the 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>I've made a few adjustments to where I can save the bitmap and reopen to edit it later. Got that all working. Only issue is the canvas color on the saved copy is black rather than the color I set it too which means the canvas color when I go into edit is also black. I load my saved bitmap as such: The rest of the file is more or less the same as the one in the SDK. I'm just trying to figure out how I can get my canvas back to the desired color as when I first created it.</p><pre><code>    public MyView(Context c) {        super(c);                   Bundle extras = getIntent().getExtras();        imageURI = extras.getString(Intent.EXTRA_SUBJECT);        mBitmap = BitmapFactory.decodeFile(imageURI);        Drawable d = new BitmapDrawable(mBitmap);          Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);          Canvas canvas = new Canvas(bitmap);          d.setBounds(0, 0, width, height);          d.draw(canvas);          mBitmap = bitmap;          mCanvas = canvas;          mPath = new Path();          mBitmapPaint = new Paint(Paint.DITHER_FLAG);      }</code></pre>","427377","","","","","2011-02-18 08:23:58","Android fingerpaint canvas color","<android>","1","1","","",""
"4431345","1","4432076","","2010-12-13 17:01:11","0","343","<p>I am in an operating systems course that centers around hacking up android phones. I want to set my friend's wallpaper to something amusing but benign. Sadly, our test phones does not have wireless drivers on them. Any idea of how I can adb push something in? </p><p>Is there a wallpapers directory I can place things in, for instance? </p>","265629","","","","","2010-12-13 18:17:00","How do I push a wallpaper to android?","<android>","1","1","","",""
"4431386","1","4431410","","2010-12-13 17:04:59","11","11602","<p>I am using something like this to share some text using available applications on the user's phone.</p><pre><code>public void share(String subject,String text) {     final Intent intent = new Intent(Intent.ACTION_SEND);     intent.setType(""text/plain"");     intent.putExtra(Intent.EXTRA_SUBJECT, subject);     intent.putExtra(Intent.EXTRA_TEXT, text);     startActivity(Intent.createChooser(intent, getString(R.string.share)));}</code></pre><p>My main problem is that I would like to have a different text if the user chooses Twitter instead of email for example (short version with short URLs VS full text with attached images).</p><p>How can ont find out which application the user has decided to use?</p>","490961","","","","","2012-02-12 23:31:22","Android share intent chooser","<android><facebook><twitter><android-intent>","1","1","6","",""
"4431470","1","","","2010-12-13 17:14:12","4","336","<p>Since google apps do not sell in China. Only Taiwan, and hong kong.....When is google planning on selling Android apps in China?</p><p>Right now, there are dozens of Chinese companies that allow developers such as myself to sell apps, and Motorola even allows sales, however, Motorola's app store is very Big Brotherish, just like iPhone store...they refused several of my apps because they contained links from my free version to buy the paid version....</p><p>None are as easy to work with as Google.</p>","420259","","750987","","2011-05-29 06:31:40","2011-05-29 06:31:40","Android App Sales in Mainland China?","<android><google-play><international>","0","0","1","2010-12-14 01:00:09",""
"4431471","1","","","2010-12-13 17:14:19","2","230","<p>I got HTC Desire phone, and i want to be able to run my application (developing ob eclipse or netbeans) on it. But when i run my applications i see (in the list of running devices ??? in 'name' column and ??? in status column. So i can<code>t press OK button (it</code>s just disabled). Please tell me how can i make normal synchronization???</p>","540828","","","","","2010-12-13 17:33:59","Android on ubuntu with eclipse","<android>","2","0","1","",""
"4431485","1","4431603","","2010-12-13 17:15:28","0","290","<p>I am working on iPhone app development currently (primarily native app using Obj-C and some web app using jQTouch). My question is regarding the future of this space;</p><ol><li>In say 3 years time, what do you think would be preferred (native or web app) ?</li><li>What are the strengths going to be for native app (I know for certain types like Games, people prefer native than browser-based, but will that remain that way forever)</li><li>Some people say HTML5 will replace native app development, as it will be ""code once, run anywhere"" kind of thing (like common for iPhone, Android, BB phones). So do you think HTML5 can completely eliminate native app development.</li></ol><p>I know the mobile space is constantly changing with new technologies coming up regularly and hence one cannot say with certainty what the situation will be 3 years forward. But I think there are projections being made by many agencies. So are there any reputed ones which can give a general idea or some sense of what might happen in future. </p><p>My main aim is what exactly should be my focus (like what technology/platform/native-web apps), if I want to look at the mobile space for the next 5-10 years.</p><p>Please provide as many responses as possible.</p>","486205","","486205","","2010-12-13 18:05:04","2011-01-05 08:58:47","General questions regarding mobile development","<iphone><android><mobile>","2","1","","",""
"4431663","1","","","2010-12-13 17:34:18","2","1040","<p>Okay i was browsing android source code and stumbled here </p><p><a href=""http://android.git.kernel.org/?p=platform/packages/apps/Gallery.git;a=blob;f=src/com/android/camera/CropImage.java"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Gallery.git;a=blob;f=src/com/android/camera/CropImage.java</a></p><p>the CropImage.java file seem to have some uninitialized variables at lines 740 , 741 etc. I am talking about the mLeft , mRight , mTop and mBottom variables.</p><p>They do not seem to be declared anywhere in the class. </p><p>Am i missing something here ?? how does the code compiles with these errors ??</p>","388044","","","","","2010-12-13 17:47:33","Android 2d Gallery source code Strange errors","<android><2d><gallery>","2","5","","",""
"4431710","1","4431789","","2010-12-13 17:39:15","1","2049","<p>I have a ContentObserver onChange() declared as a subclasse in my activity. But it always returns false. Can anyone tell me why?</p><p><strong>(Update)</strong>This code must call the fillList if the CallLog content provider changes. I mean, if I make a new call, so the data of the call will be inserted in the content provider, so it must return to the observer that something has changed there, so it will call the fillList().But it always return false, even If I make a new call on the emulator.</p><p>Here is the code.</p><pre><code>    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);            callList.add(""Contact Number: "" + contactNumber                    + ""\nContact Name: "" + contactName + ""\nDuration: ""                    + duration + ""\nDate: "" + callDate);            this.db.insert(CallDataHelper.TABLE_NAME, null, values);            Toast.makeText(getBaseContext(), ""Inserted!"", Toast.LENGTH_LONG);        } 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","","","","","2011-02-28 23:51:53","Android onChange() method only returns false","<android><android-contentprovider><android-context><calllog><android-sdk-2.3>","1","0","","",""
"4431803","1","","","2010-12-13 17:50:01","2","822","<p>I'm building an Air for Android App and I'm having problems loading a flex module. Does anyone know if loading modules is possible???</p><p>I built a simple app with just a ModuleLoader in it, which loads a mx:module. The module has only a simple mx:Label with a ""Hello World"" text.</p><p>I build a .air with this. Then I build a .apk with the followin adt command.</p><blockquote>  <p>adt -package -target apk-emulator -storetype pkcs12 -keystore certificate.p12 hello.apk hello.air</p></blockquote><p>The application works just fine when running it on the PC, but when I do it on the apk-emulator it just goes blank and throws error #2032.</p>","540861","","142162","","2011-09-25 14:04:47","2011-09-25 14:04:47","Loading Module on an Air/Android application","<android><flex><module><air><apk>","1","0","2","",""
"4431806","1","4657388","","2010-12-13 17:50:14","0","1141","<p>I'm working with an <code>ActivityGroup</code> which is orientation-aware.</p><p>When the phone is in portrait-mode <code>Activity</code> A should be started.When in landscape-mode <code>Activity</code> B should be started.</p><p>I do have a custom title in both of these activities, that is called within the corresponding <code>onCreate</code> methods.</p><p>I call the initialisation of the custom title like this:</p><pre><code>@Overrideprotected void onCreate(Bundle icicle) {    super.onCreate(icicle);    customTitleBar = new CustomTitleBar(getWindow());    Log.d(TAG, ""onCreate called"");    setContentView(R.layout.layout_a);    customTitleBar.init();    ...}</code></pre><p>And it all works when I'm launching each <code>Activity</code> on it's own.</p><p>But when trying to start them within the <code>ActivityGroup</code>, my app crashes with this exception:</p><pre><code>java.lang.RuntimeException: Unable to resume activity {foo.bar.MyActivityGroup}:java.lang.RuntimeException: Unable to start activity ComponentInfo{foo.bar.ActivityA}:android.util.AndroidRuntimeException:You cannot combine custom titles with other title features</code></pre><p>I'm not using any title feature within the <code>ActivityGroup</code>. Is anyone able to help me with this issue?</p>","422060","","422060","","2010-12-13 18:03:33","2011-01-11 12:02:19","ActivityGroup with Window.FEATURE_CUSTOM_TITLE throws RuntimeException","<android><runtimeexception><activitygroup>","1","0","","",""
"4431959","1","4442146","","2010-12-13 18:05:47","1","510","<p>When using the sample app - contact manager, and adding a contact where you have not set up an account. The contacts get written to the database, but do not show up in the contacts application. The contacts application also does not seem to require an account be setup, but does show contacts which are added through the menu -> add method. </p><p>Is there an updated ContactManager app for 2.2+ which addresses this issue? Is there a missing parameter that needs to be set to allow visibility on the android contacts application? </p><p>The only difference seems to be that the contact_in_visible_group is set to zero when it is added via the ContactManager, it is set to one when set via the contacts application. Looking through the android source code for Contacts did not seem to yield any way to modify this value, and no way to change it via the API.</p><p>Thanks</p>","393258","","95313","","2011-08-17 01:43:12","2011-08-17 01:43:12","Contacts not shown in contacts app - when using sample contact manager application","<android><contacts><contact><android-2.2-froyo>","1","0","","",""
"4432042","1","4442549","","2010-12-13 18:14:06","1","725","<p>I'm using a lazy image loader, that sets an ImageView's bitmap. I can drag the gallery, and it drags smoothly until my images load in. Then while I'm dragging the gallery stutters, as if it's trying to recenter on the middle image and doesn't let me drag. I have to do a fling to get it to move and not recenter. Anyone else run into this issue?</p>","413414","","","","","2012-02-13 11:53:55","Android: Lazy Image Loader causes Gallery to stutter","<android><gallery>","2","2","","",""
"4432077","1","4433641","","2010-12-13 18:17:17","1","977","<p>How do I fill an image as a background in android; similar to filling  an image as a windows background?</p><p>That is to say, I want to image to be stretched/shrunk to fit the background, but maintain its aspect ratio cropping sides equivalently if needed.  Is this possible?</p><p>For example, if I have an 800x800 image which I use as a background. If it is loaded onto a 320x240 device, then the image should be shrank to 320x320 and used as a background cropping 40 from each side on the short edge.</p>","481009","","481009","","2010-12-14 01:20:51","2010-12-14 01:20:51","How do I fill an image as a background in android using xml while maintaining the aspect ratio?","<android>","1","0","","",""
"4432194","1","","","2010-12-13 18:30:03","2","2962","<p>Why aren't specular highlights showing up in the binary produced by the following code?</p><pre><code>package com.example.helloandroid;import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.FloatBuffer;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.opengl.GLSurfaceView.Renderer;public class TestRenderer implements Renderer {    private FloatBuffer vb;    private FloatBuffer mab, mdb, msb;    private FloatBuffer lPos;    private FloatBuffer lab, ldb, lsb;    public TestRenderer() {        vb = ByteBuffer.allocateDirect(24 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        vb.put(new float[]{            110.0f, 240.0f,            110.0f, 190.0f,            160.0f, 240.0f,            160.0f, 190.0f,            210.0f, 240.0f,            210.0f, 190.0f,            110.0f, 290.0f,            110.0f, 240.0f,            160.0f, 290.0f,            160.0f, 240.0f,            210.0f, 290.0f,            210.0f, 240.0f});        vb.position(0);        mab = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        mab.put(new float[]{1.0f, 0.0f, 0.0f, 1.0f});        mab.position(0);        mdb = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        mdb.put(new float[]{0.0f, 1.0f, 0.0f, 1.0f});        mdb.position(0);        msb = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        msb.put(new float[]{0.0f, 0.0f, 1.0f, 1.0f});        msb.position(0);        lPos = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        lPos.put(new float[]{160.0f, 240.0f, 10.0f, 1.0f});        lPos.position(0);        lab = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        // THIS WORKS..        lab.put(new float[]{0.0f, 0.0f, 0.0f, 1.0f});        lab.position(0);        ldb = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        // SO DOES THIS..        ldb.put(new float[]{0.0f, 0.0f, 0.0f, 1.0f});        ldb.position(0);        // BUT NOT THIS        lsb = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();        lsb.put(new float[]{1.0f, 1.0f, 1.0f, 1.0f});        lsb.position(0);    }    @Override    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);        gl.glEnable(GL10.GL_LIGHTING);        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        gl.glMaterialfv(GL10.GL_FRONT, GL10.GL_AMBIENT, mab);        gl.glMaterialfv(GL10.GL_FRONT, GL10.GL_DIFFUSE, mdb);        gl.glMaterialfv(GL10.GL_FRONT, GL10.GL_SPECULAR, msb);        gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lPos);        gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lab);        gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, ldb);        gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_SPECULAR, lsb);        gl.glEnable(GL10.GL_LIGHT0);    }    @Override    public void onSurfaceChanged(GL10 gl, int width, int height) {        gl.glViewport(0, 0, width, height);        gl.glMatrixMode(GL10.GL_PROJECTION);        gl.glLoadIdentity();        gl.glOrthof(0.0f, width, 0.0f, height, -1.0f, 1.0f);        gl.glMatrixMode(GL10.GL_MODELVIEW);        gl.glLoadIdentity();        gl.glTranslatef(0.0f, 0.0f, -1.0f);    }    @Override    public void onDrawFrame(GL10 gl) {        gl.glClear(GL10.GL_COLOR_BUFFER_BIT);        gl.glVertexPointer(2, GL10.GL_FLOAT, 0, vb);        gl.glNormal3f(0.0f, 0.0f, 1.0f);        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 6);        gl.glDrawArrays(GL10.GL_LINE_STRIP, 6, 6);    }}</code></pre><p>Here is what I see from the code as is (with just a specular lighting component): i.imgur.com/4kvIx.png</p><p>With just an ambient lighting component: i.imgur.com/80Tjx.png</p><p>With just a diffuse lighting component: i.imgur.com/r5PkO.png</p><p>Possibly of interest is that the zNear/zFar parameters in my call to glOrtho don't seem to clip anything. Have I properly set up the scene to even view a specular highlight (I did try to position the light near a vertex)?</p><p>Thanks.</p>","354311","","44729","","2010-12-13 18:36:38","2012-06-20 22:34:48","Why isn't this Android specular lighting example working as intended?","<android><opengl-es><lighting><normals>","2","0","3","",""
"4432231","1","4432295","","2010-12-13 18:33:36","0","116","<p>i have to select a interval of time.</p><p>i have two timepickers on my app, i need to check if timepicker1 selected time is less than timepicker2 selected time. If not, i have to show a toast to told the user the error.</p><p>I also need to do this with two datepickers,not with times in that case, but with dates.</p><p>please can someone give me some code examples for do this?</p>","479886","","","","","2010-12-13 19:08:23","How to check if timepicker1 time is oldest than timepicker2 time?","<android><datepicker><timepicker>","1","0","","",""
"4432261","1","4470103","","2010-12-13 18:36:29","9","4512","<p>I'm creating a list of pictures using a ListView and the photos are of a size that would fit 2 to 3 photos on the screen.</p><p>The problem that I'm having is that I would like to when the user stops scrolling that the first item of the visible list would snap to the top of screen, for example, if the scroll ends and small part of the first picture displayed, we scroll the list down so the picture is always fully displayed, if mostly of the picture is displayed, we scroll the list up so the next picture is fully visible.</p><p>Is there a way to achieve this in android with the listview?</p>","540908","","","","","2014-02-28 06:21:27","List view snap to item","<android><listview>","3","0","5","",""
"4432305","1","4432396","","2010-12-13 18:40:50","-1","2005","<p>How can I do this? I have an HTML button and I'd like to open an intent when I click on that button.</p>","472537","","899344","","2012-08-18 02:06:38","2012-08-18 02:06:38","android - open intent from a webview's button click","<android><html>","1","0","","",""
"4432314","1","","","2010-12-13 18:42:05","2","3145","<p>I am using sqlite FTS3 database, with my Android application.</p><pre><code>   public Cursor getWordMatches(String query, String[] columns) {        String selection = KEY_WORD + "" MATCH ?"";        String[] selectionArgs = new String[] {query+""*""};        return query(selection, selectionArgs, columns);   }</code></pre><p>.....</p><pre><code>private Cursor query(String selection, String[] selectionArgs, String[] columns) {    SQLiteQueryBuilder builder = new SQLiteQueryBuilder();    builder.setTables(FTS_VIRTUAL_TABLE);    builder.setProjectionMap(mColumnMap);         Cursor cursor = builder.query(mDatabaseOpenHelper.getReadableDatabase(),            columns, selection, selectionArgs, null, null, null);    if (cursor == null) {        return null;    } else if (!cursor.moveToFirst()) {        cursor.close();        return null;    }    return cursor;}</code></pre><p>If I make a query and search for 'house' I will get:</p><pre><code>household house apartment house big house</code></pre><p>(I am getting everything that has house in it, in regex <em>house</em>)</p><p>How can I get this kind of result for my query?</p><pre><code>householdhouse</code></pre><p>(So i only want results that start with house, in regex house*)</p><p>My android application FORCE CLOSES if I use LIKE statement(maybe because db has 200000 rows).So should I somehow combine MATCH and LIKE statement?Is it even possible to do this on Android, if it is not maybe I should try to run some regex on cursor after I get it from this query?</p>","508216","","","","","2011-08-15 14:24:31","using sqlite (with FTS) on Android","<android><sqlite>","1","2","2","",""
"4432412","1","","","2010-12-13 18:52:20","0","582","<p>In my gallery i want to show lots of pictures, one at a time, but the size of all the pictures taken together, is too large to fit into memory. So I will have to load/unload pictures as the user moves through the gallery. Each view in the gallery consists of a RelativeLayout, containing the picture and a describing text.  Is there a method I could override that gets called each time the gallery view changes?</p><p>getView of the corresponding adapter is not suitable, it sometimes does not get called.</p>","540935","","","","","2012-11-11 12:58:53","dynamic gallery content in android","<android><memory><gallery>","1","0","","",""
"4432453","1","4432570","","2010-12-13 18:57:22","4","5334","<p>I'm developing a network app, which is group oriented. The thing is that when I'm about to join a group, it first checks if the group is secure, and if so, it asks for user and password. Getting group security may take a couple of seconds so I spawn a new thread for the whole process. I'd like to pop up a Dialog in case the group requires security. I'm thinking it may have to do with background threads, they may not be able to pop up Dialogs... But the thing is that I need to check the group security in the background thread because it takes a bit time.</p><p>Hope anyone can come up with the solution or any way to ask user/pass only when the group is secure. Here's the background thread:</p><pre><code>public void run() { secInf = mGroupId.getSecurityInformation(); if (secInf.getAdmissionLevel() == CreateGroupDialog.PRIVATE_KEY_ACCESS) {  showUserPasswordDialog(); } else {  mService.joinGroup(mGroupId);  // Notifies handler to dismiss ProgresDialog and start activity  mHandler.sendMessage(Message.obtain(mHandler,      GroupsActivity.JOIN_SUCCESSFUL)); }</code></pre><p>Where showUserPasswordDialog does (mActivity is the activity that spawned this thread):</p><pre><code> private void showUserPasswordDialog() {  AlertDialog dialog;  // add this to your code  // This example shows how to add a custom layout to an AlertDialog  LayoutInflater factory = LayoutInflater.from(mActivity);  final View textEntryView = factory.inflate(    R.layout.alert_dialog_text_entry, null);  AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);  builder.setIcon(R.drawable.alert_dialog_icon);  builder.setTitle(R.string.ask_user_password);  builder.setView(textEntryView);  builder.setPositiveButton(R.string.ok_text,    new DialogInterface.OnClickListener() {     public void onClick(DialogInterface dialog, int whichButton) {      String userName = ((EditText) mActivity        .findViewById(R.id.username_edit_alert_dialog))        .getText().toString();      String password = ((EditText) mActivity        .findViewById(R.id.password_edit_alert_dialog))        .getText().toString();      Credentials cred = new CredentialsL1(userName, password);      mSmeppService.joinGroup(mGroupId, cred);      mHandler.sendMessage(Message.obtain(mHandler,        GroupsActivity.JOIN_SUCCESSFUL));    });  builder.setNegativeButton(R.string.cancel_text,    new DialogInterface.OnClickListener() {     public void onClick(DialogInterface dialog, int whichButton) {      dialog.cancel();      mHandler.sendMessage(Message.obtain(mHandler,        GroupsActivity.DISMISS_PROGRESS_DIALOG));     }    });  dialog = builder.create();  /* I found this somewhere, but didn't work either */  // Window window = dialog.getWindow();  // WindowManager.LayoutParams lp = window.getAttributes();  // lp.token = textEntryView.getWindowToken();  // lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;  // window.setAttributes(lp);  // window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);  dialog.show(); }</code></pre><p>I'm getting this exception:</p><pre><code>12-13 19:18:31.823: ERROR/AndroidRuntime(1702): FATAL EXCEPTION: Thread-3812-13 19:18:31.823: ERROR/AndroidRuntime(1702): android.view.InflateException: Binary XML file line #17: Error inflating class android.widget.EditText12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at org.pfc.threads.GroupJoinerThread.showUserPasswordDialog(GroupJoinerThread.java:76)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at org.pfc.threads.GroupJoinerThread.run(GroupJoinerThread.java:52)12-13 19:18:31.823: ERROR/AndroidRuntime(1702): Caused by: java.lang.reflect.InvocationTargetException12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.widget.EditText.&lt;init&gt;(EditText.java:51)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at java.lang.reflect.Constructor.constructNative(Native Method)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     ... 8 more12-13 19:18:31.823: ERROR/AndroidRuntime(1702): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.os.Handler.&lt;init&gt;(Handler.java:121)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.text.method.MetaKeyKeyListener$MetaKeyDropbackHandler.&lt;init&gt;(MetaKeyKeyListener.java:605)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.text.method.MetaKeyKeyListener.&lt;init&gt;(MetaKeyKeyListener.java:96)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.text.method.BaseKeyListener.&lt;init&gt;(BaseKeyListener.java:25)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.text.method.TextKeyListener.&lt;init&gt;(TextKeyListener.java:66)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.text.method.TextKeyListener.getInstance(TextKeyListener.java:83)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.widget.TextView.&lt;init&gt;(TextView.java:806)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     at android.widget.EditText.&lt;init&gt;(EditText.java:55)12-13 19:18:31.823: ERROR/AndroidRuntime(1702):     ... 12 more</code></pre><p>The XML layout file is:       </p><pre><code>   &lt;EditText       android:id=""@+id/username_edit_alert_dialog""       android:enabled=""false""       android:layout_height=""wrap_content""       android:layout_width=""fill_parent""       android:layout_marginLeft=""20dip""       android:layout_marginRight=""20dip""       android:scrollHorizontally=""true""       android:autoText=""false""       android:capitalize=""none""       android:gravity=""fill_horizontal""       android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;  &lt;!-- Password --&gt;   &lt;TextView       android:id=""@+id/password_view""       android:layout_height=""wrap_content""       android:layout_width=""wrap_content""       android:layout_marginLeft=""20dip""       android:layout_marginRight=""20dip""       android:text=""@string/password_view_text""       android:gravity=""left""       android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;   &lt;EditText       android:id=""@+id/password_edit_alert_dialog""       android:enabled=""false""       android:layout_height=""wrap_content""       android:layout_width=""fill_parent""       android:layout_marginLeft=""20dip""       android:layout_marginRight=""20dip""       android:scrollHorizontally=""true""       android:autoText=""false""       android:capitalize=""none""       android:gravity=""fill_horizontal""       android:password=""true""       android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;</code></pre><p></p>","483362","","54200","","2010-12-13 19:00:51","2012-07-17 17:24:44","Popping up a Dialog from a non-UI thread","<android><alertdialog><android-inflate>","2","0","","",""
"4432459","1","4432819","","2010-12-13 18:57:56","2","687","<p>In my application I have a ""search"" screen where the user types into an EditText and then clicks a button to do a search.</p><p>I'd like the screen to automatically trigger the search after the user has used the voice recognition utility to populate the EditText with text.  Is there a handler I can listen for to do this?  I'm looking for a handler or message specifically for a voice recognition return.</p>","406790","","","","","2010-12-13 19:44:41","Intercepting voice recognition","<android><voice><voice-recognition>","1","0","","",""
"4432531","1","5872535","","2010-12-13 19:08:02","12","5040","<p>I'm not sure if anyone else noticed it, but the Gingerbread emulator runs like a dog, with both scrolling, navigating, interaction - all taking much longer and being much choppier. I even got an ANR in the browser when I tried to use it: <a href=""http://www.androidpolice.com/2010/12/06/walkthrough-and-hands-on-with-the-gingerbread-ui-the-new-gingerbread-keyboard-in-all-its-sexiness/"">http://www.androidpolice.com/2010/12/06/walkthrough-and-hands-on-with-the-gingerbread-ui-the-new-gingerbread-keyboard-in-all-its-sexiness/</a> (see towards the bottom).</p><p>I've just read about the new StrictMode at <a href=""http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html"">http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html</a> and about all the performance improvements in Gbread, but my experience so far suggests just the opposite.</p><p>Can we get to the bottom of this? I find myself dreading bringing up an instance of Gingerbread at this point.</p>","47680","","244296","","2011-01-03 01:30:14","2011-05-03 16:20:31","Gingerbread emulator instance is much more sluggish than Froyo and below. Why?","<android><performance><emulator><android-sdk-2.3><strictmode>","6","0","6","",""
"4432574","1","4432668","","2010-12-13 19:15:35","1","1014","<p>After reading Brad Fitzpatrick's <a href=""http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html"" rel=""nofollow"">article</a> on StrictMode I'm left with a few questions.</p><p>Where does File I/O belong in my applications? (I know the UI thread is wrong but could spawning a new thread be worse?)</p><p>If I should use a thread for doing disk access then how should my application handle the implementation? Send parameters to an AsyncTask? Shared variables? I want to optimize memory usage as well not only responsiveness (especially since there isn't any noticeable difference on my phones)</p><p>@Brad if your reading this: I'd love a blog post with samples (or links to places in the aosp source) where this was done in the frameworks.</p><p>Thanks everyone!</p>","413575","","","","","2010-12-13 19:27:12","Doing File I/O on Android - Which thread does it belong on","<android><file-io><strictmode>","1","0","","",""
"4432649","1","4432704","","2010-12-13 19:24:59","13","17294","<p>How do I add a horizontal 1px white line above image view in a relative layout? </p><pre><code>&lt;RelativeLayoutandroid:id=""@+id/widget38""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_x=""108px""android:layout_y=""87px""&gt;  &lt;ImageViewandroid:id=""@+id/widget39""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_alignParentTop=""true""android:layout_alignParentRight=""true""&gt;  &lt;/ImageView&gt;  &lt;/RelativeLayout&gt;</code></pre>","538428","","","","","2013-10-16 13:25:53","horizontal 1px white line above image view in a relative layout","<android><xml><monodroid>","2","0","3","",""
"4432828","1","4432925","","2010-12-13 19:45:19","3","1856","<p>I have three main things I want to change with the appearance of a ListView.1) get rid of horizontal dividers that print between items2) change font size of test displayed in listview3) change the padding around each item displayed</p><p>It looks like after reading for a while that 2) and 3) should be controlled by changing these properties for the TextView used by the ListView, but I don't yet understand how to do that. Can someone answer these with a little more detail? </p>","500964","","321697","","2010-12-13 20:42:14","2010-12-13 22:29:50","How to change appearance of ListView?","<android><listview>","2","0","","",""
"4432846","1","4434075","","2010-12-13 19:47:28","1","1297","<p>I have a ListView in one of my activities. I also want to have a custom title bar in the same activity. So my onCreate method starts something like </p><pre><code>public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        customTitle = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);            setContentView(R.layout.categorieslayout); //yup, i am not extending ListActivity, but just Activity        setCustomTitleBar();                ...    }</code></pre><p>When i run this, i get the error </p><pre><code>java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</code></pre><p>If i comment out the part where i request the window feature and call the function to set the custom title bar, it works fine. I am not sure how to get through this.</p><p>Any help is appreciated, thanks</p>","531036","","","","","2010-12-13 22:23:22","Custom title bar with ListView","<android><listview>","1","4","","",""
"4432903","1","4433070","","2010-12-13 19:53:45","10","11601","<p>I have a layout that uses an EditText to let users search a database and populate a ListView.  The EditText is about 2/3 of the way from the top of the screen (positioned over an ImageView, and followed by some intro text.)</p><p>The problem is that the soft keyboard hides the EditText, so the user can't see what he's typing.  (I disabled the auto-suggest.)</p><p>I've tried LinearLayout, RelativeLayout, paddings, and different alignments/centerings, but I still can't get it to work right.  The EditText is either hidden, gets pushed off the top of the screen, or get ""squished"" and distorted.</p><p>Suggestions???</p><p>One possible workaround is to move the EditText to the top of the screen.  However, this deviates from the graphic design that I was given.</p><p>Another possible workaround is for me to make the soft keyboard open in full screen (not sure how, though).  This will still hide the EditText, but then I can re-enable the auto-suggestion so the user can see what he's typing... sort of... because he can only see the <em>suggestions</em> for what he's typing.</p><p>Here's my latest attempt.  See ""introFrame"".</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=""fill_parent"" android:orientation=""vertical""&gt; &lt;LinearLayout android:id=""@+id/titleContainer""  android:orientation=""horizontal"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;  &lt;TextView android:text=""@string/title_string""   android:textSize=""15sp"" android:textColor=""#FFFFFF""   android:textStyle=""bold"" android:paddingLeft=""5dp""   android:layout_height=""fill_parent"" android:layout_width=""wrap_content"" /&gt; &lt;/LinearLayout&gt; &lt;FrameLayout  android:id=""@+id/introFrame"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:gravity=""center_horizontal"" &gt; &lt;ImageView   android:src=""@drawable/main_search_image""  android:scaleType=""center""  android:layout_gravity=""center""  android:layout_height=""wrap_content""  android:layout_width=""wrap_content""/&gt; &lt;LinearLayout  android:orientation=""vertical""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_gravity=""center""  android:paddingTop=""140dp"" &gt;  &lt;LinearLayout android:id=""@+id/introSearchContainer""   android:orientation=""horizontal""    android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_gravity=""center_vertical"" &gt;   &lt;LinearLayout     android:orientation=""horizontal""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""1"" &gt;    &lt;EditText android:id=""@+id/intro_search_box""      android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:hint=""     Enter keyword     ""      android:imeOptions=""actionGo""        android:inputType=""textFilter""      android:maxLines=""1"" /&gt;   &lt;/LinearLayout&gt;   &lt;LinearLayout     android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" &gt;    &lt;Button android:id=""@+id/intro_search_button""      android:background=""@drawable/custom_button_go""     android:layout_width=""wrap_content""      android:layout_height=""wrap_content"" /&gt;    &lt;/LinearLayout&gt;  &lt;/LinearLayout&gt;  &lt;TextView   android:text=""@string/search_intro""   android:textSize=""15sp""   android:textColor=""#FFFFFF""   android:layout_height=""wrap_content""   android:layout_width=""fill_parent"" /&gt;  &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; &lt;LinearLayout android:id=""@+id/listContainer""  android:orientation=""vertical"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;ListView android:id=""@+id/itemlist"" android:layout_width=""wrap_content""   android:layout_height=""wrap_content"" android:cacheColorHint=""#00000000"" /&gt;  &lt;TextView android:text=""No data found"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" android:gravity=""center""   android:textSize=""16sp"" android:textColor=""#FFFFFF"" android:id=""@+id/android:empty"" /&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","359519","","345717","","2010-12-13 19:57:04","2012-01-04 22:40:59","SoftKeyboard hiding EditText","<android><edittext><android-softkeyboard>","3","0","5","",""
"4432931","1","4433294","","2010-12-13 19:57:56","5","9604","<p>just wanted to ask is there a possibility to bind some listener to the ListView scroll event.</p><p>What I would like to achieve is that once ListView have been scrolled to the bottom I would like to ask server for more data if any is there.</p><p>I know that there is a function like: getLastVisiblePosition() but I assume it must bu used in some kind of listener in order to compare with currently last visible position, am I right ?</p><p>cheers,/Marcin</p>","193400","","","","","2013-07-09 10:09:39","Binding onScrolling listener to the android ListView","<android><listview>","3","0","2","",""
"4433102","1","4433173","","2010-12-13 20:19:53","0","3557","<p>Though I've write some small applications with android before, now I trying to write a root application and having some problems regarding file permissions.</p><p>Basically, my aim is to manipulate /etc/hosts file with a Java application. As my first action, I've gained root privileges with runtime.exec(""su"") and tried to open hosts file with standard ways like using File() or FileOutputStream(). But unsuccessfully, my application threw the following exception ""java.io.FileNotFoundException: /etc/hosts (Permission denied)"". Then I checked the permissions for file via accessing shell, and it was like rw-r--r-- for root. Even if it supposed to work with this permissions, I changed it to 777 from shell and voila! my application started to open file without any problem. However, since android replaces the hosts file with default version time to time, it also changes the permission for the file and with previous method, each time I have to go and change permission from adb and surely this is not I want. So, step by step;</p><p>-I tried runtime.exec(""chmod 777 /etc/hosts"") method and this didn't work without any exception or error message. </p><p>-Then I tried to use File.setWritable() method but it doesn't exist in my andoid system, though it seems supposed to be android 2.2 according to javadoc. </p><p>-Lastly, I tried to set working directory with System.setProperty(""user.dir"",""/etc/"") and use openFileOutput(""hosts"", MODE_WORLD_WRITABLE) but of course this didn't work, either.Now, I'm all out of any ideas right now. What is the way to manipulate system files in android?regards,</p>","225717","","","","","2011-03-01 06:45:45","/etc/hosts file manipulation programmatically in android","<java><android><superuser>","2","6","","",""
"4433135","1","","","2010-12-13 20:22:47","0","691","<p>I am loading a PreferenceScreen from an xml file to use as the screen to configure a new event so I'm attempting to clear and reset the values of the SharedPreference this activity is using. The problem I'm encountering is that when attempting to move to using a named preference manager, it seems the preference gets cleared but when I select an EditTextPreference element, the old data is still the default entered text on the popup.</p><p>In my onCreate method I'm attempting to initialize the preferences, clear them, then set to default values. My understanding from the dev resources were that there's no way to clear/reset in one step..</p><pre><code>private static final String PREFNAME = ""newmeetingactivity.preferences"";//load preferences and set nameaddPreferencesFromResource(R.layout.newmeeting_preferences);getPreferenceManager().setSharedPreferencesName(PREFNAME);getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);//Clear the preferences _sharedPreferences = getPreferenceManager().getSharedPreferences();SharedPreferences.Editor ed = _sharedPreferences.edit();ed.clear();ed.commit();//Load default preferences from file againPreferenceManager.setDefaultValues(this, _sharedPreferences.toString() , MODE_PRIVATE, R.layout.newmeeting_preferences, true);</code></pre><p>Edit: To try to better explain what I'm attempting to do (in case my approach is way off): I need to clear shared preferences used on a given activity while not interfering with the settings from other activities (as they should persist indefinitely).</p>","354642","","354642","","2010-12-13 21:34:21","2010-12-14 02:10:49","Resetting preferences when using PreferenceScreen","<java><android>","1","0","","",""
"4433208","1","4433251","","2010-12-13 20:30:48","7","18836","<p>Can somebody please give me some links / tutorials to using SQLite file thatis stored on a SD card? Not implementing the OpenHandler. </p><p>/SD CARD//info.db</p><p>I want to use an external SQlite database file (not use Android internal data store) because I want to frequently update the database file to provide more up to date information on info.db.</p><p>Thank you.</p>","186446","","234039","","2010-12-13 20:52:32","2011-03-01 07:26:46","Android: use SQLite database on SD Card (not using internal Android Data Store at all)","<android><sqlite>","2","0","5","",""
"4433383","1","4433441","","2010-12-13 20:51:36","5","7501","<p>Can I set some message to appear like a ""tooltip"" for a TextView or Button?</p>","508377","","321697","","2010-12-13 21:15:00","2012-07-24 18:58:20","Can I set something like ""tooltip"" for a view in android?","<android><view><edittext><toast><hint>","2","3","","",""
"4433388","1","","","2010-12-13 20:52:16","5","1601","<p>I am trying to make a android app in intellij idea using scala. I made an android module and a scala module. I'm just after a little hello world for starters.I added the scala module as a dependency for the android module but when I builde the project(""make project"") or try to run the thing I get this error:</p><p>trouble writing output: format == null</p><p>Does anyone know what the problem is?</p><p>P.S. In netbeans I can't even add anything as a resource for an android project.</p><p>Could it be that this is not the way to do it, do I need to modify the main module's ant script or something? Any pointers are welcomed.</p><p>Thanks</p>","242721","","","","","2010-12-17 16:26:59","intellij idea android scala application","<android><scala><intellij-idea>","1","0","2","",""
"4433394","1","","","2010-12-13 20:52:40","1","308","<p>This question is about using the Google Android SDK, in the Java programming language.</p><p>My question could be boiled down to: Why is this code causing the android emulator to crash?</p><p>I've been wrestling for a few days with concurrency related to setting up different threads for a game app.I have made many variations, but they have all failed. At this point, I just want to get a basic concurrent setup going. The worst part is that it is the emulator that crashes, so DDMS reports nothing; therefore I'm pretty clueless as to where the issue is. </p><p>The following code shows an activity (class Main), that calls class SceneManager, which creates a thread to be used for game logic stuff. A 3rd class, StatusChannel, is (will be) used to communicate status information between the different threads (Eventually, there will also be a OpenGL rendering thread).</p><p>The emulator crashes at different times. It may run for 20 seconds or for 5 minutes.</p><p>The setContentView(R.layout.main) in the Activity class just the set basic layout that Eclipse creates.</p><p>I've commented out the usage of Node (Created in the Activity class and accessed in SceneManager)</p><p>I have installed sdk versions 1.5 through 2.3 -- The current app is targeted at 2.1</p><p>The issue has something to do with the SceneManager class. I'm specially suspicious of the run() method.</p><p>Here are the 3 classes.</p><p>Sorry for the code length.</p><pre><code>public class Main extends Activity { private SceneManager mSceneManager; private volatile Node mSceneGraph = new Node();  private volatile Status mStatusChannel = new Status();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {     Log.d(""-- Main"", ""onCreate()"");        super.onCreate(savedInstanceState);             setContentView(R.layout.main);        // Holds the scene assets, such as the stage,        // the agents, camera, etc.        mSceneManager = new SceneManager(mSceneGraph, mStatusChannel);              mSceneManager.onCreate();    }    @Override    protected void onResume() {     Log.d(""-- Main"", ""onResume()"");             super.onResume();     mSceneManager.onResume();                     }         @Override    protected void onPause() {     Log.d(""-- Main"", ""onPause()"");             super.onPause();        mSceneManager.onPause();            }      @Override    protected void onDestroy() {     Log.d(""-- Main"", ""onDestroy()"");        super.onDestroy();        mSceneManager.onDestroy();    }    }public class SceneManager implements Runnable{ private Thread mThread; private volatile Status mStatusChannel; private volatile Node mSceneGraph; private volatile long mMillis = 0;  private volatile PrepareVisitor mPrepareVisitor; private volatile int mStatus = Status.UNKNOWN_STATUS;  SceneManager(Node sceneGraph, Status statusChannel) {  mPrepareVisitor = new PrepareVisitor();  mStatusChannel = statusChannel;  mSceneGraph = sceneGraph;        mMillis = SystemClock.uptimeMillis();    mThread  = new Thread(this);   mThread.setName(""LogicThread"");   mStatusChannel.setSceneManagerStatus(Status.READY_STATUS); } public void onCreate() {  Log.d(""-- SceneManager"", ""onCreate()..."");   // This will start the thread in a paused state.  mThread.start();  } public void onResume() {  Log.d(""-- SceneManager"", ""onResume()..."");  // Unpause the status manager, if it is currently paused.  if (mStatusChannel.getSceneManagerStatus() == Status.PAUSED_STATUS) {   mStatusChannel.setSceneManagerStatus(Status.READY_STATUS);    }   }  public void onPause() {  Log.d(""-- SceneManager"", ""onPause()..."");     if (mStatusChannel.getSceneManagerStatus() != Status.UNKNOWN_STATUS) {   mStatusChannel.setSceneManagerStatus(Status.PAUSED_STATUS);    } }  public void onDestroy() {    mStatusChannel.setSceneManagerStatus(Status.QUIT_STATUS);    try {   mThread.join();  }  catch (InterruptedException e) {   Log.d(""-- SceneManager"", ""InterruptedException"");  } } /**  *  This method should not be called by clients of this class.  */ @Override public void run() {  Log.d(""-- SceneManager"", ""Called..."");  // Main logic loop.  outer: while (true) {   // How much time has elapsed since last call.   long timeDelta = SystemClock.uptimeMillis() - mMillis;    switch (mStatus) {   case Status.READY_STATUS:    //mPrepareVisitor.go(mSceneGraph, timeDelta);    break;      case Status.PAUSED_STATUS:    break;   case Status.QUIT_STATUS:    break outer;       case Status.UNKNOWN_STATUS:    int renderStatus = mStatusChannel.getRendererStatus();        if (renderStatus == Status.READY_STATUS) {     mStatusChannel.setSceneManagerStatus(Status.READY_STATUS);    }    break;   }   mStatus = mStatusChannel.getSceneManagerStatus();         // Update the time.   mMillis = SystemClock.uptimeMillis();   } } }public class Status { /* Generic Statuses */ public final static int UNKNOWN_STATUS = 0;  public final static int READY_STATUS = 1;   public final static int PAUSED_STATUS = 2;   public final static int QUIT_STATUS = 3;   /* Current statuses values */ private int mSceneManagerStatus = UNKNOWN_STATUS ; private int mRendererStatus  = UNKNOWN_STATUS ; public synchronized int getSceneManagerStatus() {  return mSceneManagerStatus; } public synchronized int getRendererStatus() {  return mRendererStatus; } public synchronized void setSceneManagerStatus(int status) {  mSceneManagerStatus = status; } public synchronized void setRendererStatus(int status) {  mRendererStatus = status; } }</code></pre><p>-- EDIT --</p><pre><code>This issue happens even with something as simple as this:public class ThreadActivity extends Activity {    private Booboo mBooboo;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mBooboo = new Booboo();        mBooboo.onCreate();    }}public class Booboo implements Runnable {        private Thread mThread;        Booboo() {                mThread = new Thread(this, ""SceneManagerThread"");               }        public void onCreate() {                Log.d(""Booboo"", ""Thread started"");                mThread.start();        }        @Override        public void run() {                while (true) {}        }}</code></pre><p>I know the first reaction is to say that it's the while(true){}. Just remember that this is a contrived example to show the issue.  In my own code, I do the lifecycle activity as described in the docs. The issue is that the emulator crashes after some time in an infinite loop like that, whether you have break conditions or not. </p>","541050","","881229","","2014-01-28 09:04:42","2014-01-28 09:04:42","Android emulator crashes while using concurrency","<android><concurrency><android-emulator>","1","1","","",""
"4433406","1","4433662","","2010-12-13 20:54:48","-2","182","<p>I'm having problems with an app engine now that I have my whole game set up, it kind of sucks.What's this error message mean?  I really don't understand what the problem is.  Is the problem with one of my sprites that is causing the game engine to get mad?</p><pre><code>12-13 12:48:15.389: ERROR/Rokon(1776):   addToActive(1505553220)12-13 12:48:15.389: WARN/System.err(1776): java.lang.Exception:   addToActive(1505553220)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.Debug.error(Debug.java:71)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.TextureManager.addToActive(TextureManager.java:54)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.Texture.onLoadTexture(Texture.java:228)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.GLHelper.checkTextureValid(GLHelper.java:201)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.GLHelper.bindTexture(GLHelper.java:189)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.GLHelper.drawNormal(GLHelper.java:366)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.DrawableObject.onDrawNormal(DrawableObject.java:382)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.DrawableObject.onDraw(DrawableObject.java:360)12-13 12:48:15.389: WARN/System.err(1776):     at com.stickycoding.rokon.Layer.onDraw(Layer.java:138)12-13 12:48:15.397: WARN/System.err(1776):     at com.stickycoding.rokon.Scene.onDraw(Scene.java:934)12-13 12:48:15.397: WARN/System.err(1776):     at com.stickycoding.rokon.RokonRenderer.onDrawFrame(RokonRenderer.java:40)12-13 12:48:15.397: WARN/System.err(1776):     at com.stickycoding.rokon.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1112)12-13 12:48:15.397: WARN/System.err(1776):     at com.stickycoding.rokon.GLSurfaceView$GLThread.run(GLSurfaceView.java:946)</code></pre><p>Any input would be useful, thank you!</p>","513014","","44729","","2010-12-13 22:31:38","2010-12-14 22:49:16","What does this error message mean, it's caused by the rokonandroid game engine","<java><android><opengl-es><textures><rokon>","2","1","","",""
"4433464","1","4434419","","2010-12-13 21:01:52","4","2804","<p>Shown below is a simplified version of my class.  I am having trouble in the onReceive method which isn't updating the widget TextView.  It shows the correct information in the logcat which is outputted on the line before the setTextViewText.  I'm not sure whats wrong and have been pulling my hair out (and I'm already balding).</p><pre><code>public class SnowWidget extends AppWidgetProvider {public static List&lt;Article&gt; mymtns = new ArrayList&lt;Article&gt;();public static RemoteViews remoteViews;public static ComponentName thisWidget;public static String amount = """";public static String mtn_name = """";public static String desc = """";public static String condition = """";public static String[] type;public static int index = 0;@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager,   int[] appWidgetIds) {    remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);    thisWidget = new ComponentName(context, SnowWidget.class);    // This one works fine    remoteViews.setTextViewText(R.id.snowwidget,  mtn_name+ ""\n""+ amount+""\""\n""+ condition);    /* Make the buttons work */Intent next = new Intent(context, SnowWidget.class);next.setAction(ACTION_WIDGET_RECEIVER);PendingIntent nextPendingIntent = PendingIntent.getBroadcast(context, 0, next, 0);remoteViews.setOnClickPendingIntent(R.id.nextMtn, nextPendingIntent);/* END - Make the buttons work */    appWidgetManager.updateAppWidget(thisWidget, remoteViews);}@Overridepublic void onReceive(Context context, Intent intent) {    // check, if our Action was called    if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)) {        if(mymtns.size() &gt; 0)        {            // This show up correctly in logcat            Log.d(""onReceive"", ""New Info =&gt; ""+ mtn_name+ ""\n""+ amount+""\""\n""+ condition);            // This never updates my widget            remoteViews.setTextViewText(R.id.snowwidget,  mtn_name+ ""\n""+ amount+""\""\n""+ condition);        }    }    super.onReceive(context, intent);}</code></pre><p>}</p>","307310","","","","","2013-11-19 19:00:39","setTextViewText not updating widget","<java><android><android-widget>","1","1","","",""
"4433547","1","","","2010-12-13 21:15:55","1","2100","<p>I am trying to add a new row inside an existing SQLite database, but for some reason it doesn't seem to do it. I've created this method to insert the row into the table:</p><pre><code>public void insertToTable(ArrayList&lt;String&gt; courseAttributes, ArrayList&lt;String&gt; attributeValues){  ContentValues cv = new ContentValues();  for (int i = 0 ; i &lt; courseAttributes.size() ; i++){     cv.put(courseAttributes.get(i), attributeValues.get(i));  }  coursesDataBase.insert(""courses"", null, cv);}</code></pre><p>where <strong>courseAttributes</strong> is an arraylist of all the columns in the table, <strong>attributeValues</strong> is an arraylist of the corresponding values for the row I am trying to add, <strong>coursesDataBase</strong> is the SQLiteDatabase and ""<strong>courses</strong>"" is the name of the table in this database. I don't get any errors when I run it on the debugger, however it does not store the new row in the database.  I call the method from another class, in between the following open and close methods:</p><pre><code>public void openDataBase() throws SQLException{ //Open the database    String myPath = DB_PATH + DB_NAME; coursesDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);}</code></pre><p>and</p><pre><code>@Overridepublic synchronized void close() {     if(coursesDataBase != null)      coursesDataBase.close();     super.close();}</code></pre>","539538","","","","","2010-12-13 21:15:55","Android: Adding new rows into a SQLite database","<android><sqlite><insert><newrow>","0","4","","",""
"4433564","1","","","2010-12-13 21:17:10","0","444","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4400699/google-maps-api-infowindow-incorrect-height-on-iphone-android-browser"">Google Maps API InfoWindow Incorrect Height on iPhone/Android Browser</a>  </p></blockquote><p>When I rotate my phone into landscape mode and tap on one of the markers on the Google map, the infowindow that opens is compressed (see picture).</p><p>I have tried every combination possible to set the height of the content in the infowindow, but nothing makes a difference. When the phone is in portrait mode, the infowindows open up fine. This same behavior happens on Android phones.</p><p>The page that I'm working with is: <a href=""http://consumer.certifiedangusbeef.com/Buy/Mobile.aspx"" rel=""nofollow"">http://consumer.certifiedangusbeef.com/Buy/Mobile.aspx</a></p><p><img src=""http://i.stack.imgur.com/ysTyo.png"" alt=""alt text""></p>","265333","","","","","2010-12-13 21:17:10","InfoWindow Cut Off on iPhone - Google Maps v3","<javascript><iphone><android><css><google-maps>","0","2","0","2010-12-27 00:42:27",""
"4433611","1","","","2010-12-13 21:22:49","0","738","<p>I'm able to transfer a file to the server using Java, but I'm not able to transfer the file using socket programming in Android. How do I do this? Here is my Java code:</p><pre><code>import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.FileReader;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.Socket;import java.net.UnknownHostException;public class Client {    InputStream is;    OutputStream os;    FileReader fread;    BufferedReader bfrewad;    FileInputStream fis;    FileOutputStream fos;    static Socket client;    String str="""";    static File f1;    public static void main(String[] args) {         f1=new File(""abc.dat"");        Client c1=new Client();        try {            //c1.writeToAlocalfilefortesting();            client = new Socket(""192.168.0.180"", 34000);            System.out.println(client.isBound());            System.out.println(""socket created "");            c1.createAlinkForFile();            } catch (UnknownHostException e) {            // TODO Auto-generated catch block            System.out.println(""--------""+e.toString());            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            System.out.println(""--------""+e.toString());            e.printStackTrace();        }        catch (Exception e) {            // TODO Auto-generated catch block            System.out.println(""--------""+e.toString()+""-----"");            e.printStackTrace();            }    }    private void writeToAlocalfilefortesting() throws IOException {        System.out.println(""inside the function"");         //TODO Auto-generated method stub        int len;        int count=0;        System.out.println(""here "");        File file=new File(""Nas123456789123.dat"");        System.out.println(""file opened"");        fis=new FileInputStream(file);        System.out.println(""getting input stream"");        byte[] buffer =new byte[25];        os=new FileOutputStream(f1);        System.out.println(""out put stream "");        //int i=fis.read(buf)        while((len=fis.read(buffer))&gt;0){        if(len==25){            count=count+len;            fos.write(buffer, 0, len);            System.out.println(""sritten"");        }        }    }    private  void createAlinkForFile() throws IOException {        // TODO Auto-generated method stub        os=client.getOutputStream();            File file=new File(""Nas123456789123.dat"");        fis=new FileInputStream(file);        byte[] b =new byte[25];         int len1;        int count1=0;        while((len1=fis.read(b))&gt;0){            if(len1==25){                count1=count1+len1;                os.write(b, 0, len1);                os.flush();                System.out.println(""sritten"");            }       }    }}</code></pre>","541090","","223391","","2010-12-13 21:35:53","2011-10-04 14:06:38","problem regarding transferring file to server using socket connection","<android>","2","2","","",""
"4433629","1","4445124","","2010-12-13 21:25:27","4","674","<p>Executing multiple SQL statements without putting them into one transaction is a severe bottleneck (see e.g. <a href=""http://www.sqlite.org/faq.html#q19"" rel=""nofollow"">http://www.sqlite.org/faq.html#q19</a>). I haven't thoroughly checked how SQLite is configured on Android, but anecdotally I perceived dramatical performance increase within my on app when using transactions in more places.</p><p>Is it possible to detect instances where one forgets to use transactions using StrictMode? If not, could that be considered for a future release of StrictMode? It might be somewhat tricky to detect, but two different strategies could be, 1) non-select statements outside transaction, or 2) multiple non-select statements outside transaction executed within a short period of time.</p>","101886","","","","","2010-12-14 22:56:01","Detecting forgotten SQLite transaction on Android using StrictMode?","<android><sqlite><strictmode>","1","0","3","",""
"4433756","1","","","2010-12-13 21:42:08","3","442","<p>I have an open GL ES (1.1) scene with many 3d objects and a ""player"" model. I'd like the player to have the same pixel size, regardless of the screen orientation on an Android phone or Iphone.I'm <em>not</em> using glOrtho or billboards. That's a perspective 3d scene, but I just want the objects to have the same size in both screen orientation. Currently, if I rotate the phone, I keep the same aspect ratio but the scene ""zooms out"" in landscape mode.I suspect that I have to play with parameters to glFrustrum to get this; but can't figure out yet how to do it.So any ideas are welcome!</p><p>Thanks</p>","541123","","44729","","2010-12-13 22:30:21","2010-12-14 03:42:24","OpenGL ES : getting a fixed size for an object","<iphone><android><opengl-es>","1","0","","",""
"4433790","1","4433843","","2010-12-13 21:46:16","4","1241","<p>when passing extras such as Intent.putExtra(""myName"", myName), what's the convention for the name of the extra?</p><p>ie: if passing data between two activities, both would put/extract data under the id ""myName"", but should I just hardcode ""myName"" everywhere, or keep the value in the R.values.string?</p>","490703","","","","","2010-12-13 22:05:03","naming convention for passing data through extras in android","<android>","2","0","2","",""
"4433827","1","","","2010-12-13 21:49:59","0","420","<p>I got some very strange problem:</p><p>Let's say I've got two activities.</p><p>If I launch each one of them as the main activity of the application - everything seems great.</p><p>But if I launch, let's say activity A from activity B. Activity A has the same theme settings as activity B.</p><p>Why is this happening?</p><p>Activity A is translucent, and if I start the application from activity A - it is transparent, but if I start it from activity B - it is not??</p><p>This is 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=""gg.thesis.gallant.command"" android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".viewall.A"" android:label=""@string/app_name""            android:clearTaskOnLaunch=""true"" android:launchMode=""singleTask""            android:theme=""@android:style/Theme.Translucent""&gt;            &lt;intent-filter&gt;&lt;!--    &lt;action android:name=""android.intent.action.MAIN"" /&gt;--&gt;&lt;!--    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;--&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".viewall.B"" android:label=""@string/app_name""            android:clearTaskOnLaunch=""true"" android:launchMode=""singleTask""&gt;            &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;</code></pre><p>....</p><p>Is there any theme inheritance for the activities in Android?</p><p>Thanks!</p>","481828","","","","","2011-07-19 04:46:37","Starting activities problem? Theme problem","<android><activity><themes>","1","0","","",""
"4433893","1","4433968","","2010-12-13 21:57:54","0","297","<p>if i have this URL in from python code on appengine </p><pre><code>http://localhost:8080/blog/view/2f1cab5844fb432b8426ae666c4ac493</code></pre><p>how can i get the value of the key : 2f1cab5844fb432b8426ae666c4ac493</p>","508377","","","","","2010-12-13 22:25:42","how can i get value fron the URL in python appengine?","<python><android><url>","2","0","1","",""
"4433928","1","4433967","","2010-12-13 22:02:40","1","53","<p>I have a service that handles incoming data from and external source. Currently the data it recieves is forwarded to seperate DataManager that notifyAll() threads that the data has arrived. All threads check the data and the correct thread pops it off and processes it and then wait indefinitely until more data arrives. The basic idea of the thread is the class it is attached to holds all data and processing relevant towards a particular objective that may or may not be created in an Activity, but needs to be ready at any given moment.</p><p>I believe this is very inefficient and am attempting to redesign it. What I'm thinking is instead of using threads, use services and just use messenger to pass data around. Is this any more efficient or am I in the same boat?</p>","480691","","","","","2010-12-13 22:08:36","Proper design using services","<android><multithreading><service><performance><message>","1","0","","",""
"4434027","1","4452597","","2010-12-13 22:16:27","22","18815","<p>I'm trying to essentially replicate the functionality of the latest YouTube app in the Android marketplace.  When watching a video there's two separate layouts, one in portrait which provides additional info, and one in landscape which provides a full screen view of the video.</p><p><img src=""http://i.stack.imgur.com/wBuxS.png"" alt=""YouTube app portrait layout""><br><strong>YouTupe app in portrait mode</strong>  </p><p><img src=""http://i.stack.imgur.com/S23Hp.png"" alt=""YouTube app landscape layout""><br><strong>YouTube app in landscape mode</strong></p><p>(Sorry for the randomness of the photos, but they were the first pics I could find of the actual layout)</p><p>This is pretty easy to do normally - just specify an alternate layout in layout-land and all will be good.  The thing that the YouTube app does really well (and what I'm trying to replicate) is that on orientation change, the video continues playing and doesn't have to re-buffer from the beginning.</p><p>I've figured out that overriding onConfigurationChange() and setting new LayoutParameters will allow me to resize the video without forcing a rebuffer - however the video will randomly scale to different widths/heights when rotating the screen multiple times.  I've tried doing all sorts of invalidate() calls on the VideoView, tried calling RequestLayout() on the parent RelativeLayout container and just trying as many different things as I can, but I can't seem to get it to work properly.  Any advice would be greatly appreciated!</p><p>Here's my code:</p><pre><code>@Overridepublic void onConfigurationChanged(Configuration newConfig) {    super.onConfigurationChanged(newConfig);    if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {        questionText.setVisibility(View.GONE);        respond.setVisibility(View.GONE);        questionVideo.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    } else {        questionText.setVisibility(View.VISIBLE);        respond.setVisibility(View.VISIBLE);        Resources r = getResources();        int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 150.0f, r.getDisplayMetrics());        questionVideo.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, height));    }}</code></pre><p>EDIT:  I've discovered in logcat some interesting output that comes up when my video is rotated which seems to be the culprit - although I have no idea how to fix it:</p><p><strong>Logcat output when resizing properly (takes up entire window)</strong>  </p><p>notice the h=726</p><pre><code>12-13 15:37:35.468  1262  1270 I ActivityManager: Config changed: { scale=1.0 imsi=310/4 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=210}12-13 15:37:35.561  1262  1268 I TIOverlay: Position/X0/Y76/W480/H22512-13 15:37:35.561  1262  1268 I TIOverlay: Adjusted Position/X1/Y0/W403/H22512-13 15:37:35.561  1262  1268 I TIOverlay: Rotation/9012-13 15:37:35.561  1262  1268 I Overlay : v4l2_overlay_set_position:: w=480 h=22412-13 15:37:35.561  1262  1268 I Overlay : v4l2_overlay_set_position:: w=402 h=72612-13 15:37:35.561  1262  1268 I Overlay : dumping driver state:12-13 15:37:35.561  1262  1268 I Overlay : output pixfmt:12-13 15:37:35.561  1262  1268 I Overlay : w: 43212-13 15:37:35.561  1262  1268 I Overlay : h: 24012-13 15:37:35.561  1262  1268 I Overlay : color: 712-13 15:37:35.561  1262  1268 I Overlay : UYVY12-13 15:37:35.561  1262  1268 I Overlay : v4l2_overlay window:12-13 15:37:35.561  1262  1268 I Overlay : window l: 1 12-13 15:37:35.561  1262  1268 I Overlay : window t: 0 12-13 15:37:35.561  1262  1268 I Overlay : window w: 402 12-13 15:37:35.561  1262  1268 I Overlay : window h: 726</code></pre><p><strong>Logcat output when resizing incorrectly (takes up tiny portion of full screen)</strong>  </p><p>notice the h=480</p><pre><code>12-13 15:43:00.085  1262  1270 I ActivityManager: Config changed: { scale=1.0 imsi=310/4 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=216}12-13 15:43:00.171  1262  1268 I TIOverlay: Position/X0/Y76/W480/H22512-13 15:43:00.171  1262  1268 I TIOverlay: Adjusted Position/X138/Y0/W266/H22512-13 15:43:00.171  1262  1268 I TIOverlay: Rotation/9012-13 15:43:00.179  1262  1268 I Overlay : v4l2_overlay_set_position:: w=480 h=22412-13 15:43:00.179  1262  1268 I Overlay : v4l2_overlay_set_position:: w=266 h=48012-13 15:43:00.179  1262  1268 I Overlay : dumping driver state:12-13 15:43:00.179  1262  1268 I Overlay : output pixfmt:12-13 15:43:00.179  1262  1268 I Overlay : w: 43212-13 15:43:00.179  1262  1268 I Overlay : h: 24012-13 15:43:00.179  1262  1268 I Overlay : color: 712-13 15:43:00.179  1262  1268 I Overlay : UYVY12-13 15:43:00.179  1262  1268 I Overlay : v4l2_overlay window:12-13 15:43:00.179  1262  1268 I Overlay : window l: 138 12-13 15:43:00.179  1262  1268 I Overlay : window t: 0 12-13 15:43:00.179  1262  1268 I Overlay : window w: 266 12-13 15:43:00.179  1262  1268 I Overlay : window h: 480</code></pre><p>Maybe someone knows what 'Overlay' is and why it's not getting the correct height value?</p>","443839","","443839","","2010-12-13 22:44:59","2014-04-09 11:27:17","Android VideoView orientation change with buffered video","<android><screen-orientation><videoview>","7","1","28","",""
"4434179","1","4434213","","2010-12-13 22:39:35","1","7512","<p>How would I call a method from a different activity?In my main activity, I have a button that shows a dialog to set the difficulty level of the game.Then you click start game which starts a new activity containing a view with all the game information.I need to send the difficulty level chosen to the other activity but cannot seem to figure out how to.</p>","507007","","","","","2012-02-19 17:29:51","Android call method from another activity","<java><android>","2","0","2","",""
"4434192","1","4445105","","2010-12-13 22:40:48","8","3718","<p>I noticed that a <a href=""http://d.android.com/reference/android/os/DropBoxManager.html"">DropBoxManager</a> has been introduced in Android API since FroYo (API 8).</p><p>It looks like an alternative logger capable of logging not only text but also files or byte arrays, but I could not find any detailed doc anywhere about how and when we should use it.</p><p>The <a href=""http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html"">latest android dev blog post introducing StrictMode</a> talks about it, StrictMode can append data to the DropBox, and we are given a shell command to retrieve these data.</p><p>Please share here your knowledge about this! Why has it been implemented in addition to the usual logcat? Can we use this to share data across apps? What kind of apps use it?</p>","343816","","995926","","2012-05-22 08:06:09","2012-05-22 08:06:09","DropBoxManager use cases?","<android><dropbox><android-2.2-froyo><strictmode>","1","4","9","",""
"4434327","1","4464966","","2010-12-13 22:58:41","19","3127","<p>I'm writing a few custom views which share some same-named attributes. In their respective <code>&lt;declare-styleable&gt;</code> section in <code>attrs.xml</code> I'd like to use the same names for attributes:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;declare-styleable name=""MyView1""&gt;        &lt;attr name=""myattr1"" format=""string"" /&gt;        &lt;attr name=""myattr2"" format=""dimension"" /&gt;        ...    &lt;/declare-styleable&gt;    &lt;declare-styleable name=""MyView2""&gt;        &lt;attr name=""myattr1"" format=""string"" /&gt;        &lt;attr name=""myattr2"" format=""dimension"" /&gt;        ...    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>I'm getting an error saying that <code>myattr1</code> and <code>myattr2</code> are already defined. I found that I should omit the <code>format</code> attribute for <code>myattr1</code> and <code>myattr2</code> in <code>MyView2</code>, but if I do that, I obtain the following error in the console:</p><pre><code>[2010-12-13 23:53:11 - MyProject] ERROR: In &lt;declare-styleable&gt; MyView2, unable to find attribute </code></pre><p>Is there a way I could accomplish this, maybe some sort of namespacing (just guessing)?</p><p>Thanks for your help ;)</p>","247095","","56285","","2014-01-15 10:41:19","2014-01-15 10:41:19","Same-named attributes in attrs.xml for custom view","<android><android-view><android-custom-view><android-custom-attributes>","1","2","7","",""
"4434367","1","","","2010-12-13 23:06:18","5","15547","<p>I don't understand why I'm not able to copy my db file (abic_) to the application directory (""/data/data/"" + context.getPackageName() + ""/databases"")</p><p>This is my DataBaseHelper class:</p><pre><code>import java.io.File;import java.io.FileOutputStream;import java.io.InputStream;import java.io.IOException;import java.io.OutputStream;import android.content.Context;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;public class DataBaseHelper extends SQLiteOpenHelper{    //The Android's default system path of your application database.    private String DB_PATH;    private static String DB_NAME = ""abic_"";    private static final Integer DB_VERSION = 1;    private SQLiteDatabase mydb;     private final Context myContext;    /**     * Constructor     * Takes and keeps a reference of the passed context in order to access to the application assets and resources.     * @param context     */    public DataBaseHelper(Context context) {        super(context, DB_NAME, null, DB_VERSION);        this.myContext = context;        DB_PATH = ""/data/data/"" + context.getPackageName() + ""/databases"";    }       @Override    public void onCreate(SQLiteDatabase db) {;    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    }public void apriDatabase() throws SQLException {    try {            String percorso = DB_PATH + DB_NAME;            mydb = SQLiteDatabase.openDatabase(percorso, null, SQLiteDatabase.OPEN_READONLY);    } catch (Exception e) {            e.printStackTrace();    }}public void createDataBase() throws IOException{    boolean dbExist = checkDataBase();    if(dbExist){            //do nothing - database already exist    }else{            //By calling this method and empty database will be created into the default system path           //of your application so we are gonna be able to overwrite that database with our database.            this.getReadableDatabase();            try {                    copyDataBase();            } catch (IOException e) {                    e.printStackTrace();            }    }}private void copyDataBase() throws IOException{    //Open your local db as the input stream    InputStream myInput = myContext.getAssets().open(DB_NAME);    // Path to the just created empty db    String outFileName = DB_PATH + DB_NAME;    // if the path doesn't exist first, create it    File f = new File(outFileName);    if (!f.exists()){            f.mkdir();            f.createNewFile();    }    //Open the empty db as the output stream    OutputStream myOutput = new FileOutputStream(outFileName);    //transfer bytes from the inputfile to the outputfile    byte[] buffer = new byte[1024];    int length;    while ((length = myInput.read(buffer))>0){            myOutput.write(buffer, 0, length);    }    //Close the streams    myOutput.flush();    myOutput.close();    myInput.close();}private boolean checkDataBase(){    SQLiteDatabase checkDB = null;    try{            String myPath = DB_PATH + DB_NAME;            checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);    }catch(SQLiteException e){            //database does't exist yet.    }    if(checkDB != null){            checkDB.close();    }    return checkDB != null ? true : false;} @Override    public synchronized void close() {        if(mydb != null)            mydb.close();        super.close();    }}</code></pre><p>This is the listview that uses this class:</p><pre><code>  import android.app.ListActivity;import android.content.Intent;import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class abicabList extends ListActivity {         protected EditText searchText;         protected SQLiteDatabase mydb;         protected Cursor cursor;         protected ListAdapter adapter;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         mydb = (new DataBaseHelper(this)).getWritableDatabase();         searchText = (EditText) findViewById (R.id.searchText);     }     public void search(View view) {      String text = searchText.getText().toString();     String cap = ""CAP"";     // || is the concatenation operation in SQLite       if (text.length()14) {       cursor = mydb.rawQuery(""SELECT _id, ABI, BANCA, CAB, CAP, Filiale, City FROM abicab WHERE ABI || CAB LIKE ? LIMIT 30"",            new String[]{""%"" + searchText.getText().toString().substring(6,10) + ""%"" + searchText.getText().toString().substring(11,15) + ""%""});          adapter = new SimpleCursorAdapter(                                 this,                                  R.layout.abicab_list_item,                                  cursor,                                  new String[] {""BANCA"", ""Filiale"", ""City"", ""CAP""},                new int[] {R.id.BANCA, R.id.Filiale, R.id.City ,R.id.CAP});      setListAdapter(adapter);    }    }  </code></pre><p>So when I run the application the db is created in the folder but it doesn't contain the table that is in the db I have in asset folder (see the picture   [1]: <a href=""http://i.stack.imgur.com/AaFj8.jpg"">http://i.stack.imgur.com/AaFj8.jpg</a>). Thanks in advance for your help.</p>","541212","","135152","","2011-05-25 03:04:15","2013-07-06 10:09:51","Copy my own SQLite DB from Asset folder to","<android><sqlite>","4","0","2","",""
"4434402","1","","","2010-12-13 23:11:45","0","595","<p>I am an Android beginner working with the openGL ES to try to make some simple 3d animations. I only have one glDrawElements call per screen refresh and I have it set to RENDERMODE_CONTINUOUSLY. Unfortunately, for some reason, my animation is coming out very choppy with a frame rate of around 2FPS. I am drawing about 20,000 triangles, but I would think that is not too many considering some of the complex things you can render. I would be happy to post my code if anyone has any thoughts on why the animation might be so choppy? Thanks in advance</p><p>Avtar</p>","541219","","","","","2010-12-13 23:11:45","Android openGL ES animation rendering is coming out choppy","<android><animation><opengl-es>","0","2","","",""
"4434460","1","","","2010-12-13 23:20:34","2","1007","<p>I'm trying to write a simple test app to run in JUnit. I've been having trouble getting clickView to click on the proper view. Below is some sample code that can be used on SkeletonActivity sample app that comes with the SDK.</p><pre><code>    public class SkeletonInstrumentation extends ActivityInstrumentationTestCase2&lt;Activity&gt;{ private Activity act; private  Button bClear; private  Button bBack; private  EditText eMain; public SkeletonInstrumentation(){  super(""com.example.android.skeletonapp"", Activity.class); } public void setUp() {  String app = this.getInstrumentation().getTargetContext().getPackageName();    this.setActivityInitialTouchMode(true);  act = this.launchActivity(app, SkeletonActivity.class, Bundle.EMPTY);  bClear = (Button) act.findViewById(R.id.clear);  bBack = (Button) act.findViewById(R.id.back);  eMain = (EditText) act.findViewById(R.id.editor); } public void testClick()  {  TouchUtils.clickView(this, bClear); } public void testSendKeys()  {   act.runOnUiThread(    new Runnable(){     public void run(){      bClear.clearFocus();      eMain.requestFocus();     }    }   );  this.sendKeys(""A B C D E F G ENTER""); }}</code></pre><p>testClick runs, but clicks on the main EditText view that has focus when the Activity starts and ends up bringing up the on-screen keyboard. I want it to click on the 'Clear' button below the EditText. Can someone tell me what's wrong here?</p>","541159","","21234","","2010-12-13 23:59:22","2013-12-04 04:21:02","How is clickView used properly?","<android><testing><junit>","2","0","","",""
"4434478","1","5371728","","2010-12-13 23:23:33","5","1152","<p>Originally my AndroidManifest.xml contained an activity which I reached through its custom action name.</p><pre><code>&lt;activity android:label=""HERE I AM"" android:name=""TestController""&gt; &lt;intent-filter&gt;  &lt;action android:name=""com.company.project.TestActivity"" /&gt;  &lt;category android:name=""android.intent.category.DEFAULT"" /&gt; &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>With this manifest <code>startActivity(new Intent(""com.company.project.TestActivity""));</code> started my Activity without any problems.</p><p>But I was not satisfied with this coding style. Earlyer I was severeal times told not to use in-line defined string constants because it wolud lead to less maintainable code. And it really <em>is</em> a point. </p><p>So first I declared a p<code>ublic static final String MY_ACTION = ""com.company.project.TestActivity"";</code> in my App.java class (the one I used for ) and reached my component through this named constant this way:</p><p><code>startActivity(new Intent(App.MY_ACTION));</code></p><p>This seemed much better but I still had to maintain two instances of the same string. At <a href=""http://developer.android.com/reference/android/R.styleable.html#AndroidManifestAction_name"" rel=""nofollow"">http://developer.android.com/reference/android/R.styleable.html#AndroidManifestAction_name</a> a read</p><blockquote>  <p>... 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.</p></blockquote><p>So I guessed It would be fine to have this string defined <em>JUST ONCE</em>. I put <code>&lt;string name=""MY_ACTION""&gt;com.company.project.TestActivity&lt;/string&gt;</code> in my strings.xml and modified my App:</p><pre><code>public class App ...    public static String MY_ACTION;    @Override    public void onCreate() {        super.onCreate();        MY_ACTION = getString(R.string.MY_ACTION);    ...</code></pre><p>And everything was still O.K.</p><p>... until I changed my AndroidManifest.xml to use  <code>&lt;action android:name=""@string/MY_ACTION"" /&gt;</code> instead of <code>&lt;action android:name=""com.company.project.TestActivity"" /&gt;</code>.After this change to my biggest surprise the application broke down at runtime complaining about not finding the Activity for my intent. The string reference was probably not parsed correctly. :(</p><p>Maybe the problem is that R.string is config dependant...? But hey I cannot be so insane to choose such a string reference whose value may change from config to config! And developer.android.com told me it's O.K. to use references at action names! I experienced this behavior at API levels 6, 7, end 8. Is it just a simple bug in the android system? Or do I misunderstand something? </p><p>I am totally puzzled, please help me. Thanks in advance.</p>","498697","","750987","","2011-05-28 13:09:17","2011-05-28 13:09:17","Shouldn't string references work for action names of an intent filter in the AndroidManifest?","<android><action><android-manifest><intentfilter><string-literals>","1","0","1","",""
"4434574","1","","","2010-12-13 23:40:16","1","657","<p>I experience this problem on both samsung i5500 and i5800:<img src=""http://imgur.com/pedgk.jpg""></p><p>Looks like height of divider is between 0 and 1 pixels, so it sometimes rounds to 0 and sometimes to 1. The picture changes if i scroll it.And if i increase dividerHeight (i tried 2px and 2pt), then it becomes exactly 1 pixel thicker: from 0px it becomes 1px and from 1px it becomes 2px, looking like a kind of wave.</p>","181866","","","","","2011-08-01 06:08:50","Ugly separator line in ListView","<android><listview>","1","3","1","",""
"4434588","1","4434869","","2010-12-13 23:43:07","41","25260","<p>I would like to be able to assign a xml attribute or style to a <code>TextView</code> that will make whatever text it has in ALL CAPITAL LETTERS.</p><p>The attributes <code>android:inputType=""textCapCharacters""</code> and <code>android:capitalize=""characters""</code> do nothing and look like they are for user inputed text, not a <code>TextView</code>.</p><p>I would like to do this so I can separate the style from the content.  I know I could do this programmically but again I want keep style out of the content and the code.</p>","445348","","1254536","","2014-03-18 05:35:03","2014-03-18 05:35:03","Is there a way to style a TextView to uppercase all of its letters?","<android><textview><capitalization>","5","0","5","",""
"4434601","1","","","2010-12-13 23:44:15","0","605","<p>I would like to add Top Margin on the first item in the ListView. Is that possible?Or, how can I reference first list item in the List View?</p><p>I tried</p><pre><code>lv = (ListView)getListView();View myRowItem = lv.getChildAt(0);</code></pre><p>Probably, it doesn't work, because at the moment I executed it, list items didn't exist yet. I assume I should try above code in something like onPostRender event. Is there something like that in Java Android?</p>","507153","","52626","","2011-03-28 20:30:28","2014-02-27 21:34:56","How to reference first list item inside ListView?","<android><android-listview>","3","0","","",""
"4434631","1","","","2010-12-13 23:47:48","3","5098","<p>Not sure if this is the right place to ask this question but i`ll give it a try .</p><p>Does anyone know how to put AdMob ads / any-other-ad into Android applications developed in Flash for Adobe AIR ?</p><p>I repeat , ads into Adobe AIR apps , not java !</p><p>Or any other way to monetize the app ?</p><p>Thanks in advance . </p><p>Chris</p>","534591","","","","","2014-04-15 14:26:08","AdMob into AdobeAIR app for Android ","<android><flash><air><admob>","7","0","4","",""
"4434681","1","4434751","","2010-12-13 23:58:31","7","1367","<p>So let's try to explain what I am trying to do... </p><p>I have a design that looks like this - </p><p>![alt text][1]</p><p>For this I have I created two GridViews like so:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""match_parent""              android:layout_height=""wrap_content""&gt;    &lt;LinearLayout android:orientation=""vertical""                  android:layout_width=""match_parent""                  android:layout_height=""wrap_content""&gt;        &lt;TextView style=""@style/GroupName""                  android:text=""@string/currency_badges""/&gt;        &lt;GridView android:id=""@+id/currency_grid""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:columnWidth=""90dp""                  android:numColumns=""auto_fit""                  android:verticalSpacing=""10dp""                  android:horizontalSpacing=""10dp""                  android:stretchMode=""columnWidth""                  android:gravity=""left""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:orientation=""vertical""                  android:layout_width=""match_parent""                  android:layout_height=""wrap_content""&gt;        &lt;TextView style=""@style/GroupName""                  android:text=""@string/foursquare_badges""/&gt;        &lt;GridView android:id=""@+id/foursquare_grid""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:columnWidth=""90dp""                  android:numColumns=""auto_fit""                  android:verticalSpacing=""10dp""                  android:horizontalSpacing=""10dp""                  android:stretchMode=""columnWidth""                  android:gravity=""left""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I am not really happy with it because as you can see the top right icon's label is hidden. I can click and scroll but that's not what I want. Also the bigger problem is that each <em><code>GridView</code> HAS ITS OWN SCROLLBAR</em>. Again not what I want. So I think I would like to use one <code>GridView</code> to accomplish this. How can I use a <code>GridView</code> to have icons and then show the GroupName in the middle of the icons. I know I can create a <code>BaseAdapter</code> to return different types of Views, but I need to have one item that takes horizontally the whole space. Is this possible?</p><p><strong>Edit:</strong></p><p><strong>I guess a better question is how do I create grouped GridViews?</strong></p>","419075","","419075","","2010-12-20 22:43:36","2010-12-20 22:43:36","Is it possible to create a GridView that has children of different sizes?","<android>","1","0","1","",""
"4434758","1","","","2010-12-14 00:14:49","0","2115","<p>I want to play videos using VideoView in Android fullscreen mode.</p><p>When I am playing in portrait mode, the video is occupying only 1/4 of the screen.When I am playing the video in landscape mode , the video is occupying about 3/4th of the screen.</p><p>My question is how can I disable the automatic scaling of the video when using the VideoView.</p><p>Also, I created a class extending VideoView &amp; then overridden the onMeasure() .</p><p>But how can I use the class in another class which extends Activity.</p><p>I have searched a lot on Internet &amp; unable to get  a proper code.</p>","443141","","436938","","2012-04-26 12:30:57","2012-04-26 12:30:57","Full screen mode for displaying videos using VideoView","<android>","2","0","1","",""
"4434766","1","4434927","","2010-12-14 00:16:42","0","1099","<p>Actually I need to create an event in Google Calendar using my app. Every thing working fine I am not able to create desire start time and end time. Can any body please help me to tell how can I generate dtstart n dtend. i.e. I need to create an event for 20/12/2010. please </p><p>thanks</p>","227129","","","","","2011-02-18 17:20:27","Android Google Calendar dtstart dtend","<java><android>","1","0","","",""
"4434811","1","4434832","","2010-12-14 00:26:56","1","1813","<p>When creating my (unsigned) apk file, my res/values/ folder disappears when viewing the apk file through an unzipping program. However, the res/drawables and res/layout folders show up. Is there any way to ensure the apk file contains the res/values/ folder?</p><p>The main use case I have is updating various values in the resources file located in res/values depending on the customer's needs. </p><p>Thanks in advance!</p>","456916","","","","","2010-12-14 00:34:50","How to update resources file in .apk","<android><apk>","2","0","","",""
"4434899","1","4434920","","2010-12-14 00:45:20","0","503","<p>I want to create a component that will appear as a navigation menu for an Android application. Basically, the custom component is a rectangular ""Div"" (to use HTML terms) that contains six buttons. Each button provides a link to another part of the application. I want to use this on every ""page"", so I want to make it easy to maintain.</p><p>What is the recommended class to extend for creating custom components like this? <em>(I've seen the ""Widget"" class, but not sure If this should only be used for widget that appear outside the app (like Google search))</em></p><p>And</p><p>Is the process as simple as creating the custom ""Widget"" class with it's own XML layout and then adding it to each Activity class? </p>","462307","","","","","2010-12-14 00:48:00","Tips on making custom, reuesable components in Android","<android><android-widget>","1","0","","",""
"4434904","1","4434940","","2010-12-14 00:46:01","-2","135","<p>I've been making a game using the rokonandroid game engine, but I randomly get an error that causes the layout to just stay as it is, and never update.</p><p>The following error occurs:</p><p>12-13 15:05:17.876: ERROR/Rokon(2798):   addToActive(229433297)12-13 15:05:17.876: WARN/System.err(2798): java.lang.Exception:   addToActive(229433297)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.Debug.error(Debug.java:71)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.TextureManager.addToActive(TextureManager.java:54)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.Texture.onLoadTexture(Texture.java:228)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.GLHelper.checkTextureValid(GLHelper.java:201)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.GLHelper.bindTexture(GLHelper.java:189)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.GLHelper.drawNormal(GLHelper.java:366)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.DrawableObject.onDrawNormal(DrawableObject.java:382)12-13 15:05:17.876: WARN/System.err(2798):     at com.stickycoding.rokon.DrawableObject.onDraw(DrawableObject.java:360)12-13 15:05:17.884: WARN/System.err(2798):     at com.stickycoding.rokon.Layer.onDraw(Layer.java:138)12-13 15:05:17.884: WARN/System.err(2798):     at com.stickycoding.rokon.Scene.onDraw(Scene.java:934)12-13 15:05:17.884: WARN/System.err(2798):     at com.stickycoding.rokon.RokonRenderer.onDrawFrame(RokonRenderer.java:40)12-13 15:05:17.884: WARN/System.err(2798):     at com.stickycoding.rokon.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1112)12-13 15:05:17.884: WARN/System.err(2798):     at com.stickycoding.rokon.GLSurfaceView$GLThread.run(GLSurfaceView.java:946)</p><p>What causes this error?  Anybody know of how to fix this error?  And is it possible that my textures are causing this problem?</p>","513014","","44729","","2010-12-14 02:11:20","2010-12-14 02:11:20","Why do some of my Textures cause this error?","<java><android><graphics><opengl-es>","1","2","","",""
"4435031","1","4532517","","2010-12-14 01:09:45","13","10540","<p>I'm running into an issue with the android SDK where it doesn't recognize devices plugged in via usb:</p><pre><code>$adb start-server                                 * daemon not running. starting it now on port 5037 ** daemon started successfully *$adb devices                                      List of devices attached</code></pre><p>(list is empty, other sdk tools don't recognize the devices either)</p><p>According to the SDK documentation, on Mac OS X, this should ""just work"". <a href=""http://developer.android.com/guide/developing/device.html#setting-up"">(Setting up a Device for Development)</a></p><p>It's worked for me in the past, but seems to have just stopped. Is there an OS X solution to this problem? (On other operating systems presumably you have to fiddle with USB drivers)</p><p>Have tried:</p><ul><li>Power cycling machine and device</li><li>Switching USB ports Unplugging all</li><li>USB except for the sole (non-split)</li><li>cable to the device Multiple cables</li></ul>","128508","","","","","2013-11-26 10:12:07","adb devices list empty -- Snow Leopard","<android><osx-snow-leopard>","6","4","2","2013-12-16 20:11:15",""
"4435066","1","","","2010-12-14 01:18:52","2","841","<p>why does it return null value?is there a way for assigning a device's id to each an emulator.</p>","489744","","","","","2011-10-10 23:27:11","getDeviceId() API always returns null value on android emulators","<android><android-emulator>","1","2","0","",""
"4435098","1","4436261","","2010-12-14 01:24:36","2","3398","<p>There are several ways of making HTTP call using Android application. If any one wants to bring a image from http server he/she could use one method to bring the image. On the other hand if a person wants to read JSON or XML for http server response he could use another way to do that. Above two scenarios are just the examples other scenarios might occur. My question is that Is there any standard way through which I can keep check of HttpConnection Timeout. In a particular scenario you can have WIFI or GPRS Connection avaialable but because of its high turnaround time, user experience of my application is getting hampered. How can I keep a check on this issue.</p><p>Thanks </p><p>Below is code example </p><pre><code>public boolean readAndSaveFileFromWeb(String url) {    byte[] fileRead = null;    FileOutputStream fos;    try {        InputStream is = (InputStream) this.fetch(url);        if(is!=null){            fileRead = readBytes(is);        }else{            return false;        }    } catch (MalformedURLException e) {        Log.v(TAG, ""readAndSaveFileFromWeb Exception: Malformed URL ""                + e.getMessage());        return false;    } catch (IOException e) {        Log.v(TAG, "" readAndSaveFileFromWeb Exception:   IOException""                + e.getMessage());        return false;    } catch (Exception e) {        Log.v(TAG, "" readAndSaveFileFromWeb Exception: "" + e.getClass());        return false;    }}public Object fetch(String address) throws MalformedURLException,        IOException {    URL url = new URL(address);    Object content = url.getContent();    return content;}</code></pre><p>Now the above code gets the content / response from the address url. In a particular scenario WIFI or GPRS connection is available but the time taken to get data is more if the connection is slow. During this delay .. the application looks hanged though I 'm performing network intensive tasks in different thread than UI thread. This is hampering  user experience a bit.  </p>","218665","","195823","","2010-12-21 13:18:49","2010-12-21 13:18:49","Connection Time Out in Android","<android>","1","1","1","",""
"4435099","1","","","2010-12-14 01:24:41","3","1163","<p>I have a view i dynamically assign background to using SetBackgroundResource(R.drawable.led_red). This was working fine for weeks but suddenly it stopped working for one of the images i'm using for this purpose (led_blue) even though i didn't change anything in the project related to those images. Image simply doesn't appear even though same code works fine with other variations of the led image. This problematic color was also working before...</p><p>I tried a lot of things, it seems like if i add another image to the project so that id (0x7f020000) of that problematic image in R.java changes to something else, it starts working again. But of course i cannot simply solve the problem with that because unless i found the reason why this happened, it may happen for other images in the future.</p><p>Also new image i added which uses 0x7f020000 now is also not working so it seems like it is related to this individual id but i couldn't make sense of it.</p><p>This happens both on device and on the simulator using 2.1 SDK</p><p>Any ideas what is going on?</p><p>Thanks.</p>","541330","","","","","2012-05-05 23:20:43","Weird problem about an android drawable","<android>","2","2","","",""
"4435102","1","","","2010-12-14 01:25:13","0","685","<p>I am using Adwhirl first time in our apps but no joy.. Adwhirl supplied this demo code but it prompt an error ""java.lang.ClassCastException: android.widget.LinearLayout"" on selected line below please</p><pre><code>    AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5);        AdWhirlTargeting.setAge(23);        AdWhirlTargeting.setGender(AdWhirlTargeting.Gender.MALE);        AdWhirlTargeting.setKeywords(""online games gaming"");        AdWhirlTargeting.setPostalCode(""94123"");        AdWhirlTargeting.setTestMode(false);        ***AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.layout_ad);***        TextView textView = new TextView(this);        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(                LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        int diWidth = 320;        int diHeight = 52;        int density = (int) getResources().getDisplayMetrics().density;        adWhirlLayout.setAdWhirlInterface(this);        adWhirlLayout.setMaxWidth((int) (diWidth * density));        adWhirlLayout.setMaxHeight((int) (diHeight * density));        layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);        textView.setText(""Below AdWhirlLayout"");        LinearLayout layout = (LinearLayout) findViewById(R.id.test_layout);        layout.setGravity(Gravity.CENTER_HORIZONTAL);        layout.addView(adWhirlLayout, layoutParams);        layout.addView(textView, layoutParams);        layout.invalidate();</code></pre><p>XML here</p><p>    </p><pre><code>&lt;LinearLayout android:orientation=""vertical""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:gravity=""bottom"" android:id=""@+id/layout_ad"" /&gt;</code></pre><p></p><p>Thanks</p>","227129","","227129","","2010-12-14 11:25:01","2012-11-21 17:08:30","AdWhirl not rendering Android","<android><adwhirl>","2","0","0","",""
"4435228","1","4435256","","2010-12-14 01:52:34","1","997","<p>When attempting to query text fields in SQLite I get force closes if the text field contains a single quote character. I know why it's happening but how can I fix it?</p>","427377","","","","","2010-12-14 02:01:18","Android java SQLite queries and single quotes","<android>","1","1","","",""
"4435304","1","4435657","","2010-12-14 02:13:29","1","1259","<p>Am I forced to use the notifyChange() method? I ask this because, when I call this method it enters on the onChange() method, but when I don't call the notifyChange() the onChange() method is not called. Why? </p>","399459","","14860","","2010-12-14 02:18:37","2010-12-14 03:43:01","Am I forced to use the Android notifyChange() method?","<android><android-contentprovider><calllog>","1","4","","",""
"4435439","1","","","2010-12-14 02:44:23","0","1366","<p>I am using a WebView with a javaScript interface.  All I want to do is change the inner html of a span if some checkboxes are ticked.</p><p>Below is a snippet of a String I have in strings.xml.  The form will call this function onSubmit and should not continue if it does not pass.  The problem is that I can't get the innerHtml working (is returns true everytime).</p><p>This works</p><pre><code>&lt;script type=\""text/javascript\"" language=\""javascript\""&gt;    function pass() {        return javaInterface.checkboxPass();        /*        if(passed) {            //change the instructions            document.getElementById(\""txtInstructions\"").innerHTML = \'Loading Website...\';        }        return passed;        */    }&lt;/script&gt;</code></pre><p>This returns true everytime</p><pre><code>&lt;script type=\""text/javascript\"" language=\""javascript\""&gt;    function pass() {        var passed= javaInterface.checkboxPass();        if(passed) {            //change the instructions            document.getElementById(\""txtInstructions\"").innerHTML = \'Loading Website...\';        }        return passed;    }&lt;/script&gt;</code></pre><p>This is the span in the body of the document</p><pre><code>&lt;span id=\""txtInstructions\""&gt;%1$s&lt;/span&gt;</code></pre><p>What am I doing wrong?</p>","248521","","248521","","2010-12-14 05:27:15","2011-04-05 20:26:40","Cannot get javascript innerHtml to work on WebView","<javascript><android>","2","5","","",""
"4435472","1","","","2010-12-14 02:54:44","2","421","<p>I create my code like that:</p><pre><code>        final TabHost tabHost = getTabHost();        tabHost.addTab(tabHost.newTabSpec(""Month"")                .setIndicator(""Month"")                .setContent(new Intent(this, MonthView.class)));</code></pre><p>How can i communicate with tabhost in monthview class?</p>","541383","","","","","2010-12-14 03:04:00","how to communicate between tabhost and actvities","<android><android-tabhost>","1","0","","",""
"4435480","1","","","2010-12-14 02:57:34","0","197","<p>I'm planing to build a series of adult phone applications but would like to know if they will be approved by the app stores before building it.</p><p>Does Android, Nokia, BlackBerry and WinMob's app stores have an area where i can submit a design brief to find out if the app will be approved before building it? </p><p>Thanks in advance.</p>","346443","","","","","2010-12-14 02:57:34","Iphone, Android, Nokia, BlackBerry, WinMob app design briefs","<android><blackberry><windows-mobile><nokia>","0","7","","",""
"4435645","1","4435718","","2010-12-14 03:40:06","2","8679","<p>I am new to development on android and trying to create a list that has a bold header<br>and a smaller description for each item.Like the one shown here (sorry can't post images yet):<br><a href=""http://i.stack.imgur.com/UVqzq.png"" rel=""nofollow"">http://i.stack.imgur.com/UVqzq.png</a><br>This is the XML that I have to start with:</p><pre><code>&lt;LinearLayout android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TwoLineListItem android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:mode=""twoLine""&gt;&lt;TextView android:textAppearance=""?android:attr/textAppearanceLarge""android:id=""@android:id/text1"" android:layout_width=""fill_parent""android:layout_height=""wrap_content""/&gt;&lt;TextView android:layout_below=""@android:id/text1""android:textAppearance=""?android:attr/textAppearanceSmall""android:layout_alignLeft=""@android:id/text1"" android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:id=""@android:id/text2"" /&gt;&lt;/TwoLineListItem&gt;&lt;/LinearLayout&gt; </code></pre><p>Is there a way to populate the list from an array in another xml file?  If not how would I populate a list like this from the Java code?  Like I said I'm new to development, so I'm probably way off.  Thanks for any input!</p>","534125","","","","","2013-02-13 10:20:13","Proper usage of twoLineListItem Android","<android><listview>","3","0","2","",""
"4435758","1","","","2010-12-14 04:03:46","3","552","<p>Currently I have developed an application that uses the Maps External library com.google.android.maps , it runs fine on my android phone but I bought a tablet with android and it won't install on it telling me the  [INSTALL_FAILED_MISSING_SHARED_LIBRARY] error.</p><p>I have noticed that my tablet didn't come with the library pre-installed and I wonder how can I install it, the tablet has the google maps application installed but not the library to run custom maps views.</p><p>who can help me with this?</p>","539878","","","","","2010-12-14 04:03:46","installing maps external library on android device","<android><maps>","0","2","1","",""
"4435763","1","","","2010-12-14 04:05:07","1","35","<p>I need to provide  specific  resources say images for Particular resolution say 240 * 432</p><p>How can i do that without using -large extension(is der something like layout 240*432 ??)</p><p>regards,Kariyachan</p>","482604","","","","","2010-12-14 04:05:07","how can i specify the resources that can be used for particular resolution","<android>","0","1","","",""
"4435773","1","","","2010-12-14 04:07:44","15","5054","<ol><li><p>I have about 5 packages in my project, is it possible to merge all the packages into one large package, I want to do this to make hacking more difficult.</p></li><li><p>How do I remove all references to Log.e Log.d etc. in my source code using proguard. (I have the eclipse ADT with proguard integrated already).</p></li></ol><p>Update: Looks like part 2 can be done like this</p><pre><code>-assumenosideeffects class android.util.Log {    public static *** d(...);    public static *** v(...);}</code></pre>","248521","","119895","","2011-08-25 14:14:13","2011-08-25 14:14:13","Android Proguard, removing all Log statements and merging packages","<android><proguard>","1","0","9","",""
"4435806","1","4435827","","2010-12-14 04:14:58","23","13768","<p>I have an image from the web in an ImageView. It is very small(favicon) and I'd like to store it in my sqlite database.I can get a drawable from mImageView.getDrawable() but then I don't know what to do next.I don't fully understand the Drawable class in Android.</p><p>I know I can get a byte array from a bitmap like:</p><pre><code>Bitmap defaultIcon = BitmapFactory.decodeStream(in);ByteArrayOutputStream stream = new ByteArrayOutputStream();defaultIcon.compress(Bitmap.CompressFormat.JPEG, 100, stream);byte[] bitmapdata = stream.toByteArray();</code></pre><p>But how do I get a byte array from a Drawable?</p>","341390","","244296","","2010-12-15 03:56:23","2012-07-16 11:32:19","Drawable to byte[]","<android><database><drawable>","4","0","12","",""
"4435808","1","","","2010-12-14 04:15:13","7","2284","<p>Has anyone ever successfully implemented an EditText in a widget? I realize Android does not support this, however, ""Friend Stream"" on HTC devices does it... Is this due to an HTC feature? Could I implement this on HTC? Anyone have any crazy creative ideas for implementing a textbox which actually allows typing on a homescreen widget?</p><p><em>ANY</em> possible leads on this would be much appreciated!</p>","145279","","","","","2012-10-06 17:27:47","EditText Alternatives in a Widget? There has to be a way","<android><android-widget><textview><edittext><htcsense>","2","0","1","",""
"4435889","1","4436268","","2010-12-14 04:32:32","3","15886","<p>I want to start android tablet application development. i have created a new avd with 1024X600 emulator and launched, but how to come back from emulator when i click any application? is there any specific api available for developing android tablet applications or can we use the same android api for development.</p><p>Please help ?</p>","487604","","","","","2012-05-06 09:17:59","How to use Android Tablet emulator?","<android>","2","0","","",""
"4435927","1","","","2010-12-14 04:38:58","0","2018","<p>coding to find the bluetooth devices from android mobile. that bluetooth will send the device  data.that data is in the form of raw images(.3fr, .ari ,.png )</p>","538626","","","","","2010-12-14 04:51:13","coding to find the bluetooth devices from android mobile","<android><bluetooth>","1","0","","",""
"4435957","1","","","2010-12-14 04:43:02","0","138","<p>I developing a web icon application.I used the below code to launch my url</p><p>Uri uri = Uri.parse(""http://www.myurl.com""); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);</p><p>Does Android Market accept this type of application?</p>","528965","","","","","2010-12-14 05:46:10","Does Android Market Accept app using WebViewClient?","<android>","2","1","","",""
"4436035","1","","","2010-12-14 04:58:43","3","21176","<p>I would like an example Android app which uses onResume, onStart and onRestart.</p>","453448","","445131","","2013-09-15 02:02:06","2013-09-15 02:02:06","Android example which uses onResume, onStart and onRestart","<android><onresume>","2","2","","",""
"4436055","1","4436468","","2010-12-14 05:03:25","7","4304","<p>This sound so simple that I can't figure out why I can't find the answer lol </p><p>I have a working sound pool class (thanks to a tutorial and some tweaking I did), and it works fine. </p><p>the problem now is that I want to be able to change my background music randomly. (not always have the same music in a loop but have 2 or 3 and when one finishes I play one of the 2 others).</p><p>problem is I can't find a way to get notified that the music has finished playing.</p><p>Any ideas ? </p><p>Jason</p>","440336","","","","","2013-08-21 21:49:56","Android SoundPool: get notified when end of played","<android><soundpool>","3","0","1","",""
"4436165","1","4436245","","2010-12-14 05:26:43","0","4211","<p>I am creating a chat application the interacts between two users. I want to show the interaction between the users in the form of a iPhone bubble list view...</p><p>I found a tutorial that shows to create a bubble list in IOS... <a href=""http://mobiforge.com/developing/story/sms-bubble-ui-iphone-apps"" rel=""nofollow"">Here's the link...</a>...</p><p>I have seen lot of Android applications that display the bubble list view like Handcent sms etc. I am also sure that some developers here may have a clue about doing it... I would be grateful if any one direct me towards a tutorial or some samples of achieving the task... </p>","303155","","","","","2011-11-02 18:14:19","Creating iPhone style bubble list view in android","<android><listview>","1","0","3","",""
"4436377","1","4436943","","2010-12-14 06:07:14","0","139","<p>I have a MySQL database, php code to retrieve from the database, and an Android program that recieve the output from the php code via http post.</p><p>My localized characters displays as question marks in my program.  I have tried different charsets in my database.  utf8_general_ci, utf8_unicode_ci, latin1_general_ci - still questions marks.  In html I could use the code &oslash;, but not in an Android program - and I shouldn't have to.</p><p>First of all, where is this problem comming from?  The database itself have no problems displaying localized characters with utf8_.  Android also have no problems.  Is it the http post request or php that have problems with this?</p>","324943","","","","","2010-12-14 07:47:03","Howto display localized characters","<mysql><android><http><character-encoding>","1","0","","",""
"4436384","1","4436415","","2010-12-14 06:08:13","1","393","<p>I am having 2 activities:</p><p>1st Activity contains 2 arrays which are filled up with the data by making call to a webservice. And both the arrays are used to display data in ListView. On clicking on any List Item, i am opening new activity Activity-2, here i am posting data related with that selected List-item.</p><p>But i am facing trouble <strong>when i return from Activity-2 to Activity-1 , it agains goes to fetch data from Webservice into Array(Instead of, It should go for fetching data if there is anything posted from 2nd activity otherwise it should get preserved arrays value). So my question is how do i preserve value of both the arrays so that i remains preserve the same value. so it does not have to go for fetching again and again.</strong></p><p>(I think i need to use the ""Save activity state"" kind of concept, but i didnt have implemented such concept yet, so please if you know such then pls let me know for the same.)</p><h2>Update:</h2><p>I have added ""(Instead of, It should go for fetching data if there is anything posted from 2nd activity otherwise it should get preserved arrays value)""</p>","379693","","379693","","2010-12-14 07:17:34","2010-12-14 07:17:34","Android - Preserve array value while moving to and returning from the another activity","<android>","1","0","","",""
"4436420","1","","","2010-12-14 06:15:11","0","1203","<p>Any please post me the process of submission of Web app to Android market</p>","528965","","","","","2010-12-14 07:40:23","Android Web Application Submission process","<android>","1","0","","",""
"4436550","1","","","2010-12-14 06:37:43","1","385","<p>I've already created an android application that has got an already existing sqlite 3 database within it's asset's folder. I designed the application to copy the database on to the mobile when the app is launched for the first time. My question is how can I ship the database and the app so that users can easily install the app?</p><p>thanks </p>","541571","","","","","2010-12-14 06:46:02","How to package my android app with a database","<android><installation><sqlite3>","1","0","","",""
"4436571","1","","","2010-12-14 06:40:24","0","217","<p>Initially I have 3 screens in a tab bar...but when I navigate from any of these activities to any other activity the tab bar disappears...I want this tab bar to appear even on that screen...How to do that??</p>","517234","","437","","2012-05-01 17:57:28","2012-05-01 17:57:28","Showing tabbar on next screen in Android","<android>","1","0","","",""
"4436581","1","8283064","","2010-12-14 06:41:59","57","36393","<p>What does it mean and need  wheather we are uploading our app into the market? Please Explain or give me a related links.</p><p>Thanks in advance.</p>","267269","","267269","","2012-10-12 03:48:36","2012-10-12 03:48:36","what is Promotional and Feature graphic in Android Market/Play Store?","<android><google-play>","5","2","12","",""
"4436620","1","4437436","","2010-12-14 06:47:20","2","2885","<p>Dear All: i am making an application in which we can connect wireless IP camera with my android mobile and then can get images from the IP camera in my application please guide me through any tutorial that how to get connected to external hardware or to an IP camera through android application please guide me through some code snippet or any tutorial.. for connecting my android with IP camera </p><p>Thanks waiting........... </p>","521015","","","","","2013-03-12 07:46:03","Help in Streaming Video from IP Camera in android","<android><streaming><live>","1","1","2","",""
"4436660","1","","","2010-12-14 06:53:31","1","231","<p>list of images is rooling automatically.when we touch on any image the rolling is stopped and the click occured it will be view in full screen . how is this possible in android</p>","543019","","1228","","2010-12-15 12:45:27","2010-12-15 12:57:16","images rolling automatically","<android><android-image>","0","0","","",""
"4436690","1","","","2010-12-14 06:58:57","0","198","<p>Can someone tell me how the contacts.apk application does the ""export"" functionality. Does it read each and every row of the contacts.db using cursors and then convert them into .vcf. This seems to be painfully slow, but the application seems to be doing this much faster. It would be great if someone can point me to the code that does the ""export"" functionality.</p>","538255","","","","","2010-12-14 07:02:20","Exporting contacts","<android>","1","0","","",""
"4436703","1","10868878","","2010-12-14 07:00:16","0","440","<p>My Android application puts up a Dialog with and Edit Text field. If the dialog is displayed with the slide out keyboard closed and then the keyboard is opened, the dialog box (sometimes) disappears. The application goes off into never-never land. I am using a LG Alley.</p><p>Is there an event for opening a keyboard slider? An event I can capture and gain control over this situation? Any advice as to how to deal with this?</p>","496890","","","","","2012-06-03 08:21:55","Problems with Android Dialog and sliding out keyboard","<android><text><keyboard><dialog><edit>","2","0","","",""
"4436785","1","","","2010-12-14 07:19:10","0","424","<p><br>In the start of an activity in <code>OnCreate</code> method, I'm trying to add some text views dynamically to a scrollview of the layout file. But during the time of this operation the screen remains blank. Is it possible to show a progress dialog when adding views dynamically to a scrollview?</p>","541442","","488830","","2010-12-14 07:24:28","2010-12-14 08:19:46","Show progress dialog while adding views dynamically to scrollview in android","<android>","2","0","","",""
"4436802","1","4436841","","2010-12-14 07:22:50","0","1394","<p>I want to setup an Android app that will connect to a backend database (web/database server that I maintain). What are some good resources for doing so?.my webserver is build with php</p>","538626","","","","","2010-12-14 08:49:23","want to setup an Android app that will connect to a backend database","<php><android><database>","2","1","","",""
"4436833","1","","","2010-12-14 07:28:31","0","1252","<p>I added a lot of values in SQLite. How do I write query for searching dates earlier than today ?</p>","533787","","104117","","2010-12-14 08:08:00","2010-12-14 08:08:00","how to select date in sql query","<android>","1","0","","",""
"4436836","1","4446285","","2010-12-14 07:29:01","0","175","<p>i am starting new activity from current activity but some how before starting activity i am getting Null Pointer exception. and startActivity() from source activity calls sucessfully. I am getting Null Pointer exception. the following is code.</p><pre><code>Intent intent = new Intent(PdfFileSelectActivity.this, PdfViewerActivity.class)        .putExtra(EXTRA_PDFFILENAME, pdffilename)        .putExtra(EXTRA_USENIO, useNIO);</code></pre><p>i checked intenet pdffilename variable and they are not null. and the following is declaration in manifest file.</p><p> </p><p>Hope to hear soon.</p>","512973","","241475","","2010-12-14 07:34:24","2013-03-01 11:22:03","error while starting another activity","<android>","2","1","","",""
"4436884","1","4437274","","2010-12-14 07:37:22","0","100","<p>I've made a few shapes in drawable folder, is it possible to packed them in one resource file? How?</p>","541613","","","","","2013-02-25 08:29:20","Android: How can I packed some shapes into one resource file?","<android><resources><shape>","2","0","","",""
"4436896","1","","","2010-12-14 07:39:51","0","907","<p>When my Android application needs to register a receiver, I've been registering in <code>Activity.onCreate()</code> and unregistering in <code>Activity.onDestroy()</code> (I think I'm supposed to be using <code>onPause()</code> and <code>onResume()</code> instead, but that's not really the point):</p><pre><code>public class Foo extends Activity {    private Receiver bar = null;    @Override public void onCreate(Bundle bundle) {        this.registerReceiver(this.bar = new Receiver(), new IntentFilter());    }    @Override public void onDestroy(Bundle bundle) {        this.unregisterReceiver(this.bar);    }}</code></pre><p>Is unregistering the receiver actually necessary, or will the framework handle it when my application exits?</p>","309308","","","","","2010-12-14 10:00:59","Will Android receivers unregister automatically on application exit?","<android><activity><receiver>","1","2","","",""
"4436923","1","4436954","","2010-12-14 07:44:05","3","9807","<p>Hello to all I use the Following code to parse the XML file.</p><pre><code>DocumentBuilderFactory factory;DocumentBuilder builder;InputStream is;Document dom;    try {        factory = DocumentBuilderFactory.newInstance();        is = new FileInputStream(strFileName);        builder = factory.newDocumentBuilder();        dom = builder.parse(is);        } catch(Exception e){}</code></pre><p>Instead of XML file is there any way to parse the String.</p><pre><code>String xml=""&lt;?xml version=""1.0""?&gt; &lt;name&gt; Application&lt;/name&gt; &lt;demo&gt; Demo &lt;/demo&gt; &lt;/xml&gt;""; </code></pre>","538642","","","","","2011-02-16 22:29:18","XML String parsing in Android?","<android>","2","1","2","",""
"4436993","1","4437755","","2010-12-14 07:54:20","2","3996","<p>I've been looking over a bunch of 2D Engines for Android development and I'm finding it fairly difficult to decide between all of the options. Many of the engines are no longer being developed and not all of them offer the same features.</p><p>The game I am developing will require fairly standard functionality:</p><ul><li>Drag and Drop</li><li>Graphics Commands Optimized to Handle Low Sprite Count (~20)</li><li>Sounds/Music</li></ul><p>Taking into account that I won't be creating a super-complex game and that I'm hoping to avoid a lot of the typical hassle with creating a GUI in Java, what plug-in would satisfy my needs in a simple and optimized fashion. So far I have looked into a group of engines including cocos2D, Angle, and various others.</p><p>The engine can either be under development or not, so long as it is a complete project.</p><p>Sorry if there are any grammar errors or any confusion, I'm up rather late after setting everything up/doing the research.</p><p>Many thanks in advance,</p><p>Justian M.</p>","373196","","","","","2014-04-09 23:14:42","Android 2D Engine","<android><2d>","2","0","","",""
"4437023","1","","","2010-12-14 08:00:06","36","31294","<p>Compile Error:Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.</p><p>Compile other simple sample works.Same source file and project works on my college's machine.</p><p>Any tips ? Why resources.ap_ doesn't get generated ? </p>","498177","","","","","2012-11-08 11:17:58","resources.ap_ does not exist when compile my android project","<android><resources>","25","0","11","",""
"4437041","1","","","2010-12-14 08:02:47","1","2040","<p>My application is running properly on emulator but not on device. Earlier I have run the same app on device many a times. I have turned USB- Debugging on my device, also set debuggable to true in manifest. </p><p>When I try to use command adb devices, it's showing me an empty list of devices.</p><p>Has anybody encountered same problem anytime?</p><p>Thanx in advance.</p>","227943","","","","","2012-06-08 18:22:18","Application not running on Android device","<android><install><device>","3","2","","",""
"4437095","1","","","2010-12-14 08:10:06","0","736","<p>I am using autoCompleteTextView to load the contacts. There is no errors and it doesnt crash too. But the autocompleteTextview doesn't seem to appear anything.I will post my codes and logcat.</p><p>Codes:-       package com.droidnova.android.samples;</p><pre><code>   import android.app.Activity;   import android.content.ContentResolver;   import android.content.Context;   import android.database.Cursor;   import android.net.Uri;   import android.os.Bundle;   import android.provider.Contacts;   import android.provider.Contacts.People;   import android.provider.SyncStateContract.Constants;   import android.view.LayoutInflater;   import android.view.View;   import android.view.ViewGroup;  import android.widget.AutoCompleteTextView;  import android.widget.CursorAdapter;  import android.widget.Filterable;  import android.widget.LinearLayout;   import android.widget.TextView;   public class AutoComplete extends Activity {private static TextView mName;private static TextView mNumber;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.button);   ContentResolver content = getContentResolver();    Cursor cursor = content.query(People.CONTENT_URI,            PEOPLE_PROJECTION, People.NAME+""IS NOT NULL AND"" +            People.NUMBER_KEY+""IS NOT NULL"",null,People.DEFAULT_SORT_ORDER);    ContactListAdapter adapter = new ContactListAdapter(this, cursor);    AutoCompleteTextView textView = (AutoCompleteTextView)            findViewById(R.id.AutoCompleteTextView01);    textView.setAdapter(adapter);    textView.setHint(""type name"");}// XXX compiler bug in javac 1.5.0_07-164, we need to implement Filterable// to make compilation work   public static class ContactListAdapter extends CursorAdapter implements Filterable {     public ContactListAdapter(Context context, Cursor c) {        super(context, c);        mContent = context.getContentResolver();    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        final LinearLayout ret = new LinearLayout(context);        final LayoutInflater inflater = LayoutInflater.from(context);        mName = (TextView) inflater.inflate(                android.R.layout.simple_dropdown_item_1line, parent, false);        mNumber=(TextView) inflater.inflate(                android.R.layout.simple_dropdown_item_1line, parent, false);        int nameIdx = cursor.getColumnIndexOrThrow(People.NAME);        int numberIdx = cursor.getColumnIndex(People.NUMBER);        String name = cursor.getString(nameIdx);        String number = cursor.getString(numberIdx);        mName.setText(name);        mNumber.setText(number);        return ret;    }    @Override    public void bindView(View view, Context context, Cursor cursor) {         int nameIdx = cursor.getColumnIndexOrThrow(People.NAME);         int numberIdx = cursor.getColumnIndex(People.NUMBER);         String name = cursor.getString(nameIdx);         String number = cursor.getString(numberIdx);         ((TextView) ((LinearLayout) view).getChildAt(0)).setText(name);         LinearLayout horizontal = (LinearLayout) ((LinearLayout) view).getChildAt(1);         ((TextView) horizontal.getChildAt(0)).setText(number);    }    @Override    public String convertToString(Cursor cursor) {        int numCol = cursor.getColumnIndexOrThrow(People.NUMBER);        String number = cursor.getString(numCol);        return number;    }    @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(People.NAME + "" IS NOT NULL AND "" + People.NUMBER_KEY + "" IS NOT NULL AND "");            buffer.append(""UPPER("");            buffer.append(People.NAME);            buffer.append("") GLOB ?"");            args = new String[] { constraint.toString().toUpperCase() + ""*"" };        }        return mContent.query(People.CONTENT_URI,PEOPLE_PROJECTION, buffer == null ? null : buffer                .toString(), args, People.DEFAULT_SORT_ORDER);    }    private ContentResolver mContent;}  private static final String[] PEOPLE_PROJECTION = new String[] {     People.NAME,    People._ID,    People.NUMBER,};</code></pre><p>}</p><p>This is my logcat:</p><pre><code>12-14 07:26:46.711: INFO/ActivityManager(59): Start proc com.droidnova.android.samples  for activity com.droidnova.android.samples/.SelectContact: pid=250 uid=10025 gids={1015}  12-14 07:26:46.721: ERROR/AndroidRuntime(244): ERROR: thread attach failed  12-14 07:26:46.761: DEBUG/dalvikvm(244): LinearAlloc 0x0 used 639500 of 5242880 (12%)  12-14 07:26:46.941: DEBUG/ddm-heap(250): Got feature list request12-14 07:26:47.091: INFO/ARMAssembler(59): generated scanline__00000177:03515104_00000001_00000000 [ 73 ipp] (95 ins) at [0x49e2e8:0x49e464] in 1288362 ns12-14 07:26:47.111: WARN/ActivityThread(250): Application com.droidnova.android.samples is waiting for the debugger on port 8100...12-14 07:26:47.141: INFO/System.out(250): Sending WAIT chunk12-14 07:26:47.151: INFO/dalvikvm(250): Debugger is active12-14 07:26:47.211: INFO/ARMAssembler(59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x4a2798:0x4a28a4] in 571302 ns12-14 07:26:47.351: INFO/System.out(250): Debugger has connected12-14 07:26:47.361: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:47.561: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:47.761: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:47.781: INFO/ARMAssembler(59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x393188:0x393244] in 604406 ns12-14 07:26:47.801: INFO/ARMAssembler(59): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x393dd0:0x393f98] in 666356 ns12-14 07:26:47.961: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:48.161: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:48.371: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:48.571: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:48.782: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:48.981: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:49.181: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:49.391: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:49.593: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:49.791: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:49.996: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:50.201: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:50.401: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:50.601: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:50.801: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:51.012: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:51.216: INFO/System.out(250): waiting for debugger to settle...12-14 07:26:51.421: INFO/System.out(250): debugger has settled (1459)12-14 07:26:51.971: WARN/Resources(250): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f060000}12-14 07:26:52.931: INFO/ActivityManager(59): Displayed activity com.droidnova.android.samples/.SelectContact: 6292 ms (total 6292 ms)12-14 07:26:58.051: DEBUG/ViewFlipper(99): updateRunning() mVisible=true, mStarted=false, mUserPresent=true, mRunning=false12-14 07:26:58.051: DEBUG/ViewFlipper(99): updateRunning() mVisible=true, mStarted=false, mUserPresent=true, mRunning=false12-14 07:26:58.611: DEBUG/dalvikvm(105): GC freed 2632 objects / 154776 bytes in 515ms12-14 07:27:02.341: ERROR/MediaPlayerService(30):   error: -212-14 07:27:02.351: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:02.351: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:06.391: DEBUG/dalvikvm(170): GC freed 726 objects / 53656 bytes in 106ms12-14 07:27:26.941: ERROR/MediaPlayerService(30):   error: -212-14 07:27:26.951: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:26.951: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:30.351: ERROR/MediaPlayerService(30):   error: -212-14 07:27:30.351: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:30.351: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:33.401: ERROR/MediaPlayerService(30):   error: -212-14 07:27:33.401: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:33.401: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:37.211: ERROR/MediaPlayerService(30):   error: -212-14 07:27:37.211: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:37.211: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:38.371: ERROR/MediaPlayerService(30):   error: -212-14 07:27:38.371: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:38.381: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:39.351: ERROR/MediaPlayerService(30):   error: -212-14 07:27:39.351: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:39.351: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:39.931: ERROR/MediaPlayerService(30):   error: -212-14 07:27:39.931: ERROR/MediaPlayer(59): Unable to to create media player12-14 07:27:39.941: WARN/AudioService(59): MediaPlayer IOException: java.io.IOException: setDataSource failed.: status=0x8000000012-14 07:27:49.261: DEBUG/AndroidRuntime(267): &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-14 07:27:49.271: DEBUG/AndroidRuntime(267): CheckJNI is ON12-14 07:27:49.491: DEBUG/AndroidRuntime(267): --- registering native functions ---12-14 07:27:49.891: DEBUG/ddm-heap(267): Got feature list request12-14 07:27:50.431: DEBUG/AndroidRuntime(267): Shutting down VM12-14 07:27:50.431: DEBUG/dalvikvm(267): DestroyJavaVM waiting for non-daemon threads to exit12-14 07:27:50.431: DEBUG/dalvikvm(267): DestroyJavaVM shutting VM down12-14 07:27:50.441: DEBUG/dalvikvm(267): HeapWorker thread shutting down12-14 07:27:50.441: DEBUG/dalvikvm(267): HeapWorker thread has shut down12-14 07:27:50.451: ERROR/AndroidRuntime(267): ERROR: thread attach failed12-14 07:27:50.451: DEBUG/jdwp(267): JDWP shutting down net...12-14 07:27:50.451: INFO/dalvikvm(267): Debugger has detached; object registry had 1 entries12-14 07:27:50.471: DEBUG/dalvikvm(267): VM cleaning up12-14 07:27:50.491: DEBUG/dalvikvm(267): LinearAlloc 0x0 used 629532 of 5242880 (12%)12-14 07:27:50.981: DEBUG/AndroidRuntime(275): &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-14 07:27:50.981: DEBUG/AndroidRuntime(275): CheckJNI is ON12-14 07:27:51.251: DEBUG/AndroidRuntime(275): --- registering native functions ---12-14 07:27:51.641: DEBUG/ddm-heap(275): Got feature list request12-14 07:27:52.222: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.droidnova.android.samples/.SelectContact }12-14 07:27:52.242: DEBUG/AndroidRuntime(275): Shutting down VM12-14 07:27:52.252: DEBUG/dalvikvm(275): DestroyJavaVM waiting for non-daemon threads to exit12-14 07:27:52.252: DEBUG/dalvikvm(275): DestroyJavaVM shutting VM down12-14 07:27:52.252: DEBUG/dalvikvm(275): HeapWorker thread shutting down12-14 07:27:52.262: DEBUG/dalvikvm(275): HeapWorker thread has shut down12-14 07:27:52.262: ERROR/AndroidRuntime(275): ERROR: thread attach failed12-14 07:27:52.272: DEBUG/jdwp(275): JDWP shutting down net...12-14 07:27:52.272: INFO/dalvikvm(275): Debugger has detached; object registry had 1 entries12-14 07:27:52.292: DEBUG/dalvikvm(275): VM cleaning up12-14 07:27:52.331: DEBUG/dalvikvm(275): LinearAlloc 0x0 used 639500 of 5242880 (12%)</code></pre>","513658","","210916","","2010-12-21 12:27:54","2010-12-21 13:25:21","LogCat error while running AutoCompleteTextView contacts android","<android><autocomplete><textview><logcat>","1","0","","",""
"4437120","1","","","2010-12-14 08:13:25","2","2435","<p>Is it possible to get the thumbnail image from a video Url? I need to thumbnails of videos in a list view.</p>","541442","","1077754","","2013-10-07 11:31:07","2013-10-07 11:31:07","Get thumbnail image of video from video url","<android>","3","0","","",""
"4437149","1","","","2010-12-14 08:17:41","0","1128","<p>Now i am working json application.The Force close message occured the app is crosed.  so </p><p>how to catch force to close error in try catch exception.Help me.....</p>","533787","","","","","2012-10-23 15:49:43","how to catch android force to close","<android>","3","1","","",""
"4437240","1","4437304","","2010-12-14 08:33:11","0","134","<p>Is there a way to set some attribute to the character '@' ?<br>i.e. explicitly <em>not</em> referencing any resource, just want the '@' sign?</p>","3055","","","","","2010-12-14 08:42:03","Android: Specifying a literal '@'?","<android><xml>","1","0","1","",""
"4437463","1","","","2010-12-14 09:06:21","0","173","<p>I am having a home screen widget and i want to run a background service which does all the fetching from url and should update all the widgets on the home screen corresponding to the provider i have created it.</p><p>how to do it? it seems that i unable to access appwidget or the context from the service.</p><p>any help?</p>","238798","","","","","2010-12-14 09:26:05","how to run a service which updates the appwidget?","<android><android-widget>","1","0","","",""
"4437497","1","5306167","","2010-12-14 09:10:50","0","911","<p>I use following code :</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setTheme(android.R.style.Theme_Wallpaper);    setContentView(R.layout.main);}</code></pre><p>But it does nothing!</p><p>How can I apply Theme.Wallpaper at runtime on android?</p>","541700","","","","","2013-12-16 15:29:01","How to apply Theme.Wallpaper at runtime on android?","<android><themes>","1","2","1","",""
"4437657","1","","","2010-12-14 09:31:04","1","746","<p>Actually, I don't want to accept the same name which is already entered in the text field (i.e; unique values) stored in database. </p><p>For example, I entered a name ""health"" in text field and saved it. If again enter the same name then it won't accept.</p><p>I tried below but it's not working. Please help me.</p><pre><code>boolean ifExisting(String cat)     {      Cursor c = db.rawQuery(""SELECT * FROM "" + ""restaurants"" + ""WHERE"" + ""category"" + ""="" + cat, null);          if(c.getCount() == 0)         {          return;          }           else          {           return;          }     }       insert();</code></pre>","541719","","441574","","2012-01-20 22:09:22","2012-01-20 22:09:22","how to compare the text field values with database values which is entered in the text field","<android><sqlite>","2","0","","",""
"4437690","1","4488428","","2010-12-14 09:34:54","21","12806","<p>I am planning to create a cross platform application which works in Android, iPhone and Blackberry? I thought of using Phonegap or Titanium. My questions are as these: </p><ul><li><em>Whether in cross platform if it is possible toachieve all the native behavior ofall phone models, something like in Android menu and iPhone gestures?</em></li><li><em>Apart from cross-platformadvantage, what are otheradvantage do it have?</em></li><li><em>What are the disadvantages? Isthere any limitation when it comes to comparing tonative app?</em></li><li><em>Whether I can use same codewithout any modification in all the devices or i have tochange the code with respective todevice identified dynamically?</em></li></ul>","430652","","1556478","","2013-02-07 09:38:23","2013-04-15 06:55:21","What are the advantages and disadvantages of using Phonegap and Titanium?","<android><phonegap><cross-platform><titanium>","2","3","8","2013-04-16 12:36:41",""
"4437719","1","","","2010-12-14 09:38:22","0","556","<p>How to pick image from particular folder, say sdcard/mypics?</p>","541723","","244296","","2010-12-14 10:51:57","2011-07-05 18:20:50","How to pick image from particular folder, say sdcard/mypics?","<android>","1","0","","",""
"4437763","1","","","2010-12-14 09:41:43","0","1602","<p>how to read some data from particular url  in android</p>","538626","","","","","2010-12-14 11:32:54","how to read some data from particular url in android","<android><url>","2","2","1","2012-08-18 05:03:15",""
"4437789","1","","","2010-12-14 09:44:47","0","342","<p>I need to place a file on a specific folder, so that my application can read it. First i want to try to create a new file with a specific path, but anyway i try, on the android dev tool on eclipse, I have an IOException.Do you know a way to create ""helloworld.txt""  - For example - on the virtual device?</p><p>Thanks.</p><p>PS: I tried ""new File(Environment.get..., ""helloworld.txt"").mkdirs();"", and stuffs like that</p>","541741","","","","","2010-12-14 11:10:36","Read a file out of an android application","<android><android-emulator>","2","0","","",""
"4437796","1","4459195","","2010-12-14 09:45:41","2","803","<p>Some days ago I've installed the updates for ADT Plugin in Eclipse and I've just tried the new <strong>Hierarchy viewer</strong> tool. Beside it took me a while to find that the measurements are calculated only at the first (parent) view, I have observed that the values shown are not the same every time, even if there are no changes in my application.</p><p>For example, I've launched in the emulator one of my applications, loaded it in the Hierarchy viewer and got the next results: (I've wanted to include the screen shots, but my reputation doesn't allow me to post pictures yet, so I'll just write the values)</p><p><strong>Measure:</strong> 175.340 ms<br><strong>Layout:</strong> 5.179 ms<br><strong>Draw:</strong> 47.115 ms       </p><p>Then, without any changes, I launched again the application, and got the following results:</p><p><strong>Measure:</strong> 98.696 ms<br><strong>Layout:</strong> 4.819 ms<br><strong>Draw:</strong> 50.923 ms </p><p>Could someone tell me why there is such a big difference between the values of Measure, for example?</p><p>Also, did someone know the meaning / the difference between the 3 values provided: <strong>Measure</strong>, <strong>Layout</strong> and <strong>Draw</strong>? Are each related with some specific attributs of the views?  </p><p>The Android developers page doesn't provide too many explanations for that, and all I know is those values must be as small as possible.</p>","469983","","469983","","2012-10-05 07:17:16","2012-10-25 10:21:38","hierarchy viewer results interpretation","<android><performance><hierarchy>","1","0","2","",""
"4438042","1","","","2010-12-14 10:16:05","0","7092","<p>Could someone tell me what is the alternative for <code>System.out.print</code> in Android?</p>","538626","","421372","","2013-04-27 11:22:40","2013-04-27 11:22:40","Alternative for System.out.print in Android","<android>","5","2","","",""
"4438125","1","4438209","","2010-12-14 10:26:40","4","5191","<p>Iam getting Checkbox from OnItemClickListener by using below snippet</p><pre><code>onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {        Log.w(""TAG"",""onItemClick clicked position :""+position);        CheckBox cbx = (CheckBox)view.findViewById(R.id.c_checkbox);        if(cbx.isChecked()){            Toast.makeText(getApplicationContext(),                     ""Checked position "" + shoppingList.get(position).getItem(),                     Toast.LENGTH_SHORT).show();        }</code></pre><p>I need to get all the positions to check which list item is checked.For that I used below snippet</p><pre><code>int firstPosition = list.getFirstVisiblePosition();             for(int i=firstPosition;i&lt;=list.getCount();i++){             View v=list.getChildAt(i);             cbx = (CheckBox)v.findViewById(R.id.c_checkbox);             if(cbx.isChecked()){            }         }</code></pre><p>in below code cbx giving me null pointer exception.i used ViewHolder for the custom adapter.Please give me solution.why same thing is worked in OnItemClickListener?</p><p>Regards,Rajendar</p>","486216","","","","","2010-12-14 10:34:57","How to get checkbox from ListView android?","<android>","1","0","","",""
"4438128","1","","","2010-12-14 10:26:56","12","23887","<p>I have a GridView which is pretty similar to the Google tutorial, except that I want to add the ImageViews on runtime (via a subactivity). The results are okay, but the layout of the View is messed up: The GridView doesn't fill the content of its parent, what do I have to do to design it properly?</p><p>Here the code of adding the children:</p><pre><code>public void initializeWorkbench(GridView gv, Vector&lt;String&gt; items) {        Prototype.workbench.setDimension(screenWidth, divider.height()+workbenchArea.height());        Prototype.workbench.activateWorkbench();        // this measures the workbench correctly        Log.d(Prototype.TAG, ""workbench width: ""+Prototype.workbench.getMeasuredWidth());        // 320        Log.d(Prototype.TAG, ""workbench height: ""+Prototype.workbench.getMeasuredHeight());        // 30        ImageAdapter imgAdapter = new ImageAdapter(this.getContext(), items);        gv.setAdapter(imgAdapter);        gv.measure(screenWidth, screenHeight);        gv.requestLayout();        gv.forceLayout();        Log.d(Prototype.TAG, ""gv width: ""+gv.getMeasuredWidth());        // 22        Log.d(Prototype.TAG, ""gv height: ""+gv.getMeasuredHeight());        // 119        Prototype.workbench.setDimension(screenWidth, divider.height()+workbenchArea.height());    }}</code></pre><p>activateWorkbench, setDimension and measure in the workbench (LinearLayout above the GridView):</p><pre><code>public void activateWorkbench() {    if(this.equals(Prototype.workbench)) {        this.setOrientation(VERTICAL);        show = true;        measure();    }}public void setDimension(int w, int h) {    width = w;    height = h;    this.setLayoutParams(new LinearLayout.LayoutParams(width, height));    this.invalidate();}private void measure() {    if (this.getOrientation() == LinearLayout.VERTICAL) {        int h = 0;        int w = 0;        this.measureChildren(0, 0);        for (int i = 0; i &lt; this.getChildCount(); i++) {            View v = this.getChildAt(i);            h += v.getMeasuredHeight();            w = (w &lt; v.getMeasuredWidth()) ? v.getMeasuredWidth() : w;        }        if (this.equals(Prototype.tagarea))            height = (h &lt; height) ? height : h;        if (this.equals(Prototype.tagarea))            width = (w &lt; width) ? width : w;    }    this.setMeasuredDimension(width, height);}</code></pre><p>The ImageAdapter constructor:</p><pre><code>public ImageAdapter(Context c, Vector&lt;String&gt; items) {    mContext = c;    boolean mExternalStorageAvailable = false;    boolean mExternalStorageWriteable = false;    String state = Environment.getExternalStorageState();    if (Environment.MEDIA_MOUNTED.equals(state)) {        // We can read and write the media        mExternalStorageAvailable = mExternalStorageWriteable = true;    } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {        // We can only read the media        mExternalStorageAvailable = true;        mExternalStorageWriteable = false;    } else {        // Something else is wrong. It may be one of many other states, but        // all we need        // to know is we can neither read nor write        mExternalStorageAvailable = mExternalStorageWriteable = false;    }    if (mExternalStorageAvailable &amp;&amp; mExternalStorageWriteable) {        for (String item : items) {            File f = new File(item);            if (f.exists()) {                try {                    FileInputStream fis = new FileInputStream(f);                    Bitmap b = BitmapFactory.decodeStream(fis);                    bitmaps.add(b);                    files.add(f);                } catch (FileNotFoundException e) {                    Log.e(Prototype.TAG, """", e);                }            }        }    }}</code></pre><p>And the xml layout:</p><pre><code>&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""                android:orientation=""vertical""                android:gravity=""bottom""                android:paddingLeft=""0px""                android:paddingTop=""0px""                android:paddingRight=""0px""&gt;    &lt;com.unimelb.pt3.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;GridView xmlns:android=""http://schemas.android.com/apk/res/android""             android:id=""@+id/gridview""            android:layout_width=""fill_parent""             android:layout_height=""fill_parent""            android:columnWidth=""90dp""            android:numColumns=""auto_fit""            android:verticalSpacing=""10dp""            android:horizontalSpacing=""10dp""            android:stretchMode=""columnWidth""            android:gravity=""center"" /&gt;    &lt;/com.unimelb.pt3.ui.TransparentPanel&gt;&lt;/LinearLayout&gt;</code></pre>","538581","","","","","2013-09-17 19:26:25","How to refresh a GridView?","<android><xml><gridview><layout>","6","0","6","",""
"4438137","1","","","2010-12-14 10:27:48","3","2161","<p>Is there any way to extract data from dataset which contains records I want to call .net webservice using android but its return datasetso how to handle dataset? </p>","537403","","537403","","2010-12-21 11:38:56","2011-10-23 18:41:58","return dataset from .net service and use data into android","<android>","1","0","","",""
"4438139","1","4438329","","2010-12-14 10:27:55","0","259","<p>Another Java/Android newbie...</p><p>My Activity contains a delcaration for a variable of a class that I've defined...    public Teams theTeams = null;Within the onCreate method of this Activity, I create an object of that class...    Teams theTeams = new Teams();I've been able to make some changes to this object...    theTeams.setName(""A"", ""Jets"");... which assigns ""Jets"" to a string in the class.However, from within a private method of the Activity, attempts to refer to ""theTeams"" give me a null pointer error.  I guess there's something about object visibility that I'm not understanding.  Can someone clarify?</p>","541770","","541770","","2010-12-14 10:39:01","2010-12-14 10:47:34","Classes & Activities in Android","<android><class><activity>","1","1","","",""
"4438152","1","4438635","","2010-12-14 10:29:47","18","7242","<p>I need help in deciding which IOC container is best for development on mobile devices(android).What i need is basic IOC without much overhead. Spring is very good framework but is it overkill for mobile devices.</p>","446262","","136445","","2011-02-03 18:09:27","2014-02-05 10:06:18","Best IOC container for android/mobile devices","<android><roboguice>","4","0","7","",""
"4438154","1","4446915","","2010-12-14 10:30:23","0","256","<p>I am using tabview in my application with which i am navigating to all modules present in my android application.However, i am facing a problem while using it. Tabview is present on my launching activity.But not further.I want the tabview to be present on all activities.How should i proceed.</p><p>Thanks</p>","541786","","","","","2010-12-15 05:12:46","TabView common to all activities","<android>","1","0","2","",""
"4438199","1","4439632","","2010-12-14 10:34:01","1","536","<p>Basically, I want to be able to use two ListViews through my BaseAdapter class in the same activity.  The ListViews will be displayed side-by-side and each item within the ListView will contain multiple views (ImageView, TextView, etc.).</p><p>My main issue is retreiving/displaying data through the getView() method inherited from BaseAdapter.  How would I go about detecting which ListView is being updated through this method so I will know which code to call/update?  I've tried looking at the ViewGroup parameter in getView() hoping that it led me to the parent of the ListItem but the id it returns was different from my ListView's resource ID...in fact it wasn't even in my R.java file at all:</p><pre><code>12-14 04:44:58.613: ERROR/ParentFromGetView(312): 1690829812-14 04:44:58.623: ERROR/MyListViewId(312): 2131165191</code></pre><p>I was <em>hoping</em> to do something like so:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    if (parent.getId() == R.id.ListView1) {        //Do stuff    } else if (parent.getId() == R.id.ListView2) {        //Do different stuff    }}</code></pre><p>...but the Ids are drastically off as seen above.</p><p>Thanks in advance!</p>","535476","","","","","2010-12-14 13:25:11","How could I go about using two ListViews with a BaseAdapter?","<android><android-layout>","1","2","","",""
"4438211","1","","","2010-12-14 10:35:02","1","763","<p>I have an application on the market which seems to be fine on my phone and some other phones I tested on. However I recently recived a crash report from a user whom says it crashed on starting the map activity. The exception is a out of memory exception on some bitmap.inflate operation related to the map view. In my tests my applicarion never passed 18 mb in ram and it never crashed on the map screen. I have a few map overlay layers but neither of them are heavy on graphics.<br>Any suggestions?</p><p>Thanks.</p>","480978","","358281","","2010-12-19 06:25:00","2010-12-23 01:28:39","Out of memory exception when stsrtin a map view activity","<android><android-mapview><out-of-memory>","2","5","1","",""
"4438230","1","","","2010-12-14 10:37:25","0","394","<p>I have two lists in my view . Both use  the same row layout. The problem is that I cannot set a divider between the two list as to create the impression that there is only one . The reason why I'm using two lists is that I want to handle separately selection of their items.</p>","304866","","","","","2010-12-14 10:37:25","List divider problem","<android>","0","2","","",""
"4438260","1","4438398","","2010-12-14 10:39:25","0","194","<p>I have my ListActivity that when you tap on an item, it pops up a Dialog that ask the user for user and password. How can I get the selected position from the dialog?</p><p>Here's how I initialize the ListActivity:</p><pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ListView listView = getListView(); listView.setOnItemClickListener(new OnItemClickListener() {  public void onItemClick(AdapterView&lt;?&gt; parent, View view,    int position, long id) {   showDialog(DIALOG_USER_PASSWORD);  } });}</code></pre><p>The Dialog I pop up is a simple AlertDialog with 2 EditText which I inflate from an xml file</p><pre><code>protected Dialog onCreateDialog(int id) {        switch (id) {        ...        case DIALOG_USER_PASSWORD:            LayoutInflater factory = LayoutInflater.from(this);                        final View dialogView = factory.inflate(R.layout.alert_dialog_text_entry, null);                        return new AlertDialog.Builder(MyListActivity.this)                        .setIcon(R.drawable.alert_dialog_icon)                        .setTitle(R.string.ask_user_password)                        .setView(dialogView)                        .setPositiveButton(R.string.ok_text, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    String userName = ((EditText) findViewById(R.id.username_edit_alert_dialog))                            .getText().toString();                    String password = ((EditText) findViewById(R.id.password_edit_alert_dialog))                            .getText().toString();                    Credentials cred = new CredentialsL1(userName, password);                    /* HERE IS WHERE i NEED THE SELECTED ITEM                     mId IS THE OBJECT ASSOCIATED TO THE SELECTED POSITION */                    mService.connect(mId, cred);                    }                })                // Cancel button                .setNegativeButton(R.string.cancel_text,                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int whichButton) {                            dialog.cancel();                        }                    })                .create();        }        return null;    }</code></pre><p>The only I've come up with is creating a new field ""mId"" and setting it when the user taps and using it when the user taps OK in the Dialog. Any more elegant idea?Thanks</p>","483362","","932225","","2012-07-13 09:29:50","2012-07-13 09:29:50","Acess AdapterView from Dialog","<android><alertdialog><listactivity><android-adapterview>","1","0","","",""
"4438297","1","","","2010-12-14 10:43:34","8","3681","<p>one of the features in android 2.3 is integrated proguard obfuscation when doing release builds. but how do i enable this obfuscation when creating my apk?</p><p>thanks!</p>","97688","","","","","2012-09-25 10:48:39","how to use proguard in android 2.3","<android><obfuscation><proguard>","2","1","3","",""
"4438426","1","","","2010-12-14 10:59:07","0","630","<p>How can i set the System Port and Proxy?Is there any command in java that can do that?If not, how can i change it with superuser permission?I have tryed a lot of codes, but no one worked for me.Please help.</p>","541829","","244296","","2010-12-14 11:02:24","2010-12-19 12:18:39","Android SDK: System Setting","<java><android><networking><sdk><port>","2","0","","",""
"4438454","1","4438797","","2010-12-14 11:02:34","1","206","<p>I have a <code>ListView</code> in which data is streaming (changing). I want to just highlight the row for a fraction of seconds when the data is changing and then comes back to old state.</p><p>any solution?</p>","405747","","119895","","2010-12-14 11:38:31","2010-12-14 11:46:35","ListView row highlight when data changes","<android>","1","0","1","",""
"4438498","1","","","2010-12-14 11:08:03","1","147","<p>I've built an android application with a database (sqlite 3) targeted for Android 2.2 with API level 8. It works by copying the database from the assets directory to the /data/data/com.myapp.db/databases folder. It works just fine on the emulator. However, when I try to install the application on HTC mobile device with version 2.2 and 2.1-update1, it crashes. The error says ""Failed to Copy the Database"". Could this be as a result of the database path that I used on the emulator and the actual device mismatching? I'm eagerly looking for your answers.</p><p>Thanks    </p>","522784","","","","","2010-12-14 11:20:37","Android App with a database crashes","<android><installation><sqlite3>","1","0","","",""
"4438503","1","","","2010-12-14 11:09:23","3","676","<p>I'm writing a software update application that (among other stuff) does the following:</p><p>When I find an image I want to download, I'm passing an <code>ACTION_VIEW</code> intent to the Browser application.The browser starts the download, and when it completes, I see the download complete message in the notification bar.</p><p>now I am facing the following problem:I would like to receive an intent when the download is complete.</p><p>Can anyone help?</p>","541843","","119895","","2010-12-14 11:34:18","2010-12-14 12:28:09","receiving an intent when completing a browser download","<android>","2","2","","",""
"4438504","1","4438717","","2010-12-14 11:09:31","4","1647","<p>I need to download a .mp3 or .m4a file from the server by using an URL, and then play that song.</p><p>Any ideas?</p>","461975","","119895","","2010-12-14 11:30:10","2011-02-01 18:53:40","How to download and play the song(.mp3,.m4a) if we know the url in android","<android>","2","0","1","",""
"4438586","1","4438634","","2010-12-14 11:21:29","0","592","<p>hi i have create one simple media player.... now its working fine. i retrieve video thumbnails in gallery. when i click the thumbnails video will play in other page... if i click thumbnails video play same page...see my screen shot....my video play in that red box...this type of frame how to create.....</p><p>this is my screen shot:<img src=""http://i.stack.imgur.com/WTWGL.png"" alt=""alt text""></p><p>if i click thumbnails the video will play another page:that screen shot:<img src=""http://i.stack.imgur.com/CrN8m.png"" alt=""alt text""></p><p>this is for my coding:</p><pre><code>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;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 AdapterView.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.setBackgroundColor(Color.WHITE);            imgVw.setLayoutParams(new Gallery.LayoutParams(150, 100));            imgVw.setPadding(5,5,5,5);            imgVw.setScaleType(ImageView.ScaleType.FIT_XY);    }        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>coding 2:`</p><pre><code>public class ViewVideo extends Activity {private String filename;private VideoView Video;@Overridepublic 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);    //setContentView(new Zoom(this));    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>anyone help me...</p>","486554","","486554","","2010-12-14 12:17:01","2011-03-15 15:19:13","how to play video in same page(media player)","<java><android><video><frame>","2","1","","",""
"4438657","1","4438706","","2010-12-14 11:31:13","1","744","<p>i want your help very badly..bcz i am seeking an answer for this from couple of day's but did not find a bit...</p><p>my query is i have a screen shot app written in java...i just want to port it on android emulator and run it..i know i have to rewrite some android specific code but can anyone tell me what changes i should make to the screen shot java app to make it run on android platform..here is my java screen shot app: (i know for this the device should be rooted i am okay for that)</p><pre><code>import java.awt.AWTException;    import java.awt.Robot;import java.awt.Rectangle;    import java.awt.Toolkit;import java.awt.image.BufferedImage;import java.io.*;import javax.imageio.ImageIO;class ScreenCapture {  public static void main(String args[]) throws           AWTException, IOException {     // capture the whole screen     BufferedImage screencapture = new Robot().createScreenCapture(           new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );     // Save as JPEG     File file = new File(""screencapture.jpg"");     ImageIO.write(screencapture, ""jpg"", file);     // Save as PNG     // File file = new File(""screencapture.png"");     // ImageIO.write(screencapture, ""png"", file);  }}</code></pre>","505580","","505580","","2010-12-14 11:37:28","2010-12-14 11:37:28","porting screen shot java app on android","<java><android>","1","1","","",""
"4438681","1","4439599","","2010-12-14 11:33:46","1","2756","<p>After sending a sms, write the sms into sent folder. How can i do it on android?</p><pre><code>SmsManager sm = SmsManager.getDefault();sm.sendTextMessage(to, null, text, null, null);</code></pre>","489744","","","","","2013-11-09 22:16:16","How to insert sms into sent folder on android","<android><sms>","1","1","","",""
"4438703","1","","","2010-12-14 11:36:19","0","195","<p>In my application I am interfacing with google services such as calendar and documents.  For testing I have just been providing a user name and password to access services as follows...</p><pre><code>myService.setUserCredentials(username,password);</code></pre><p>This method, at least how I'm implementing it, requires that I request the username and password for each session, which obviously is not practical.  I would prefer not to save the username or password in long term storage.  I know there is an account manager class in the SDK, but am unsure of proper implementation.  My question is, what is the most secure and user friendly method for accessing google services from within the application?  Thanks.</p>","532933","","","","","2011-07-02 16:31:47","How to get authentication to access google services with android?","<android>","1","0","1","",""
"4438713","1","","","2010-12-14 11:37:14","14","9155","<p>I use an a-htmltag in my <code>TextView</code>, but when i tap on it nothing happens.</p><p>How can I make it open the web browser with the url?</p>","97688","","119895","","2012-09-18 13:43:21","2012-09-18 13:43:21","android: html in textview with link clickable","<android><html><textview>","2","0","1","2013-07-16 23:13:16",""
"4438785","1","","","2010-12-14 11:45:57","1","7178","<p>The list view is not updating data when the notifyDataChanged() method called.</p><p>In onCreate() method i initialized the the listview with no data.</p><pre><code>            ListView videoList = (ListView)findViewById(R.id.videos_list);    videoList.setOnItemClickListener(listener);    listAdapter = new PHVideosListAdapter(PHVideosActivity.this, videos);    videoList.setAdapter(listAdapter);</code></pre><p>After this I started fetching list of video using new VideosCategoryFetchTask().execute();</p><p>in the post execute method I called </p><pre><code>            @Override    protected void onPostExecute(Boolean success) {        if(success) {             listAdapter.notifyDataSetChanged();        } else {            //show dialog        }    }</code></pre><p>but nothing is displayed on the list. If anybody knew the solution please help...</p><pre><code> private class VideosDetailsFetchTask extends AsyncTask&lt;String, Void, Boolean&gt; {    @Override    public void onPreExecute() {        super.onPreExecute();    }    @Override    protected Boolean doInBackground(String... params) {        Boolean success = false;        try {            if (params.length &gt;= 0) {                videos = (Videos)videoAPI.videosForCategoryId(params[0],new VideosParser());                success = true;            }        } catch (Exception e) {            // TODO: handle exception        }        return success;    }    @Override    protected void onPostExecute(Boolean success) {        if(success) {              progressBar.setVisibility(View.INVISIBLE);              onFinishVideoFetch();        } else {            //show dialog           }           }}</code></pre><p>here  using two Async classes sec one is called on the onPostExecute() of first one..</p><pre><code>   private void onFinishVideoFetch() {    if(videos != null) {        listAdapter.notifyDataSetChanged();    }}</code></pre><p>I 'm not fetching videos one by one.. here a list of videos is returned....</p><p>After getting the list of videos i wanted to refresh the list.</p><pre><code>@Overrideprotected void onProgressUpdate(Videos... values) {    videos = values[0]; //add published object to list which holds    listAdapter.notifyDataSetChanged();}</code></pre><p>I tried this but no luck please help..</p><p>this is the adapter class used</p><p>public class PHVideosListAdapter extends BaseAdapter{</p><pre><code>private Videos videoTitles;private LayoutInflater inflater;public PHVideosListAdapter(Context context, Videos videoTitles) {    inflater = LayoutInflater.from(context);    this.videoTitles = videoTitles;}@Overridepublic int getCount() {    // TODO Auto-generated method stub    if(videoTitles != null) {        return videoTitles.size();    }    else {        return 0;    }}@Overridepublic Object getItem(int position) {    // TODO Auto-generated method stub    return videoTitles.get(position);}@Overridepublic long getItemId(int position) {    // TODO Auto-generated method stub    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    // TODO Auto-generated method stub    VideoListViewHolder holder = null;    if (convertView == null) {            holder = new VideoListViewHolder();            convertView = inflater.inflate(R.layout.videos_list, null);            holder.videoTitle = (TextView) convertView.findViewById(R.id.video_title);            holder.videoImage = (ImageView) convertView.findViewById(R.id.video_image);            holder.videoDuration = (TextView) convertView.findViewById(R.id.video_duration);            convertView.setTag(holder);    } else {        holder = (VideoListViewHolder)convertView.getTag();    }    holder.videoImage.setImageResource(R.drawable.icon);    holder.videoDuration.setText(""00:10"");    holder.videoTitle.setText(videoTitles.get(position).getVideoTitle());    return convertView;}   private class VideoListViewHolder {     ImageView videoImage;     TextView  videoTitle;     TextView  videoDuration;}</code></pre><p>}</p>","541442","","541442","","2010-12-14 12:32:17","2013-07-06 10:38:50","notifyDataSetChanged not working in android","<android>","3","3","","",""
"4438788","1","","","2010-12-14 11:46:01","0","394","<p>I am new to android.Want to work with maps in android.Can anyone tell me how to implement google map in android..?</p>","475349","","","","","2010-12-15 11:40:12","regarding showing map in android","<android>","2","0","","",""
"4438822","1","5159954","","2010-12-14 11:49:22","12","12158","<p>I have a <code>.wav</code> file in my <code>www</code> folder. I am using jQuery with the following code. The alerts go off but the sound does not play. Am I doing something wrong?</p><pre><code>&lt;script type=""text/javascript"" charset=""utf-8"" src=""phonegap-0.9.2.js""&gt;&lt;/script&gt; &lt;script type=""text/javascript"" charset=""utf-8"" src=""jquery.js""&gt;&lt;/script&gt; &lt;script type=""text/javascript"" charset=""utf-8""&gt;$(document).ready(function () {    window.alert(""READY!"");    document.addEventListener(""deviceready"", onDeviceReady, true);    function onDeviceReady(){        window.alert(""OK@!"");        var snd = new Media(""test.wav"");        snd.play();    }});&lt;/script&gt; </code></pre><p>The sound just does not play.</p>","542285","","918414","","2012-07-12 07:39:09","2014-03-07 03:09:22","Playing local sound in phonegap","<android><jquery><ios><phonegap>","2","0","5","",""
"4438836","1","","","2010-12-14 11:50:59","1","3193","<p>According to the topic...<br>I am a newcomer of Android!!!!<br>I have been tried to implement JmDNS successfully on Android for 2 more weeks...<br>(Not only on Google IDEOS phone,but also on Eclipse)...<br>I,ve been tried the ""TestBonjour"" code (comment 22)...<br> <a href=""http://code.google.com/p/android/issues/detail?id=2917"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=2917</a><br>But it's still not working!!<br>Could anyone can help me to solve this question?<br>Thanks a million and forgive my poor English!!</p>","517011","","517011","","2010-12-14 13:02:02","2011-03-25 14:09:34","How can I use JmDNS successfully on Android?","<java><android><jmdns>","1","1","2","",""
"4438874","1","4441571","","2010-12-14 11:54:15","0","612","<p>I'm drawing a number of bitmaps on a canvas, and using MotionEvents to let me drag them around.</p><p>When each item is pressed, I'd like to display a Toast, or, Toast-like mini information-panel that tracks the movement of the bitmap being dragged during an ACTION_MOVE.  The ""Toast"" would appear on ACTION_DOWN and vanish on ACTION_UP.</p><p>The problem with using Toast is that I have to give it a duration, and, also, I can't change its position once it has been displayed.  Unless I can kill the Toast for each ACTION_MOVE, and display a new one right away at the current coordinates? (Sorry, thinking aloud at this point, can't get to my dev machine to test...)</p><p>I don't know what other options there might be to achieve this, and I'd very much appreciate suggestions from the community.</p>","442912","","","","","2010-12-14 16:34:49","Android: Draggable Toast, Or Alternative?","<android><toast>","2","0","0","",""
"4438896","1","","","2010-12-14 11:58:03","0","252","<p>I am writing an Air app that needs to access the Android Media Store.</p><p>So far tried:Direct access to the SQLite database. Seems Android does not give permissions for this.Next attempted calling a native Android app from my Air app. Burrito does not seem to support NativeProcess for Android.</p><p>Any ideas or workarounds?Or do we drop AS3 and code native for Android?</p><p>Thanks, Ronnie</p>","541901","","773263","","2012-05-14 13:46:06","2012-05-14 13:46:06","Android MediaStore from Air App","<android><air><air-android>","1","0","","",""
"4438935","1","","","2010-12-14 12:03:24","3","1782","<p>I'm working on android application that will have basic image gallery functionality included. I've managed to build activity that fetches list of photos from my application backend API and render them in android gridview within activity layout.<br/><br/></p><p>This is how it looks like at the moment: <br><img src=""http://i.stack.imgur.com/YxuB1.png"" alt=""alt text""><br/></p><p>However I'm having difficulties to build same gallery experience for user's device photos that were taken by camera and stored on device. Two solutions I considered were:</p><ol><li>Building my own image gallery.</li><li>Starting default android image gallery using intent.</li></ol><p><strong>Solution 1:</strong> I belive that first solution will take me too much time to developed. I started with <a href=""http://androidsamples.blogspot.com/2009/06/how-to-display-thumbnails-of-images.html"" rel=""nofollow"">this tutorial</a> but as soon I implemented it I found out that it is running too slow. Then I take a look at android camera <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=summary"" rel=""nofollow"">source code</a> to find solution but again I found that it will take me too much time to review the code and to build my own gallery from scratch. I also believe that it is not in Android OS philosophy to rewrite functionalities that already exists but to use Intents to start activities that can handle actions you need. This lead me to second solution.</p><p><strong>Solution 2:</strong> I tried calling default android gallery using intent in order to browse user's device photos by soon I was stuck again. Problem this time was that as soon as user tap on photo, gallery exits and returns to activity that originaly started it, and I expected (and I want) to start large image preview instead. I saw that others had this problem too <a href=""http://stackoverflow.com/questions/3864860/how-to-open-gallery-via-intent-without-result"">how to open gallery via intent without result</a>.Because I didn't find the fix for this I decided to quit.</p><p>My question is how can I overcome these problems and build gallery that is similar to one I already have for web photos.If anyone could give me reference I would be most thankful.</p>","124644","","","","","2010-12-14 12:03:24","How to implement custom device photos gallery for android?","<android><gridview><android-intent><gallery>","0","2","0","",""
"4438953","1","","","2010-12-14 12:05:57","0","742","<p>I recently started working on proximity alerts App. This basically changes the ringtone profile (just vibrate or ringtone intially) based on the users GPS location. I completed the coding part. On ""enter"" and ""exit"" Proximity alerts are getting fired and the code in registered BroadcastReceiver is been executing. Till this point it is fine. Actual problem is as follows, (with my sample code lines)</p><p>I registered one broadcastreceiver for two Intent actions. Those Intent actions are declared as below,  public static final String INTENT_ACTION1 = ""org.droidmania.action.<strong>PROXIMITYALERT</strong>"";  public static final String INTENT_ACTION2 = ""org.droidmania.action.<strong>PROXIMITYALERT2</strong>"";</p><p>And PendingIntent part is as,</p><p>private void setProximityAlerts(String intentAction){ Intent intent = new Intent(); intent.setAction(intentAction); <strong>//in case the call comes from HomeActivity intentAction will be INTENT_ACTION1 else INTENT_ACTION2</strong></p><p>PendingIntent pIntent = PendingIntent.getBroascast(context, 0, intent,                    PendingIntent.FLAG_CANCEL_CURRENT);</p><p>locationManager.addProximityAlert(latitude,longitude, vRadius, -1,pIntent);}</p><p>Now the BroadcastReceiver code,</p><p>class ProxyReceiver extends BroadcastReceiver{   @Override   public void onReceive(Context context,Intent intent){<br>     boolean isEnter = intent.getBooleanExtra(KEY_PROXIMITY_ENTERING,false);</p><pre><code>if(isEnter){  **//if user is in Home location**   if(intent.getAction().equals(INTENT_ACTION1)){       give the notification that user is in home area  } **//if user is in Office location** if(intent.getAction().equals(INTENT_ACTION2)){     give the notification that user is in office area }</code></pre><p>}   else{       <strong>//if user is out of Home location</strong><br>       if(intent.getAction().equals(INTENT_ACTION1)){<br>         give the notification that user is out of home area      }     <strong>//if user is out of Office location</strong>     if(intent.getAction().equals(INTENT_ACTION2)){         give the notification that user is out of office area     }   } }</p><p>This is the way I tested it on my mobile device,</p><ol><li><p>In home I set the gps location with 10m radius. It gave me notification that ""user is in home area""</p></li><li><p>It shown ""user exited the home area"" message when I am out of that radius.</p></li><li><p>Now when I am in office I set the gps location with 5m radius. So It gave me notification that ""user is in office area"". <strong>But here I am facing the actual problem</strong> as It is showing <strong>both ""home area entered"" and ""office area entered"" and ""home area exited "" and ""office area exited"" messages for every 2 or 1 minute(s) gap. I am not getting why it is happening.</strong>  (Even I am not moving around after I set the office location GPS..just staying there in the same point......sitting in my office desk seat...)</p><p>Am I missing or giving something extra here? Why the alerts are occuring for home proximity as it's been long time since I exited the home area?</p><p>Guys please help me out (It's been already 2 weeks of time I spent :-( ). Your help is appreciated. </p></li></ol><p>Thanks.</p>","540798","","","","","2011-11-17 22:20:51","Proximity alerts are firing even I exit the set GPS location and occuring every 2 or 1 minute reccursively","<android><alerts><proximity>","1","2","0","",""
"4438989","1","4448078","","2010-12-14 12:09:15","0","579","<p>I have a ucLinux microcontroller, which connects to loudspeakers. Now I want to stream music from Android/iOS devices to the microcontroller, and make the loudspeaker play music on my mobile devices. The microcontroller and mobile devices can connect via wi-fi. Is it possible to do so? Thanks.</p>","111896","","","","","2010-12-15 09:27:36","Is it possible to stream music from Android/iOS devices to desktop devices?","<iphone><android><ios><streaming>","2","4","1","",""
"4439023","1","4439158","","2010-12-14 12:14:02","1","1659","<p>Hello i have question about android spinner</p><p>I have spinner which is populated by array.The array is Country name and Country phone code on every row</p><p>part of the array</p><pre><code>&lt;item&gt;355  Albania&lt;/item&gt;&lt;item&gt;213  Algeria&lt;/item&gt;&lt;item&gt;376  Andorra&lt;/item&gt;&lt;item&gt;244  Angola&lt;/item&gt;&lt;item&gt;1264  Anguilla&lt;/item&gt;&lt;item&gt;1268  Antigua and Barbuda&lt;/item&gt;&lt;item&gt;54  Argentina&lt;/item&gt;</code></pre><p>This is my java code for populating the spinner</p><pre><code>final Spinner spnCountry = (Spinner) findViewById(R.id.countries);ArrayAdapter&lt;CharSequence&gt; adpCountry = ArrayAdapter.createFromResource(        this, R.array.countries, android.R.layout.simple_spinner_item);adpCountry    .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);spnCountry.setAdapter(adpCountry);</code></pre><p>I want to show only country code on the box and when the spinner is opened to show country name and code on every row.</p><p>Can someone help me how to do that?</p><p>Thank you</p>","514521","","","","","2012-12-13 11:29:16","Android Spinner","<android><spinner>","1","0","2","",""
"4439043","1","4439898","","2010-12-14 12:15:44","4","4369","<p>I need to check if the Android Market is installed like this</p><pre><code>    /*     * Test for existence of Android Market     */    boolean androidMarketExists = false;    try{        ApplicationInfo info = getPackageManager()                             .getApplicationInfo(""com.google.process.gapps"", 0 );        //application exists        androidMarketExists = true;    } catch( PackageManager.NameNotFoundException e ){        //application doesn't exist        androidMarketExists = false;    }</code></pre><p>But I don't know if com.google.process.gapps is the package that has android market or not.</p>","248521","","","","","2013-07-05 15:41:36","What is the package name of the Android Market or Google Apps","<android>","2","0","0","",""
"4439044","1","","","2010-12-14 12:15:56","0","1075","<p>In my project I am calling a web service by the sending soap request in this format,</p><pre><code>try {       URL u = new URL(server);       URLConnection uc = u.openConnection();       HttpURLConnection connection = (HttpURLConnection) uc;       connection.setDoOutput(true);       connection.setDoInput(true);       connection.setRequestProperty(""SOAPAction"", SOAP_ACTION);       connection.setRequestMethod(""POST"");       connection.setRequestProperty(""Content-type"", ""text/xml; charset=utf-8"");       String xmldata = ""&lt;?xml version=\""1.0\"" encoding=\""UTF-8\""?&gt;"" +                         ""&lt;soap:Envelope xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xmlns:xsd=\""http://www.w3.org/2001/XMLSchema\"" xmlns:soap=\""http://schemas.xmlsoap.org/soap/envelope/\""&gt;""+                         ""&lt;soap:Body&gt;""+                        ""&lt;GetAllCars  xmlns=\""http://parkinghero.com/\""&gt;""+                                                  ""&lt;clsGetAllCarsRequest&gt;""+                        ""&lt;clsCredentials&gt;""+                        ""&lt;EmailAddress&gt;""+Email+""&lt;/EmailAddress&gt;""+                        ""&lt;Password&gt;""+passWRD+""&lt;/Password&gt;""+                        ""&lt;TokenID&gt;""+token+""&lt;/TokenID&gt;""+                        ""&lt;/clsCredentials&gt;""+                        ""&lt;/clsGetAllCarsRequest&gt;""+                          ""&lt;/GetAllCars&gt;""+""&lt;/soap:Body&gt;""+                        ""&lt;/soap:Envelope&gt;"";               System.out.println(xmldata);       OutputStream out = connection.getOutputStream();          Writer wout = new OutputStreamWriter(out);          wout.write(xmldata);          wout.flush();          wout.close();          BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));            //InputStream in = connection.getInputStream();            String result;        //int c;          while ((result=rd.readLine()) != null) {          System.out.println(result);          int length = result.length();          String jsonObj = result.substring(294, (length - 74));          System.out.println(jsonObj);          }rd.close();   }   catch (IOException e)    {       System.out.println(""in Exception called""); System.err.println(e);    }</code></pre><p>For this request the response will be json array</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;GetAllCarsResponse xmlns=""http://abcd.com/""&gt;    &lt;GetAllCarsResult&gt;    {""clsError"":{""ErrorCode"":306,""ErrorDescription"":""Data Available""},    ""CarsArray"":[{""CarID"":1,""UserID"":1,""RegisteredOwner"":""Suresh    thorata"",""Make"":""Esteem"",""Model"":""23434"",""Color"":""Brownd"",""BodyType"":""Normal"",""PlateType"":""COM"",""PlateNumber"":""WAG1PM"",""State"":""NY"",""VINNumber"":""000000000000"",""YearOfRegistration"":2000,""ExpiryDate"":""10/25/2014 4:24:57 PM"",""IsDeleted"":true,""DateAddedTimeStamp"":""10/18/2010 10:19:04 AM"",""LastUpdatedTimeStamp"":""10/25/2010 4:24:57 PM""},{""CarID"":2,""UserID"":1,""RegisteredOwner"":""Balaji"",""Make"":""Land Rover"",""Model"":""9999"",""Color"":""Brown"",""BodyType"":""Normal"",""PlateType"":""PAS"",""PlateNumber"":""WAG2PM"",""State"":""NY"",""VINNumber"":"""",""YearOfRegistration"":2003,""ExpiryDate"":""10/18/2014 11:01:07 AM"",""IsAutoFightOn"":true,""IsDeleted"":true,""DateAddedTimeStamp"":""10/18/2010 11:01:07 AM"",""LastUpdatedTimeStamp"":""10/18/2010 11:01:07 AM""}, {""CarID"":3,""UserID"":1,""RegisteredOwner"":""Suresh"",""Make"":""Dodge"",""Model"":""5670"",""Color"":""Brown"",""BodyType"":""Normal"",""PlateType"":""AYG"",""PlateNumber"":""WAG3PM"", ""State"":""NY"",""VINNumber"":"""",""YearOfRegistration"":2000,""ExpiryDate"":""10/18/2014 11:01:39 AM"",""IsDeleted"":true,""DateAddedTimeStamp"":""10/18/201 0 11:01:39 AM"",""LastUpdatedTimeStamp"":""12/9/2010 11:36:14 PM""}, {""CarID"":4,""UserID"":1,""RegisteredOwner"":""Suresh Babu"",""Make"":""Infiniti"",""Model"":""234353"",""Color"":""Brownd"",""BodyType"":""Normal"",""PlateType"":""PAS"", ""PlateNumber"":""WAG4PM"",""State"":""NY"",""VINNumber"":""000000000000"",""YearOfRegistration"":2000,""ExpiryDate"":""10/20/2014 1:01:22 PM"",""IsAutoFightOn"":true, ""IsDeleted"":true,""DateAddedTimeStamp"":""10/20/2010 1:01:22 PM"",""LastUpdatedTimeStamp"":""12/3/2010 12:20:29 PM""},{""CarID"":5,""UserID"":1, ""RegisteredOwner"":""Suresh1 thorata"",""Make"":""Esteem"",""Model"":""23434"",""Color"":""Brownd"",""BodyType"":""Normal"",""PlateType"":""COM"", ""PlateNumber"":""WAG5PM"",""State"":""NY"",""VINNumber"":""000000000000"",""YearOfRegistration"":2000,""ExpiryDate"":""10/25/2014 11:44:06 AM"" ,""IsDeleted"":true,""DateAddedTimeStamp"":""10/25/2010 11:39:00 AM"",""LastUpdatedTimeStamp"":""10/25/2010 11:44:06 AM""},{""CarID"":73,""UserID"":1, ""RegisteredOwner"":""Balaji "",""Make"":""Audi"",""Model"":""Sportz"",""Color"":""Red"",""BodyType"":""Coupe"",""PlateType"":""PAS"", ""PlateNumber"":""SUPERMAN"",""State"":""NJ"",""VINNumber"":"""",""YearOfRegistration"":2010,""ExpiryDate"":""12/12/2020 12:00:00 AM"", ""IsAutoFightOn"":true,""IsDeleted"":true,""DateAddedTimeStamp"":""10/25/2010 6:36:07 PM"",""LastUpdatedTimeStamp"":""12/9/2010 11:41:46 PM""}, {""CarID"":74,""UserID"":1,""RegisteredOwner"":""suresh"",""Make"":""BMW"",""Model"":""sedane"",""Color"":""silver"",""BodyType"":""Convertible"",""PlateType"":""PAS"", ""PlateNumber"":""GREENMAN"",""State"":""NJ"",""VINNumber"":"""",""YearOfRegistration"":2010,""ExpiryDate"":""12/12/2020 12:00:00 AM"",""IsAutoFightOn"":true,""IsDeleted"":false, ""DateAddedTimeStamp"":""10/26/2010 10:15:34 AM"",""LastUpdatedTimeStamp"":""12/9/2010 11:38:56 PM""},{""CarID"":79,""UserID"":1,""RegisteredOwner"":""Balu"",""Make"":""Hero"", ""Model"":""Honda"",""Color"":""Green"",""BodyType"":""2005"",""PlateType"":""ARG - Air National Guard"",""PlateNumber"":""2434"",""State"":""NY"",""VINNumber"":""12345"", ""YearOfRegistration"":2004,""ExpiryDate"":""3/17/2021 12:00:00 AM"",""IsAutoFightOn"":false,""IsDeleted"":false,""DateAddedTimeStamp"":""11/17/2010 9:55:32 AM"", ""LastUpdatedTimeStamp"":""12/6/2010 11:13:01 AM""},{""CarID"":80,""UserID"":1,""RegisteredOwner"":""Balaji"",""Make"":""Accura"",""Model"":""i10"",""Color"":""Red"", ""BodyType"":""1994"",""PlateType"":""ATD - All Terrain Dealer"",""PlateNumber"":""NOFEAR"",""State"":""DE"",""VINNumber"":""456789"",""YearOfRegistration"":1999, ""ExpiryDate"":""10/29/2047 12:00:00 AM"",""IsAutoFightOn"":true,""IsDeleted"":false,""DateAddedTimeStamp"":""11/17/2010 11:25:54 AM"", ""LastUpdatedTimeStamp"":""11/17/2010 11:25:54 AM""},{""CarID"":81,""UserID"":1,""RegisteredOwner"":""Balaji"",""Make"":""Esteem"",""Model"":""Honda"",""Color"":""LemonYellow"", ""BodyType"":""1976"",""PlateType"":""AYG"",""P</code></pre><p>I am able to get response but it is incomplete. what am i doing wrong. I think it is because of buffer reader.</p>","501859","","21234","","2010-12-15 08:34:25","2011-03-31 09:34:01","java getting incomplete soap response","<java><android><soap>","1","4","2","",""
"4439260","1","4439286","","2010-12-14 12:41:59","0","109","<p>I have a video recording in Android and the file generated is 3gp. I want to send mp4 file to server, how can I convert 3gp file to mp4, is there any jar for this purpose?</p>","487219","","21234","","2010-12-14 12:47:32","2010-12-14 12:47:32","Java file conversion","<java><android><video>","1","0","","",""
"4439312","1","4439520","","2010-12-14 12:47:44","0","283","<p>I'm stuck with this problem for the last 2 days:</p><p>I have server running WCF JSON service that returns type: string.</p><p>The client that consumes this service is Android application.</p><p>The problem:</p><p>The string returned by the WCF service seems to be fine (for example: ""result_1""), but the value in the Android application looks like this: """"result_1"""" (note the problematic extra quotes...).</p><p>What should i do in order to fix this?Thanks.</p>","501560","","","","","2010-12-14 13:12:44","strings returned by wcf wrapped with extra quotes","<android><wcf><json>","1","0","","",""
"4439362","1","4439392","","2010-12-14 12:53:35","1","342","<p>I developed one application based on android 2.2 version.Is it possible to work that application on other android versions (1.5 to 2.1)? </p>","488433","","","","","2010-12-14 13:23:15","Is it possible to work android 2.2 application on other android versions (1.5 to 2.1)?","<android>","3","1","","",""
"4439429","1","4442810","","2010-12-14 13:02:31","1","2447","<p>lets assume i have a LinearLayout , horizontal that contains a TextView and afterward a Spinner or another clicable TextView or an EditText.</p><p>I want that a click on any part of the line (if the layout has padding then the layout area as well!) will deleage the onTouchEvent to the Right part of the layout (EditText, TextView or Spinner) as if they were clicked themselves.</p><p>Doing it myself will require me either create my own versions of those widgets (too much work for little effect :-( ) or putting listeners on many items for the touch events and delegate them. I'm pretty sure Android has some methods or properties to do that, just didn't see any so far. </p><p>Can anyone help ?</p>","312288","","20402","","2010-12-14 13:41:54","2010-12-14 18:32:44","Delegating touch events","<android><events><delegates><touch>","1","0","","",""
"4439441","1","5010001","","2010-12-14 13:03:32","0","381","<p>I'm looking for a method that returns me the Google Checkout User Account of the owner of the telephone... </p><p>I explain: when I buy an application over the market, in the phone is stored somewhere the Google Account that I use to purchase the app (that maybe can be different from the main google main account?). I need a method, if exists, that gives me this account (only the username, I don't need the password!).</p><p>Thanx in advance</p>","489146","","21234","","2010-12-14 13:13:44","2011-03-15 00:46:55","Google Checkout Account Username","<android><google-checkout>","3","2","1","",""
"4439454","1","4439527","","2010-12-14 13:04:52","2","1431","<p>is there some kind of widget for Android which does same job what UISlider for iPhone or jQuery slider for js ?</p><p>cheers,/Marcin</p>","193400","","","","","2013-06-18 07:10:36","UISlider in Android?","<android><slider>","1","0","","",""
"4439456","1","4440209","","2010-12-14 13:05:10","2","14132","<p>I would like to create an custom <code>View</code> on Android. I have tried to do it as simple as possible and created an almost empty class <code>MyView</code> and used it in my <code>LinearLayout</code> but the application fails on start with ""Force Close"". How can I do a simple custom <code>View</code>? According to <a href=""http://developer.android.com/guide/topics/ui/custom-components.html"" rel=""nofollow"">Building Custom Components</a> the <code>View</code> gets the size 100x100 if I don't override <code>onMeasure()</code>.</p><pre><code>public class MyView extends View {    public MyView(Context context) {        super(context);    }}</code></pre><p>And I use it in a <code>LinearLayout</code> with:</p><pre><code>&lt;view    class=""com.example.MyView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""0.0"" /&gt;</code></pre><p>What am I doing wrong?</p><hr><p>If I use the constructor that <a href=""http://stackoverflow.com/questions/4439456/how-to-create-a-simple-custom-view/4440209#4440209"">itemon</a> suggest and the corresponding call to the superclass. Then the ""Force Close"" is gone, but my <code>LinearLayout</code> is broken, the components after <code>MyView</code> isn't shown.</p><p>Here is my <code>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:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    &gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""0.0""    android:background=""#f00""    android:text=""Hello""/&gt;&lt;view    class=""com.example.MyView""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""0.0""/&gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_weight=""0.0""    android:background=""#00f""    android:text=""World""/&gt;&lt;/LinearLayout&gt;</code></pre>","213269","","213269","","2010-12-14 17:20:04","2014-04-18 15:34:15","How to create a simple custom View?","<android><view><android-linearlayout><custom-view>","3","1","1","",""
"4439496","1","4439903","","2010-12-14 13:10:24","0","1212","<p>I'm android developer and I use Eclipse.</p><p>Sometimes, when I am debugging my apps, Eclipse doesn't stop on my breakpoints. Eclipse shows a ""v"" symbol on the breakpoint.  I think this symbol means that Eclipse has passed the breakpoint without problems, but I would like Eclipse to stop when it reaches the breakpoint.</p><p>Of course, I have pressed the debug button (the icon with the green bug on it.)</p><p>How can I avoid this behavior?</p>","479886","","403455","","2012-06-08 15:53:22","2013-09-12 04:36:42","Why does Eclipse sometimes ignore my breakpoints?","<android><eclipse><breakpoints>","2","0","","",""
"4439499","1","4439529","","2010-12-14 13:10:44","0","506","<p>I'm having a service class that I bind from my main activity with a <code>ServiceConnection</code> to call a method within the service as soon as it is bound. I need to explicitly call the method to pass over the context of my main activity.</p><p>If I call this service class from within an <code>IntentReceiver</code>, I need to use <code>peekService</code> to bind to the service. But how can I spawn it's method then? :-s</p><p>Best regards / Thanks alot!<br>S.</p>","419501","","","","","2010-12-23 09:46:08","Accessing a method of a bound service from an IntentReceiver on Android","<android><service><android-intent>","1","0","","",""
"4439606","1","15420183","","2010-12-14 13:21:29","2","1784","<p>I need to attach a progress bar to an AsyncTask. The AsyncTask works fine, but the progress bar is not.</p><p>The progress bar is actually a spinner! I imagine a progress bar being a horizontal thick line being filled from 0% to 100%. Instead I get a 'spinner'.</p><p>So, I tried mProgressBar.setIndeterminate(false); - it does not appear to have any effect.I guess the really important line is </p><p>style=""?android:attr/progressBarStyleHorizontal"" in the xml tag progressBar.</p><p>How can I do that from java code, and not xml ?</p>","346583","","","","","2013-03-14 21:05:12","Android::Create a progressBar from code-behind (java, not from xml)","<java><android><progress-bar>","2","0","","",""
"4439625","1","","","2010-12-14 13:24:04","0","798","<p>I am trying to make a listview which uses a ratingbar. I use a wrapperclass ViewHolder, and store the results in a arraylist called rl. But it dosn't work.</p><pre><code>  class ratingAdapter extends ArrayAdapter{  ratingAdapter(){   super(todolister.this,R.layout.row,R.id.todo, al);  }  @Override  public View getView(int position,View convertView,ViewGroup parent){   View row;   ViewHolder vh;   row=convertView;   TextView t;   RatingBar r;   final int pos=position;   if(row==null){    LayoutInflater inflater=getLayoutInflater();    row=inflater.inflate(R.layout.row,parent,false);    vh=new ViewHolder(row);    row.setTag(vh);    r=vh.getRB();               r.setOnRatingBarChangeListener(new OnRatingBarChangeListener(){  @Override  public void onRatingChanged(RatingBar ratingBar,    float rating, boolean fromUser) {   rl.set(0,rating);  }    });   }   else{    vh=(ViewHolder)row.getTag();   }   t=vh.getTextView();   r=vh.getRB();   t.setText(al.get(pos));   r.setRating(rl.get(pos));   return row;  } }</code></pre><p>}</p><p>This is the wrapper class</p><pre><code>public class ViewHolder {private TextView t;private RatingBar r;private View base;public ViewHolder(View row) {    base=row;}public TextView getTextView(){    if(t==null){        t=(TextView)base.findViewById(R.id.todo);    }    return t;}public RatingBar getRB(){    if(r==null){        r=(RatingBar)base.findViewById(R.id.rater);    }    return r;}}</code></pre><p>This is not the full code. The program compiles properly. The program is like a todolist app. But the ratingbar next to each item varies its rating each time a new item is added.</p>","528314","","528314","","2010-12-14 13:30:28","2010-12-14 13:30:28","ListView with a RatingBar","<android><listview>","0","3","1","",""
"4439660","1","4439940","","2010-12-14 13:29:53","0","368","<p>how to upload the datas to  webserver from android mobile.Please provide coding </p>","538626","","","","","2010-12-14 14:01:09","how to upload the datas to webserver from android mobile","<android><upload><webserver>","1","3","","",""
"4439741","1","","","2010-12-14 13:39:28","1","987","<p>I wish to be able to send touch events to the foreground Activity.<strong>Assume that I don't have control over the foreground Activity</strong>. For example sending touch events to Android Gallery Activity or even the Main Menu.</p><p>I've read that there are ways to perform this task under TouchUtils - using ActivityInstrumentationTestCase2, which a more of an automated testing tool.. I'm willing to go down this road as long that I can launch the OEM Activities that arrives with the device and send them the simulated touch events.</p><p>Is there a way to do so? Is there anything in MotionEvent that could help? (other then creating the actual touch event)</p><p>Thanks for helping,</p><p>Ita</p>","189319","","","","","2012-02-03 15:54:54","How to simulate touch events and send them to foreground activity (On device)","<android><android-input-method>","0","2","","",""
"4439892","1","","","2010-12-14 13:55:40","0","517","<p>I am trying to record a voice from Mic using Media Recorder class. in the mentioned class we have just setOutputFile method to set the output file, but I need to get a buffer of some certain recorded voice, I mean i need something like a CallBack method that return a block of recorded byte at that time and i am going to send the mentioned bytes to another device...</p><p>Actually I want to stream and send the recorded voice through socket to another device simultaneously not saving the recorded voice and then read the file and send it, due to it results an unexpected delay...</p>","538843","","213269","","2011-08-15 19:52:30","2011-08-15 19:52:30","CallBack for the recorded block in MediaRecorder","<android><callback><streaming><audio-recording><mediarecorder>","1","1","","",""
"4439934","1","4473179","","2010-12-14 14:00:15","1","3453","<p>I have been digging since last three days to find out the appropriate way to use kSoap2 in order to access the web service. now i am able to access the web service , but i need to know, whether i followed  the right way or i have gone out of standards. I have posted complete code and output that i have got, please correct me , if i have gone wrong anywhere.</p><p><code>// WebServiceConsumer.java</p><pre><code> public SoapObject soap(String METHOD_NAME, String SOAP_ACTION, String NAMESPACE, String URL) throws IOException, XmlPullParserException {    /** Construction of the SoapObject */    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //set up request    /** passing the values in to the webservice*/    request.addProperty(""iTopN"", ""0""); //variable name, value. got the variable name, from the wsdl file!    /** Creation of the SoapEnvelope with the appropriate version*/    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); //put all required data into a soap envelope    envelope.dotNet = true;    envelope.setOutputSoapObject(request);  //prepare request    /** Creating AndroidTransport for passing the request to the URL where the service is located*/    AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);      httpTransport.debug = true;  //this is optional, use it if you don't want to use a packet sniffer to check what the sent message was (httpTransport.requestDump)    httpTransport.call(SOAP_ACTION, envelope); //send request    SoapObject result =(SoapObject)envelope.bodyIn; //get response    return result; } public void callService() {     try{         SoapObject result = soap(METHOD_NAME, SOAP_ACTION, NAMESPACE, URL);         Log.i(TAG,""Result:"" + result);         try {            // FootballScoreParser.parseBusinessObject(result.getProperty(0).toString(), footballscore);                 SoapObject logObject = (SoapObject) result.getProperty(0);                 Log.i(TAG,""LogObject : "" + logObject);                 for(int i = 0; i &lt; 10 ; i++) {                 SoapObject logger = (SoapObject) logObject.getProperty(i);                // Log.i(TAG,""Name : "" + logger.getProperty(""sName""));                // Log.i(TAG,""Goals : ""+ logger.getProperty(""iGoals""));                 /** Appending the sName,iGoals in to ArrayList name */                    name.add((String)logger.getProperty(""sName"").toString());                    goals.add((String) logger.getProperty(""iGoals"").toString());                    country.add((String) logger.getProperty(""sCountry"").toString());                    flag.add((String) logger.getProperty(""sFlag"").toString());                 /** Converting the ArrayList into the Object Array*/                    objName = name.toArray();                    objGoals = goals.toArray();                    objCountry = country.toArray();                    objFlags = flag.toArray();                 }                 for(int j = 0; j &lt; objName.length; j++){                            Log.i(TAG,""Name [""+ j + ""]="" + objName[j].toString() + "","" + ""Goals [""+ j + ""]="" + objGoals[j].toString()+ "",""  + ""Country["" + j  + ""]="" + objCountry[j].toString() + "","" +""Flag["" +j+ ""]="" + objFlags[j].toString());                         }                 }         catch(Exception err){             Log.i(TAG, """" + err);         }         }         catch(Exception err){             Log.i(TAG,""""+ err);         }           /* catch(NumberFormatException err){            err.printStackTrace();              }            catch(IllegalArgumentException err){                err.printStackTrace();            }            catch(IllegalAccessException err){                err.printStackTrace();            }            catch(InstantiationException err){                err.printStackTrace();            }*/         //}</code></pre><p></code></p><p><code>// FootBallScrorerActivity.java</p><pre><code>package com.project.mobile.FootballScorers;import android.app.Activity;import android.os.Bundle;public class FootbalScorerActivity extends Activity {WebServiceConsumer webconsumer;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    webconsumer = new WebServiceConsumer();    webconsumer.callService();}}</code></pre><p></code></p><p>Output:</p><p><a href=""http://i.stack.imgur.com/ozJbm.png"" rel=""nofollow"">Please click here to see the Output</a></p><p>Any Help is Appreciated.... Thanks in Advance</p>","384193","","384193","","2010-12-14 14:16:13","2011-06-09 14:28:31","Accessing the WebService in android using kSoap2","<android><web-services><ksoap2>","1","0","2","",""
"4439983","1","4440117","","2010-12-14 14:06:31","8","2089","<p>When compiling android stuff in eclipse, I am forever annoyed when I hit the ""Run"" button to compile and run, if I am in a .java file everything works great if im in an .xml file (for android layouts) it compiles the xml file and produces an _out.xml file which screws up the project so that I first have to delete the ""out"" file then clean my project files.</p><p>Any quick answer on how to disable the compiling of xml files?</p>","483610","","","","","2010-12-14 14:28:24","Eclipse - Disabling compiling of XML files while in Java perspective","<java><android><xml><eclipse>","2","0","3","",""
"4440047","1","","","2010-12-14 14:14:01","0","931","<p>I have an activity that controls starting and stopping of a background service via. a button click. When the service is not running the button says 'START SERVICE' and when the service is running the button says 'STOP SERVICE'. The logic, what should happen on button click, toggles in the same manner (if the service is not running we start it and bind to it on button click and we stop it and unbind from it if the service is running). </p><p>Please, take a look at the code excerpt bellow for more information.</p><p><strong>Bind and unbind</strong></p><p>While the service can currently only be stopped through the STOP SERVICE button, I'm unbinding the service in onPause and rebinding it in onResume. Does this make sense? onPause and onResume lifecycle methods are called quite often, so this is a lot of binding and unbinding overhead, but as onPause is always called before the application could be killed, I think this is the best place for releasing service bindings and to avoid leaks.</p><p><strong>BACK button</strong></p><p>I'm also not sure what to do when the BACK button is pressed. Should the service remain running in the background when the BACK button is pressed (the same behaviour as in Android Music application)? If yes, what would be the proper way to persist the information that the service is running (as <em>onSaveInstanceState</em> is not getting called on BACK button pressed I am wondering what would be the cleanest way to persist the application's state - in my case the isServiceRunning boolean variable)? I need this information to set the correct text on the start/stop button (with respect to the state of the background service) when the activity will be started again. One possible alternative would also be to allow the activity to finish normally without saving any service state information (isServiceRunning). I could get this information in onCreate from ActivityManager, where I could query for the running services. </p><p>On the other hand, if the service should be stopped on the BACK button press, where should I implement stopping of the service? onDestroy would be a natural answer to this question, but I'm facing problems as onDestroy is also getting called on activity restart (e.g. on orientation change) and I do not want to stop the service in that case.</p><pre><code>    public class ServiceController extends Activity { public void onStartClick(View v) {  if (!isServiceRunning) {   button.setText(""STOP"");   isServiceRunning = true;   startService(...)   bindService(...)  } else {   button.setText(""START"");   isServiceRunning = false;   unbindService(...)   stopService(...)  } } @Override protected void onResume() {  super.onResume();  if (isServiceRunning) {   button.setText(""STOP"");   bindService(...);  } } @Override protected void onPause() {  super.onPause();  if (mBoundAccService != null) {   unbindService(...);  } } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) {  super.onRestoreInstanceState(savedInstanceState);  if (savedInstanceState != null) {      isServiceRunning = savedInstanceState.getBoolean(ID_SERVICE_RUNNING);  } } @Override protected void onSaveInstanceState(Bundle outState) {  super.onSaveInstanceState(outState);  outState.putBoolean(ID_SERVICE_RUNNING, isServiceRunning); }    } </code></pre>","404200","","","","","2010-12-15 05:06:27","Android background service state information","<android><state><lifecycle><back-button>","1","0","","",""
"4440126","1","4440857","","2010-12-14 14:21:48","2","1986","<p>I wanted to try out IntelliJ-IDEA but my experiments failed in a very early state. The Problem is that I found no way to set the Java platforms to be used.</p><p>Standard Java fails <code>@Override</code> annotation as IntelliJ-IDEA fails to to use the installed Java 6.</p><p>Android tells me to set the Android platform - only there is no setting so be seen to set any platform.</p><p>So what am I missing here?</p>","341091","","473070","","2010-12-15 14:45:59","2010-12-15 14:45:59","How to specifiy the java/android platform with IntelliJ-IDEA?","<android><intellij-idea>","2","0","2","",""
"4440173","1","4440404","","2010-12-14 14:27:15","1","231","<p>is there something like MFMailComposeViewController in iPhone for Android, basicly Activity which handles email addresses and email creation etc. ? or all must be made from scratch by me?</p><p>cheers,/Marcin</p>","193400","","","","","2010-12-14 14:51:42","MFMailComposeViewController in Android?","<android><email>","1","0","","",""
"4440364","1","","","2010-12-14 14:47:22","2","1607","<p>I am trying out for audio streaming over socket in android.I am using AudioRecord for obtaining recorded audio at client side and AudioTrack classes for playing raw data at server side. But I am unable to do it.Is there any other procedure to do this?</p><p><strong>audiosender file</strong></p><pre><code>public void run(){  BufferedOutputStream bufferedStreamInstance = null;  try  {    Socket socket = new Socket(""192.168.1.25"", 1234);    bufferedStreamInstance = new BufferedOutputStream(        socket.getOutputStream());  } catch (FileNotFoundException e)  {    throw new IllegalStateException(""Cannot Open File"", e);  } catch (UnknownHostException e)  {    e.printStackTrace();  } catch (IOException e)  {    e.printStackTrace();  }  DataOutputStream dataOutputStreamInstance = new DataOutputStream(      bufferedStreamInstance);  int bufferRead = 0;  int bufferSize = AudioRecord      .getMinBufferSize(this.getFrequency(), this.getChannelConfiguration(), this.getAudioEncoding());  AudioRecord recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, this.getFrequency(), this      .getChannelConfiguration(), this.getAudioEncoding(), bufferSize);  short[] tempBuffer = new short[bufferSize];  recordInstance.startRecording();  while (this.isRecording)  {    bufferRead = recordInstance.read(tempBuffer, 0, bufferSize);    if (bufferRead == AudioRecord.ERROR_INVALID_OPERATION)    {      throw new IllegalStateException(          ""read() returned AudioRecord.ERROR_INVALID_OPERATION"");    }    else if (bufferRead == AudioRecord.ERROR_BAD_VALUE)    {      throw new IllegalStateException(          ""read() returned AudioRecord.ERROR_BAD_VALUE"");    }    else if (bufferRead == AudioRecord.ERROR_INVALID_OPERATION)    {      throw new IllegalStateException(          ""read() returned AudioRecord.ERROR_INVALID_OPERATION"");    }    try    {      for (int idxBuffer = 0; idxBuffer &lt; bufferRead; ++idxBuffer)      {        dataOutputStreamInstance.writeShort(tempBuffer[idxBuffer]);      }    } catch (IOException e)    {      throw new IllegalStateException(          ""dataOutputStreamInstance.writeShort(curVal)"");    }  }  recordInstance.stop();  try  {    dataOutputStreamInstance.close();    bufferedStreamInstance.close();  } catch (IOException e)  {    throw new IllegalStateException(""Cannot close buffered writer."");  }}</code></pre><p><strong>audioreceiver</strong></p><pre><code>public void run(){  musicLength = 66535;  music = new short[musicLength];  try  {    ServerSocket serverSocket = new ServerSocket(1234);    Socket socket = serverSocket.accept();    InputStream is = socket.getInputStream();    BufferedInputStream bis = new BufferedInputStream(is);    dis = new DataInputStream(bis);    while (dis.available() &gt; 0)    {      music[musicLength - 1 - i] = dis.readShort();      i++;    }    try    {      dis.close();    } catch (IOException e)    {      e.printStackTrace();    }    audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 11025,        AudioFormat.CHANNEL_CONFIGURATION_MONO,        AudioFormat.ENCODING_PCM_16BIT, musicLength,        AudioTrack.MODE_STREAM);    audioTrack.play();    audioTrack.write(music, 0, musicLength);  } catch (Throwable t)  {    Log.e(""AudioTrack"", ""Playback Failed"");  }}</code></pre>","414523","","32090","","2010-12-14 14:52:17","2011-01-25 16:47:18","AudioStreaming over Sockets in android","<android>","1","0","1","",""
"4440471","1","","","2010-12-14 14:58:57","0","539","<p>Hey Guys, I want to do a nice test to the Android OS. I would like to flash my rooted Android device with my own android OS version. I am doing so because I want to change some system app and kernel framework to act differently. </p><p>So I know I can download the source code with git, but can I open it with Eclipse? how do I compile it, and the most important question, how do I flash it back (with the changes) to the device?</p><p>I need to do it on Windows...I know it suppose to run on Mac\Linux, any free solution?</p><p>Thanks M</p>","542113","","","","","2011-12-05 19:38:32","Download, Update, Compile and publish Android source code on Windows","<android><compilation><root>","2","0","","",""
"4440499","1","4441743","","2010-12-14 15:02:52","2","1067","<p>Good afternoon.</p><p>I have been making a small openGL based app for android that loops at the normal 60 fps and does various wondrous things.</p><p>I have been keeping an eye on my frame rate and trying to optimise where possible as I am going along. I recently noticed that whilst my program is running sometimes there will be a slight pause. I immediatly suspected that it might be the Garbage Collector running and looking in LogCat there were a few suspect GC's appearing around the times of the dips in fps.</p><p>However I am unsure if it is my app that is causing the collects.</p><p>So these are my questions about the GC:</p><p>1) When I get logging from LogCat it contains a PID (process id?) and here is an example of a typical GC i receive:</p><pre><code>12-14 14:52:40.647: DEBUG/dalvikvm(492): GC_EXPLICIT freed 3831 objects / 203576 bytes in 32ms</code></pre><p>The 492 is the PID. Is this PID going to be of the process that performs the GC? Or is it a process running on the phone that is also needing a GC? </p><p>For example from the same session here is a log from my app using Log.debug:</p><pre><code>12-14 13:50:42.717: DEBUG/Curve(2298): LIFECYCLE - OnStart</code></pre><p>The PID for my app is not 492, it is 2298. Does this mean the GC was not due to my app? </p><p>Using the allocation tracker I have very few allocations occuring. A few lines of logging causing some strings to be generated and the occasional Rect being generated on a user press (I have fixed this so it will only be allocated once now...) So I cannot see how my app itself will be generating the need for GC's.</p><p>2) If it is not my app allocating away and is simply some other process that is eating into memory happily should it affect my app at all?</p><p>3) Could the very fact I am using the ddms be causing GC's? </p><p>4) When I look in to the allocation tracker there are some entries which do not come from any code that I am running / going through myself. One of which was related to thread stats, could this be the ddms?</p><p>Sorry if this is really several questions but it is all related to really whether the GC logs I see in my Logcat are actually from my application or not.</p><p>Bearing in mind that at the moment my phone is sat not running my app and I am still getting small GC's 5 - 15 seconds. These normally run for 33ms and seems quite small amounts of memory. So I guess this means they are not due to me. - Again basically about the PID and what that shows.</p>","432272","","","","","2010-12-14 17:14:41","Android DDMS and allocation tracking - Identifying what is causing the GC to trigger and why","<java><android><garbage-collection><ddms>","1","0","","",""
"4440518","1","4443350","","2010-12-14 15:05:14","1","1046","<p>My setup is like so:</p><ul><li>An SQLite database sits in one of my Apache folders</li><li>A Perl cgi script sits in the same folder, with public permissions, so that it can handle database interactions</li><li>A C program, running on the same machine, listens on a specific port for specific JSON requests and responds with specifically-formatted JSON data </li></ul><p>A webpage, written primarily in jQuery and HTML, must access both the SQLite database and the C program somewhat constantly. It does so using AJAX requests -- here's an example from the code:</p><pre><code>function sendCommand(cmd, callback) {$.ajax({url: ""http://192.168.42.90:6112/?cmd="" + cmd,    dataType: ""jsonp"",    success: function(d,s,x) {          callback(d);    },    jsonpCallback: ""json"",    error: function(xhr) {         alert('Error: ' + xhr.status);    }});}</code></pre><p>So I might invoke it with something like sendCommand(""get_x"", updatePosition) -- so that it'd send the get_x command along to the C program, and, if it got good feedback, run said feedback through the updatePosition function.</p><p>So all of this works SPLENDIDLY if I'm running on a webpage on the same machine. If I move to another machine -- in this case, specifically, an Android phone, doing tethered IP over USB, it ... sort of works. This is what's puzzling me -- it doesn't silently fail, like I'm used to JavaScript doing. Instead, as far as I can tell, it sends the request out, claims that it got data back, and runs the callback function -- only, according to the C program, nothing ever happened; according to Wireshark, no packets were sent; and the ""data"" that it gets back is an empty, specially-formatted string. If I'm expecting ""(5,5)"" as output from C, it's getting ""(0,0)"" -- why is it getting anything at all? Much less filling ""(,)"" with 0s?</p><p>Very strange. I've tried various little things, like changing the dataType to ""json"", making sure all my permissions are set up right, etc. I'm fairly sure that Apache isn't interfering, since there's nothing in the logs -- what gets me is that I don't see anything on Wireshark, of all things. It's like the phone just plain isn't trying to make the request.</p>","462879","","","","","2010-12-14 19:47:40","Cross-domain AJAX request behaving oddly on Android phone's native browser","<jquery><android><json><cross-domain>","2","0","","",""
"4440579","1","4440608","","2010-12-14 15:11:09","0","1972","<p>I am quite new to XML parsing and I have my method of parsing XML. Only that method is for simple XML layouts with just 1 child node.</p><p>I now have to parse an XML file with childs that have childs that have childs (got it :)?)</p><p>This is the parse-method I have now:</p><pre><code>protected Map&lt;String, Maatschappij&gt; getAutopechTel() {    Map&lt;String, Maatschappij&gt; telVoorAutopech = new HashMap&lt;String, Maatschappij&gt;();    try {        DocumentBuilder builder = DocumentBuilderFactory.newInstance()                .newDocumentBuilder();        Document doc = builder.parse(getAssets().open(""autopech.xml""));        NodeList nl = doc.getElementsByTagName(""dienst"");        for (int i = 0; i &lt; nl.getLength(); i++) {            Node node = nl.item(i);            Maatschappij maat = new Maatschappij();            maat.setNaam(Xml.innerHtml(Xml.getChildByTagName(node, ""naam"")));            maat.setTel(Xml.innerHtml(Xml.getChildByTagName(node, ""tel"")));            telVoorAutopech.put(maat.getTel(), maat);        }    } catch (Exception e) {    }    return telVoorAutopech;}</code></pre><p>How must I adjust this in order to parse this type of XML file:</p><pre><code>   &lt;Message&gt;      &lt;Service&gt;Serviceeee&lt;/Service&gt;      &lt;Owner&gt;Bla&lt;/Owner&gt;      &lt;LocationFeedTo&gt;Too&lt;/LocationFeedTo&gt;      &lt;Location&gt;http://maps.google.com/?q=52.390001,4.890145&lt;/Location&gt;      &lt;Child1&gt;        &lt;Child1_1&gt;          &lt;Child1_1_1&gt;ANWB&lt;/Child1_1_1&gt;        &lt;/Child1_1&gt;      &lt;/Child1&gt;&lt;Message&gt;</code></pre>","517460","","","","","2011-11-02 18:15:23","How to parse this XML in Android?","<java><android><xml><parsing><xml-parsing>","1","1","","",""
"4440640","1","","","2010-12-14 15:18:36","6","4449","<p>I have a webview control in a scrollview. when i load a long html document into it, it resizes to accommodate it. this is correct. however, when i use the same control again afterwards and put less space-consuming html into it, the content size doesn't shrink. this is a problem because the user is able to still scroll a short document into white space. any ideas on how to resolve this?</p>","542140","","","","","2012-09-20 07:59:56","How a change the content size of a webview in android?","<java><android><webview><scrollview>","2","0","","",""
"4440743","1","","","2010-12-14 15:28:03","0","263","<p>I am working android app,I have display different types of view in My Listview.My problem </p><p>is i have displayed 5 items in ListView the Values are status,Required date,Response </p><p>date,title,name.How can change Required date values is less than today date listview </p><p>background color is red.I can check below model. color is displayed but i can scroll fast </p><p>the List View color is not stable.pls help me.......</p><p>my getview:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {          View view = super.getView(position, convertView, parent);            HashMap&lt;String, String&gt; str=Action_module_screen.mylist.get(position);           String req=str.get(""Req_date"");                          Calendar c2 = Calendar.getInstance();                    Calendar c3 = Calendar.getInstance();                    Calendar c = Calendar.getInstance();                    int cyear = c.get(Calendar.YEAR);                    int cmonth = c.get(Calendar.MONTH);                    int cday = c.get(Calendar.DAY_OF_MONTH);                    c2.set(cyear,cmonth,cday);                             Locale l=new Locale(req);                            Calendar c1 = Calendar.getInstance(l);                            int cyear1 = c1.get(Calendar.YEAR);                            int cmonth1 = c1.get(Calendar.MONTH);                            int cday1 = c1.get(Calendar.DAY_OF_MONTH);                             c3.set(cyear1,cmonth1,cday1);                           String s=str.get(""status"");            if((s.equals(""CLO""))||(s.equals(""APP""))||(s.equals(""ANN""))||(s.equals(""ANR""))||(s.equals(""AOK"")))            {                  view.setBackgroundColor(Color.GREEN);              }            if(s.equals(""NEW""))            {                 view.setBackgroundColor(Color.WHITE);              }            if(s.equals(""REJ""))            {                 view.setBackgroundColor(Color.GRAY);               }               if(c2.after(c3))                  {                  view.setBackgroundColor(Color.RED);                   }      return view;    }</code></pre>","533787","","473070","","2010-12-14 15:33:07","2011-04-23 22:25:49","How can i check date values in getview Method","<android>","1","0","","",""
"4440878","1","4443378","","2010-12-14 15:38:59","0","507","<p>I have some icons of varying height, and the default tabspec layout on my HTC Legend places the icon at the top.</p><p>I wanted to center it by defining my own layout for the tabspec, but after many experiments with style &amp; background, I still can't make it look like the built-in layout.</p><p>So I need the built-in Padding &amp; background for my tabspec layout, anyone knows what they're called?</p>","509904","","","","","2010-12-14 19:35:36","TabHost.TabSpec layout that looks like the built-in layout","<android><layout><android-tabhost>","1","1","","",""
"4440881","1","4441296","","2010-12-14 15:39:34","0","504","<p>these methods are deprecated... but... still work on android 2.3 or 3.0 ?</p><p>i'm sure they work on 2.1, cause i tested it on my android phone, but works also in 2.3 or 3.0 ?</p>","479886","","","","","2010-12-14 16:16:02","Time and Date getHour(), getDay() etc... still work on Android 2.3 and 3.0?","<android><date><time><deprecated>","2","1","","",""
"4440895","1","","","2010-12-14 15:40:43","0","417","<p>I'm having trouble trying to create a screen where I have two bitmaps (one on top of the other so it's totally obscuring the lower one) and ""rub out"" the top one so it reveals the bottom one under the path of the finger. I realise I may need 3 separate layers (bottom image, top image and then a custom view that handles the finger tracking) but I can't find a method of manipulating the middle layer from the custom view. Can anyone offer some advice on how I might do this? </p>","277668","","","","","2013-01-24 11:20:26","Overlay two bitmaps and rub out the top one","<android><image-processing><bitmap>","1","0","","",""
"4440967","1","","","2010-12-14 15:46:36","0","1036","<p>Running Android 2.1, preferences and other dialogs have white/blue text.  Looking at theme values I see things like textColorPrimary and textColorSecondary.  If I reference those colors in my layout xml, with something like: </p><pre><code>  android:textColor=""?android:attr/textColorSecondary"" </code></pre><p>I just see white text (I have tried textColorPrimary, textColorTertiary and textColorHint also).</p><p>I do not have any theme values stated in my manifest file.  I am presuming this means I am using the system default theme.</p><p>All that said, am I barking up the wrong tree with textColor* references?</p>","542171","","542171","","2010-12-16 16:03:07","2010-12-25 15:20:34","How to get the blue style text in 2.1 Contacts or Preferences","<android><coding-style><android-layout>","1","0","2","",""
"4440994","1","4441434","","2010-12-14 15:49:04","0","705","<p>I need to know the amount of the heap usage of an applications and how the memory is allocated. Is there any chance to get a general picture of this? I want something like an hprof but more complete.</p><p>thanks in advance.</p>","501696","","","","","2010-12-14 16:24:17","native heap usage android","<android><memory><heap>","1","0","","",""
"4441002","1","4441424","","2010-12-14 15:49:44","4","330","<p>I'd like to develop a library that can be included in other Android applications to intercept certain kinds of intent. Is it possible?</p><p>I've created a library and a test project, both having their own <code>AndroidManifest.xml</code> files. In library's manifest I've defined an intent filter for action ""TEST"". But when I launch an intent with action ""TEST"" from the test project, that intent filter does not work.</p><p>Are intent filters from libraries ever used by Android?</p>","6533","","","","","2010-12-14 16:23:27","Can a library in Android have its own intent filters?","<android>","1","0","","",""
"4441081","1","4441260","","2010-12-14 15:54:55","5","1195","<p>I need to know : What is the fastest way to download several thumbs in a row, lets say 10 images. It seems like the built-in browser does this in a very clever way.</p><p>I have Google'd and found that most developers are using the HttpUrlConnection class to download a jpeg to display it in a ImageView, inside an ListAdapter etc. </p><p>Some developers implements the download by using DefaultHttpClient class as it has better support for timeouts etc. In fact <a href=""http://developer.android.com/videos/index.html#v=xHXn3Kg2IQE"" rel=""nofollow"">Google recommends</a> to use the Apache Http client, and not the native Java HttpUrlConnection. That said, both startegies mentioned works fine, but thay are very slow compared to how the build in browser on my HTC desire download thumbnails. The built in browser seems to download images about 5x-10x faster then when try to download the same bitmaps with my own code. And yes, I always do the download/http work on a separate worker thread (not GUI thread).</p><p><strong>Do anybody know how the built-in browser is downloading thumbs, or at least what is the fastest way to download several images from a server ?</strong></p><p>I have tried using this code: </p><pre><code>DefaultHttpClient client = new DefaultHttpClient();HttpParams httpParameters = new BasicHttpParams();HttpConnectionParams.setConnectionTimeout(httpParameters, CONNECTION_TIMEOUT);HttpConnectionParams.setSoTimeout(httpParameters, SO_TIMEOUT);      client.setParams(httpParameters);client.setKeepAliveStrategy(new ConnectionKeepAliveStrategy() {    @Override    public long getKeepAliveDuration(HttpResponse response, HttpContext context)    {        return 5000;    }});</code></pre><p>Now, i use this connection to fetch several bitmaps / thumbs in a for-loop:</p><pre><code>public static Bitmap downloadBitmap(String url, DefaultHttpClient client){  HttpResponse response = null;  HttpGet get = new HttpGet(url);  try {      response = client.execute(get);      return BitmapFactory.decodeStream(response.getEntity().getContent());  }   catch (ClientProtocolException e1) {      e1.printStackTrace();  }  catch (IllegalStateException e){      e.printStackTrace();  }   catch (IOException e1) {      e1.printStackTrace();  }  return null;}</code></pre><p>I created a testpage.html with 10 bitmaps and loaded it with the built-in browser. The browser renders the page with all the thumbs within 1 seconds. And I'm sure they are not cached in the browser, as i randomize the 10 images for every page-refresh.</p><p>When i try to make a simple activity that downloads and displays the same thumbs, its a lot slower.  </p><p><strong>I hope the Google Android Team picks up this and includes it in one of their video speaks on the next developer conference.</strong> </p><p>They should define a best-practise for this, as it seems that every developer tries to solve this ""download-bitmap"" use-case their own way, when we in fact are all trying to do the same thing. </p><p>I have also tested using the same DefaultHttpClient object to fetch several images by calling execute() with diffrent urls (HttpGet objects), but its still far from the speed to the built-in browser. I see that my requests has sat the connection keep-alive flag, but it does not seem to make any difference.</p>","133858","","133858","","2010-12-15 08:17:48","2010-12-15 08:17:48","Android: What is the fastest way to load several bitmaps/thumbs via http?","<android><http><download><bitmap>","2","0","1","",""
"4441092","1","","","2010-12-14 15:55:38","0","306","<p>The latest xml layout editor is missing the up and down controls (where you can move Views around the xml heirarchy), now I can't move layouts into another LinearLayout.  Drag and drop simply does not work.</p><p>Where have they gone?  What is the new way of doing this?</p>","248521","","248521","","2010-12-14 16:03:57","2010-12-15 06:07:56","Android Layout Editor missing up and down controls","<android>","2","1","","",""
"4441173","1","","","2010-12-14 16:03:09","1","461","<p>I have an old Android application in the market. It's a paid application without licensing validation. I tried to upgrade this application including license validation and I could publish it but after that, I couldn't pass the validation process. When I want to run my application with my device I can't pass the license validation process and I can't run my application. I have this problem when I upgrade an old application without licensing validation because if I publish a new paid application with licensing validation, I don't have any problem.</p><p>The response code of licensing validation process is <b>NOT_LICENSED</b></p>","495239","","1104926","","2011-12-19 13:25:51","2011-12-19 13:25:51","Android vending licensing","<android><licensing>","0","2","0","",""
"4441223","1","","","2010-12-14 16:06:57","0","697","<p>Without the onclick listener implements and its relevant codes, the activity works fine.  But when onclick listener is there it just force close. </p><p>Here is my code:</p><pre><code>public class Names extends ListActivity implements OnClickListener {    private static String[] FROM = { _ID, NAME, ADDRESS, AGE };       private static int[] TO = { R.id.rowid, R.id.name, R.id.address, R.id.age};       private static String ORDER_BY = NAME + "" DESC"";       @Override       public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.main);          Cursor cursor = getNames();          showNames(cursor);        // Set up click listeners            View addButton = findViewById(R.id.add_button);            addButton.setOnClickListener(this);               }       private Cursor getNames() {          // Perform a managed query.          return managedQuery(CONTENT_URI, FROM, null, null, ORDER_BY);       }       private void showNames(Cursor cursor) {          // data binding          SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,                R.layout.names, cursor, FROM, TO);          setListAdapter(adapter);       }      public void onClick(View v) {         switch (v.getId()) {            case R.id.add_button:                Cursor cursor = getNames();                showNames(cursor );                break;                               }     }}</code></pre><p>What have i done wrong?  many thanks for your help.</p>","542206","","21234","","2010-12-14 16:14:19","2011-05-07 13:17:45","Android: onclicklistener forced close?","<android><onclick>","1","1","","",""
"4441331","1","4444457","","2010-12-14 16:16:34","0","256","<p>i've got a listView with some data that i inflated to get some nice background color. The problem is that i want to get some awesome separators and i'm unable to setDividerHeight() depending on the row's data, because it seems that i can't inflate two views on the same getView() method, here's some code:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent){    String myText = getItem(position).toString();               String firstLetter = Character.toString(myText.charAt(0));    if(convertView == null){        convertView = this.inflater.inflate(R.layout.lettersrows, null);    }    TextView tv = (TextView)convertView.findViewById(R.id.label);    tv.setText(this.list.get(position));    tv.setTextSize(25);    convertView.setBackgroundColor((position &amp; 1) == 1 ? Color.WHITE : Color.LTGRAY);    /**This is what i want to do*/    if(!firstLetter.equals(""A"")){        convertView = this.inflater.inflate(R.layout.letters, null);        ListView lv = (ListView)convertView.findViewById(R.id.letters_listview);        lv.setDividerHeight(3);    }    return convertView;}</code></pre><p>The error i'm getting is a NullPointerException at: tv.setText(this.list.get(position));I guess that dues to that the convertView is now a ListView that's why it doesn't find where to set the text. How could i fix this problem.</p><p>Best regards.</p>","526924","","","","","2010-12-14 21:32:48","problem to listview android","<android><listview>","1","2","","",""
"4441334","1","9622040","","2010-12-14 16:16:40","26","37980","<p>I was wondering how I could play a notification sound without playing it over the media stream.  Right now I can do this via the media player, however I don't want it to play as a media file, I want it to play as a notification or alert or ringtone.  heres an example of what my code looks like right now:</p><pre><code>MediaPlayer mp = new MediaPlayer();mp.reset();mp.setDataSource(notificationsPath+ (String) apptSounds.getSelectedItem());mp.prepare();mp.start();</code></pre>","408079","","2555566","","2013-10-08 06:25:56","2014-03-27 11:23:42","How to play an android notification sound","<android><notifications><sounds>","8","2","15","",""
"4441432","1","4442485","","2010-12-14 16:24:09","0","1090","<p>In my android app I'm opening a new activity for result when a button is pressed:</p><pre><code>button.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {Intent intent = new Intent(parent.this.getApplication(), child.class);startActivityForResult(intent, REQUEST_CODE);</code></pre><p>My child activity returns a result like this:</p><pre><code>Intent newIntent = new Intent();newIntent.putExtra(""name"", ""name"");newIntent.putExtra(""description"", ""desc"");setResult(RESULT_OK, newIntent);finish();</code></pre><p>My onActivityResult is like this:</p><pre><code>if (requestCode == GOTO_ADDPARKING) {        if (resultCode == RESULT_OK) {         String Name = data.getStringExtra(""name"");         String Description = data.getStringExtra(""description"");</code></pre><p>In the debug mode I can see that in the child activity the newIntent's hash map points to an object, but in the parent activity the hash map points to null.</p><p>Any suggestions?</p>","536912","","","","","2010-12-14 18:04:36","Problem with setReult and onActivityResult","<android><android-widget>","1","2","","",""
"4441464","1","4732367","","2010-12-14 16:27:07","7","426","<p>On the Android homescreen it's possible to delete the items by dragging them to the bin.</p><p>I would like to have similar functionality in my own application, where I have a view with custom view items that I want to be user drag-and-droppable.</p><p>Is there a easy way to implement this functionality? Or could somebody give me pointers that can guide me on the possibly difficult way to achieving this?</p>","107029","","","","","2011-01-19 06:29:22","How to get the homescreen behaviour of drag to bin, in my own application?","<java><android><drag-and-drop>","1","3","3","",""
"4441513","1","","","2010-12-14 16:30:26","0","94","<p>I'm working on my University thesis creating an android app. As I'm new in android development I would like to read your opinion on that.</p><p>I would like to create an app that has a home screen with n buttons. This will be the app for my uni forum. When I press the ""announcement"" button for example I want to get the announcements from my university site.</p><p>The problem is, that this site doesn't have a rss feed and but I want to see the announcements in the app and not with a <code>WebView</code>.</p><p>Could you please tell me what I have to search for? HTML parsing? Hope my question is understandable.</p>","519526","","180538","","2010-12-14 16:38:24","2010-12-14 17:30:57","Help creating an app with parsing","<android><html-parsing>","1","2","","",""
"4441575","1","4441712","","2010-12-14 16:35:05","-1","1415","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1106736/how-can-i-convert-oo-perl-to-java"">How can I convert OO Perl to Java?</a>  </p></blockquote><p>Hello.</p><p>I have a perl script and I want to translate it to Java.</p><p>Is there any translator/conversor from perl script to Java?</p><p>By the way, I'm developing an Android 2.2 application.</p><p><strong>EDIT</strong><br/>I have closed the question. Stop downvoting me!!!!!! And if you downvote tell us why!!</p><p>Thanks.</p>","68571","","68571","","2010-12-15 12:51:46","2010-12-15 12:51:46","How can I translate a perl script to Java?","<java><android><perl>","3","8","","2010-12-14 21:58:45",""
"4441737","1","","","2010-12-14 16:47:24","1","1287","<p>i have main.xml :</p><pre><code>     &lt;? xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:background=""@drawable/detailsback""&gt;      &gt;&lt;TextView  android:id=""@+id/name""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginTop=""30px""android:layout_marginBottom=""10px""/&gt;&lt;EditText  android:id=""@+id/ed""android:layout_width=""200px"" android:layout_height=""200px""android:editable=""false""android:focusable=""false""android:text=""ddddddddddd""android:layout_below=""@id/name""/&gt;&lt;TableLayoutandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_alignParentBottom=""true""android:id=""@+id/tableLayout"" &gt;&lt;TableRow&gt;      &lt;Button  android:id=""@+id/btn1""android:layout_width=""50px"" android:layout_height=""50px"" android:layout_marginRight=""15px""/&gt;    &lt;Button  android:id=""@+id/btn2""android:layout_width=""40px"" android:layout_height=""50px""  android:layout_marginRight=""15px""/&gt;      &lt;Button  android:id=""@+id/btn3""android:layout_width=""100px"" android:layout_height=""20px"" android:layout_marginRight=""15px""/&gt;&lt;/TableRow&gt;&lt;TableRow&gt;       &lt;Button  android:id=""@+id/btn4""android:layout_width=""50px"" android:layout_height=""50px""  android:layout_marginRight=""15px""android:layout_marginTop=""5px""/&gt;&lt;Button  android:id=""@+id/btn5""android:layout_width=""30px"" android:layout_height=""50px""  android:layout_marginRight=""15px""android:layout_marginTop=""5px""    /&gt;  &lt;Button  android:id=""@+id/btn6""android:layout_width=""100px"" android:layout_height=""20px""  android:layout_marginRight=""15px""android:layout_marginTop=""5px""/&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>in the code i used</p><pre><code>  setContentView(R.layout.main);</code></pre><p>now i  want to modify  TableLayout margin's according to screen resolution , the problem is how to reach to TableLayout via code , i tried this : </p><pre><code>TableLayout table=(TableLayout)findViewById(R.id.tableLayout);    LayoutParams pa=new LayoutParams();    pa.bottomMargin=20;    pa.rightMargin=20;    table.setLayoutParams(pa);</code></pre><p>but it don't work !! </p>","542218","","","","","2013-06-19 04:16:17","How to modify (TableLayout margin's embeded in Relativelay out in xml) in code","<android><tablelayout><relativelayout>","1","2","","",""
"4441825","1","4476569","","2010-12-14 16:56:18","0","660","<p>I have a simple idea:I want to draw a line in 3d space (the screen). The line will have a 3d direction and magnitude (length). I would then like to append a new line (vector) onto the last, and another, and another, etc. </p><p>I would like to show these lines in a 3d wire frame that serves as a visual reference to the vectors contained within. I would like each Vector would have a label showing its magnitude. </p><p>Is this feasible with the existing Android graphics/3d framework? </p>","268803","","","","","2010-12-18 04:02:42","3d line (Vector) drawing in Android?","<java><android><3d>","1","0","","",""
"4441833","1","","","2010-12-14 16:57:19","0","146","<p>I have read the example for Rss Parsing from the ibm site.(http://www.ibm.com/developerworks/opensource/library/x-android/).</p><p>In this example,the rss are shown in a listview and then,if you press one announcement you can see it in the web browser of the device.How could i see them in the app,with no use of the device browser?</p><p>Thanks a lot</p>","519526","","","","","2010-12-14 22:31:05","xml parsing with no browser use","<android>","2","0","","",""
"4441849","1","","","2010-12-14 16:58:43","8","3372","<p><br>how is it possible that <code>context.getApplicationContext().getCacheDir()</code> returns <code>null</code>? As far as I know the internal cache directory should always exist.</p><p>Thanks!</p>","389262","","","","","2013-10-10 14:48:27","Cache directory doesn't exist","<android><caching><memory-management>","3","6","2","",""
"4441883","1","4474652","","2010-12-14 17:01:25","2","354","<p>I am having a very strange issue in an activity using a listview that contains buttons.</p><p>The error seems to pop up kind of randomly (although we know that doesn't really exist), i mean to say I cant get a defined pattern to reproduce the error. It just happens every so often.</p><p>The big issue i'm having trying to figure this out is the logCat shows no error in my code, just in the code that (i believe) android uses to determine the view where the click is coming from. Take notice that no package that doesnt belong to android/java is mentioned in the error.</p><p>LogCat:</p><pre><code>12-14 12:04:20.994: ERROR/AndroidRuntime(5619): FATAL EXCEPTION: main12-14 12:04:20.994: ERROR/AndroidRuntime(5619): java.lang.IndexOutOfBoundsException12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at java.util.Arrays$ArrayList.get(Arrays.java:77)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:298)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:351)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.Spinner.makeAndAddView(Spinner.java:189)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.Spinner.layout(Spinner.java:148)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.Spinner.onLayout(Spinner.java:112)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1238)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1044)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.View.layout(View.java:7032)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1055)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1737)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.os.Handler.dispatchMessage(Handler.java:99)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.os.Looper.loop(Looper.java:123)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at java.lang.reflect.Method.invokeNative(Native Method)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at java.lang.reflect.Method.invoke(Method.java:521)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-14 12:04:20.994: ERROR/AndroidRuntime(5619):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Here is my custom ArrayAdapter code, the error occurs when I click on various ""boton_modificar"" from the various rows repeatedly, mostly if I click them fastly.</p><pre><code>private class CustomAdapter extends ArrayAdapter&lt;DataType&gt; {  public CustomAdapter(Context context, int resource,List&lt;DataType&gt; objects) {   super(context, resource, objects);  }  @Override  public View getView(int position, View convertView, ViewGroup parent) {   View row = convertView;   final int position2 = position;   if (row == null) {    LayoutInflater inflater = getLayoutInflater();    row = inflater.inflate(R.layout.row_layout,parent,false);   }   //Some more code here   ImageButton boton_modificar = (ImageButton) row.findViewById(R.id.modificar);   boton_modificar.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {     DataT t = tr.get(position2);     ((EditText) (findViewById(R.id.monto))).setText(Double.toString(t.m));     ((Spinner) (findViewById(R.id.spinnerTipoB))).setSelection(t.posSTB);     ((Spinner) (findViewById(R.id.spinnerB))).setSelection(t.posSB);    }   });   return (row);  } }</code></pre><p>Does anybode have the slightest idea what this might be? Im tired of trying to figure this out and nothing. Most I found was a bug report of a similar issue, but I doubt its the same thing, in any case <a href=""http://code.google.com/p/android/issues/detail?id=8450"" rel=""nofollow"">the report is here.</a></p><p>Thanks in advance, Stefano</p><p>Edit:</p><p>LogCat of just before the error pops, doubt it has anything to do with the position sets.</p><pre><code>12-16 15:12:56.159: INFO/position2(21828): 712-16 15:12:56.159: INFO/Spinner A # elements:(21828): 312-16 15:12:56.159: INFO/Assigned position(21828): 112-16 15:12:56.159: INFO/Spinner B # elements:(21828): 2012-16 15:12:56.159: INFO/Assigned position(21828): 5</code></pre><p>Added code:</p><pre><code>spinnerTipoB.setOnItemSelectedListener(new OnItemSelectedListener() {                    @Override                    public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                            int position, long arg3) {                        int posId = tipoBIds[position];                        if (posId == 0) {                                spinnerB.setAdapter(arrayAdapterBP);                        } else if (posId == 1) {                            spinnerB.setAdapter(arrayAdapterBT);                        } else if (posId == 2) {                            spinnerB.setAdapter(arrayAdapterBO);                        }                    }                    @Override                    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {                        // Do Nothing                    }                });</code></pre><p><code>spinnerB</code> does nothing on position select.All spinner array adapter are created like this:</p><pre><code>arrayAdapterNAME = new ArrayAdapter&lt;String&gt;(this, R.layout.layoutspinner, DATA);</code></pre><p>I would presume the error ocurrs because <code>((Spinner) (findViewById(R.id.spinnerB))).setSelection(t.posSB);</code> is executed before <code>spinnerB.setAdapter(arrayAdapterNAME)</code>is done?</p>","474883","","474883","","2010-12-17 21:19:18","2010-12-20 16:07:02","Weird IndexOUBException using buttons inside listview","<android><listview>","1","14","1","",""
"4441888","1","","","2010-12-14 17:02:10","1","2072","<p>I would like to ""shift"" a Bitmap by a certain x and y offset.  By shift, I mean, If I have a 300x500 bitmap, and I shift it by a y offset of -50, I would expect every pixel to move up 50 pixels, and a 300x50 pixel rectangle to be blank, along the bottom of the Bitmap.  The below code works great if shiftX and shiftY are negative, but doesn't work at all for positive values.  I have no idea why?</p><pre><code>Rect srcRect = new Rect(-shiftX, -shiftY, mBitmap.getWidth(), mBitmap.getHeight());Rect destRect = new Rect(srcRect);destRect.offset(shiftX, shiftY);Canvas bitmapCanvas = new Canvas(mBitmap);bitmapCanvas.drawBitmap(mBitmap, srcRect, destRect, null);</code></pre><p>I've tried many different versions of this.  It seems that trying to translate a Bitmap with a positive y always produces garbage.  In this simpler example, a negative shiftY gives expected behavior, but a positive shiftY gives a garbage result:</p><pre><code> Canvas bitmapCanvas = new Canvas(mBitmap); bitmapCanvas.drawBitmap(mBitmap, 0, shiftY, null);</code></pre><p>*Update. This is solved by the below code.  However, this is not memory efficient.  Any suggestions for a better solution?</p><pre><code>Canvas bitmapCanvas = new Canvas(mBitmap);Bitmap tempBitmap = mBitmap.copy(CONFIG.ARGB_8888, false);bitmapCanvas.drawBitmap(tempBitmap, 0, shiftY, null);</code></pre>","426493","","426493","","2010-12-14 20:01:48","2010-12-14 20:01:48","Android: how to shift a Bitmap?","<android><bitmap>","1","6","","",""
"4441916","1","","","2010-12-14 17:03:48","0","3168","<p>I am trying to write a twitter application on Android target 2.2 (using some sample code that I found on the net and using Marko Gargenta's O'Reilly text). I am stuck with the problem as in the log below. The source code is given first followed by the log. Any idea what's going wrong here ? Also does anyone have or can point to a sample jtwitter code working on Android.</p><p>Thanks,Ravi</p><hr><pre><code>protected String doInBackground(String... statuses) {  try {         //Autho information         /*OAuthSignpostClient oauthclient = new OAuthSignpostClient(cons_key,            cons_secret, access_token, access_secret);*/         OAuthSignpostClient oauthclient = new OAuthSignpostClient(access_token, access_secret,""oob"");         //***POSTING TO TWITTER CURRENTLY DOES NOT WORK WITH THIS INTERFACE         twitter = new Twitter(mytwitterusername, oauthclient);         //twitter.setAPIRootUrl(""http://learningandroid.status.net/api"");   //***POSTING TO TWITTER CURRENTLY DOES NOT WORK WITH THIS INTERFACE   Log.i(Logtag, ""Status currently is "" + statuses[0]);   Twitter.Status status = twitter.updateStatus(statuses[0]);   //return status.text;   return statuses[0];  } catch (TwitterException e) {   Log.e(Logtag, e.toString());   e.printStackTrace();   return ""Failed to post to Twitter"";  }</code></pre><p>}</p><hr><h2>Log file:</h2><pre><code>E/dalvikvm(  719): Could not find method javax.swing.JOptionPane.showInputDialog, referenced from method winterwell.jtwitter.OAuthSignpostClient.askUserW/dalvikvm(  719): VFY: unable to resolve static method 443: Ljavax/swing/JOptionPane;.showInputDialog (Ljava/lang/Object;)Ljava/lang/String;W/dalvikvm(  719): VFY:  rejecting opcode 0x71 at 0x0000W/dalvikvm(  719): VFY:  rejected Lwinterwell/jtwitter/OAuthSignpostClient;.askUser (Ljava/lang/String;)Ljava/lang/String;W/dalvikvm(  719): Verifier rejected class Lwinterwell/jtwitter/OAuthSignpostClient;W/dalvikvm(  719): threadid=17: thread exiting with uncaught exception (group=0x4000fe70)E/AndroidRuntime(  719): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exceptionE/AndroidRuntime(  719): java.lang.RuntimeException: An error occured while executing doInBackground()E/AndroidRuntime(  719):        at android.os.AsyncTask$3.done(AsyncTask.java:200)E/AndroidRuntime(  719):        at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234)E/AndroidRuntime(  719):        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258)E/AndroidRuntime(  719):        at java.util.concurrent.FutureTask.run(FutureTask.java:122)E/AndroidRuntime(  719):        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)E/AndroidRuntime(  719):        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)E/AndroidRuntime(  719):        at java.lang.Thread.run(Thread.java:1058)E/AndroidRuntime(  719): Caused by: java.lang.VerifyError: winterwell.jtwitter.OAuthSignpostClientE/AndroidRuntime(  719):        at com.ravi.tweeto.StatusActivity$PostToTwitter.doInBackground(StatusActivity.java:81)E/AndroidRuntime(  719):        at com.ravi.tweeto.StatusActivity$PostToTwitter.doInBackground(StatusActivity.java:1)E/AndroidRuntime(  719):        at android.os.AsyncTask$2.call(AsyncTask.java:185)E/AndroidRuntime(  719):        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)E/AndroidRuntime(  719):        ... 4 moreI/Process (  585): Sending signal. PID: 719 SIG: 3I/dalvikvm(  719): threadid=7: reacting to signal 3I/dalvikvm(  719): Wrote stack trace to '/data/anr/traces.txt'----</code></pre>","542257","","","","","2010-12-14 20:50:14","Android throwing up Error using jtwitter","<java><android>","3","0","1","",""
"4442033","1","","","2010-12-14 17:17:47","0","867","<p>My app can accept various files e.g. images and such but the problem is if the file such as an image contains illegal characters clicking on it will crash the app. How can such behavior be avoided? if possible I'd still like to be able to have the image open. Thanks.</p><pre><code>    attachedImage.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {                           Intent intent = new Intent(Intent.ACTION_VIEW);            String new_string = imageURI.replaceAll("" "", ""%20"");            image_uri = Uri.parse(""file://"" + new_string);            intent.setDataAndType(image_uri, ""image/*"");                            startActivity(intent);        }    });</code></pre>","427377","","427377","","2010-12-14 18:41:58","2010-12-14 18:41:58","Android and dealing with illegal characters in file names","<android>","0","8","1","",""
"4442096","1","4454631","","2010-12-14 17:24:04","1","442","<p>I am writing an app that allows the user to select from a list of names and then add one of the names (with phone number, etc) to their contacts. When I retrieve my phone's list of Contact Accounts, I am getting 3 results: ""Phone"", ""a000000229aa3e...."", ""Gmail"".</p><p>The center result, ""a000000229aa3e...."" is not an account that I have setup or appears anywhere else on my phone. This also does not appear in the emulator. </p><p>My coworker ran it on hit Droid (original Droid) and did not get the odd account. I am running it on a Droid X.</p><p>Does anyone know where this Contact Group is coming from? Is there something I need to do to filter this out?</p><hr><p>I was able to get the name and type for the odd contact account:Account Name: a00000229aa3e5-8877431712057062230@random.svcmot.comAccount Type: com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE</p>","300129","","300129","","2010-12-14 20:24:33","2010-12-15 20:38:24","Phantom Contact Account Appearing - Android","<android><contacts><groups><phantom-reference>","2","0","","",""
"4442105","1","4442247","","2010-12-14 17:24:49","11","7297","<p>I want to localize an image by adding the folder res/drawable-hdpi-no, but I get an error stating ""invalid resource directory name"".  What's up with this?</p>","324943","","","","","2012-11-17 07:28:30","Localization and drawables","<android><resources><localization><drawable>","3","0","3","",""
"4442288","1","","","2010-12-14 17:42:28","0","204","<p>We are currently developing an app that displays large data sets in ""registers"" and in rows. We are using a TableLayout as the base view and then adding table rows for every item (with a LinearLayout in each row).</p><p>I have noticed that once the amount of records get beyond a certain point (1000+ records), the device slows down tremendously. I am sure that this is a simple memory issue(maybe rendering too?) and have devised a plan that could increase the speed.</p><p>We have implemented continuous paging on a lot of silverlight projects, and I figure that this is the best approach to take in Android?</p><p>The only problem I have now is to recognize when a specific view (say row 100) has been scrolled into view, so that I can start to render the next couple of lines.</p><p>Does anyone know how to do this, or of a better way to implement/handle large data sets?</p><p>Regards</p>","469076","","","","","2010-12-14 18:11:58","How to know when a View has scrolled into view","<android>","3","0","","",""
"4442382","1","4442427","","2010-12-14 17:53:20","0","1094","<p>Everytime I redeploy an android application it hangs at this step:</p><blockquote>  <p>[2010-12-14 09:48:40 - HelloWorld] Uploading HelloWorld.apk onto device 'emulator-5554'</p>    <p>[2010-12-14 09:48:49 - HelloWorld] Installing HelloWorld.apk...</p></blockquote><p>If I then go into the DDMS, I can kill the process (by hitting the stop sign) and then it finishes and launches the application.  Any idea how to fix this?  I've rebuilt the emulator, rebuilt the workspace etc with the same behavior.  I'm using Eclipse build 20100218-1602</p>","542322","","852828","","2011-12-19 14:24:17","2011-12-19 14:24:17","Android Emulator Redeployment Hangs","<android><eclipse><android-emulator>","1","0","2","",""
"4442447","1","","","2010-12-14 18:00:03","2","2418","<p>I have this code here:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    if(l.isItemChecked(position))        l.setItemChecked(position, false);    else        l.setItemChecked(position, true);    Toast.makeText(mContext, ""Mission: "" + ((TreeNode)l.getItemAtPosition(position)).getTitle(), Toast.LENGTH_LONG).show();}</code></pre><p>It works as far as the debugger goes, but the setItemChecked never seems to really set the item both graphically I do not see the check box appear and then on the next click through the isItemChecked still returns false.</p><p>Not sure what I am doing wrong here?</p>","327258","","","","","2012-12-21 07:21:45","ListActivities setItemChecked in onListItemClick not working","<android><listview><listactivity>","3","0","","",""
"4442472","1","","","2010-12-14 18:03:29","0","342","<p>I am wokring on an Android app that needs to be able to access a specific html ID and only display that information.  I am trying to get some like this for example www.example.com/test.php#FeatureGroup  I tried to put that in with a WebView but it only loads it to that item which is what I was expecting I would like to remove the rest of the stuff from the site is that possible and do I need to use something other than a WebView.</p>","531479","","","","","2010-12-15 19:35:32","In Android is it possible to only show a specific ID of an html element using WebView","<android><webview><android-webview>","1","0","1","",""
"4442483","1","","","2010-12-14 18:04:24","0","827","<p>I am having an issue with an Android app I am writing.  It crashes on Eclair due to a <code>NullPointerException</code> but runs fine on Froyo and Gingerbread.  Can anyone tell me how to rewrite this to avoid the Null Pointer Exception?  Thanks in advance.</p><p><strong>Edit</strong>I added the stack trace and logcat, I might have read it wrong originally, looks like it could be my <code>TabWidget</code>?</p><p>logcat references this line in my <code>Home</code> class:</p><pre><code>tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""Snow"", res.getDrawable(R.drawable.weather2)).setContent(new Intent(this,FirstTab.class))); </code></pre><p><strong>Logcat</strong></p><pre><code>ERROR/AndroidRuntime(314): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wilcoxis.android.kirkwood/com.wilcoxis.android.Home}: java.lang.NullPointerExceptionERROR/AndroidRuntime(314):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)ERROR/AndroidRuntime(314):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)ERROR/AndroidRuntime(314):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)ERROR/AndroidRuntime(314):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)ERROR/AndroidRuntime(314):     at android.os.Handler.dispatchMessage(Handler.java:99)ERROR/AndroidRuntime(314):     at android.os.Looper.loop(Looper.java:123)ERROR/AndroidRuntime(314):     at android.app.ActivityThread.main(ActivityThread.java:4363)ERROR/AndroidRuntime(314):     at java.lang.reflect.Method.invokeNative(Native Method)ERROR/AndroidRuntime(314):     at java.lang.reflect.Method.invoke(Method.java:521)ERROR/AndroidRuntime(314):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)ERROR/AndroidRuntime(314):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)ERROR/AndroidRuntime(314):     at dalvik.system.NativeStart.main(Native Method)ERROR/AndroidRuntime(314): Caused by: java.lang.NullPointerExceptionERROR/AndroidRuntime(314):     at android.widget.TabWidget.onFocusChange(TabWidget.java:351)ERROR/AndroidRuntime(314):     at android.view.View.onFocusChanged(View.java:2622)ERROR/AndroidRuntime(314):     at android.view.View.handleFocusGainInternal(View.java:2445)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.handleFocusGainInternal(ViewGroup.java:404)ERROR/AndroidRuntime(314):     at android.view.View.requestFocus(View.java:3562)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.requestFocus(ViewGroup.java:976)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1021)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.requestFocus(ViewGroup.java:977)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1021)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.requestFocus(ViewGroup.java:980)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1021)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.requestFocus(ViewGroup.java:977)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:1021)ERROR/AndroidRuntime(314):     at android.view.ViewGroup.requestFocus(ViewGroup.java:980)ERROR/AndroidRuntime(314):     at android.view.View.requestFocus(View.java:3513)ERROR/AndroidRuntime(314):     at android.view.View.requestFocus(View.java:3491)ERROR/AndroidRuntime(314):     at android.widget.TabHost.setCurrentTab(TabHost.java:334)ERROR/AndroidRuntime(314):     at android.widget.TabHost.addTab(TabHost.java:213)ERROR/AndroidRuntime(314):     at com.wilcoxis.android.Home.onCreate(Home.java:83)ERROR/AndroidRuntime(314):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)ERROR/AndroidRuntime(314):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)ERROR/AndroidRuntime(314):     ... 11 more</code></pre><p><strong>Stack Trace</strong></p><pre><code>DalvikVM[localhost:8610]        Thread [&lt;3&gt; main] (Suspended (exception NullPointerException))          TabWidget.onFocusChange(View, boolean) line: 351            TabWidget(View).onFocusChanged(boolean, int, Rect) line: 2622           TabWidget(View).handleFocusGainInternal(int, Rect) line: 2445           TabWidget(ViewGroup).handleFocusGainInternal(int, Rect) line: 404           TabWidget(View).requestFocus(int, Rect) line: 3562          TabWidget(ViewGroup).requestFocus(int, Rect) line: 976          LinearLayout(ViewGroup).onRequestFocusInDescendants(int, Rect) line: 1021           LinearLayout(ViewGroup).requestFocus(int, Rect) line: 977           TabHost(ViewGroup).onRequestFocusInDescendants(int, Rect) line: 1021            TabHost(ViewGroup).requestFocus(int, Rect) line: 980            FrameLayout(ViewGroup).onRequestFocusInDescendants(int, Rect) line: 1021            FrameLayout(ViewGroup).requestFocus(int, Rect) line: 977            PhoneWindow$DecorView(ViewGroup).onRequestFocusInDescendants(int, Rect) line: 1021          PhoneWindow$DecorView(ViewGroup).requestFocus(int, Rect) line: 980          PhoneWindow$DecorView(View).requestFocus(int) line: 3513            PhoneWindow$DecorView(View).requestFocus() line: 3491           TabHost.setCurrentTab(int) line: 334            TabHost.addTab(TabHost$TabSpec) line: 213           Home.onCreate(Bundle) line: 83          Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047           ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2459          ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512           ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119         ActivityThread$H.handleMessage(Message) line: 1863          ActivityThread$H(Handler).dispatchMessage(Message) line: 99         Looper.loop() line: 123         ActivityThread.main(String[]) line: 4363            Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]          Method.invoke(Object, Object...) line: 521          ZygoteInit$MethodAndArgsCaller.run() line: 860          ZygoteInit.main(String[]) line: 618         NativeStart.main(String[]) line: not available [native method]      Thread [&lt;13&gt; Binder Thread #2] (Running)        Thread [&lt;11&gt; Binder Thread #1] (Running)</code></pre>","542340","","15168","","2012-03-18 00:36:31","2012-03-18 00:36:31","Android App - returning Null Pointer Exception on Eclair","<java><android>","1","2","","",""
"4442486","1","4447938","","2010-12-14 18:04:45","4","5378","<p>In the gallery tutorial they create a new ImageView in code and apply <em>Gallery.LayoutParams</em>.I use a gallery with a custom adapter and want to inflate a imageview from xml and use that as the gallery item. <strong>The problem is, that the given size (see item xml definition underneath) is disregarded.</strong></p><p>Custom Adapter:</p><pre><code>public View getView(final int position, View convertView,     final ViewGroup parent) {  ViewHolder holder;  if(convertView == null) {     convertView = m_inflater.inflate(R.layout.coverflow_item, null);     holder = new ViewHolder();     holder.coverImage = (ImageView)convertView;     convertView.setTag(holder);  } else {     holder = (ViewHolder) convertView.getTag();  }  m_imageCache.download(m_imageUrls.get(position), holder.coverImage);  return convertView;}</code></pre><p>Item xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""120dp""     android:layout_height=""120dp""     android:scaleType=""centerInside""/&gt;</code></pre><p>Is there a way to apply the Gallery.LayoutParams in the xml?</p><p>PS: I know that i could apply the Gallery.LayoutParams in code, but this is only a simplefied case ... the gallery item in my case is a bit more complex and that is the reason why i want to do it in the xml.</p>","405615","","","","","2010-12-15 08:15:43","Android gallery problem setting image size via xml","<android><android-layout><android-gallery>","1","1","2","2013-03-21 01:56:52",""
"4442660","1","4589804","","2010-12-14 18:18:58","7","15991","<p>What would be the best way to check if an Android service is running? I am aware of the ActivityManager API, but it seems like the use of the API is not advised for the scenarios similar to mine (<a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg18521.html"">source</a>). I am also aware of the possibility of using global/persistent variables to maintain the state of a service.</p><p>I have tried to use bindService with flags set to 0, but I got the same problems as the person on the <em>source</em> link (the only exception was, I was trying the bindService with a local service).</p><p>The following call</p><p><code>getApplicationContext().bindService(new Intent(getApplicationContext(),                MyService.class), mServiceConnection, 0);</code></p><p>always returns true, but does not get connected. Is this the expected behaviour? It seems to me bindService should return false if the service is not already running (it is not, I have checked that) or if the BIND_AUTO_CREATE flag is not set (again, it is not).</p>","404200","","","","","2013-02-15 08:36:34","Android: Check if service is running via. bindService","<android><service><state>","6","0","1","",""
"4442673","1","4522644","","2010-12-14 18:20:41","0","796","<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;    &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:54:48","2011-01-21 13:54:48","android app working on simulator but not on phone","<android><listview>","3","4","","",""
"4442726","1","4443648","","2010-12-14 18:25:23","2","2502","<p>I want to change the appearance of cursor/marker in an EditText.  In general the cursor looks like this: |and is flashing.I want it to look like a black rectangle (the size of 1 character) that is flashing.  Like the standard cursor used in a unix terminal.Is this possible?  </p>","500964","","","","","2012-05-29 10:37:03","How to change the apperance of the cursor in an EditText?","<android><edittext>","2","0","","",""
"4442734","1","4442804","","2010-12-14 18:25:52","0","67","<p>I got 2 classes in my project. The first class(main) have a listview and this is the onclick():</p><pre><code>@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();        class2 sec = new Class2();        Intent intent = new Intent(this, Class2.class);        startActivity(intent) ;        if (keyword == ""hello""){            sec.setInfo(keyword);        }    }</code></pre><p>so and then in my other class which have a defferent layout.xml. The code is:</p><pre><code>public class det extends Activity {    static WebView map;    public TextView header;    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.details);}    public void setInfo(String mystring){        header = (TextView) findViewById(R.id.text01);        header.setText(mystring);        //Toast.makeText(this, map, Toast.LENGTH_LONG).show();        //return;    }</code></pre><p>Ye, i keep getting force close on my android phone. The App i meant to change the header text to text that ive tapped on the listview. But when i click a item it pop up a window with FC.</p><p>ive try to comment away the: </p><pre><code>header = (TextView) findViewById(R.id.text01);        header.setText(mystring);</code></pre><p>and it worked without a FC however the headertext is stil null.</p><p>Thank you!Your Friend!</p>","502419","","473070","","2010-12-14 18:49:07","2010-12-14 18:49:07","Android Development: pass information and fail","<android>","1","0","","",""
"4442738","1","4454612","","2010-12-14 18:25:56","0","871","<p>I need a little help with getting my camera to work right.</p><p>What I'm trying to do is have the user take a picture that will then be used in another activity as the view's background. It is important not to have any skewing, and ideally the image would fill the entire background with the highest resolution possible.</p><p>I've been having a heck of a time trying to get the outputted picture of my camera to be oriented properly and be the same aspect of the display. So I took some time to think of exactly what I needed to do, and I don't think I need the normal saved image at all. </p><p>What I came up with is that I need a surface view to display the preview, and an overlay for some text and a capture button. When the user ""takes the picture"" it should autofocus, and then I need to capture the preview (under the screen overlays) to a bitmap to use in the other activity.</p><p>*Should I extend a SurfaceView for my preview and add it to a XML layout that contains the overlays?</p><p>*How do I save the SurfaceView's image to a bitmap?</p><p>Thanks. </p>","368845","","","","","2011-03-01 18:35:17","Saving a camera's preview to a bitmap","<android><canvas><surfaceview><android-camera>","2","0","","",""
"4442787","1","","","2010-12-14 18:29:49","3","4195","<p>What I'm trying to do is have a TextView, and to the right of it an editText that takes up the rest of the space.  The textView should be  centered vertically along the editText.  Now I can do this using an linearlayout, however I would prefer to do it in a relativelayout.  </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:padding=""10dp""&gt;     &lt;TextView          android:id=""@+id/loginText""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:text=""Login:""          android:paddingRight=""20dp"" /&gt;&lt;EditText          android:id=""@+id/login""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:layout_toRightOf=""@id/loginText"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","542364","","","","","2012-07-20 10:30:46","Center a textview vertical to a EditText","<android><textview><android-layout><edittext><relativelayout>","3","0","","",""
"4442824","1","4445649","","2010-12-14 18:34:08","0","251","<p>For reasons I cannot determine, the name string I am passing to the display activity will not be updated when I change it in the menu setting. I have omitted some excess code but hopefully the concepts are there. In particular, when DisplayName is started, I checked with the debugger and the extras put into the intent do not change from their default values (ie: ""John Doe""). I note that when I use the options menu activity to change the name, this change is reflected every time I go back to the options menu. However, when I go to the display screen, the name continues to stay the same.</p><p>I am aware that these values are simple enough that they can be kept in static member variables and I wouldn't normally have to deal with the passing of bundles, however I still am curious as to why my code fails to function correctly.</p><p>I notice that if I use the menu option to set the name first, then click the display button, the change is reflected. However, after returning to the main screen and changing the name, the display screen continues to keep the same name. This leads me to think that since I press ""Back"" to return to the main screen from the display activity, then the activity is never killed so it would never change the displayed name. Is this guess correct?</p><pre><code>public class MainScreen extends activity {  private String mName;  public static final String EXTRA_NAME = ""android.intent.extra.NAME"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mName = ""John Doe""        Button button = (Button) findViewById(R.id.display_button);        button.setOnClickListener(mDisplayButtonListener);    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        super.onCreateOptionsMenu(menu);        menu.add(0, SET_CONTACT_ID, 0, R.string.menu_setName);        return true;    }    @Override    public boolean onMenuItemSelected(int featureId, MenuItem item) {        switch(item.getItemId()) {            case SET_CONTACT_ID:                Intent intent = new Intent(MainScreen.this, ContactEdit.class);                intent.putExtra(EXTRA_NAME, mName)                startActivityForResult(intent, 1);                return true;        }        return super.onMenuItemSelected(featureId, item);    }    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);        if (resultCode == RESULT_OK)        {            mName = data.getExtras().getString(EXTRA_NAME);        }    }    private OnClickListener mDisplayButtonListener = new OnClickListener() {      public void onClick(View v) {                Intent intent = new Intent(MainScreen.this, DisplayName.class);        intent.putExtra(EXTRA_NAME, mName);        startActivity(intent);      }    };}public class ContactEdit extends Activity {  private EditText mEditName;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mEditName = (EditText) findViewById(R.id.editName);    mEditName.setText(this.getIntent().getExtras().getString(MainScreen.EXTRA_NAME));    Button button = (Button) findViewById(R.id.submit_select);    button.setOnClickListener(mSubmitName);  }  private OnClickListener mSubmitName = new OnClickListener() {    @Override    public void onClick(View v) {      Intent intent = new Intent();      mName = mEditName.getText().toString();      intent.putExtra(MainScreen.EXTRA_NAME, mName);      setResult(RESULT_OK, intent);      finish();    }  }}public class DisplayName extends Activity {  private String mName;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mName = getIntent.getExtras().getString(MainScreen.EXTRA_NAME)    TextView view = (TextView) findViewById(R.id.name);    view.setText(mName);  }}</code></pre>","490703","","490703","","2010-12-14 21:20:29","2010-12-15 00:26:31","why isn't the data from my bundle being sent to the new activity?","<android>","3","0","","",""
"4442838","1","","","2010-12-14 18:34:57","0","168","<p>When you choose a locationProvider by Criteria you can choose to allowCost or not.But of which cost we are talking about?If I choose to don't allow cost I allow the network provider?Which providers can have a cost?</p>","269454","","","","","2010-12-14 19:36:11","LocationProvider costAllowed","<android><location>","2","0","","",""
"4442888","1","","","2010-12-14 18:40:08","1","841","<p>I have create an application in android 2.x , in which there are few activities and a livewallpaper service which creates live wallpaper</p><p>so after building and running the whole application in a simulator , if i access Livewallpaper from Livewallpaper picker and try to set my created live wallpaper i encountered following error.</p><p>and i really don't know what its saying as i have removed the BIND_WALLPAPER permission also</p><pre><code> WARN/LiveWallpaperPreview(373): Failure setting wallpaper WARN/LiveWallpaperPreview(373): java.lang.SecurityException: Selected service does not require android.permission.BIND_WALLPAPER: ComponentInfo{com.vb.ui/com.vb.ui.CWallpaper} WARN/LiveWallpaperPreview(373):     at android.os.Parcel.readException(Parcel.java:1247) WARN/LiveWallpaperPreview(373):     at android.os.Parcel.readException(Parcel.java:1235) WARN/LiveWallpaperPreview(373):     at android.app.IWallpaperManager$Stub$Proxy.setWallpaperComponent(IWallpaperManager.java:210) WARN/LiveWallpaperPreview(373):     at com.android.wallpaper.livepicker.LiveWallpaperPreview.setLiveWallpaper(LiveWallpaperPreview.java:95) WARN/LiveWallpaperPreview(373):     at java.lang.reflect.Method.invokeNative(Native Method) WARN/LiveWallpaperPreview(373):     at java.lang.reflect.Method.invoke(Method.java:521) WARN/LiveWallpaperPreview(373):     at android.view.View$1.onClick(View.java:2067) WARN/LiveWallpaperPreview(373):     at android.view.View.performClick(View.java:2408) WARN/LiveWallpaperPreview(373):     at android.view.View$PerformClick.run(View.java:8816) WARN/LiveWallpaperPreview(373):     at android.os.Handler.handleCallback(Handler.java:587) WARN/LiveWallpaperPreview(373):     at android.os.Handler.dispatchMessage(Handler.java:92) WARN/LiveWallpaperPreview(373):     at android.os.Looper.loop(Looper.java:123) WARN/LiveWallpaperPreview(373):     at android.app.ActivityThread.main(ActivityThread.java:4627) WARN/LiveWallpaperPreview(373):     at java.lang.reflect.Method.invokeNative(Native Method) WARN/LiveWallpaperPreview(373):     at java.lang.reflect.Method.invoke(Method.java:521) WARN/LiveWallpaperPreview(373):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) WARN/LiveWallpaperPreview(373):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) WARN/LiveWallpaperPreview(373):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","405383","","19750","","2011-03-31 15:42:40","2011-03-31 15:42:40","unable to set live wallpaper","<android><live-wallpaper>","1","2","","",""
"4443000","1","4443151","","2010-12-14 18:53:03","0","2490","<p>AlertDialog.Builder dialog = new AlertDialog.Builder(this)has not (or not showing) dismiss() method under setOnItemClickListener() ??</p><p>particularly this is my code.</p><pre><code>AlertDialog.Builder dialog = new AlertDialog.Builder(getApplicationContext());dialog.setTitle(""TITLE"");dialog.setView(view);dialog.show();listView.setOnItemClickListener(new OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; adapter, View view, int pos,        long id) {    dialog.dismiss() // dismiss is not there.    }});</code></pre><p>thanks.</p>","536853","","440502","","2010-12-14 19:01:54","2010-12-14 20:02:10","dialog has not dismiss() in onitemclick listener","<android>","1","3","","",""
"4443012","1","","","2010-12-14 18:54:16","2","373","<p>I am looking for a way to tell which item in a Gallery View has landed in the center after scrolling the Gallery left or right.  At the moment I can only get a response when clicking one of the Gallery items, which of course brings it to center.  The exact behavior I am trying to accomplish is to be able to scroll the Gallery and have a TextView indicate which item has landed in the center, without having an item actually clicked upon.</p><p>Very new at Android, any thoughts would be appreciated.</p><p>Thanks!</p>","538576","","","","","2013-05-25 02:50:34","Android: How to tell which item has landed in the center after scrolling a Gallery View","<android><view><gallery><galleryview>","2","2","","",""
"4443082","1","","","2010-12-14 19:03:35","0","710","<p>Ive been trying to fix this for ages, on the tab tutorial for android ive followed it exactly but keep getting this error messege on my TabWidget.java class.</p><blockquote>  <p>R.drawable.ic_tab_albums cannot be resolved<br>  tabWidget.java/HelloTabWidget/src/com/example/tabwidget</p></blockquote><p>and</p><blockquote>  <p>R.drawable.ic_tab_songs cannot be resolved<br>  tabWidget.java/HelloTabWidget/src/com/example/tabwidget</p></blockquote><p>Heres my code for my TabWidget.java class</p><p>`<br>     import com.example.androidtab.R;</p><pre><code> import android.app.Activity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.widget.TabHost;public class TabWidget extends Activity {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    // Create an Intent to launch an Activity for the tab (to be reused)    intent = new Intent().setClass(this, ArtistsActivity.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, AlbumsActivity.class);    spec = tabHost.newTabSpec(""albums"").setIndicator(""Albums"",                      res.getDrawable(R.drawable.ic_tab_albums))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, SongsActivity.class);    spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"",                      res.getDrawable(R.drawable.ic_tab_songs))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(2);}private TabHost getTabHost() {    // TODO Auto-generated method stub    return null;}</code></pre><p>}`</p>","542408","","","","","2012-03-24 04:04:53","Error in Android Tab Tutorial","<java><android>","2","2","","",""
"4443148","1","","","2010-12-14 19:10:56","5","5874","<p>In my Android app, I am able to programmatically open up the default email editor with To, Subject, and Message using the following:</p><pre><code>Intent emailIntent=new Intent(Intent.ACTION_SEND);emailIntent.putExtra(Intent.EXTRA_EMAIL, toemail);emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);emailIntent.putExtra(Intent.EXTRA_TEXT, body);emailIntent.setType(""text/plain"");emailIntent.setClassName(""com.android.email"", ""com.android.email.activity.MessageCompose"");startActivity(emailIntent);</code></pre><p>This works great, but I need to wait in my app until the user finishes with the email screen and also know whether the email was sent or discarded.</p><p>Anyone know how to do this?</p>","483388","","","","","2012-11-06 13:57:52","How to wait for email intent to finish and get result?","<android><android-intent><email-client>","2","1","1","2013-02-21 07:35:04",""
"4443255","1","4443549","","2010-12-14 19:22:36","0","568","<p>I am trying to build a quick search box. it is basically a widget. Upon clicking, it pops up the quick search box and launch the browser with query string. No activity except searchactivity. </p><p>And also added codes for 'recent query suggestion' But having a problem to have menu for 'clear history' Here is what I wanted to implement. When quick search box is displayed, by pressing menu button, I want option menu to be popped up, keypad to be disappeared, quick search box to be stayed.</p><p>the implementation of google sample code - Searchable dictionary is not what I want to implement. It starts an activity with instruction message and when a user presses the search button or menu button, it pops up the quick search box. Mine is when it runs from a widget, the quick search box is popped up right away just like the google search widget.</p><p>How can I override onCreateOptionMenu on searchmanager? Or is there any way to activate option menu  when the searchmanager is activated? </p><p>Please take a look at the images below. the second image is what I want to implement upon clicking menu button.</p><p><img src=""http://i.stack.imgur.com/nSp4o.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/Otf6n.png"" alt=""alt text""></p>","419893","","","","","2010-12-14 19:54:33","How to activate option menu when search box is displayed? (SearchManager)","<android><search>","1","0","","",""
"4443278","1","","","2010-12-14 19:25:31","12","9215","<p>I'm trying to display a simple message via Toast, and am getting a RunTime Exception ""sending message to a Handler on a dead thread"". The class that is trying to show the Toast message extends IntentService. The class (C2DMReceiver) actually comes from the ChromeToPhone example for C2DM. Here is the method:</p><pre><code>/** * Called when a cloud message has been received. */@Overridepublic void onMessage(Context context, Intent intent) {    Log.i(LOG_TAG, ""A message notification has occured with the cloud."");        Log.i(LOG_TAG, ""Showing toast message of the broadcast..."");        Toast toast = Toast.makeText(context, ""Some text"", Toast.LENGTH_LONG);        toast.show();        Log.i(LOG_TAG, ""Sending notification of the broadcast..."");        LauncherUtils.generateNotification(this, ""this is where the text would go."", ""Broadcast"", intent);    }}</code></pre><p>I assumed since the class extends IntentService that it would be possible to request a simple Toast message from here in this manner. Isn't this correct?</p>","534250","","","","","2013-07-12 08:31:57","Toast ""sending message to a Handler on a dead thread""","<android>","4","0","10","",""
"4443340","1","4443369","","2010-12-14 19:31:12","1","682","<p>How to properly instantiate AssetManage? </p><p>I have a file that I'd like to load and I am getting an error.</p><p>Here is what I have:</p><pre><code>     AssetManager assetManager = new AssetManager(handle);     Typeface tf = Typeface.CreateFromAsset(assetManager, ""fonts/calibri.ttf"");     this._textView.SetTypeface(tf, 0); // i just need a regular calibri, I added a file into the fonts folder and set it to AndroidAsset.</code></pre><p>What should be a ""handle"" in this case?</p><p>Thank you</p>","538428","","345717","","2010-12-14 19:35:05","2011-02-09 22:38:54","AssetManage instantiation","<android><mobile><monodroid>","2","2","","",""
"4443517","1","4443586","","2010-12-14 19:50:52","1","814","<p>i have to make a listview that haves a list of names, and also, aligned to the left, but in the same field, the sex of the person, male or female</p><p>is possible to do it? how?</p><p>code examples welcome</p><p>EDIT</p><p>I try with the first user answer, and i got this exception: <code>12-14 22:39:56.191: ERROR/AndroidRuntime(917): java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView</code></p><p>this is the code of the XML item i make:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""fill_parent""     android:layout_height=""wrap_content"" &gt;        &lt;TextView         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""Left side""         android:layout_alignParentLeft=""true""/&gt;        &lt;TextView         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""Right side""         android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt; </code></pre><p>and this is the code where i have my list:</p><pre><code>public class PendingInvitations extends ListActivity {...............        @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);    private List&lt;String&gt; usernames=new ArrayList&lt;String&gt;();        for (int i=0;i&lt;friends.size();i++)              {                usernames.add(i,friends.get(i).getFullName());              }              setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item2, usernames));</code></pre>","479886","","479886","","2010-12-14 22:42:31","2010-12-14 22:59:55","Can i put text in the left and in the right side of the elements of a listview?","<android><listview>","2","1","","",""
"4443595","1","4443641","","2010-12-14 19:59:21","0","604","<p>I'm creating an app which is going to have some data that is stored in an SQLite database. I want the user to be able to create ""folders"" which can be assigned to each data item.</p><p>I was going to do this using a one to many relationship e.g. one ""folder"" can have many data objects under it but having looked at relationships with SQLite and Android it seems that this would only work in 2.2+ so I'm just wondering what the alternative is?</p><p>Any information is much appreciated.</p>","319940","","","","","2010-12-14 20:05:55","Alternative to using relationship with SQLite","<android>","1","0","","",""
"4443606","1","4444747","","2010-12-14 20:01:11","1","574","<p>I have a working Android application. It works on more than 500 different devices. The manifest is</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""package=""info.decamps.droid.photoid"" android:versionCode=""5""android:versionName=""1.4""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_label""    android:name=""PhotoIDroid"" android:description=""@string/app_desc""    android:debuggable=""FALSE""&gt;</code></pre><p>But when it it launched from a Samsung Galaxy Tab, it doesn't start and crashes with:</p><blockquote>  <p>java.lang.RuntimeException: Unable to  instantiate application  info.decamps.droid.photoid.PhotoIDroid:  java.lang.ClassNotFoundException:  info.decamps.droid.photoid.PhotoIDroid  in loader  dalvik.system.PathClassLoader[/data/app/info.decamps.droid.photoid-1.apk]  at  android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:670)  at  android.app.ActivityThread.handleBindApplication(ActivityThread.java:4483)  at  android.app.ActivityThread.access$3000(ActivityThread.java:135)  at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:2181)  at  android.os.Handler.dispatchMessage(Handler.java:99)  at  android.os.Looper.loop(Looper.java:144)  at  android.app.ActivityThread.main(ActivityThread.java:4937)  at  java.lang.reflect.Method.invokeNative(Native  Method) at  java.lang.reflect.Method.invoke(Method.java:521)  at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  at  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  at  dalvik.system.NativeStart.main(Native  Method) Caused by:  java.lang.ClassNotFoundException:  info.decamps.droid.photoid.PhotoIDroid  in loader  dalvik.system.PathClassLoader[/data/app/info.decamps.droid.photoid-1.apk]  at  dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)  at  java.lang.ClassLoader.loadClass(ClassLoader.java:573)  at  java.lang.ClassLoader.loadClass(ClassLoader.java:532)  at  android.app.Instrumentation.newApplication(Instrumentation.java:945)  at  android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:660)  ... 11 more</p></blockquote><p>How an the Samsung Galaxy not find the application class?Any clue on how to resolve this?</p><p>I have been able to reproduce tis crash on the Samsung Galaxy emulator.</p>","94363","","","","","2010-12-14 22:04:18","ClassNotFoundException on Galaxy Tab (only)","<android><galaxy>","1","6","1","",""
"4443660","1","4548597","","2010-12-14 20:08:27","2","3320","<p>I m looking for the best practice to implement a service for logging gps- or other sensor-values periodically (every 10-60 sec). The service should deal with the standby mode, when the phone goes asleep. </p><p>Any help (pseudo-code or tutorials) is very much appreciated!</p>","449366","","21234","","2010-12-14 20:15:41","2011-02-25 20:33:49","Android: service for gps / sensor logging","<android><android-service>","2","0","2","",""
"4443763","1","4445929","","2010-12-14 20:18:21","0","519","<p>i'm developing a Client/Server Application with Android/Rails and Communication via REST Json</p><p>When i'm testing my App via Emulator, all works fine.Also when i deploy the app on my phone with <strong>WIFI on</strong> it works and the speed is ok.</p><p>But when i disconnect from WIFI and use the 3G connection, the phone becomes incredible Slow and it takes Minutes du get one JSON Response from the Server.</p><p>I'ved debug a little bit and the Problem seems to be the HTTPClient, which execute Method takes ulta long.</p><p><strong>Other Apps with Network Access are working perfectly.</strong></p><p>Any Suggestions what to do?</p><pre><code>HTC Magic Android 1.6</code></pre><p>My Http Connection Code:</p><pre><code>HttpClient client = new DefaultHttpClient();        HttpGet get = new HttpGet(""URL"");        try {            client.execute(get);        } catch (ClientProtocolException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }</code></pre><p>Regards</p>","542207","","542207","","2010-12-14 21:49:48","2010-12-15 01:25:11","Android Developing - Slow Intenet Connectionvia 3G","<android><http><connection><client>","2","3","","",""
"4443891","1","4444019","","2010-12-14 20:29:10","10","20146","<p>I want my application to recognize barcodes taken by camera. Is it possible using Android SDK?</p><p>Something like this:<a href=""http://www.appbrain.com/app/barcode-scanner/com.google.zxing.client.android"">Barcode Scanner</a></p>","295141","","114066","","2011-01-19 09:55:39","2013-01-15 08:11:01","How to read barcodes with the camera on Android?","<android><barcode><barcode-scanner>","4","2","5","",""
"4444024","1","","","2010-12-14 20:43:47","0","998","<p>I want to change the database at:</p><pre><code>/data/data/com.android.provider.settings/databases/settings.db</code></pre><p>I can create new databases with:</p><pre><code>final String MY_DB_NAME = ""Test"";final String MY_DB_TABLE = ""Autos"";SQLiteDatabase myDB = null;myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE + "" (_id integer primary key autoincrement, name varchar(100))"");myDB.execSQL(""INSERT INTO "" + MY_DB_TABLE + "" (name)"" + "" VALUES ('Audi TT');""); myDB.execSQL(""INSERT INTO "" + MY_DB_TABLE + "" (name)"" + "" VALUES ('Honda Civic');"");</code></pre><p>Now, that creates only the name, how can I add the value?</p><p>Thanks in advance</p>","542537","","229044","","2010-12-15 07:27:50","2010-12-15 07:27:50","How to edit Database file?","<android><sdk><source>","1","0","","",""
"4444027","1","4445197","","2010-12-14 20:44:06","1","1249","<p>i have a widget that needs to perform a potentially long-running operation in onUpdate(). just performing the operation directly resulted in ANR's. to solve this, my first attempt was to create a thread therein. i noticed that the widget would not get updated in some cases. my guess here is that once onUpdate() exits, android may kill the process along with the unfinished thread.</p><p>my next attempt was create an intent service. the widget's onUpdate() just starts the intent service, which does the work directly and updates the widget when done. this works, but much to my surprise it appears that onHandleIntent() is single threaded. if i have two widgets, and then both update and start the intent service, they update sequentially ...</p><p>the two widget case is not really important, but i'm just wondering about a best practice for this type of pattern.</p><p>to solve the two widget case i ended up updating all the widget instances with the same data whenever any one of them is clicked. e.g., i perform the long running process once and apply the results to all the widget instances. in my scenario this doesn't matter, but for many widgets it might be important not to do that.</p><p>thoughts?</p>","337455","","337455","","2010-12-14 20:50:09","2010-12-14 23:06:47","android long-running operation to update an appwidget","<android><appwidget>","2","0","1","",""
"4444044","1","4445326","","2010-12-14 20:45:33","1","547","<p>Well, I have another problem that I can't seem to find the solution to...I have an app that loads the main.xml file on startup, of course. In it are several buttons, and I want the buttons to take me to a different XML file. I just used setContentView(R.layout.newlayout.xml) method for that, and it works great. The problem comes in after that. If I reference any of the buttons or other objects in the new layout, the app won't even finish loading before it errors out and closes on the emulator. However, if I take all references to objects out, the app runs fine. I can navigate <em>TO</em> the new layouts, but their buttons can't do anything. Do I need to create a separate Java file for each layout? Or am I doing it all wrong? I'm trying to be as specific as I can...I suppose you could say I need to have different ""pages"" in my app like a website would.</p>","519436","","","","","2010-12-15 05:13:06","Switching Views/layouts","<android><layout><view>","3","1","","",""
"4444092","1","","","2010-12-14 20:51:56","0","264","<p>I want to get continues reading from a continues touch down event.I mean that I want to get event every 0.01 sec.I've tried to use GestureDetector and I got down, show and long events during a continuestouch. After the long event I don't get any events.Please help...</p>","539060","","","","","2010-12-28 08:59:29","get continues reading from continues touch","<android><events>","2","1","","",""
"4444101","1","4444501","","2010-12-14 20:52:31","1","525","<p>I have a ListView that has a subtle gradient bitmap in the background of each item.  I noticed that when I scroll the list, the background gradient becomes banded and changes color.  The gradient is a dark gray and when it scrolls is becomes subtly green and banded.  It basically looks like the quality of the images greatly decreases as it scrolls.</p><p>Most of the time, as soon as it finishes scrolling, it returns to the normal quality.  Sometimes it actually stays poor quality even after scrolling stops.  On a Nexus One it almost always stays low quality after scrolling.</p><p>Is there a way to avoid this?</p><p>Note:  This is not the common ListView background problem discussed here: <a href=""http://developer.android.com/resources/articles/listview-backgrounds.html"" rel=""nofollow"">http://developer.android.com/resources/articles/listview-backgrounds.html</a></p><p>Here is an enlarged screen cap to show the difference.  On the left side is the background normally.  On the right half you can see what it looks like when it scrolls.</p><p><img src=""http://i.stack.imgur.com/4Yu54.png"" alt=""alt text""></p>","445348","","445348","","2010-12-14 22:11:02","2010-12-14 22:11:02","Bitmap colors change while scrolling","<android>","1","0","","",""
"4444142","1","","","2010-12-14 20:55:56","0","1263","<p>I'm having a problem where it seems I can't get key events to fire at all in the emulator (it was working before, but, somehow.. something broke).</p><p>Here is some sample code that should fill the second text box with the text of the first when a key is pressed in the first (or if the button is clicked).  But it doesn't do that.</p><p>Am I doing something wrong?</p><p>Activity class:</p><pre><code>package abc.def;import android.app.Activity;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;public class Fill extends Activity {    /** Called when the activity is first created. */ EditText e1; EditText e2; Button b;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        e1 = (EditText) findViewById(R.id.EditText01);        e2 = (EditText) findViewById(R.id.EditText02);        b = (Button) findViewById(R.id.Button01);        e1.setOnKeyListener(new OnKeyListener() {   @Override   public boolean onKey(View v, int keyCode, KeyEvent event) {    e2.setText(e1.getText());    return false;   }        });        b.setOnClickListener(new OnClickListener() {   @Override   public void onClick(View arg0) {    e2.setText(e1.getText());   }        });    }}</code></pre><p>Layout file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;EditText android:text="""" android:id=""@+id/EditText01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;EditText android:text="""" android:id=""@+id/EditText02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Button android:text=""Click"" android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","534173","","","","","2011-01-11 19:08:23","Android - onKey events don't fire","<android><android-layout>","2","3","","",""
"4444146","1","","","2010-12-14 20:56:15","0","631","<p>is there a possiblity to explicitely use the wifi connection for doing Http Url requests?In fact i just need to know if an internet connection (access to google.com for example) is possible via wifi.(not via 2g / 3g / ..)</p>","478605","","","","","2010-12-14 21:32:48","Android: How to perform Url Request via Wifi","<java><android><url><request><wifi>","3","0","","",""
"4444195","1","4444386","","2010-12-14 21:01:19","0","133","<p>hi againhave bent my head on getting this to work for 3 days now.The serviceBinder is always NULL when i select picture in Share menu. I debug this with LogCat, stepping the code.. and see no obvious error. Also the bindService return false. I have a service class but think the hickup is here somewhere.Please point me in the right direction!</p><pre><code>package com.example.ptpp;public class ServicesDemo extends Activity { private MyService serviceBinder = null; private static final String TAG = ""ServicesDemo""; boolean mIsBound; ServiceConnection mConnection = null; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  startService(new Intent(this, MyService.class));  Intent intent = getIntent();  Bundle extras = intent.getExtras();  final String mimeType = intent.getType();  String action = intent.getAction();   mConnection = new ServiceConnection() {  public void onServiceConnected(ComponentName className, IBinder service) {   serviceBinder = ((MyService.MyBinder) service).getService();   }   public void onServiceDisconnected(ComponentName className) {    serviceBinder = null;   }  };  Intent bindIntent = new Intent(ServicesDemo.this, MyService.class);  bindService(bindIntent, mConnection, Context.BIND_AUTO_CREATE);  mIsBound = true;   if (Intent.ACTION_SEND.equals(action)) {   if (extras.containsKey(Intent.EXTRA_STREAM)) {    Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM);     try {     if(serviceBinder != null)     // here i call my service to do stuff with the                                         //picture i got from ""share"" menu     serviceBinder.addAttachment(mimeType, uri, false);    } catch (UnknownHostException e) {     // TODO Auto-generated catch block     e.printStackTrace();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }    return;   } else if (extras.containsKey(Intent.EXTRA_TEXT)) {     return;   }  }  } void doUnbindService() {  if (mIsBound) {   // Detach our existing connection.   unbindService(mConnection);   mIsBound = false;  } } protected void onDestroy() {  super.onDestroy();  doUnbindService(); }}</code></pre><p>package com.example.ptpp;</p><p>public class MyService extends Service {</p><pre><code>private static final String TAG = ""MyService"";private final IBinder binder = new MyBinder();private ServicesDemo callingActivity = null; public void setActivity(ServicesDemo i) {    callingActivity = i;}public IBinder onBind(Intent intent) {    return binder;}public class MyBinder extends Binder {    MyService getService() {        return MyService.this;    }}public void onCreate() {}public void onDestroy() {}public void onStart(Intent intent, int startid) {}public int onStartCommand(Intent intent, int flags, int startId) {    return START_STICKY;}public void addAttachment(String mimeType, Uri uri, boolean b) throws UnknownHostException, IOException {}</code></pre><p>}</p>","538837","","538837","","2010-12-14 21:20:40","2010-12-14 21:23:15","Newbe need to be Pointed in the right direction","<java><android><android-intent>","1","1","","",""
"4444235","1","","","2010-12-14 21:05:48","8","9919","<p>I'm trying to open a socket bluetooth between a milestone and a pc but the device can not connect. I hope I am sending the code help.</p><pre><code>public class Bluetooth_V2 extends Activity { public TextView tela; public ListView telaDevice; public BluetoothAdapter bluetooth; public String endBluetooth; public String endDevice; public String nomeDevice; public ArrayAdapter&lt;String&gt; nomeBluetooth; private static final String info = ""DEBUG""; private static final int DISCOVERABLE_REQUEST = 0; private static final int DISCOVERY_REQUEST = 0; public BroadcastReceiver mReceiver = null; public ArrayList&lt;String&gt; deviceDescoberto; public BluetoothDevice deviceRemoto; public BluetoothServerSocket btserver; public BluetoothSocket serverSocket; public UUID uuid = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""); public OutputStream outStream; public InputStream instream; public BluetoothSocket socket;public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  tela = (TextView) findViewById(R.id.telaMsg);  telaDevice = (ListView) findViewById(R.id.telaDevice);  bluetooth = BluetoothAdapter.getDefaultAdapter();  nomeBluetooth = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1);   telaDevice.setAdapter(nomeBluetooth);  Log.d(info, ""Recebeu adaptador"");  if(bluetooth==null)  {   Log.d(info,""Bluetooth nao suportado"");   tela.append(""Bluetooth nao suportado"");  }  if(!bluetooth.isEnabled())  {   Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);   startActivityForResult(enableBtIntent,RESULT_OK);  }  tela.append(""\nNome:""+bluetooth.getName());  tela.append(""\nEndereço:""+bluetooth.getAddress());  bluetooth.startDiscovery();  Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);  startActivity(discoverableIntent);  //discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);  bluetooth.isDiscovering();  Log.d(info,""Estado de descoberta"");  IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);  this.registerReceiver(mReceiver, filter);  tela.append(""\nModo de busca"" + bluetooth.getScanMode());  filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);  this.registerReceiver(mReceiver, filter);  //startActivityForResult(new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE),DISCOVERABLE_REQUEST);  tela.append(""\nDispositivos encontrados:"");   BroadcastReceiver discoveryResult = new BroadcastReceiver() {   public void onReceive(Context context, Intent intent) {    nomeDevice = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);    deviceRemoto = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);    tela.append(""\n""+nomeDevice+""\n""+deviceRemoto);    // TODO Do something with the remote Bluetooth Device.   }  };  registerReceiver(discoveryResult,    new IntentFilter(BluetoothDevice.ACTION_FOUND));  if (!bluetooth.isDiscovering())   bluetooth.startDiscovery();  /* //Mostra dispositivos pareados  tela.append(""\nDispositivos pareados mas não conectados"");  Set&lt;BluetoothDevice&gt; devices = bluetooth.getBondedDevices();  for(BluetoothDevice device : devices){   tela.append(""\n""+device.getName());  }*/  startActivityForResult(new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE),DISCOVERY_REQUEST);  final BluetoothDevice device = bluetooth.getRemoteDevice(""90:4C:E5:FA:01:22"");  final Set&lt;BluetoothDevice&gt; bondedDevices = bluetooth.getBondedDevices();  BroadcastReceiver Result = new BroadcastReceiver(){   @Override   public void onReceive(Context context, Intent intent) {    deviceRemoto = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);    if(deviceRemoto.equals(device)&amp;&amp;bondedDevices.contains(deviceRemoto)){     tela.append(""Dispositivos""+deviceRemoto.getName()+"" ja está pareado"");    }   }  };  registerReceiver(Result, new IntentFilter(BluetoothDevice.ACTION_FOUND));   try{   deviceRemoto = bluetooth.getRemoteDevice(""90:4C:E5:FA:01:22"");   BluetoothSocket clientSocket =    device.createRfcommSocketToServiceRecord(uuid);   clientSocket.connect();   Log.d(info,""Cliente Conectado"");   //sendMessage(""OI"");   // TODO Transfer data using the Bluetooth Socket  } catch (IOException e) {   Log.d(""BLUETOOTH CLIENTE"", e.getMessage());  } }}</code></pre>","476378","","121493","","2010-12-14 21:11:21","2011-12-04 09:57:45","Problems connecting with bluetooth Android","<android><bluetooth>","1","1","5","",""
"4444311","1","","","2010-12-14 21:14:42","0","1821","<p>I'm trying to implement a way to know when there is a press and a release of a key on a soft keyboard.  I have used the onKeyListener to get the down and the up of the key, but the problem with that is that it only works on a hard keyboard.  I have found the OnKeyBoardActionListener which seems to have this functionality.  The problem I am running into with this is that i need to get the KeyboardView from an edittext i am using for simple testing.  </p><pre><code>public class testing extends Activity implements KeyboardView.OnKeyboardActionListener{     EditText testingBox;     TextView textbox;     KeyboardView keyView;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    textbox = (TextView)findViewById(R.id.TextView01);    testingBox = (EditText)findViewById(R.id.EditText01);    //keyView is null i need to get it somehow.      keyView.setOnKeyboardActionListener(this);}//methods for the OnKeyBoardActionListener}</code></pre><p>if anyone could provide any advice on how i can get this keyBoardView or another way i can capture these soft keyboard presses and releases would be great.  thanks.</p>","542571","","1016716","","2012-04-30 08:14:04","2012-04-30 08:14:04","OnKeyboardActionListener android keys","<android><keyboard><keypress><actionlistener><keylistener>","1","0","","",""
"4444769","1","","","2010-12-14 22:05:57","2","573","<p>I've a problem regarding the Samsung Galaxy S in landscape mode. I use autocompletion field and the Galaxy S has its own autocompletion management, it works like the XT9 keyboard (see picture below).</p><p>My problem is that when you select your choice, the autocomplete list doesn't disappear because the text in the field match to the autocompletion result.</p><p>After selecting my choice, if I add a space at the end, the list disappears. So I've tried to subclass the AutoCompleteTextView to add this space at the end of the string, the space is written but the list is always present...</p><p>Someone has a solution or even a workaround ?</p><p><img src=""http://i.stack.imgur.com/s9s0x.png"" alt=""alt text""></p>","337141","","","","","2011-11-05 15:44:55","Android: Galaxy S autocompletion in landscape mode","<android><autocomplete><landscape><autocompletetextview><galaxy>","0","0","","",""
"4444818","1","4444989","","2010-12-14 22:12:38","15","20024","<p>I made the mistake of upgrading eclipse today and now can't get my a new Android project to get going.</p><p>I get the message Proguard.cfg (the file can't be found).</p><p>Where is this thing I can't seem to find it? Is it possible to get rid of it I don't need Obfuscation in this project...</p><p>Thanks</p>","542631","","","","","2012-09-24 01:01:23","Proguard.cfg Missing","<java><android><proguard>","4","0","7","",""
"4444946","1","8268218","","2010-12-14 22:29:32","3","892","<p>I am newbie to android development and currently I am studying the 3D animation by going through the file Rotate3dAnimation in ApiDemos project. This class shows the image in reverse order, I am trying to display this control to display the image in actual order but my bad luck continues. Could you please advice me which line that shows the image in reverse order?</p><p>Thanks,Shan   </p>","441918","","","","","2011-11-25 11:09:49","Android ApiDemos - Rotate3dAnimation","<android><animation>","1","0","","",""
"4444950","1","4445040","","2010-12-14 22:29:40","0","2655","<p>I have an integer array in an xml file as follows</p><pre><code>&lt;integer-array name=""myArray""&gt;    &lt;item&gt;@drawable/pic1&lt;/item&gt;    &lt;item&gt;@drawable/pic2&lt;/item&gt;    &lt;item&gt;@drawable/pic3&lt;/item&gt;    &lt;item&gt;@drawable/pic4&lt;/item&gt;&lt;/integer-array&gt;</code></pre><p>In the code, I am trying to load this array</p><pre><code>int[] picArray = getResources().getIntArray(R.array.myArray);</code></pre><p>The expected result is</p><pre><code>R.drawable.pic1, R.drawable.pic2,R.drawable.pic3</code></pre><p>but instead it is coming with an array with all values as zero</p><p>Can anyone tell me what is wrong?</p>","518219","","101361","","2013-10-05 09:14:09","2013-10-05 09:14:09","Loading Interger Array from xml","<android>","3","2","","",""
"4445058","1","4445070","","2010-12-14 22:45:29","1","1677","<p>Using the SensorManager I can find the x,y,z from the ACCELEROMETER.I can detect that the device moves, but how I can I check if it moves DOWN direction and not up?</p><p>thanks.</p>","257764","","","","","2010-12-14 23:00:43","Detecting the device moving direction using ACCELEROMETER in Android","<android>","1","0","1","",""
"4445103","1","","","2010-12-14 22:51:57","0","1309","<p>using Android SDK > 5, I m creating a contact by starting the ACTION_INSERT activity.I want to add several phone numbers (work, home, etc...) for the contact using the following code:</p><p><code>Intent newIntent = new Intent(Intent.ACTION_INSERT,           ContactsContract.Contacts.CONTENT_URI); </p><p>for(ContactInfo.Phone p : phones)      {</p><pre><code>   newIntent.putExtra(ContactsContract.Intents.Insert.PHONE, p.number);   newIntent.putExtra(ContactsContract.Intents.Insert.PHONE_ISPRIMARY, p.isPrimary ? new Integer(1) : null);   newIntent.putExtra(ContactsContract.Intents.Insert.PHONE_TYPE, unconvertPhoneType(p.type));  }</code></pre><p></code></p><p>(unconvertPhoneType() is a function to get the type as CommonDataKinds.Phone.TYPE_XXX)</p><p>I have just one example being inserted in the contact.What is wrong with the above?</p><p>Additionally, in LogCat logs, I have also the following error:</p><blockquote>  <p>12-14 11:09:03.015: WARN/Bundle(1724): Key phone_type expected String but value was a java.lang.Integer.  The default value  was returned.</p></blockquote><p>looks like it comes from PHONE_TYPE, however CommonDataKinds.Phone.TYPE_XXX is of type integer, so i am not sure...What is the cause of that?</p><p>Thanks!</p>","542662","","","","","2010-12-15 02:38:05","android add multiple phone numbers for a contact","<android><insert><contact>","1","0","","",""
"4445174","1","4445345","","2010-12-14 23:03:58","4","562","<p><strong>Background:</strong><br>I have been working on an Android application that stores data in a local database as my pet project.  Lately, I have decided that I want to password protect the application and encrypt the database.  Now, I am aware of the complexities of encrypting the database on the fly and have (given the expected usage pattern of my application) decided to just encrypt the whole database file rather than try to store encrypted column value or the like.  Thus far I have implemented a system that will prompt for a password on every application launch or whenever the user navigates away from my activity (to account for the user pressing the home key and the application not being killed in a timely manner).</p><p>Currently, I am trying to decide how exactly to go about hashing the password and where to store it.  Given that everything must be stored on the device, I am basically treating the password hashes and salt as already compromised as anyone who has spent 10 minutes reading can root a given device and access my database / preferences.</p><p>I have developed what I think should still provide very strong security given the above assumptions.  I wanted to get some feedback from the community to see if my solution is viable or if there is a better way.</p><p>My idea is to generate 10 different random salt values on the first run of the application.  These values will be stored with the actual final password hash in the application preferences (rather than in the database).  Note that there will only be one password and it is used for both user authentication and database decryption.  Whenever a challenge is presented, the password will be hashed as follows:</p><ol><li>Cleartext password is hashed.</li><li>Hashed password is run through the same checksum algorithm that is used for standard UPC barcodes.  This will result in a value between 0 and 9 (inclusive).</li><li>This checksum digit will be used as an index to the array of salt values.  This single salt value will be appended to the current hash.</li><li>The new hash + salt value will then be hashed and steps 2 - 3 will be repeated.</li></ol><p>I figure doing this process for 5 iterations would give 5^10 different salt combinations alone and should make any type of rainbow attack practically impossible.  Once the final hash has been verified correct, it can be used to decrypt the database.</p><p>Now, I realize that this sounds like overkill for a simple cellphone app.  It is.  But, this being my pet project, why not?</p><p><strong>Question:</strong><br>So, after that wall of text, is this approach reasonable or is there a better way?  I think, with this in place, the weakest link would be an in-memory attack or am I mistaken?  Any feedback is greatly appreciated.</p><p>Thank you in advance.</p><p>-cheers</p>","481075","","481075","","2010-12-15 00:05:14","2012-08-08 19:56:12","Creating a Strong Password Scheme When All Data is Stored on Device","<java><android><encryption><password-protection>","5","3","2","",""
"4445226","1","","","2010-12-14 23:10:35","0","630","<p>I'm creating custom view derived from EditText. My view is declared as inner class like this:</p><pre><code>package com.woodshy.glucoXpert.DPass;//...public class DPassValuesEditActivity extends GenericScreenActivity {//...public static class DPassValuesEditField extends EditText {    protected String mDbFieldName;    public DPassValuesEditField(Context context) {        super(context);    }    public DPassValuesEditField(Context context, AttributeSet attrs) {        super(context, attrs);        TypedArray a = context.obtainStyledAttributes(attrs,                R.styleable.DPassValuesEditField);        CharSequence s = a                .getString(R.styleable.DPassValuesEditField_dbFieldName);        if (s != null) {            mDbFieldName = s.toString();        }    }    //...}}</code></pre><p>res/attrs.xml file looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;declare-styleable name=""DPassValuesEditField""&gt;        &lt;attr name=""dbFieldName"" format=""string"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>I'm adding my custom view to xml layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:app=""http://schemas.android.com/apk/res/com.woodshy.glucoXpert""    android:id=""@+id/LinearLayout01"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:orientation=""vertical""&gt;    &lt;ScrollView android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:layout_gravity=""center_vertical""        android:scrollbars=""vertical""&gt;        &lt;RelativeLayout android:id=""@+id/editFielsdLayout""            android:layout_height=""fill_parent"" android:layout_width=""fill_parent""            android:clickable=""true""&gt;            &lt;view                class=""com.woodshy.glucoXpert.DPass.DPassValuesEditActivity$DPassValuesEditField""                android:id=""@+id/edtWeight"" android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:width=""75px""                android:maxLines=""1"" android:layout_below=""@+id/TextView01""                android:lines=""1"" android:gravity=""center"" android:imeOptions=""flagNoExtractUi""                android:inputType=""numberDecimal"" android:maxLength=""3""                app:dbFieldName=""Weight""&gt;&lt;/view&gt;        &lt;/RelativeLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>but I cant see it in visual editor (Eclipse SDK, Version: 3.6.1) while it appears in application in run-time and works fine.</p><p>Am I doing something wrong? How could I get my custom view visible in visual editor?</p><p>thanks.</p>","542659","","","","","2011-10-30 22:06:19","custom view becomes invisible in xml layout","<android>","2","0","","",""
"4445298","1","4524292","","2010-12-14 23:21:57","0","1750","<p>I started learning android programming a couple of weeks ago. I am a beginner so I followed this tutorial on making a simple 2D game engine:</p><p><a href=""http://obviam.net/index.php/a-very-basic-the-game-loop-for-android/"" rel=""nofollow"">http://obviam.net/index.php/a-very-basic-the-game-loop-for-android/</a></p><p>I implemented the onTouchEvent(MotionEvent event) method in the main game panel surface view. Everything seemed to work until I ran the game on an actual device (Galaxy Vibrant 2.1-update). I then noticed the game doesn't respond to ACTION_POINTER_DOWN or ACTION_POINTER_UP events. Does anyone know how to implement multitouch in a game engine of this structure? I am completely stuck and have tried everything. I even tried implementing Robert Green's DIY multitouch test app within my main game panel surface view, but still my app didnt respond to pointer actions, only MOVE_DOWN and MOVE_UP actions</p><p>source code to multitouch test app:http://<em>*</em>.rbgrn.net/content/367-source-code-to-multitouch-visible-test(replace * with www)Should i be listening to touch events on the main game panel class like the tutorial says? </p>","542677","","","","","2013-05-23 08:47:44","How to implement multi-touch in an android game that uses a main game panel surface view and a main thread","<android><2d><game-engine><multi-touch>","2","0","1","",""
"4445316","1","","","2010-12-14 23:24:19","2","417","<p>Is there any way to comment xml items of Android resources so that the comment is visible in Eclipses' IntelliSense when browsing 'R' class?</p>","532968","","","","","2010-12-15 00:15:37","Can XML comments on Android resources be automatically copied to R?","<android><xml><resources>","1","1","","",""
"4445359","1","4446457","","2010-12-14 23:33:09","1","651","<p>I am building a an Android Application. Some of my classes extends Activity and some extends ListActivity. Is there a way I can build a global menu class which can be used to generate menu.</p><p>I already know the way suggested in documentation of extending a base menu class with activity and then using that class to extend all other activities. But in my case couple of my classes extend listactivity.</p><p>Thanks in advance.</p>","444514","","","","","2010-12-15 05:07:51","Global Menu for Android Applications","<android><menuitem>","2","2","","",""
"4445546","1","","","2010-12-15 00:05:48","1","1680","<p>I am going through the supporting Multiple Screens documentation on the Android and need some clarification.</p><p>It's my understanding that designing three unique interfaces (ldpi, mdpi, and hdpi) would be the best way to go about supporting all the potential android screens.</p><p>but i believe this would hold true when you do this while design time.</p><p>but if you create a view during run time programmatically and want to set background image then would the above hold true?</p><p>i am trying to draw a bitmap on a canvas using following,</p><p>canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.image_1), 0, 0, null);in my custom view extending SurfaceView and then using this view in my main activity.</p><p>now i am using image_1.png which is 480*800 pixels using gimp.</p><p>if i use this image in the above code then it is not displaying correctly and the image appears bigger i.e. the image appears too big for the screen and hence not able to display the full content.</p><p>can you please advice what is the best approach to go on this?</p><p>thanks,--ad</p>","542720","","","","","2010-12-15 05:05:06","Android: How to display IMAGE for Different screen resolutions/size programmatically","<android>","2","1","","",""
"4445594","1","","","2010-12-15 00:16:41","1","157","<p>In many tutorials, the updating of a widget is suggested to be as follows;</p><pre><code>    public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {      final int N = appWidgetIds.length;      for (int i = 0; i &lt; N; i++) {       int widgetId = appWidgetIds[i];Log.d(TAG, "" ## onUpdate ## , appWidgetIds.length = ""+ String.valueOf(appWidgetIds.length) + "" appWidgetId = "" + widgetId );       context.startService(new Intent(context, UpdateService.class));      }}</code></pre><p>However, though there is only one widget on my homescreen, the size of appWidgetIds returns 52 and each one of them tries to process an update. This, of course, causes an overload on the called service, eventually crashing the application.</p><p>In his <a href=""http://kmansoft.wordpress.com/2010/06/22/per-widget-options-stale-widgets/#comment-315"" rel=""nofollow"">post</a>, Kostya Vasilyev offers a workaround for this bug.</p><p>This should be quite a common issue but I couldnT find any alternatives to this solution. How could we identify the stale widgets and avoid trying to update them?</p><p>Thanks in advance. </p><p><strong>EDIT :</strong> I ve just figured one good way to avoid stale widgets is to stop the running service (if there is any), upon the completion of the code in it :) This seems to have saved my day, of course it s not the answer though.</p>","494659","","494659","","2010-12-15 22:52:28","2012-01-25 11:08:25","How to avoid updating Stale widgets in android","<android><size><widget>","0","2","1","",""
"4445621","1","4445773","","2010-12-15 00:21:11","1","2200","<p>I was trying to make my UI as neat as possible, The user should enter some values into a circuit diagram,so I was trying to make the user click the resistor for example, then, a pop-up window appear with an EditText field in it for the user to enter the value of the resistor. </p><p>So far I was able to do that by using two separate setContentView()s, one for the circuit diagram and the other holds the EditText field, but I want the layout with the circuit Diagram to be visible in the background while the pop-up is the one in focus.</p><p>something like this (random example from the web):<a href=""http://blog.itechtalk.com/wp-content/2010/10/SMS-Popup-1.png"" rel=""nofollow"">http://blog.itechtalk.com/wp-content/2010/10/SMS-Popup-1.png</a></p>","542726","","","","","2010-12-15 05:04:00","popup layout in android?","<android>","3","0","","",""
"4445663","1","4455437","","2010-12-15 00:29:01","1","5374","<p>I have a list of songs that I'm streaming using the MediaPlayer. Some of the songs consistently work and others consistently do not work. I can't see a difference between these files, and they seem to play fine in itunes and such.</p><p>When the songs fail it is throwing an IllegalStateException on the mediaPlayer.prepare() line.  The IllegalStateException that is thrown has no useful info in it, (detailMessage is null, stackState is null)</p><p>Here is my code</p><pre><code>try {    mediaPlayer.setDataSource(media.url);    setPlayerState(PlayerState.PREPARING);    mediaPlayer.prepare();} catch (Exception e) {    e.printStackTrace();    Log.e(TAG, ""bad stream"");}</code></pre><p>Here is a url to the file that does NOT work:skdy.bryceb.dev.mediarain.com/song.m4a</p><p>Here is one that DOES work:skdy.bryceb.dev.mediarain.com/song2.m4a</p><p>Any ideas why this works on some songs and fails on others?</p>","469682","","842697","","2013-06-06 16:06:30","2013-06-06 16:06:30","MediaPlayer.prepare is throwing an IllegalStateException when playing m4a file","<android><android-mediaplayer>","2","4","","",""
"4445676","1","8538373","","2010-12-15 00:31:07","3","2444","<p>I found this link to a page here on StackOverflow about <a href=""http://stackoverflow.com/questions/3479780/creating-audio-using-javascript-in-audio"">""Creating Audio using Javascript in &lt;audio&gt;""</a>, and this page on <a href=""http://www.storiesinflight.com/html5/audio.html"" rel=""nofollow"">how to play audio on multiple channels</a>.  I found that the iPhone supports the audio tag and the Audio object in Javascript to play single channel audio, but is there a way to play audio on multiple channels?</p><p>Maybe I'm over complicating this, so this is what I'm trying to do.  I want a way to make a graceful audio player in Javascript that supports transitioning from one audio file to another.  The way I was going to implement this is to incrementally reduce the volume on one channel while incrementally increasing the volume on the other channel so I'd get a kind of fade effect.  Is there a simpler solution to this using only Javascript?  I guess another solution would be to reduce the volume to a certain point, start the new audio file on the same channel, then increase the volume again.  This circumvents the need for fading, but I would like to fade if at all possible.</p><p>Is this possible?  I know the HTML5 spec isn't finished yet, but is there some kind of workaround that you know of?  Do any of you have ideas for another approach?</p><p>From what I can tell from this post about <a href=""http://stackoverflow.com/questions/3069124/playing-html5-audio-in-android-browser"">playing audio in the Android browser</a>, this isn't supported yet, but do any of you know if it will support multiple channel audio once the audio tag is supported?  Does opera mini support this?</p>","538551","","","","","2013-03-28 23:12:05","Multi-channel audio support in the browser on iOS and Android","<javascript><android><html5><ios><audio>","3","3","2","",""
"4445870","1","","","2010-12-15 01:11:03","2","823","<p>I'm new to Android but I have some Java knowledge and I've started reading the Android documentation and some book but I'm in the very beginning. But even if I've read more, it would be hard to know the recommended way to do what I want without real experience in Android programming...</p><p>What I need is to have some kind of surface where I can paint/draw/whatever lots of images, probably PNGs with transparency. I need to be able to pan around and zoom this surface with all those images. I also need to be able to click on any of those images and know which one was clicked.</p><p>I've been reading the <a href=""http://blogs.sonyericsson.com/developerworld/2010/05/18/android-one-finger-zoom-tutorial-part-1/"" rel=""nofollow"">One Finger Zoom Tutorial</a> from Sony Ericsson developers and it looks like a good solution for what I want to do. But I'm a little confused because that code is for a single bitmap image and I need to have lots of them drawn on some surface/canvas.</p><p>I'm thinking of two ways to accomplish this:</p><ol><li>Adapt the code somehow so I can draw each image on the <code>Canvas</code> (from <code>onDraw()</code>) but that's where I'm confused, I don't see how can I accomplish this cause the current code is simple for a single image, there's not much to account for.</li><li>Overlay all my images into a single bitmap and use that bitmap as a background for the <code>Canvas</code> (once again, from <code>onDraw()</code>). I could save those images position in the <code>Canvas</code> into an Array or something and use that as reference to see if the user clicked in any of them. I suppose this is possible this way?</li></ol><p>So, in reality, here's what I'm asking:</p><ul><li>If the first described method above is better, please help me understand how can I achieve such a thing.</li><li>If the second one is better, could you give me some hints how can I overlay all those images, save their positions and detect them with a touch event?</li><li>If there's a better a way to handle all this, I would love to hear about it.</li></ul><p>This is for a very basic game I'm thinking of developing and before you go that way, OpenGL is too much for what I need and I want to take one step at a time. First learn Android programming and someday learn OpenGL.</p>","40480","","40480","","2010-12-15 01:33:02","2011-06-21 09:18:56","How to paint lots of images in some kind of surface with pan/zoom?","<android><image><zoom><pan>","4","0","1","",""
"4445918","1","4445949","","2010-12-15 01:24:04","0","224","<p>ok so im making a lovely little app for my phone that will let me convert bases. This would make my APCS homework much better and provide me some practical and useful coding experience.</p><p>I see lots of questions concerning the time and date pickers but that is not what i am looking for. For example, on iOS, if you press on something that is almost like a dropdown menu you can scroll through the selections and choose which one you want. Any ideas?</p>","533108","","","","","2010-12-15 01:29:18","Picker for numbers","<android>","1","0","","",""
"4445944","1","","","2010-12-15 01:28:40","11","3298","<p>As far as I know, the <a href=""https://play.google.com/store/apps/details?id=com.facebook.katana"" rel=""nofollow"">Facebook app for android</a> only supports a basic intent. </p><p>Does anyone know of an authoritative list of intents for facebook? It would be nice if you could just have a <em>like</em> intent. </p>","420259","","1097104","","2012-03-24 09:08:14","2014-01-31 07:03:40","What Intents does the Facebook Android app support","<android><facebook><android-intent><facebook-like><apk>","1","3","4","",""
"4446014","1","4446028","","2010-12-15 01:45:28","14","6137","<p>Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.Is there anything I can do to solve it?Thanks</p>","542792","","194753","","2011-10-07 15:12:17","2012-11-17 02:55:57","Logcat is often out of work","<android><logcat>","6","1","","",""
"4446056","1","","","2010-12-15 01:54:48","0","2300","<p>This is a rather odd issue which I can't seem to solve no matter how many times I stare at it (so it probably has an obvious answer). The issue is that when I have my RelativeLayout/ActionBar in the layout XML doc, the ListView below doesn't want to show up on screen when debugging. Here's my XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;RelativeLayout     android:orientation=""horizontal"" android:layout_width=""fill_parent""    android:layout_height=""50dip"" android:background=""#4a8bcc"" android:id=""@+id/relLayout"" &gt;    &lt;TextView android:layout_width=""wrap_content"" android:layout_centerVertical=""true""            android:textSize=""7pt""            android:textColor=""#ffffff""            android:textStyle=""bold"" android:layout_height=""wrap_content""            android:text=""List"" android:padding=""8dp"" /&gt;     &lt;!-- A dividing line --&gt;    &lt;ImageView android:layout_width=""1px"" android:src=""#ffffffff""            android:layout_height=""wrap_content"" android:text=""@string/hello""            android:id=""@+id/bordertwo"" android:layout_toLeftOf=""@+id/refresh""            android:layout_marginRight=""12dip"" android:layout_alignParentBottom=""true""            android:layout_alignParentTop=""true"" /&gt;    &lt;!-- share button --&gt;    &lt;ImageView android:layout_width=""25dip"" android:src=""@drawable/ic_title_share_default""            android:layout_height=""25dip"" android:text=""@string/hello""            android:layout_marginRight=""12dip"" android:layout_centerVertical=""true""            android:id=""@+id/refresh"" android:layout_toLeftOf=""@+id/borderone""            android:scaleType=""fitXY"" /&gt;    &lt;!-- A dividing line --&gt;    &lt;ImageView android:layout_width=""wrap_content"" android:src=""#ffffffff"" android:layout_height=""wrap_content""            android:id=""@+id/borderone"" android:layout_alignParentTop=""true""            android:layout_marginRight=""12dip"" android:layout_alignParentBottom=""true""            android:layout_alignBottom=""@+id/search"" android:text=""@string/hello""            android:layout_toLeftOf=""@+id/search"" /&gt;    &lt;!-- Add friend --&gt;    &lt;ImageView android:src=""@drawable/ic_title_add_default"" android:text=""@string/hello""            android:layout_width=""25dip"" android:layout_alignParentRight=""true""            android:layout_centerVertical=""true"" android:id=""@+id/search""            android:layout_marginRight=""12dip"" android:layout_height=""25dip""            android:scaleType=""fitXY"" /&gt;&lt;/RelativeLayout&gt;&lt;LinearLayout     android:orientation=""horizontal"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:background=""#4a8bcc"" android:id=""@+id/linLayout""     android:visibility=""visible""&gt;    &lt;ListView android:id=""@+id/ListView01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks for trying to help!</p>","219196","","","","","2010-12-15 02:22:08","ListView Not Showing Below RelativeLayout","<android><xml><listview><android-layout>","2","0","","",""
"4446105","1","4446489","","2010-12-15 02:05:04","9","5572","<p>Suppose I have 2 XML files and my activity will setContentView the appropriate one based on some button press from the user. Is it possible to change the transition animation for the changing of content view?</p><p>So far I see super.overridePendingTransition() which is suitable for starting new activities, however my example does not start a new activity, it just changes the layout in the current one.</p>","490703","","","","","2012-07-12 09:41:44","is it possible to do transition animations when changing views in the same activity?","<android>","2","0","4","",""
"4446182","1","","","2010-12-15 02:28:30","0","539","<p>I am working on Android GPS library. I need to create a separate thread in the library that keeps running continuously after creating client and server sockets.</p><p>Similarly I create sockets in the Java application that sends values to the library code on user interaction.</p><p>How do I create such socket in GPS library and in the application so that they keep running continuously? Basically I want the socket in GPS library in different thread so that it never stops.</p><p>Eagerly waiting for your replies....</p>","308131","","","","","2010-12-15 04:38:17","How to create server and client socket on a single different thread","<android><sockets>","1","3","","",""
"4446256","1","4446282","","2010-12-15 02:42:34","4","12818","<p>Has anyone been successful with hooking up a Samsung Galaxy S (I9000) with ADB running on Win 7? Links to already existing threads or tutorials related to this would be much appreciated! Thanks!</p>","351723","","","","","2012-12-12 11:12:39","Android adb doesnt recognize Samsung Galaxy S (I9000) on Windows 7 64 bit","<android><windows-7><64bit><adb>","3","1","","",""
"4446312","1","","","2010-12-15 02:54:36","4","7576","<p>I am trying to get the SMS center number of a phone programmatically in android. Is that possible ? I have tried searching but found nothing concrete. Can anyone help ?</p><p>Thanks</p><p>-ahsan :)</p>","342925","","","","","2010-12-15 04:27:32","how to get the smsc number of a phone in android?","<android><sms>","1","1","","",""
"4446428","1","4448678","","2010-12-15 03:28:12","0","237","<p>I am playing around Smack for android - writing a chat client using xmpp protocol. I used patched Smack from here <a href=""http://people.apache.org/~dims/android/XMPPClient-2.zip"" rel=""nofollow"">http://people.apache.org/~dims/android/XMPPClient-2.zip</a><br>Yesterday, I could chat from my phone (with an jabber.org account) to an gmail account, and it worked well for several times connect/disconnect in about 30 minutes. But today I came into office, tried to chat again - and it just doesn't work. It's weird. Have anyone ever met that problem ?  </p><p>Best,Son</p>","424721","","","","","2011-05-23 14:03:11","Android smack stops working","<android><smack>","1","0","","",""
"4446469","1","4446605","","2010-12-15 03:38:05","0","7975","<p>I'm using aidl to answer call automagically, code as following:</p><pre><code>ITelephony.Stub.asInterface(ServiceManager.getService(""phone""))    .answerRingingCall();</code></pre><p>I import ServiceManager.class</p><pre><code>import android.os.ServiceManager;</code></pre><p>but there's a problem:The import android.os.ServiceManager cannot be resolved</p><p>How can I make it work? Thanks</p>","542792","","","","","2012-10-26 07:39:55","The import android.os.ServiceManager cannot be resolved","<android><aidl>","2","0","1","",""
"4446560","1","4446614","","2010-12-15 04:03:25","0","121","<p>I cannot figure out why it's throwing a NullPointerException on line 28, which is <code>return mClasses.size();</code> and I cant figure out why, Any Ideas?</p><pre><code>private ArrayList&lt;String&gt; mClasses;    public int size;    public mAdapter(Context context,ArrayList&lt;String&gt; classes,ArrayList&lt;Integer&gt; checked) {        mInflater = LayoutInflater.from(context);        mClasses = classes;        mChecked = checked;    }    public int getCount() {        return mClasses.size();    }..etc}</code></pre>","481082","","","","","2010-12-15 04:11:19","List View problem","<android><listview>","2","4","","",""
"4446592","1","4446684","","2010-12-15 04:08:37","1","3800","<p>Are there any e-books out there on the topic of OpenGL in Android?</p>","478700","","1228","","2013-08-02 14:54:48","2013-08-02 14:54:48","Android OpenGL e-books?","<android><opengl-es>","1","0","","2011-09-19 06:17:10",""
"4446678","1","4450332","","2010-12-15 04:25:52","2","848","<p>I have a simple application with two views, one is a TableView and the other is ListView.  I use GestureDetector to detect the swipes across the screen similarly to how it is done <a href=""http://stackoverflow.com/questions/4030389/how-to-implement-fling-in-android-listview"">here</a>.   Everything works OK, if the list view is populated with just a few items,  however when the ListView fills up the whole screen the gesture detection stops working.  Doing the swipe across the screen simply shows highlights one of the list items.   </p><p>I think this is happening because ListView somehow steals the touch events from the GestureListener.  Is there a way to prevent this?</p>","186099","","","","","2012-11-09 10:44:17","Gesture detector doesn't work with scrollable list activity","<android><gesture-recognition>","2","0","1","",""
"4446695","1","4446746","","2010-12-15 04:29:00","2","524","<p>I am using eclipse as IDE for android programming. I have update android SDK to API 9. these are installed on my laptop.</p><p>Now, I want to transfer all of these to my PC. On my PC, I didn't have eclipse and SDK. </p><p>My question is, may I copy folders of eclipse and SDK from laptop and paste it on my PC? can I use it and create new project after this?</p><p>Thanks</p>","513413","","","","","2010-12-15 06:42:26","Android: Is it possible to cut/paste android SDK and use it?","<android><installation>","4","2","","",""
"4446752","1","4454192","","2010-12-15 04:40:17","3","1231","<p>I am using the InstrumentationTestCase class in order to unit test some things within an activity.</p><p>I need to be able to check the SharedPreferences's contents and edit them, before this activity is launched.</p><p>I cannot use the setUp method to create the Activity and access it's SharedPreferences object to edit it, and then close that activity before finishing the setUp method because it apparently is locking the tests processing.</p><p>I also cannot access the SharedPreferences after I have launched the activity inside the test because as soon as the Activity is launched, it will already change the SharedPreferences object and act according to it, before I had the chance to get it's reference.</p><p>I apparently cannot access the SharedPreferences before either, because I have no Activity object... and as soon as I do, it is already executing code and being launched...</p><p><strong>So, my question is, is there any way to access the SharedPreferences (and any other Activity information) of this Activity before I have the Activity actually created through an Intent?</strong></p><p>I cannot change it to an ActivityInstrumentationTestCase2 because my test uses a second activity in it's process, so I can't just change to this class and use it's setUp() method to access the SharedPreferences.</p>","371388","","","","","2010-12-15 19:48:42","Accessing Activity before it starts","<android><junit>","3","0","2","",""
"4446811","1","4446910","","2010-12-15 04:53:17","10","13328","<p>How can I get the Latitude and Longitude values of a particular location that I have long clicked on the map in Android?</p>","267269","","41116","","2011-09-14 07:39:46","2014-04-10 06:00:12","How to get the Latitude and Longitude on Map in Android?","<android><google-maps><android-mapview>","3","0","2","",""
"4446821","1","","","2010-12-15 04:55:20","3","1514","<p>I have an Android application that uses the SAX parsers to extract data from an XML file. Some of the data is found within some CDATA tags and sometimes contains newline characters. Those newline characters are being removed during parsing. How do I preserve them?</p><p>By the way, I thought I found an answer <a href=""http://stackoverflow.com/questions/3401111/preserve-newlines-when-parsing-xml"">here</a>, but placing ""&amp;#xA;"" inside a CDATA tag will only result in getting a ""&amp;#xA;"" when I parse it.</p><p>Does anyone have any suggestions?</p><p>Thank you.</p>","398641","","","","","2010-12-15 05:45:09","Android SAX Parsing: How to Preserve Newlines from within a CDATA Tag","<android><xml><newline><sax><saxparser>","1","1","","",""
"4447022","1","","","2010-12-15 05:38:16","2","5232","<p>how to read image from particular url  in android?</p>","538626","","","","","2013-04-24 13:37:10","how to read image from particular url in android","<android><http><url>","3","1","","",""
"4447052","1","4447427","","2010-12-15 05:43:37","1","370","<p>I am writing an IMS application over LTE such that, the MT should take the P-CSCF address it gets while performing an LTE Attach procedure, if it doesn't get any P-CSCF address in the Attach procedure then it should take the P-CSCF address that is present in the ISIM, i.e., the pre-configured one.I am able to extract the P-CSCF address from the LTE Attach Procedure response, but I am unable to find a mechanism using which i can access the information in ISIM. Is there a set of APIs to access ISIM? If not, how should i go about it?</p><p>Thanks,Mayank.</p>","138462","","","","","2011-11-14 00:08:49","Accessing ISIM information on Android","<android>","1","0","","",""
"4447053","1","4447411","","2010-12-15 05:43:39","0","1385","<p>I am new to Android and I just started creating an application.I want to place a back ground image for my app.What is the width and height of the image that I've to use so that it works on all the devices.</p>","265341","","","","","2010-12-15 06:47:14","android - Screen resolution for the app","<android><screen-resolution>","2","0","2","",""
"4447103","1","4453949","","2010-12-15 05:53:09","7","3777","<p>Can we create PDF file from android application, do any libraries available to do so. </p>","515616","","296677","","2010-12-15 14:22:57","2013-02-08 09:23:14","create PDF file from android","<android><pdf>","2","0","2","2013-06-30 13:24:35",""
"4447118","1","4447509","","2010-12-15 05:55:57","2","244","<p>How to make the Map routing in the Android 1.5 sdk.</p><p>Is the Map routing available for the Android 1.5?<br>Is the Map routing available for the Blackberry 5.0?</p>","430278","","75204","","2010-12-15 16:06:19","2010-12-15 16:06:19","Map Routing - For Android 1.5 and Blackberry 5.0","<android><blackberry>","1","0","1","",""
"4447145","1","4457225","","2010-12-15 06:00:59","12","6565","<p>I have just used proguard, but classes I am trying to instantiate via reflection are not working.</p><p>I have an interface</p><pre><code>Algorithm</code></pre><p>I pass classes like this</p><pre><code>AlgorithmFactory.SomeClassThatExtendsAlgorithmImpl.class</code></pre><p>The class is instantiated like this</p><pre><code>public ArrayList&lt;Algorithm&gt; getAlgorithms(Context cnx) {ArrayList&lt;Algorithm&gt; list = new ArrayList&lt;Algorithm&gt;();for(Class&lt;? extends Algorithm&gt; alg: algorithms) {    try {        Constructor&lt;? extends Algorithm&gt; c = alg.getConstructor(Context.class);        list.add(c.newInstance(cnx));    } catch (IllegalArgumentException e) {        Log.e(TAG, ""IllegalArgumentException"", e);        throw new IllegalStateException(""There was a problem creating the Algorithm class"");    } catch (InvocationTargetException e) {        Log.e(TAG, ""InvocationTargetException"", e);        throw new IllegalStateException(""There was a problem creating the Algorithm class"");    } catch (InstantiationException e) {        Log.e(TAG, ""InstantiationException"", e);        throw new IllegalStateException(""There was a problem creating the Algorithm class"");    } catch (IllegalAccessException e) {        Log.e(TAG, ""IllegalAccessException"", e);        throw new IllegalStateException(""There was a problem creating the Algorithm class"");    } catch (SecurityException e) {        Log.e(TAG, ""SecurityException"", e);        throw new IllegalStateException(""There was a problem creating the Algorithm class"");    } catch (NoSuchMethodException e) {        Log.e(TAG, ""NoSuchMethodException"", e);        throw new IllegalStateException(""There was a problem creating the Algorithm class"");    }}return list;}</code></pre><p>Here is my proguard.cnf</p><pre><code>-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*-keep public class * extends android.app.Activity-keep public class * extends android.app.Application-keep public class * extends android.app.Service-keep public class * extends android.content.BroadcastReceiver-keep public class * extends android.content.ContentProvider-keep public class com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native &lt;methods&gt;;}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep class * implements android.os.Parcelable {  public static final android.os.Parcelable$Creator *;}-assumenosideeffects class android.util.Log {    public static *** d(...);    public static *** v(...);    public static *** i(...);    public static *** w(...);    public static *** e(...);}</code></pre>","248521","","1055764","","2013-07-24 13:07:43","2013-07-24 13:07:43","Proguard and reflection in Android","<java><android><reflection><obfuscation><proguard>","2","1","8","",""
"4447207","1","4447229","","2010-12-15 06:10:40","1","512","<p>I work one application for android audio recording in which i used mediaRecorder    class to record sound.now i have to change that sound to other sounds like cartoon    sound,and i also want when i stop recording it automatically plays sound    I have no idea for that can you please help me out.   Thanks In advance,any help will be appreciated.Thanks</p>","461503","","223391","","2010-12-15 06:11:35","2010-12-15 06:15:38","Android Audio Recording","<android>","1","0","","",""
"4447260","1","","","2010-12-15 06:19:16","-1","600","<p>Give suggestion  which phone having android os is best for testing purpose available in india?</p>","542961","","","","","2010-12-15 06:38:22","best 3 android phone available in india for application developer (testing purpose)?","<android>","4","0","","",""
"4447312","1","","","2010-12-15 06:27:37","0","4722","<p>i want to lock the phone when i click the lock button.anybody please help with simple code.i tried with part of code from  API_Demos but it shows some error.</p>","402980","","","","","2013-08-30 08:28:58","how to lock the android programatically","<android><locking>","3","2","1","",""
"4447430","1","","","2010-12-15 06:50:46","0","676","<p>I am trying to push the sliders to the right margin but every attempt leaves them about 20dip left of the right margin. </p><p>`</p><p></p><pre><code>&lt;RelativeLayout    xmlns:tabunlock=""http://schemas.android.com/apk/res/com.android.tabunlock""    android:layout_width=""match_parent""    android:layout_height=""match_parent""    android:background=""@drawable/lockscreen_bg""    android:orientation=""horizontal""    android:gravity=""center_horizontal""    android:id=""@+id/root""&gt;</code></pre><p></p><pre><code>&lt;!-- left side --&gt;&lt;RelativeLayout        android:layout_width=""0dip""        android:layout_height=""match_parent""        android:layout_weight=""1.0""        android:layout_marginLeft=""24dip""        android:gravity=""left""&gt;    &lt;TextView        android:id=""@+id/carrier""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_marginTop=""20dip""        android:singleLine=""true""        android:ellipsize=""marquee""        android:gravity=""right|bottom""        android:textAppearance=""?android:attr/textAppearanceMedium""        android:textSize=""22sp""        /&gt;    &lt;!-- ""emergency calls only"" shown when sim is missing or PUKd --&gt;    &lt;TextView        android:id=""@+id/emergencyCallText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_marginTop=""20dip""        android:text=""@string/emergency_calls_only""        android:textAppearance=""?android:attr/textAppearanceSmall""        android:textColor=""@color/white""       /&gt;    &lt;com.android.internal.widget.DigitalClock android:id=""@+id/time""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/carrier""        android:layout_marginTop=""56dip""        android:paddingBottom=""8dip""        &gt;        &lt;TextView android:id=""@+id/timeDisplay""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:singleLine=""true""            android:ellipsize=""none""            android:textSize=""72sp""            android:textAppearance=""?android:attr/textAppearanceMedium""            android:shadowColor=""#C0000000""            android:shadowDx=""0""            android:shadowDy=""0""            android:shadowRadius=""3.0""            android:layout_marginBottom=""6dip""            /&gt;        &lt;TextView android:id=""@+id/am_pm""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_toRightOf=""@id/timeDisplay""            android:layout_alignBaseline=""@id/timeDisplay""            android:singleLine=""true""            android:ellipsize=""none""            android:textSize=""22sp""            android:layout_marginLeft=""8dip""            android:textAppearance=""?android:attr/textAppearanceMedium""            android:shadowColor=""#C0000000""            android:shadowDx=""0""            android:shadowDy=""0""            android:shadowRadius=""3.0""            /&gt;    &lt;/com.android.internal.widget.DigitalClock&gt;    &lt;TextView        android:id=""@+id/date""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/time""        android:layout_marginTop=""6dip""        android:textAppearance=""?android:attr/textAppearanceMedium""        /&gt;    &lt;TextView        android:id=""@+id/status1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/date""        android:layout_marginTop=""6dip""        android:textAppearance=""?android:attr/textAppearanceMedium""        android:drawablePadding=""4dip""        /&gt;    &lt;TextView        android:id=""@+id/status2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/status1""        android:layout_marginTop=""6dip""        android:textAppearance=""?android:attr/textAppearanceMedium""        android:drawablePadding=""4dip""        /&gt;    &lt;TextView        android:id=""@+id/customMsg""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""4.0dip""        android:layout_below=""@id/status2""        android:textAppearance=""?android:attr/textAppearanceSmall""        /&gt;    &lt;TextView        android:id=""@+id/screenLocked""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/customMsg""        android:textAppearance=""?android:attr/textAppearanceMedium""        android:gravity=""center""        android:layout_marginTop=""12dip""        android:drawablePadding=""4dip""        /&gt;</code></pre>                           <pre><code>&lt;!-- emergency call button shown when sim is PUKd and tab_selector is     hidden --&gt;&lt;Button    android:id=""@+id/emergencyCallButton""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:drawableLeft=""@drawable/ic_emergency""    style=""@style/Widget.Button.Transparent""    android:drawablePadding=""8dip""    android:layout_marginRight=""80dip""    android:visibility=""gone""    /&gt;    &lt;com.android.internal.widget.SlidingTab    android:id=""@+id/tab_selector2""    android:orientation=""vertical""    android:layout_width=""wrap_content""    android:layout_height=""match_parent""    android:layout_marginRight=""0dip""    android:layout_alignParentRight=""true""    android:layout_gravity=""right""    /&gt;&lt;com.android.internal.widget.SlidingTab    android:id=""@+id/tab_selector""    android:orientation=""vertical""    android:layout_width=""wrap_content""    android:layout_height=""match_parent""    android:layout_marginRight=""0dip""    android:layout_alignParentRight=""true""    android:layout_gravity=""right""    /&gt;</code></pre><p></p><p>`</p><p>I have added the alignRight=""true"" and adjusted the right margin to zero. That gets me this far but I can't seem to make it all the way.  Anyone have any ideas?</p><p><a href=""http://www.mattstamp.com/android/images/snap20101212_220758.png"" rel=""nofollow"">A screenshot of the problem</a>.</p>","261617","","261617","","2010-12-15 07:08:34","2010-12-15 07:08:34","XML layout issues with landscape lockscreen droid 1","<android>","0","2","","",""
"4447462","1","","","2010-12-15 06:58:42","0","825","<p>I have two text view  first one aligns on the left of parent and contains a single word. the backgroung color of first is different from second one.The next textview contains two lines. I need to display the first line of text to the right of first text view and the second line of text to the bottom of the first text view.</p><p>the view is like this 'Date' is the word and rest is the text in second text view.</p><p><strong>Date</strong> This my new car. Thank u all</p><p>for your advice.</p><p>Thanks in advance.</p>","541442","","","","","2010-12-15 07:56:54","Align text in text view","<android>","1","1","","",""
"4447477","1","4530294","","2010-12-15 07:02:12","101","69033","<p>I have a few files in the <code>assets</code> folder. I need to copy all of them to a folder say /sdcard/folder. I want to do this from within a thread. How do I do it? </p>","481239","","19868","","2010-12-15 07:24:34","2014-03-29 16:35:32","Android: How to copy files in 'assets' to sdcard?","<android><copy><assets>","10","0","54","",""
"4447515","1","4447549","","2010-12-15 07:08:00","1","214","<p>today I upgrade my SDK 2.2 to 2.3. every thing was OK with 2.2 but after upgrading to 2.3 adb.exe couldn't find by the android.</p><p>What should I do?<img src=""http://i.stack.imgur.com/MJcDq.jpg"" alt=""alt text""></p><p>Thanks</p>","513413","","19750","","2010-12-15 07:11:32","2010-12-15 07:13:25","Android: I have problem with SDK after upgrade of that","<android><eclipse-plugin><upgrade><android-sdk-2.3>","1","1","","",""
"4447519","1","4448115","","2010-12-15 07:08:41","0","1677","<p>How can I set up my project for sending crash report using ACRA. I read some posts but am not able to do it.</p><p>I got some details in <a href=""http://code.google.com/p/acra/wiki/ACRAHowTo#Setting-up_your_project"" rel=""nofollow"">http://code.google.com/p/acra/wiki/ACRAHowTo#Setting-up_your_project</a> but it would not work for me</p><pre><code>12-15 14:06:06.221: WARN/System.err(2972): java.net.UnknownHostException: Host is unresolved: spreadsheets.google.com:8012-15 14:08:11.111: WARN/System.err(3050): java.net.UnknownHostException: Host is unresolved: spreadsheets.google.com:8012-15 14:08:11.111: WARN/System.err(3050):     at java.net.Socket.connect(Socket.java:1037)12-15 14:08:11.111: WARN/System.err(3050):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)12-15 14:08:11.121: WARN/System.err(3050):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:145)12-15 14:08:11.121: WARN/System.err(3050):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:67)12-15 14:08:11.132: WARN/System.err(3050):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:821)12-15 14:08:11.151: WARN/System.err(3050):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:807)12-15 14:08:11.151: WARN/System.err(3050):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1150)12-15 14:08:11.161: WARN/System.err(3050):     at org.acra.HttpUtils.doPost(HttpUtils.java:87)12-15 14:08:11.172: WARN/System.err(3050):     at org.acra.ErrorReporter.sendCrashReport(ErrorReporter.java:537)12-15 14:08:11.172: WARN/System.err(3050):     at org.acra.ErrorReporter.checkAndSendReports(ErrorReporter.java:632)12-15 14:08:11.180: WARN/System.err(3050):     at org.acra.ErrorReporter.handleException(ErrorReporter.java:443)12-15 14:08:11.191: WARN/System.err(3050):     at org.acra.ErrorReporter.handleException(ErrorReporter.java:459)12-15 14:08:11.191: WARN/System.err(3050):     at org.acra.ErrorReporter.uncaughtException(ErrorReporter.java:335)12-15 14:08:11.201: WARN/System.err(3050):     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887)12-15 14:08:11.211: WARN/System.err(3050):     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884)12-15 14:08:11.220: WARN/System.err(3050):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","487219","","741249","","2012-05-04 11:07:30","2012-05-04 11:07:30","Android crash reporting using ACRA","<android><acra>","1","0","","",""
"4447533","1","","","2010-12-15 07:11:27","-2","2835","<p>My Question is</p><p>I have a expandable list view. in the expandable list i have  two buttons in each child in the list. Now i can able to add buttons in the child list. But i dont know how to get parent position and child position. with this parent and child values i need to call another activity. I dont know how to use expandablelistadapter and onChildClick method. Can anybody explain with example. Because am new to android.</p>","515810","","","","","2011-02-23 02:21:48","Creating buttons in expandablelistview","<android><button><control><expandablelistview>","2","0","","",""
"4447572","1","4447600","","2010-12-15 07:15:36","2","380","<p>hi i am fresher now i am working android application...tell me how to create widget....</p>","486554","","","","","2010-12-15 07:20:07","what is mean by widget and explain use widget","<java><android><widget>","1","0","","2010-12-16 06:08:07",""
"4447581","1","","","2010-12-15 07:17:04","1","626","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3585556/how-to-send-email-in-android"">How to send email in Android ?</a>  </p></blockquote><p>How to embeded the native email application within android .In that i need 3 buttons SEND,SAVE AS DRAFT,DISCARD with default functionality and TO also auto populate email adresses.Please help me.</p><pre><code>Intent mailIntent = new Intent(android.content.Intent.ACTION_SEND);Intent mailIntent = new Intent(android.content.Intent.ACTION_SEND);            mailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, ""To"");            mailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,""Subject"");            mailIntent.setType(""text/plain"");            mailIntent.putExtra(android.content.Intent.EXTRA_TEXT, mailText.toString());            startActivity(Intent.createChooser(mailIntent, ""Compose Mail""));</code></pre><p>it i take this code the Send button appeares beside Body.but I need the buttons(3)  below the Body(Compose).![alt text][1]</p><p>But I need like this</p><p>![alt text][2]</p>","486216","","486216","","2010-12-15 10:58:32","2010-12-15 10:58:32","Need native email application android?","<android>","0","2","","2012-05-20 23:37:38",""
"4447594","1","4448086","","2010-12-15 07:18:24","2","2612","<p>I've a <em>ScrollView / RelativeLayout / FrameLayout</em> and I inside put programmaticaly some widgets. </p><p>Here is the gui xml :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollViewxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:fillViewport=""true""android:background=""@drawable/fond_app""&gt;  &lt;RelativeLayout  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  &gt;   &lt;TextView   android:id=""@+id/titreAppli""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:text=""My Big Application""    android:textStyle=""bold""   android:textColor=""#9b9b71""   android:textSize=""15dp""   /&gt;   &lt;FrameLayout   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:id=""@+id/out""   android:layout_below=""@id/titreAppli""   /&gt;  &lt;/RelativeLayout&gt;&lt;/ScrollView&gt; </code></pre><p>In the FrameLayout, I put programaticaly another RelativeLayout, and other widgets inside.</p><p>With some widgets (text, image, buttons), I can't scroll. With other (a linearlist with text), I can scroll.</p><p>Why ? Is there a solution ?</p><p>Thanks.</p>","312025","","","","","2012-09-12 09:43:41","ScrollView don't scroll?","<android><android-widget><android-layout>","2","2","1","",""
"4447664","1","4458449","","2010-12-15 07:30:17","5","4846","<p>How to remotely wipe the data from device? </p><p>I have already tried the sample code given in Device administration. In that we can locally wipe all the device data and reset the device to factory settings. </p><p>Given in below link</p><p><a href=""http://developer.android.com/guide/topics/admin/device-admin.html"">http://developer.android.com/guide/topics/admin/device-admin.html</a></p><p>Now i want the code for wiping the data remotely. i.e if the phone is lost, user can wipe phone data remotely. Can anybody help please</p>","363503","","19750","","2011-06-22 03:32:15","2014-02-03 18:53:38","Remotely Wipe Data from device in android 2.2","<android><device-admin>","3","2","3","",""
"4447692","1","","","2010-12-15 07:34:53","13","20113","<p>Is there anyone who tried JDBC connection in android because in Android 2.3 JDBC is supported.</p><p>I have to connect with Mysql without web service.</p><p>I have made application but it gives me error</p><pre><code>public class MysqlConnect extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);System.out.println(""MySQL Connect Example."");Connection conn = null;String url = ""jdbc:mysql://localhost:3306/"";String dbName = ""jdbctutorial"";String driver = ""com.mysql.jdbc.Driver"";String userName = ""root""; String password = ""root"";try {  Class.forName(driver).newInstance();  conn = DriverManager.getConnection(url+dbName,userName,password);  System.out.println(""Connected to the database"");  conn.close();  System.out.println(""Disconnected from database"");} catch (Exception e) {  e.printStackTrace();}}}</code></pre><p>i am getting error in getConnection. error is like java.lang.VerifyError : com.mysql.jdbc.MysqlIO</p><p>Thanks in advance.</p>","543022","","","","","2013-09-17 07:20:23","JDBC connection in Android","<android><jdbc>","4","1","4","",""
"4447766","1","4447800","","2010-12-15 07:44:49","0","1471","<p>this is ma program.in this program on delete button there didnt perform onclick listener please solve this problem or how can i get the id of an particular item.</p><pre><code>    delete = (Button) findViewById(R.id.delete);    delete.setOnClickListener(this);    if(v.equals(delete))    {         new AlertDialog.Builder(ShareFolioEditActivity.this)          .setTitle(""Delete"")     .setMessage(""Are you sure ??? "")             .setNeutralButton(""no"",null)             .setPositiveButton(""yes"", new DialogInterface.OnClickListener() {   public void onClick(DialogInterface dialog, int whichButton) {     delete();                    }})      .show();    }}public void delete(){     db.delete(""sharelist"", ""_id=""+ID, null);   Toast.makeText(this, ""row deleted""+ID, Toast.LENGTH_SHORT).show();   Bundle b=null;   onCreate(b);}</code></pre><p>this is my xml layout</p><p>  </p><pre><code>&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""horizontal""android:padding=""10sp""&gt;&lt;TextViewandroid:id=""@+id/category""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""""android:layout_toRightOf=""@+id/catagory"" /&gt; &lt;/RelativeLayout&gt;</code></pre><p></p><p>please tell me solution</p><p>Thanks</p>","745367","","","","","2010-12-15 07:51:13","how can i delete an item from listview and also database","<android><xml><database>","1","1","1","",""
"4447834","1","4456924","","2010-12-15 07:56:19","3","3398","<p>Working in Android (1.5), I have a hundred or so grayscale images in the form of byte arrays. I want to use the images as alpha masks for drawing solid colors in a Canvas. The images are fixed but the colors can change. I can create Bitmap objects for each image/color combination, but that seems terribly inefficient. What would be a good way to approach this problem, in terms of both memory and speed? (I need to do this many times for each image/color combo.)</p>","535871","","","","","2012-05-05 07:50:33","How to alpha mask a color","<android><image><canvas><alpha><grayscale>","3","0","3","",""
"4447911","1","4448676","","2010-12-15 08:11:56","0","970","<p>I'm starting to work on the next step of my application which requires communication to a server, and more importantly being able to receive information from a server.</p><p>the concept is simple I want to be able from a server to tell the android device of a particular user that there is new informations (and xml file) to run in the application.</p><p>Since I'm completely ignorant in this area of programming my question is simple: </p><p>Can/How can I do that ?</p>","440336","","213269","","2010-12-15 10:03:23","2013-08-27 20:42:08","Android Notify android phone from server","<android><notifications><push><push-notification>","1","6","1","",""
"4448015","1","","","2010-12-15 08:27:02","0","362","<p>I reading frameworks/base/core/java/com/android/internal/app/ResolverActivity.java</p><p>System code:getPackageManager().addPreferredActivity(filter, bestMatch, set,                        intent.getComponent());</p><p>My code:    not work! why?</p><pre><code>private void addPreferredActivity() {    PackageManager packages = getPackageManager();    IntentFilter filter = new IntentFilter(""android.intent.action.MAIN"");    filter.addCategory(""android.intent.category.HOME"");    filter.addCategory(""android.intent.category.DEFAULT"");    ComponentName[] components =        new ComponentName[] {            new ComponentName(""com.android.launcher"", "".launcher""),            new ComponentName(""com.saaa"", "".saaa"")        };    ComponentName activity = new ComponentName(""com.saaa"", "".saaa"");    packages.clearPackagePreferredActivities(""com.saaa"");    packages.addPreferredActivity(filter, 0, components, activity);}</code></pre><p>My english very bad! please everyone help!.</p>","543077","","543077","","2010-12-16 03:10:40","2010-12-16 08:06:32","android2.2 how implements lock srceen? who has carhome.apk source? please give me ones","<android>","0","4","","",""
"4448062","1","4448092","","2010-12-15 08:34:12","0","2486","<p>From readings, I have the height of the soft keyboard with the onSizeChanged method. What I want to do is to display a list in place of the soft keyboard when it is closed, and remove the list when the keyboard is required again.</p><p>The way I'm doing it at the moment is that when a button is pressed, a list will be made visible and the keyboard dismissed using the InputMethodManager. The problem in the button's onClick method, I set the list to be visible, but the keyboard hiding animation is still ongoing. This causes a visible flicker to happen, since the set visible call triggers the layout to be redone, and the list becomes visible while the keyboard is still there, pushing other views out of sight to the top. After the keyboard animation is finished, other views become visible again, this process causes a visible flicker...</p><p>Anyone got any suggestions on how I should approach this??Pulling my hair at the moment, since setting the list visible during onLayout or onSizeChanged doesn't let the list become visible...</p><p>Thanks!!!Dave.</p>","543073","","","","","2010-12-15 08:48:08","How to make view change after keyboard open/close event","<android><keyboard>","1","0","","",""
"4448084","1","","","2010-12-15 08:37:07","3","1406","<p>I used WebViewClient to display web pages in webview and also added back and forward buttons to navigate but it does not work, whenever i click back and forward buttons it does not go intended url instead remains in same url</p><p>Please help me. I am need of it</p>","528965","","528965","","2010-12-15 08:56:20","2012-10-13 11:22:28","android WebView goBack and goForward does not work with WebViewClient","<android>","2","0","","",""
"4448242","1","","","2010-12-15 08:59:35","1","822","<p>I have a listview and my implementation of the CursorAdapter. As apart of my list item I have a delete button. When the user presses thebutton I show a dialog asking for confirmation and if the user pressesok I delete the item from the database. The problem is with refreshingthe listview. I tried calling cursor.requery() andmAdapter.notifyDataSetChanged() (separately or both) but that doesn'thelp. Requery clears the list and it re-appears (without the missingitem) after re-entering the activity. notifyDataSetChanged doesnothing (the item is still on the list) and again it is ok after re-entering the activity. I have managed to make this working afterreloading the whole database:</p><pre><code> //in the dialog:{DBAdapter db = new DBAdapter( getApplicationContext() );db.open();db.deleteTitle( rowid );db.close();//cursor.requery();//mAdapter.notifyDataSetChanged();fillData();}private void fillData() {                try{                db.open();                cursor = db.getAllTitles();                startManagingCursor(cursor);                 mAdapter = new MyIDsListCursorAdapters(this, R.layout.myidsrow,cursor, columns, to);                setListAdapter(mAdapter);                db.close();             }catch (SQLException e){                showDatabaseErrorDialog ();             }         }</code></pre><p>But reloading the whole db seems to be a very expensive task and I'mquite sure there must be a better way to do this.</p><p>I also have another problem - my listview items are defined by arelativelayout. However the layout seems to be ignoring all 'vertical'attributes, like alignParentBottom or centerVertical. I have seen angoogle I/O with Romain Guy and he answered a similar question bysaying we should pass the parent ViewGroup followed by false, to theinflate function, but that still doesn’t solve my problem. Don’t knowwhat is going on here. I solved this by placing my items below someothers and playing with the margin/padding but I don’t really likethat solution. </p>","279670","","","","","2011-06-09 13:58:24","Problem with refreshing listview from a dialog window","<android><database><listview><dialog><refresh>","1","1","","",""
"4448274","1","5744019","","2010-12-15 09:07:53","0","1667","<p>I am trying to load URL inside a WebViewClient as below:</p><pre><code>webview.setWebViewClient(new WebViewClient(){    public boolean shouldOverrideUrlLoading(WebView view, String url) {             view.loadUrl(url);             return true;       }    public void onPageFinished(WebView view, String url)        {    }     public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)       {   } }); webview.loadUrl(articleLink);</code></pre><h2>Problem:</h2><p>Web URL is loading successfully but in some occurrence i got the following errors, at the same time i would like to display Alert Dialog instead of Webview with Error message.</p><p>So can you please let me know ,<strong>How do i handle the following kind of errors:</strong></p><ol><li>""Web page not available"" error</li><li>""Directory listing Denied""</li></ol><p>I have attached the 2nd one's image for your reference:</p><p><img src=""http://i.stack.imgur.com/ftD1i.png"" alt=""alt text""></p>","379693","","","","","2011-04-21 12:21:20","Android - WebViewClient","<android>","1","0","","",""
"4448276","1","4449472","","2010-12-15 09:08:02","0","490","<p>In my application I need to view some data which are accessible with <code>Intent.ACTION_VIEW</code>. Problem is in simple fact that I can't pass to ACTION_VIEW Intent Uri of my data, since data not in file or net resource - they're in encrypted database. I need to either subclass <code>android.net.Uri</code> or find a way and teach ACTION_VIEW accept instead of Uri just simple InputStream. But:</p><ol><li>android.net.Uri can't be subclassed, since Uri() constructor is private</li><li>Intent.ACTION_VIEW accepts only <code>Uri</code> as data (does it?)</li></ol><p>Any ideas how to solve issue?</p>","472270","","472270","","2010-12-15 10:06:52","2010-12-15 11:39:55","Intent.ACTION_VIEW and subclassing android.net.Uri","<android><uri><action><inputstream>","1","0","","",""
"4448355","1","","","2010-12-15 09:18:29","1","1067","<p>I am developing a banking application. We have a binary SMS functionality where the application listens to a specific port for SMS. The application is able to receive SMS but a copy of SMS is also stored in inbox. I do not want the SMS to be stored in inbox. It must be receid only by the application. Can you please help me on how to overcome this issue?</p><p>regards,Chinnadurai</p>","543133","","","","","2012-09-20 13:03:35","Receving binary SMS on port also stores a copy of SMS in inbox","<android><binary><sms>","2","2","1","",""
"4448427","1","4448666","","2010-12-15 09:27:58","1","2485","<p>I have a mapview, with itemizedoverlays, exactly like in the example of android developers guide: <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a></p><p>At that example, when you press on a item, it's showed a dialog with a tittle and a body:</p><pre><code>protected boolean onTap(int index) {  OverlayItem item = mOverlays.get(index);  AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);  dialog.setTitle(item.getTitle());  dialog.setMessage(item.getSnippet());  dialog.show();  return true;}</code></pre><p>ok, it works fine, and i still need to show that dialog, but i need to add A BUTTON, that when i press it it loads a new activity, and maybe some more text lines.</p><p>how can i do it? i can't find nothing on google</p>","479886","","","","","2010-12-15 09:58:51","Can i personalize the onTap() dialog of the items on my googlemapview?? (i wanna add a button on it)","<android><android-mapview>","1","0","","",""
"4448437","1","","","2010-12-15 09:29:15","2","1867","<p>how to work on pagination into gridview in android.provide sample code for this.</p>","543144","","","","","2011-10-24 12:35:34","how to work on pagination into grid view in android?","<android><pagination>","2","0","","2012-08-18 08:05:02",""
"4448473","1","4448755","","2010-12-15 09:34:17","4","3371","<p>I am using a custom overlay on my MapView and I'm trying to imitate the look of the official Google ""Maps"" application when using the GPS and as a result I'm looking for the arrow the application uses to show your bearing.</p><p><em>The closest I've found is <a href=""http://3.bp.blogspot.com/_PiaX_YSoZGA/SujKmuV-uQI/AAAAAAAAAGA/7Zo8BhiBejA/s200/Google+Maps+Navigation.gif"" rel=""nofollow"">this</a> but it's too large, its not an animated GIF like the official one and I'm not sure if I'm allowed to use it or not.</em></p><p><strong>Edit: Just found out that is completely useless because I forgot (obviously) gifs do not have an alpha transparency layer.</strong></p><p>Has anyone had to use this before? Am I going to be forced to make my own?</p>","249390","","249390","","2010-12-15 09:49:15","2010-12-15 10:07:42","Where can I get the ""default"" android arrow graphic for MapView?","<android><maps><android-mapview>","2","1","","",""
"4448512","1","","","2010-12-15 09:39:01","0","60","<p>I entered this code for comparing the records with the database records.it executing but it shows already exists for every entering record (it may be old or new record.)</p><pre><code>boolean ifExisting() {      //Cursor c = db.rawQuery(""SELECT * FROM  sharelist  WHERE  category='""+str1+""'"",null);Cursor c = db.rawQuery(""SELECT * FROM  sharelist  WHERE""  + ""category"" + ""="" + category,null);        Integer a=new Integer(c.getCount());      Log.e(""getcount"",a.toString());         if(c.getCount()&gt;-1)        { return false;}     else{         return true;    }</code></pre><p>please help me.............</p>","541719","","440502","","2010-12-15 09:39:48","2010-12-15 09:47:06","it's not returning the true value","<android><sqlite>","2","0","","",""
"4448546","1","4448578","","2010-12-15 09:43:33","4","1714","<p>How to kill my application after call finish?</p><p>(i can see my app in HTC's phone, but i finished that activity anyway)</p>","472537","","104117","","2010-12-15 10:45:55","2010-12-15 10:45:55","Kill my application after finish","<android><kill>","2","1","","",""
"4448583","1","","","2010-12-15 09:49:34","2","1107","<p>is it possible to somehow get the current scaling factor in javascript on the android browser?</p>","97688","","","","","2012-01-26 15:36:05","android browser: get scale factor","<javascript><android><browser><scaling>","1","0","","",""
"4448611","1","","","2010-12-15 09:52:46","2","325","<p>I want to get the screen size in pixels for the current android phone in JNI  </p>","526359","","","","","2010-12-15 09:52:46","how to get the screen size in android-jni?","<android><jni>","0","1","2","",""
"4448697","1","","","2010-12-15 10:02:47","3","832","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4782543/integration-zxing-library-directly-into-my-android-application"">Integration ZXing library directly into my Android application</a>  </p></blockquote><p>I want scan the barcode from my Android App without installing a 3rd party barcoder scanner application. I downloaded the source code of ZXing. When I click a button in my App, the barcode scanning window should launch. What are the methods that I need to call from my application  for successful scanning of barcodes.</p><p>Can anyone please help me in sorting out this issue?</p><p>Thanks in Advance.</p>","429501","","1512962","","2012-07-16 19:51:23","2012-07-16 19:51:23","Implementing Barcode Scanning Without installing barcode application","<android><barcode><zxing>","0","4","","2013-01-28 17:37:06",""
"4448756","1","","","2010-12-15 10:07:43","0","306","<p>I added a space after ""WHERE"" in my SQL query based on the advice in <a href=""http://stackoverflow.com/questions/4448512/its-not-returning-the-true-value"">my earlier question</a>.<br>However, now my app gets a ""Force Close"".</p><pre><code>Cursor c = db.rawQuery(""SELECT * FROM  sharelist  WHERE "" + ""category"" + ""="" + category,null);</code></pre>","541719","","234938","","2010-12-18 10:00:14","2010-12-18 10:00:14","App gets Force Close upon running an SQL query","<android><sqlite>","2","2","","",""
"4448772","1","4448994","","2010-12-15 10:09:07","2","1194","<p>How to safely delete file content? I mean data should be unrecoverably wiped, so even if someone (intruder) would undelete deleted file, one could find instead of real data just garbage?</p>","472270","","","","","2010-12-15 16:35:01","Safely wipe file content","<android><security><file>","1","0","1","",""
"4448779","1","4456878","","2010-12-15 10:10:04","31","35604","<p>I want to inflate a XML-Layout-File in a custom ViewGroup Class, my Problem is that it produces just a empty screen. Doing the same in the Activity Class works fine. Here is my simple XML-Layout-File: </p><pre><code>shownumberlayout.xml:    &lt;RelativeLayout         xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:background=""#FFFFFF""         android:id=""@+id/layoutForNumber""&gt;        &lt;TextView             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""             android:id=""@+id/tvNumber""            android:layout_centerHorizontal=""true""             android:textColor=""#000000""             android:text=""Test""             android:layout_centerVertical=""true""             android:textSize=""30dip""&gt;        &lt;/TextView&gt;    &lt;/RelativeLayout&gt;</code></pre><p>Here is the working Version, inflating the <code>shownumberlayout.xml</code> in the Activity <code>ShowNumber</code>:</p><pre><code>ShowNumber.classpublic class ShowNumber extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        ViewGroup vg = (ViewGroup) inflater.inflate(R.layout.shownumberlayout, null);        setContentView(vg);    }}</code></pre><p>This shows a White Background with the black Text “Test” centered.</p><p>Now the Version inflating the xml in the Custom <code>ViewGroup</code>-Class:</p><pre><code>ViewGroup.classpublic class ViewNumber extends ViewGroup {    private LayoutInflater inflater;    public ViewNumber(Context context) {        super(context);        // TODO Auto-generated constructor stub        initView(context);    }    public ViewNumber(Context context, AttributeSet attrs) {        super(context, attrs);        // TODO Auto-generated constructor stub        initView(context);    }    public ViewNumber(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        // TODO Auto-generated constructor stub        initView(context);    }    private void initView(Context context){        inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        inflater.inflate(R.layout.shownumberlayout, null);      }    @Override    protected void onLayout(boolean changed, int l, int t, int r, int b) {        // TODO Auto-generated method stub    }}</code></pre><p>ShowNumber.classpublic class ShowNumber extends Activity {    /** Called when the activity is first created. */</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ViewGroup vg = new ViewNumber(this);     setContentView(vg);}</code></pre><p>}</p><p>Im doing it basically like in <a href=""http://stackoverflow.com/questions/3368182/anyway-to-use-xml-layout-files-for-specific-view-viewgroups"">this</a> Answer explained.This just produces a Empty Black Screen. What I am doing wrong?</p><p><strong>UPDATE 1</strong></p><p><strong>@Konstantin</strong>I applied your changes but still just a blank screen, i also made a log-ouput for getting the number of children. It remains always 1, even i add one more Textview to the XML-Layout-File. Before the Changes it remains always 0.</p><pre><code>public class ViewNumber extends RelativeLayout {...private void initView(Context context){        //inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        //inflater.inflate(R.layout.shownumberlayout, null);        View.inflate(context, R.layout.shownumberlayout,this);         Log.v(""ViewNumber"", ""Number of Child: "" + this.getChildCount());//output is 1,before it remains 0    }...}</code></pre><p><strong>@Sankar</strong> This is the Logcat, after the Changes from Konstantin:</p><pre><code>12-16 09:24:23.606: DEBUG/AndroidRuntime(8951): &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-16 09:24:23.606: DEBUG/AndroidRuntime(8951): CheckJNI is OFF12-16 09:24:23.606: DEBUG/dalvikvm(8951): creating instr width table12-16 09:24:23.656: DEBUG/AndroidRuntime(8951): --- registering native functions ---12-16 09:24:23.916: DEBUG/AndroidRuntime(8951): Shutting down VM12-16 09:24:23.916: DEBUG/dalvikvm(8951): Debugger has detached; object registry had 1 entries12-16 09:24:23.916: INFO/AndroidRuntime(8951): NOTE: attach of thread 'Binder Thread #3' failed12-16 09:24:24.076: DEBUG/AndroidRuntime(8960): &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-16 09:24:24.076: DEBUG/AndroidRuntime(8960): CheckJNI is OFF12-16 09:24:24.076: DEBUG/dalvikvm(8960): creating instr width table12-16 09:24:24.126: DEBUG/AndroidRuntime(8960): --- registering native functions ---12-16 09:24:24.376: INFO/ActivityManager(78): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.customview.harold/.ShowNumber }12-16 09:24:24.426: DEBUG/AndroidRuntime(8960): Shutting down VM12-16 09:24:24.426: DEBUG/jdwp(8960): Got wake-up signal, bailing out of select12-16 09:24:24.426: DEBUG/dalvikvm(8960): Debugger has detached; object registry had 1 entries12-16 09:24:24.456: INFO/AndroidRuntime(8960): NOTE: attach of thread 'Binder Thread #3' failed12-16 09:24:24.456: VERBOSE/ViewNumber(8923): Number of Child: 112-16 09:24:24.496: VERBOSE/RenderScript_jni(164): surfaceDestroyed12-16 09:24:24.526: INFO/ActivityManager(78): Displayed activity org.customview.harold/.ShowNumber: 104 ms (total 104 ms)12-16 09:24:24.576: DEBUG/dalvikvm(158): GC_FOR_MALLOC freed 10631 objects / 526248 bytes in 52ms12-16 09:24:34.606: DEBUG/dalvikvm(164): GC_EXPLICIT freed 1776 objects / 106960 bytes in 91ms</code></pre><p><strong>UPDATE 2</strong></p><p>The Content is finally showing correctly up.The missing thing was to override the Method <code>onLayout</code> (thanks to <strong>Franco</strong>) in the RelativeLayout-Sublcass:</p><pre><code>public class ViewNumber extends RelativeLayout {...    @Override            protected void onLayout(boolean changed, int l, int t, int r, int b) {                // TODO Auto-generated method stub                for(int i = 0 ; i &lt; getChildCount() ; i++){                    getChildAt(i).layout(l, t, r, b);                }            }...}</code></pre><p>Note: Later you should also override the Method <code>onMeasurement()</code>, but currently the content is also showing correctly without overriding it.</p><p>Now the solution for the Method <code>initView</code> from <strong>Franco</strong> do not align the TextView in the Center, but puts it in the top left corner. The solution from <strong>Konstantin</strong> puts it correctly in the Center of the View:</p><pre><code>public class ViewNumber extends RelativeLayout {...private void initView(Context context){        View.inflate(context, R.layout.shownumberlayout,this);     }...}</code></pre>","275595","","275595","","2010-12-16 05:18:06","2013-06-18 14:19:06","How to inflate XML-Layout-File correctly inside Custom ViewGroup?","<android><android-layout>","3","3","12","",""
"4448783","1","4448903","","2010-12-15 10:10:31","0","288","<p>I my application I have a background music that plays when the program starts. In menu I want to add option that user have ability to stop or start the music.</p><p>How can I know that the music is playing or stop?</p><p>Thanks</p>","513413","","","","","2010-12-15 10:31:06","Android: How can I toggle music?","<android><music><stop>","1","0","","",""
"4448926","1","","","2010-12-15 10:29:04","0","613","<p>I have developed a application which have obfuscated by ProGuard, <a href=""http://www.androidengineer.com/2010/07/optimizing-obfuscating-and-shrinking.html"" rel=""nofollow"">learn from this tutorial</a>.</p><p>But the problem is when I click the ""Home"" button to go back the wallpaper screen (the screen have ur clock and shortcur or widget). Then when i click my application to resume back (my app didn't close before), it will restart a new activity and not resume to my previous activity and then crash!I have test it before obfuscate, the application was prefect.</p><p>Your reply is very appreciated. Thank you.</p><p>P/S: sorry about my bad english, hope you guys understand what I'm talking about. Thanks</p>","409419","","","","","2011-04-18 16:52:50","app not resume and reopen a new activity after obfuscated by ProGuard","<android><obfuscation>","1","4","","",""
"4449079","1","","","2010-12-15 10:49:24","1","1023","<p>how to contact Android technical Support team?</p><p>Any e-mail???</p>","528965","","","","","2010-12-15 10:59:18","Android Technical Support team Contact","<android>","1","1","","2010-12-15 11:18:11",""
"4449099","1","","","2010-12-15 10:52:06","2","1010","<p>My code: </p><pre><code>@Override public void onUpdate(Context context, AppWidgetManager appWidgetManager,   int[] appWidgetIds) {  Intent active = new Intent(context, DialerWidget.class);  active.setAction(ACTION_WIDGET_RECEIVER);  active.putExtra(""com.anirudha.android.appwidget.Number"", currentNumber);  PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context,    0, active, 0);  views.setOnClickPendingIntent(R.id.one,    actionPendingIntent);  views.setTextViewText(R.id.number, currentNumber);  appWidgetManager.updateAppWidget(appWidgetIds, views); }        @Override        public void onReceive(Context context, Intent intent) {  if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)) {   currentNumber = intent.getStringExtra(""Number"");   currentNumber += ""1"";     Intent active = new Intent(context, DialerWidget.class);   active.setAction(ACTION_WIDGET_RECEIVER);   active.putExtra(""com.anirudha.android.appwidget.Number"", CurrentNumber);   active.putExtra(""com.anirudha.android.appwidget.Key"", ""1"");   PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context,      0, active, 0);   views.setOnClickPendingIntent(R.id.one,      actionPendingIntent);   views.setTextViewText(R.id.number, currentNumber);   ComponentName cn = new ComponentName(context.getPackageName(),      DialerWidget.class.getName());   AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);   appWidgetManager.updateAppWidget(cn, views);   Toast.makeText(context, currentNumber, Toast.LENGTH_SHORT).show();     }   super.onReceive(context, intent); }</code></pre><p>So, basically i want to change the extras i should receive with the Intent. But whenever the button is pressed i receive the same value with the Intent. I'm new to android development. Any help would be appreciated. Thanks</p>","541864","","","","","2011-09-05 10:38:27","Updating extras in an intent in app Widget in Android","<android><android-intent><appwidget>","1","0","1","",""
"4449163","1","4449222","","2010-12-15 11:00:08","0","520","<p>there is one ""icu4c"" project at android platform (external/icu4u)any one know how to use this in my android application?I want to do some conversion, ec. unicode->big5, ...?</p>","206630","","","","","2010-12-15 11:06:05","use icu4c in Android Application","<android>","1","0","","",""
"4449260","1","","","2010-12-15 11:10:08","1","735","<p>How would one access the WIFI HotSpot function on a Samsung Galaxy S phone.</p><p>It's Android 2.1 - so they seem to have a custom implementation, or is it a backport from 2.2?</p><p>I wonder whether there is an API or some low level system modification that needs to be done.</p>","375209","","","","","2012-05-24 19:59:20","Samsung Galaxy S - access WIFI HotSpot Function","<android><hardware>","0","1","1","",""
"4449387","1","","","2010-12-15 11:29:31","3","1079","<p>In the webview, one page from url is loaded.and in that page, a button for browse file is there in the name ""choose file"".When the user clicks the button, the app should show the gallery to select a file and retrieve it to that page as input.how can i implement this?</p>","","user466730","","","","2011-03-11 19:15:22","choose a file from device and upload it to page loaded in the webview","<android><eclipse><browser><android-emulator>","1","0","3","",""
"4449416","1","","","2010-12-15 11:32:41","5","4241","<p>Is it possible pagination in android gridview? if it is available can you provide any link.</p>","515810","","218196","","2012-05-09 12:29:53","2013-03-17 13:34:30","android pagination in gridview","<android><gridview><pagination>","1","2","","",""
"4449453","1","","","2010-12-15 11:36:45","3","2736","<p>I am new to facebook implementation in android. I am trying to implement facebook in my android application. I implemented using facebook-android-sdk in first activity. I want the same in the second activity also. Second activity facebook publish button is not working even though  i already logged in the first activity and giving some error. It's working well if i login in the second activity also. I was fed up with this problem.</p><p>The same thing happening vice versa.( from second to first ) Can I work with unique session?</p><p>I want login facebook in one activity and post(publish) in anyone of other activities.</p><p>My code is as fallowing in the first activity,</p><p>mFacebook = new Facebook();        mAsyncRunner = new AsyncFacebookRunner(mFacebook);</p><pre><code>    SessionStore.restore(mFacebook, this);    SessionEvents.addAuthListener(new SampleAuthListener());    SessionEvents.addLogoutListener(new SampleLogoutListener());    mLoginButton.init(mFacebook, PERMISSIONS);    mPostButton.setOnClickListener()</code></pre><p>{// some code to post a comment}</p><p>I written the same in 2nd activity also.Immediate Help Required Please.</p><p>Thanks and Regards,</p><p>Kiran </p>","416143","","","","","2011-06-09 10:03:41","How to get Facebook Session in second activity In Android?","<android><android-layout>","1","0","3","",""
"4449540","1","4449613","","2010-12-15 11:46:52","95","27957","<p>when I tried to update my applcation with new version that has same signature as previous one, shows above error.</p><p>What I am missing?</p>","482604","","512507","","2012-12-23 23:28:09","2012-12-23 23:28:09","Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application","<android><install>","3","0","14","",""
"4449564","1","","","2010-12-15 11:50:20","4","6486","<p>i am try to lock the device using DeviceAdminReceiver and try to enable administration like following:</p><pre><code>if (!mDPM.isAdminActive(mDeviceAdminSample)) {  Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN)  intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminSample);  intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, ""Additional text explaining why this needs to be added."");   startActivity(intent); }</code></pre><p>and getting error something like the following:</p><blockquote>  <p>ERROR/Error(1022):  java.lang.SecurityException: No active  admin owned by uid 10045 for policy #3</p></blockquote><p>kindly give me some code solutions and how to enable the administration permission.</p>","543306","","66873","","2014-02-24 06:57:49","2014-02-24 06:57:49","Lock device using DeviceAdminReceiver","<android><device-admin>","2","1","1","",""
"4449605","1","","","2010-12-15 11:55:06","0","317","<p><br>is there a way to determine the color model of a Bitmap image? I went through the Android documentation but I wasn't able to find anything.</p><p>Thanks in advance!</p>","389262","","","","","2010-12-15 11:55:06","How can I determine the color model of a Bitmap image?","<android><bitmapimage>","0","3","","",""
"4449758","1","","","2010-12-15 12:16:36","5","3108","<p>I want to integrate the Facebook Like button in my android application.</p><p>Please tell me Steps how to integrate it in Android.</p>","543326","","114066","","2010-12-15 12:23:31","2010-12-15 12:27:34","Facebook Like button Integration in Android","<android><facebook>","1","1","1","",""
"4449854","1","","","2010-12-15 12:26:50","1","5685","<p>I am implementing progressbar in my android app. In my app i want to display progressbar when images are loading from the web after loading all images the loader should be stopped.</p><p>I seen some example of progressbar in that it is displaying for predefined period of time. But i want the progressbar display  dynamically depends on the time to load images from the web.</p>","524787","","114066","","2010-12-15 12:28:07","2010-12-15 13:15:25","How to display Progressbar When data is loading from the web?","<android><android-widget>","3","0","1","",""
"4449864","1","4506059","","2010-12-15 12:27:59","2","3265","<p>Is there any way in which I can pass/get an object of android context in my ndk appliation. I want to use SharedPreferences in my ndk application via jni interface. To get an instance of SharedPreferences object, I need to call getSharedPreferences() on context object. But I do not have access to the context object.</p><p>OR </p><p>How can I read and write an xml file from NDK ?</p><p>Any pointers will be appreciated.</p>","248132","","","","","2010-12-22 04:25:40","Access android context in ndk application","<android><android-ndk>","1","3","1","",""
"4449916","1","4450481","","2010-12-15 12:35:43","0","1644","<p>Can anyone tell me if there is any way to add current activity to Activity Stack (Activities history). I have situation as following:</p><ol><li>user starts new activity - A (which I don't want to put on stack)</li><li>user starts new activity (B) from A</li><li>user presses BACK button from B</li><li>B is gone, but A is gone also</li></ol><p>When user starts activity B, I want to keep A in history to be able to move back with BACK button.</p><p>The only thing I have in my mind is to starts new activity A from B in onKeyDown() method. But maybe is there a better way?</p>","419308","","213269","","2010-12-21 16:43:01","2010-12-21 16:43:01","How to add current activity to Activity Stack","<android><activity>","3","1","","",""
"4449955","1","4449988","","2010-12-15 12:40:34","3","22883","<p>I am using following code in my ListActivity</p><pre><code>// a separate class in projectpublic class MyActivity extends ListActivity {    // some common functions here..}public class SelectLocation extends MyListActivity {    public void onCreate(Bundle savedInstance) {        // here.....    }    @Override    protected void onDestroy() {        super.onDestroy();        if (adap != null) adap = null;        if (list != null) list = null;        System.gc();    }}</code></pre><p>any one guide me why <code>onDestroy</code> method is not called in my code?</p>","249991","","281545","","2013-07-22 21:35:31","2013-07-22 21:35:31","Activity OnDestroy never called?","<android><ondestroy>","3","1","0","",""
"4449980","1","4509392","","2010-12-15 12:43:10","0","701","<p>i could need some help with that. here is the problem and what i have done until now.</p><p><strong>problem:</strong></p><p>i want to play a pcm file that i recorded before. as this file can be larger, i play it by using audiotrack. this works quite nice. but i dont want the activity to freeze. i already tried thread and so on, now im working on the asynctask but the activity still is not responding.</p><p><strong>this is what i got:</strong></p><p>in the ui activity, i create a new waveplayer object and try to run it.</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    /**     * Handles ShortClicks for ListView     */    OnItemClickListener itemlistener = new OnItemClickListener(){        MediaPlayer mp=null;        String currentlyplaying = null;        @Override        public void onItemClick(AdapterView&lt;?&gt; adaptview, View clickedview, int position,                long id) {            String pathtofile = (String) adaptview.getItemAtPosition(position);            if(pathtofile.contains("".wav""))            {                //HQ!                if(mp==null)                {                    clickedview.setSelected(true);                    try                    {                        WavePlayer t = null;                        //TODO: //add thread waveplayer to play file!                        try {                            t = new WavePlayer(pathtofile);                            t.execute((Void)null);                        } catch (Exception e) {                            // TODO Auto-generated catch block                            e.printStackTrace();                        }                        clickedview.postDelayed(new Deselector(clickedview, t), 1000);                        currentlyplaying = pathtofile;                    } catch (IllegalArgumentException e) {                        e.printStackTrace();                    } catch (IllegalStateException e) {                        e.printStackTrace();                    }                 }                else                {                }            }            else{                //NO HQ                //you dont need to know that :)            }        }    };</code></pre><p>the class deselector:</p><pre><code>/** * This Runnable tries to deselect the view after playing the audio file. * @author quant * */class Deselector implements Runnable{    View view = null;    AsyncTask thread;    Deselector(View view, AsyncTask t)    {        this.view = view ;         this.thread = t;    }    @Override    public void run() {        // TODO Auto-generated method stub        try {            view.setSelected(false);            thread.cancel(true);        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre><p>everything concerning playback works nice, i can hear my voice and the playback itself works fine... but still the gui in the main activity does freeze/is not responding.</p><p>hope someone can help.</p><p>thanks in advance</p><p>markus</p>","537865","","537865","","2011-02-10 20:43:13","2014-01-15 00:46:23","Using AsyncTask for PCM AudioTrack playback without freezing activity","<android><android-asynctask>","1","3","","",""
"4450216","1","","","2010-12-15 13:10:01","1","522","<p>I have problem with progress bar between two activities. When app loading form one activity to another activity I am getting blank screen for few seconds in my app due to the lazy loading images in the second activity. I want to display the progressbar in that blank screen. How can I do it?</p><p>Thanks and Regards,</p><p>Bhargav</p>","524787","","473070","","2010-12-15 13:16:39","2010-12-15 13:17:56","Blank screen loader in android","<android><android-layout><android-asynctask><progressdialog>","1","0","","",""
"4450347","1","4450405","","2010-12-15 13:25:34","0","345","<p><br>can any one tell me ""how to lauch an 3rd application automatically when the android phone is switched on?"". As I want to launch an application which is written by me when the device is turned on.<br>I will be waiting for any valuable reply . <p>Thanks in Advance,</p>","429501","","","","","2010-12-15 19:23:22","how to lauch an 3rd application automatically when the android phone is switched on","<android>","1","1","2","",""
"4450425","1","","","2010-12-15 13:32:14","3","12387","<p>I use the command: adb devices to list the attached devices. On my computer I get :List of devices attached HT9CTP820988 device</p><p>My question is: how can I get this id (HT9CTP820988) programmatically ?</p>","164460","","","","","2011-05-19 19:03:01","android device ID (not IMEI)","<android><device>","5","0","2","",""
"4450460","1","","","2010-12-15 13:36:13","0","795","<p>When displaying a gallery with lots of large bitmaps (fullscreen, wvga), I quite frequently get out of memory issues. I assume this is related to bitmaps not being recycled. When/how can I force bitmaps to be recycled?</p><p>I also noticed that in the getView method of simpleCursorAdapter, convertView is always null. I assume this means that the old view is not recycled? Even when scrolling back and forth, a new view is created each time. However, scrolling back and forth does not cause out of memory issues, that only happens when the total number of images is large enough.</p><p>When using the same adapter with a ListView, views are recycled, so it seems the problem is with the Gallery.</p><p>What can I do to force views and/or bitmaps to be recycled? What else can I do manage memory without reducing gallery size and bitmap quality.</p>","184844","","","","","2012-10-27 05:29:57","When is it safe/possible to recycle a bitmap in Android SimpleCursorAdapter with Gallery view?","<android><gallery><out-of-memory>","2","1","","",""
"4450517","1","","","2010-12-15 13:42:52","7","13433","<p>In my android app, I want users to ""share"" my app in their wall, so I want them to post a predefined content status on their wall.</p><p>How can I customize the wall status? (I want to add my app icon and some flare text).</p>","258429","","881229","","2014-02-14 18:24:11","2014-02-14 18:24:11","Adding content to Facebook feed dialog from Facebook SDK for Android","<android><facebook><facebook-wall>","4","4","2","",""
"4450562","1","4450617","","2010-12-15 13:48:07","1","1103","<p>how to Restrict users to be able to use only single application in Android device ?That is I write an  3rd party application which is launched after start up of Android phone  and users should not be allowed to access other applications in device.can this be possible in Android?can any one suggest me the possible ways in achieving this?</p><p>Thanks in Advance,</p>","429501","","","","","2012-04-25 08:47:34","Restrict users to be able to use only single application in Android device","<android>","2","1","","",""
"4450734","1","","","2010-12-15 14:05:56","0","1503","<p>I am working on an android project where I have to show a pdf through our project. The pdf is located at some URL (e.g <a href=""http://www.cbwe.gov.in/HTMLEditor1/pdf/sample.pdf"" rel=""nofollow"">http://www.cbwe.gov.in/HTMLEditor1/pdf/sample.pdf</a> ). </p><p>I have to  directly open the pdf without saving it on the phone using android code like browser. In android we can not show pdf in browser. </p><p>How do I do this?</p>","506052","","894284","","2012-05-07 13:14:24","2012-05-07 13:14:24","How to open pdf file from android code directly","<android><pdf>","1","0","","",""
"4450778","1","4465845","","2010-12-15 14:09:30","0","1435","<p>I implemented a ContentObserver and it worked fine. But now everytime the ContentObserver is notified for some changes in the CallLog.Calls content provider, it runs the onChange() method without stopping. </p><p>I'd like that my observer runs once for each item that has changed in the content provider. So, if 5 new items have been added to the CallLog.Calls content provider, the observer must be notified 5 times, and for each notify to the observer, a new call to the onChange() method must happen.</p><p>Here is my code.</p><pre><code>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 Cursor cursor;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.getApplicationContext()            .getContentResolver()            .registerContentObserver(                    android.provider.CallLog.Calls.CONTENT_URI, true,                    new RatedCallsContentObserver(handler));    Log.d(""FILLLIST"", ""calling from onCreate()"");}class RatedCallsContentObserver extends ContentObserver {    public RatedCallsContentObserver(Handler h) {        super(h);    }    @Override    public boolean deliverSelfNotifications() {        return true;    }    @Override    public void onChange(boolean selfChange) {        Log.d(LOG_TAG, ""RatedCallsContentObserver.onChange( "" + selfChange                + "")"");        super.onChange(selfChange);        fillList();    }}private void fillList() {    cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    Log.d(""FILLLIST"", ""Calling from filllist"");    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;();    cursor.moveToFirst();    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,            new RatedCallsContentObserver(handler));    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);    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-07-05 17:51:26","2011-07-05 17:51:26","Android ContentObserver never stopped","<android><android-contentprovider><calllog>","2","0","","",""
"4450804","1","4450875","","2010-12-15 14:12:13","0","2360","<p>I have a mapview, with itemizedoverlays, exactly like in the example of android developers guide: <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a></p><p>on the itemizedoverlay, i have a personalized dialog, with a button. all fine until here, but now i have problems trying to add the functionality to the button. I need that the button start's a new activity, but i can't achieve that.... ¿why? because on this line: <code>i = new Intent (NyItemizedOverlay.class, Locate.class);</code> i have the current Intent class as first parameter, and the target intent class at second parameter.</p><p>MyItemizedOverlay is not a Intent class... it's  ItemizedOverlay extension, then it doesn't compile when i try to launch the intent, i am trying to pass a normal class as first argument, and it needs an intent class. I have to put the launcher class, but the launcher class is not an intent :S</p><p>If i try to put another intent class on the first argument, i got this error: <code>No enclosing instance of the type AllActivity is accessible in scope</code>   .... (AllActivity is a public activity class of my app)</p><p>How i can solve this?</p><p>full code here:</p><pre><code>public class MyItemizedOverlay extends ItemizedOverlay { private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;(); private ArrayList&lt;String&gt; permissions = new ArrayList&lt;String&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 void addOverlay(OverlayItem overlay,String permission) {     mOverlays.add(overlay);     permissions.add(permission);     populate(); } public MyItemizedOverlay(Drawable defaultMarker, Context context) {    //super(defaultMarker);    super(boundCenterBottom(defaultMarker));    mContext = context; } public void clear() {  mOverlays.clear();  permissions.clear();//lista de permisos de cada usuario, ya que hay dos campos, el email (snippet) y el permission, una lista. } protected boolean onTap(int index) {   try{    OverlayItem item = mOverlays.get(index);    if (permissions.size()==0)    {          AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);     dialog.setTitle(item.getTitle());     dialog.setMessage(item.getSnippet());     dialog.show();    }    else    {    //set up dialog    Dialog dialog = new Dialog(mContext);    dialog.setContentView(R.layout.personal_dialog);    dialog.setTitle(item.getTitle());    dialog.setCancelable(true);    //there are a lot of settings, for dialog, check them all out!    //set up text    TextView DialogEmail = (TextView) dialog.findViewById(R.id.DialogEmail);    TextView DialogPermission = (TextView) dialog.findViewById(R.id.DialogPermission);    DialogEmail.setText(item.getSnippet());    DialogPermission.setText(permissions.get(index));    final String userName=item.getTitle();    final String email=item.getSnippet();    final int cont=index;    //set up button    Button button = (Button) dialog.findViewById(R.id.DialogButton);    button.setOnClickListener(new OnClickListener() {     @Override     public void onClick(View v) {      //do something      Bundle bundle = new Bundle(); //bundle is like the letter      bundle.putString (""user"",userName ); //arg1 is the keyword of the txt, arg2 is the txt            bundle.putString (""email"", email);            bundle.putString (""permission"", permissions.get(cont));            Intent i=null;             i = new Intent (MyItemizedOverlay.class, Locate.class);            i.putExtras(bundle);            startActivity(i);     }    });    //now that the dialog is set up, it's time to show it        dialog.show();    }   }catch(Exception e){}   return true; }}</code></pre>","479886","","479886","","2010-12-15 14:18:39","2010-12-15 14:34:53","It is possible to start a Intent from ItemizedOverlay class? (mapview item)","<android><android-intent><android-mapview><itemizedoverlay>","3","0","","",""
"4450895","1","","","2010-12-15 14:23:38","1","2951","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3510377/android-1-6how-to-display-gif-animation-on-webview"">[Android 1.6]How to display GIF animation on Webview</a>  </p></blockquote><p>I have the Animated Gif image in res folder.I need to show that image in My application.But it shows the first frame of the image.How to use Gif images in Android ??</p>","538642","","","","","2011-07-28 02:46:45","Show animated Gif image in Android?","<android>","0","2","","2011-08-24 13:44:58",""
"4450915","1","4453130","","2010-12-15 14:26:54","0","250","<p>I really newbie of android.I have a database server which collect user&amp;pass of users (by login from website). On android application, I want to check user&amp;pass, but I don't know how I send and receive data.</p><p>Thanks for helpful</p>","538788","","","","","2010-12-15 17:46:10","How to make and check a user and password on android application?","<android><networking>","1","1","","",""
"4451162","1","","","2010-12-15 14:50:16","1","579","<p>I am an experienced Java developer but I am now developing a app in Android and I have design related question.  Here is the scenario and the questions follow.</p><p>The app intends to collect some statistics from a remote service (the collection of statistics may take a few minutes to about an hour) and display the statics on the smartphone as a graph, or some hierarchy of widgets to enable drill-downs or it may capture additional data from the user to get more information from the remote service.</p><p>My questions:</p><ol><li>How do I capture the user app registration info? Is there a sample registration capture pattern that can be saved on the remote server.</li><li>After a successful registration the user can request (by clicking a button) for statistics.  I intend to call a POST method on the REST Java remote service as an async call.  The service collects the data and notifies the user not sure how.  Should the service push the data? or should it notify the user that the data is ready and the user process pulls the data?</li></ol><p>Any help will be greatly appreciated.</p><p>Thanks in advance.</p>","543483","","229044","","2010-12-15 15:33:34","2010-12-15 16:01:18","Designing Android App - Best Practice?","<android>","2","0","","",""
"4451174","1","5333082","","2010-12-15 14:51:39","4","1807","<p>I've got a Gallery class showing a bunch of images in an Android app, but since only one image is ever displayed at a time, it is difficult for the user to see when they have reached the first or last image in the gallery.  Is there a way to mimic iOS' ""rubber band"" effect, so that the user sees a bit of empty space when dragging the last image, and they release it, the image snaps back to the center of the view.  Is this possible to do?</p>","14302","","","","","2011-03-16 23:46:23","Mimicking the ""rubber band"" effect from iOS in the Gallery on Android","<android><gallery>","1","0","3","",""
"4451212","1","","","2010-12-15 14:54:40","6","246","<p>Trying to resize images stored on my sdcard, I noticed that original colors where altered. It seams that BitmapFactory.decodeFile is responsable for this. Here is a demonstration code:</p><pre><code>private void testImage() throws Exception{    BitmapFactory.Options o = new BitmapFactory.Options();    o.inDither = false;    o.inPreferredConfig = Bitmap.Config.ARGB_8888;    o.inScaled = false;    Bitmap b = BitmapFactory.decodeFile(""/sdcard/test/original.jpg"", o);    b.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(""/sdcard/test/result.jpg""));    b.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(""/sdcard/test/result.png""));}</code></pre><p>Resulting images (original.jpg, result.jpg, result.png):</p><p><img src=""http://i.stack.imgur.com/5zHVN.jpg"" alt=""alt text""><img src=""http://i.stack.imgur.com/laWrm.jpg"" alt=""alt text""><img src=""http://i.stack.imgur.com/28cFC.png"" alt=""alt text""></p><p>Has you can see, the skin of the boy is a bit green on the 2 resulting images. Any tips to solve this issue ?</p>","508194","","508194","","2010-12-15 15:13:08","2010-12-15 15:17:09","Android has no respect for colors!","<android><bitmap>","1","5","1","",""
"4451262","1","4451303","","2010-12-15 14:58:26","2","580","<p>i have completed my development  for my app in android. when i goto publish my app. i have to License my application why because its a paid app. so if the your want share the app from the phone to phone then i have to restrict to share or ask for the payment. How to do that in android?</p><p>is there possible to publish my app without licensing by selecting copy-protection option as off now and update it later.</p><p>Thanks in advance.</p>","267269","","21234","","2010-12-15 15:49:59","2010-12-15 15:49:59","Doubt on Licensing app in android?","<android><licensing><android-lvl>","1","1","","",""
"4451299","1","","","2010-12-15 15:00:34","5","2826","<p>I'm anxiously awaiting the open source release of StrictMode for continuation of our platform development. The sample in the <a href=""http://android-developers.blogspot.com/2010/12/new-gingerbread-api-strictmode.html"" rel=""nofollow"">Android blog entry</a> suggests surrounding the StrictMode calls with </p><pre><code>if (DEVELOPER_MODE) {    ...}</code></pre><p>For SDK development, I'd expect this constant to be locally defined by each application.  However, for platform development, is <code>android.util.Config.DEBUG</code> the best way to determine whether to turn this on?  </p>","543503","","2135787","","2013-06-16 20:20:47","2013-06-16 20:20:47","Definition of DEVELOPER_MODE for StrictMode","<android><android-sdk-2.3><strictmode>","3","1","2","",""
"4451319","1","","","2010-12-15 15:02:02","0","136","<p>I tried to set my app to portrait mode only. so i have added in the manifest for each activity <code>android:configChanges=""orientation"" android:screenOrientation=""portrait""</code>.</p><p>BUT my home screen finishes when I change oreintation and the app closes. It does this on a 3 of my sreens only ..all other seem ok .</p>","505655","","891589","","2013-05-23 05:39:01","2013-05-23 05:39:01","android activity closes when orientation chaged","<android><android-layout><android-manifest>","0","2","0","",""
"4451330","1","4454382","","2010-12-15 15:02:38","12","5475","<p>After i recently installed the new Android SDK stuff, I no longer can view the Javadoc while editing my project's code.  I get this message: <code>Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc.</code></p><p>I am getting this message for all methods, variables, classes, etc.</p><p>I have installed the documentation and everything available to me via the android update manager.  I have also tried to do a clean install of the android sdk and eclipse, and no luck getting the javadoc working.</p><p>I have also tried manually setting the javadoc via <code>project properties -&gt; javadoc location -&gt; file:/C:/Program Files/Android/android-sdk-windows/docs/reference/</code> with no luck</p><p>What suggestions do you have that could fix this problem?</p>","416412","","","","","2012-03-27 13:09:15","Android/Java Javadoc missing after updating Android SDK","<android><eclipse>","5","0","3","",""
"4451363","1","4451463","","2010-12-15 15:04:36","0","715","<p>I'm trying to  invoke certain functions of my service with intents sent from my activity.</p><p>This is how I send intents from activity (in UI thread):</p><pre><code>Intent it = new Intent(MyService.INTENT_ACTIVITY_POSITION_CHANGED);it.setClass(getApplicationContext(), MyService.class);it.putExtra(""posPercentX"", x);it.putExtra(""posPercentY"", y);startService(it);</code></pre><p>This is how my <strong>onStartCommand</strong> looks like in MyService:</p><pre><code>    @Override    public int onStartCommand (Intent intent, int flags, int startId){       super.onStartCommand(intent, flags, startId);       if(intent.getAction().equals(INTENT_ACTIVITY_START)){        Toast.makeText(this,""onStartCommand ..."", Toast.LENGTH_SHORT).show();       }else if(intent.getAction().equals(INTENT_ACTIVITY_POSITION_CHANGED)){        // here comes some code to get extras from intent        Log.d(""INTENT_ACTIVITY_POSITION_CHANGED"", ""x="" + posX + "" y="" + posY);        //TODO preveri       }       return startId;    }</code></pre><p>after few calls I get:</p><pre><code>ERROR/ActivityManager(52): java.lang.IllegalArgumentException: Unknown service start result: 4</code></pre><p>Why do I get this error? any idea?</p>","491320","","","","","2010-12-15 15:12:51","I get ""Unknown service start result"" error on multiple intents","<android><service><android-intent>","1","0","","",""
"4451374","1","4451825","","2010-12-15 15:05:23","14","21741","<p>HelloI've got a searched <code>EditText</code> and search <code>Button</code>. When I type the searched text, I'd like to use <strong>ENTER</strong> key on softkeyboard instead of search <code>Button</code> to activate search function.</p><p>Thanks for help in advance.</p>","295141","","","","","2014-03-19 09:58:11","Use ""ENTER"" key on softkeyboard instead of clicking button","<android><keyboard><android-softkeyboard>","5","0","8","",""
"4451495","1","4451609","","2010-12-15 15:16:34","4","2885","<p>I have been playing with the states all day trying to figure out why, when I press the power button to bring up the lock screen, my app loses focus and calls it's onStop() (as it should) but then it calls the onStart() again before hte screen goes off. This is causing me a problem because some sounds in my app (and presumably other stuff) start playing again while the lockscreen is active.</p><p>how can I make sure it is properly backgrounded and stopped when the lockscreen is active?</p>","353674","","","","","2010-12-15 15:26:51","Android, app restarted after lock screen starts","<android><activity><state>","1","0","1","",""
"4451539","1","8353367","","2010-12-15 15:20:05","0","5959","<p>I know Android doesn't support MJPEG natively but are there any jar files/drivers available that can be added to a project to make it possible?</p>","460887","","","","","2011-12-02 08:01:18","Viewing MJPEG Video Streams","<android>","4","0","","",""
"4451584","1","","","2010-12-15 15:24:40","0","745","<p>How to create a folder in android phone and move sms in it</p>","543535","","","","","2010-12-15 15:51:56","Folder creation in android phone","<android>","1","0","","",""
"4451641","1","4453651","","2010-12-15 15:30:26","1","5362","<p>I start my application with a layout <code>main.xml</code> like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/relative"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;ImageButton android:id=""@+id/applogo"" ... android:src=""@drawable/app_logo""/&gt;    &lt;TabHost android:id=""@android:id/tabhost"" ... android:layout_below=""@+id/applogo""&gt;        &lt;LinearLayout ...&gt;            &lt;TabWidget.../&gt;            &lt;FrameLayout android:id=""@android:id/tabcontent""...&gt;            &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;&lt;/RelativeLayout&gt;</code></pre><p>And the user in the settings menu can choose another layout, smaller (<code>tiny.xml</code>), whose layout is this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/relative"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;TabHost android:id=""@android:id/tabhost"" ...&gt;        &lt;LinearLayout ...&gt;            &lt;TabWidget.../&gt;            &lt;FrameLayout android:id=""@android:id/tabcontent""...&gt;            &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;&lt;/RelativeLayout&gt;</code></pre><p>The <code>mainActivity</code> extends <code>TabActivity</code> and in the <code>onCreate</code> method:</p><p>...</p><pre><code>if (isTiny())setContentView(R.layout.tiny);elsesetContentView(R.layout.main);mTabHost = getTabHost();TabSpec newsTab = mTabHost.newTabSpec(NewsActivity.static_getTabActivityTag());newsIntent = new Intent(this, NewsActivity.class);      newsTab.setContent(newsIntent);TextView textView = new TextView(this);textView.setText(getResources().getString(NewsActivity.static_getIndicatorStringID());textView.setTextSize(size);textView.setTextColor(color);textView.setBackgroundDrawable(background);tab.setIndicator(textView);mTabHost.addTab(newsTab);</code></pre><p>The idea is to write some code in <code>mainActivity#onRestart</code> so if the user changed the layout through the settings panel load the new layout for him. How to achieve it? I tried using <code>setContentView</code> <strike>but it just crashes</strike> and creating the views for the tabs again but it just do not work, the views are blank.</p><p>Thanks in advance.</p><p>Updated: added how to create a tab in the Activity.</p><p><b>Update</b> It is possible to do more than once setContentView. My problem was related to the activities in the Intent.</p>","222851","","222851","","2010-12-16 11:30:04","2010-12-16 11:30:04","Change android layout programatically","<android><layout>","1","5","1","",""
"4451662","1","4451876","","2010-12-15 15:31:51","0","875","<p>How is this mechanism realized, I mean, having some layouts and changing them when user scrolls the screen? I need it to look like the Samsung Galaxy S main menu, or Angry Birds Seasons level menu. Thanks in advance.</p>","543539","","490961","","2010-12-15 15:38:00","2010-12-15 18:52:07","How to make a scrollable view? (Samsung Galaxy S menu, Angry Birds Seasons level menu)","<android><layout><view><scrollable>","3","1","","",""
"4451905","1","4453448","","2010-12-15 15:51:01","0","1084","<p>i have a scrollview layout, with some textviews and buttons, and also a mapview in the middle.All the content of this layout is on a scrollview, because it haves a lot of things, and user have to scroll the windows to see all.</p><p>But then i have a problem, when the user tryes to move the map, it doesn't move, and the finger scrolls the entire window, because of the scrollview. Its cool to have the possibility to scroll the entire window, but i want that when the user moves the finger on the map, the user scrolls only the map.</p><p>exist a way to fix this problem without removing the scrollview? i need it! </p><p>there is the code:</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;LinearLayout     android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""     android:padding=""10px""&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/UserLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""5px""        android:text=""@string/userlabel""/&gt;    &lt;TextView        android:id=""@+id/User""        android:layout_alignBaseline=""@id/UserLabel""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/PermissionLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""13px""        android:text=""@string/perlabel""/&gt;    &lt;TextView        android:id=""@+id/Permission""        android:layout_alignBaseline=""@+id/PermissionLabel""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/FromLabelLocate""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""13px""        android:text=""@string/fromlabel""/&gt;    &lt;TextView        android:id=""@+id/FromLocate""        android:layout_alignBaseline=""@+id/FromLabelLocate""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/ToLabelLocate""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""13px""        android:text=""@string/tolabel""/&gt;    &lt;TextView        android:id=""@+id/ToLocate""        android:layout_alignBaseline=""@+id/ToLabelLocate""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:id=""@+id/LastUpdateLabel""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""13px""        android:text=""@string/lastupdatelabel""/&gt;    &lt;TextView        android:id=""@+id/LastUpdate""        android:layout_alignBaseline=""@id/LastUpdateLabel""        android:layout_alignParentRight=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;&lt;View    android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:layout_height=""1dip""    android:background=""#808080""    android:layout_marginTop=""5px""    android:layout_marginBottom=""10px""/&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=""230px""    android:clickable=""true""    android:apiKey=""mykey""/&gt;&lt;View    android:layout_gravity=""center_horizontal""    android:layout_width=""fill_parent""    android:layout_height=""1dip""    android:background=""#808080""    android:layout_marginTop=""10px""    android:layout_marginBottom=""10px""/&gt;&lt;RelativeLayout    android:gravity=""center_vertical""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button        android:id=""@+id/locate""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/locate""        android:width=""130px""        android:layout_marginLeft=""15dip""/&gt;    &lt;Button        android:id=""@+id/trace""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""@string/trace""        android:width=""130px""        android:layout_alignBaseline=""@id/locate""        android:layout_alignParentRight=""true""        android:layout_marginRight=""15dip""/&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","479886","","","","","2012-07-13 07:47:03","Problems with a scrollview layout with some text and a mapview on it... i can't move the map","<android><layout><android-mapview><scrollview>","2","0","","",""
"4451953","1","4452607","","2010-12-15 15:56:35","0","132","<p>My application requires the user to login on their first visit, and then it stores this in SharedPreferences for any future times the application is launched.</p><p>I'm trying to implement a sign out feature, and I'm wondering what the best way would be.</p><p>As of right now, my LoginActivity and SignOutActivity are separate since they occur on different screens.  Ideally, I'd like to be able to store the preferences in a way that both of these activities can access the login data and have it still be secure.  How would all of you suggest I handle this?</p>","302118","","","","","2010-12-15 16:53:26","Securely accessing login data in two different Activities in Android","<java><android><security>","1","0","","",""
"4452026","1","4473716","","2010-12-15 16:02:55","0","1216","<p>My group and I are having a heck of a time trying to find some documentation on how to get an image to load into our AIR app.  We're doing this in Pure AS3, using Flash Builder 4.  We've tried using loaders, bitmaps, Image classes, nothing is working!</p><p>We're also trying to get sound to play as well.  Here's our attempt at it...(this works as a Desktop app)</p><pre><code>var sound:Sound = new Sound();sound.load(new URLRequest(""car-horn.mp3""));    public function playSound(event:MouseEvent.CLICK):void    {         sound.play();    }</code></pre><p>As i said, works on a desktop app, but can't get it to work for the Android app.  Any help would greatly save us!  Thanks!</p>","385565","","","","","2012-10-20 22:18:49","Android-Adobe Air: Placing an image (and sound) on the stage","<android><air>","2","0","","",""
"4452181","1","4452385","","2010-12-15 16:17:33","0","1304","<p>How to display TabActivity in AlertDialog?I know that it's a little bit tricky, as we should run TabActivity as normal activity, </p><p>e.g. </p><pre><code>Intent intent = new Intent(MyClass.this, Settings.class);startActivity(intent);</code></pre><p>where Settings - TabActvivity.</p><p>The only way I know it to set view for AlertDialog, but it will don't work.</p><pre><code>View view = (View) ((LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE))  .inflate(R.layout.settings, null);new AlertDialog.Builder(this).setTitle(""AlertDialog"").setView(view).show();</code></pre><p>Is there any way to show TabActivity in AlertDialog?</p><p>Thanks,</p>","136834","","","","","2010-12-15 16:53:47","Android TabActivity in AlertDialog","<java><android><tabs><activity><android-intent>","2","0","","",""
"4452185","1","4452285","","2010-12-15 16:18:07","1","1160","<p>I'd like to have a button in the top left corner of one of my activities that holds the name of the activity under it on the stack. Is this possible? The button will essentially just finish the current activity, I just need to set the text to something like the label for the activity below it on the stack.</p><p>I've got a half-working solution where I just pass a string-extra to the activity wherever I start it from, which allows me to set the text to anything that makes sense. This does not work when I'm using notifications.</p>","397060","","","","","2010-12-15 16:27:51","Implementing an iPhone-like back button in Android?","<android><back-button><activity-stack>","1","2","","",""
"4452506","1","4452642","","2010-12-15 16:44:04","2","6533","<p>I have a list where each item is a row in an sqlite table, i'm trying to pass the row id of the item they clicked on from one activity to the next.Here's the method im trying to set up in activity A,</p><pre><code>public static final int REQUEST_CODE=0; //variable used when i want to startActivityForResult..public void ListItemCommonIntent(long id, View view){    Log.i(""Blah"", ""current item pressed is"" + id);    Intent keypadIntent = new Intent(view.getContext(), Keypad.class);    keypadIntent.putExtra(Keypad.selectedRowId, id);    startActivityForResult (keypadIntent, REQUEST_CODE);}</code></pre><p>And here's where i'm trying to get the id in activity b and put it in selectedRowId</p><pre><code>public Long selectedRowId;private String findBudgetQuery = ""SELECT BUDGET_AMOUNT FROM CAT_BUD_TAB WHERE _ID='"" + selectedRowId + ""'"";public void FindBudgetForId(){    //This method should query for current budget and..    SQLiteDatabase db = budgetData.getWritableDatabase();    selectedRowId = getIntent().getLongExtra(selectedRowId, 1);    db.rawQuery(findBudgetQuery, null);}</code></pre><p>However i just cant get it to work, i think i need more information, can someone explain to how to use putExtra and the get something on the otherside. I think i don't fully understand the parametres on even method.</p>","523874","","","","","2014-04-06 00:38:42","How do i use putExtra/get_Extra when working with intents?","<java><android><parameters><android-intent>","2","0","","",""
"4452538","1","","","2010-12-15 16:47:22","30","54940","<p>I've created a sqlite database programmatically with the default way of extending SQLiteOpenHelper and overriding onCreate. This way db gets created on the fly when needed.</p><p>I'd like to check the contents of the db file on my OS X machine with a sqlite browser.I know the name of db file, but can't find it on the device. I've connected to the device via USB, then looked with finder and terminal, just can't find the db file. </p><p>What is the default location for sqlite databases on an android device?</p><p>pom </p>","54155","","","","","2014-02-17 15:16:43","android: location of sqlite database on the device","<android><sqlite>","9","0","7","",""
"4452556","1","","","2010-12-15 16:49:04","0","628","<p>I've created a sqlite database programmatically with the default way of extending SQLiteOpenHelper and overriding onCreate. This way db gets created on the fly when needed.</p><p>I'd like to copy the file over to mac/pc to check its contents with an sqlite browser.I know the name of db file, but can't find it on the device. I've connected to the device via USB, then looked with finder and terminal, just can't find the db file. </p><p>What is the default location for sqlite databases on an android device?</p><p>pom </p>","54155","","","","","2010-12-15 19:33:00","android: location of sqlite database on the device","<android><sqlite>","0","0","0","",""
"4452565","1","4454059","","2010-12-15 16:49:56","9","7988","<p>I was wondering if it's possible (and if it is how) to start up my app at a specific time, something like an alarmclock which goes off at a specific time. Let's say I want my app to start up at 8 in the morning, is that feasable ?</p>","162147","","","","","2014-01-25 12:01:45","Start app at a specific time","<android><task><alarm>","5","0","3","",""
"4452668","1","4452775","","2010-12-15 16:59:26","0","156","<p>i want to know if anybody experiments this, i have a Custom View, who draws a Radar, everything is fine, the draw, measurement, layout, but when i construct it i set the view id with an integer like this, </p><pre><code>Radar radar = new Radar(context);radar.setId(RADAR_COMPONENT.hashCode());LayoutParams lParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);lParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);lParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);this.addView( radar, lParams );</code></pre><p>and later i add others views without set the id... like this</p><pre><code>this.addView( getItemView(item), new LayoutParams(150, 100));...this.addView( getItemView(item), new LayoutParams(150, 100));...</code></pre><p>the getItemView(item) returns a inflated View from xml without id, and item is the object who holds the view info. My problem is when i add this views the fist view Radar... lost the id, and the id is -1, Anyone experiments this?</p><p>Thanks a lot</p>","519515","","","","","2010-12-15 17:11:02","Adding Views to Layout overrides View id","<android><view><android-layout>","1","0","","",""
"4452815","1","4453034","","2010-12-15 17:14:54","2","7872","<p>I need to be able to create a WAV file using the mic in Android. Currently, I'm having a lot of trouble. So far, this is my situation. I'm using parts of the micDroid project code to record thus:</p><pre><code>//read threadint sampleRate = 44100;int bufferSize = AudioRecord.getMinBufferSize(sampleRate,android.media.AudioFormat.CHANNEL_CONFIGURATION_MONO,android.media.AudioFormat.ENCODING_PCM_16BIT);AudioRecord ar = new AudioRecord(AudioSource.MIC,sampleRate,android.media.AudioFormat.CHANNEL_CONFIGURATION_MONO,android.media.AudioFormat.ENCODING_PCM_16BIT,bufferSize);short[] buffer = new short[bufferSize];ar.startRecording();while(isRunning){    try{        int numSamples = ar.read(buffer, 0, buffer.length);        queue.put(new Sample(buffer, numSamples));    } catch (InterruptedException e){        e.printStackTrace();    }}//write threadint sampleRate = 44100;WaveWriter writer = new WaveWriter(""/sdcard"",""recOut.wav"",sampleRate,android.media.AudioFormat.CHANNEL_CONFIGURATION_MONO,android.media.AudioFormat.ENCODING_PCM_16BIT);try {    writer.createWaveFile();} catch (IOException e) {    e.printStackTrace();}while(isRunning){    try {        Sample sample = queue.take();        writer.write(sample.buffer, sample.bufferSize);    } catch (IOException e) {        //snip    }}</code></pre><p>Which appears to work fine, however the end result recognizably contains whatever I said, but it is horribly distorted. Here's a screen cap of audacity (WMP refuses to play the file).</p><p><img src=""http://i.stack.imgur.com/dicAO.png"" alt=""alt text""></p><p>Any help would be greatly appreciated, let me know if you need more code / info.</p><p><strong>Update</strong></p><p>Following markus's suggestions, here is my updated code:</p><pre><code>int sampleRate = 16000;writer = new WaveWriter(""/sdcard"",""recOut.wav"",sampleRate,android.media.AudioFormat.CHANNEL_IN_MONO,android.media.AudioFormat.ENCODING_PCM_16BIT);int bufferSize = AudioRecord.getMinBufferSize(sampleRate,android.media.AudioFormat.CHANNEL_IN_MONO,android.media.AudioFormat.ENCODING_PCM_16BIT);AudioRecord ar = new AudioRecord(AudioSource.MIC,sampleRate,android.media.AudioFormat.CHANNEL_IN_MONO,android.media.AudioFormat.ENCODING_PCM_16BIT,bufferSize);byte[] buffer = new byte[bufferSize]; //all references changed from short to byte type</code></pre><p>...and another audacity screencap:<img src=""http://i.stack.imgur.com/YVJNT.png"" alt=""alt text""></p>","319618","","319618","","2010-12-15 18:31:48","2014-02-16 22:55:26","Recording a wav file from the mic in Android - problems","<java><android><wav><audio-recording>","4","1","4","",""
"4452821","1","4452882","","2010-12-15 17:15:08","3","554","<p>Does any one have any experience with those ""cross-platform mobile apps framework"" such as PhoneGap or Titanium Mobile?</p><p>How big is the performance difference compared to the native Java (for android) or Objective-C (for iPhone)?</p>","144283","","","","","2011-09-20 02:46:33","""cross-platform mobile apps"" performance","<android><performance><mobile>","2","0","","",""
"4452853","1","","","2010-12-15 17:17:28","0","641","<p>Is it possible in Android to animate between two points in a Google MapView in a predefined number of seconds?</p><p>I want to write some sort of game where an object is flying from the start point to the end point. But the Object will be centered on the screen and the map shall be moved.</p><p>Do you have any idea how to do this? :)</p><p>Best,kiwaque</p>","543680","","","","","2010-12-15 18:19:22","Android MapView: custom animation possible?","<android><animation><android-mapview>","1","0","","",""
"4452880","1","4454012","","2010-12-15 17:20:30","0","1872","<p>Is there a specific View/Widget available for browsing files on the device? Or is there another solution that has become accepted? Searching has yielded very little useful information for me.</p>","543677","","881229","","2014-03-18 20:06:26","2014-03-18 20:06:26","File browsing in Android","<android><file-browser>","2","0","","",""
"4452981","1","4453038","","2010-12-15 17:29:53","0","111","<p>I would like to call getResouces in some classes, however, these classes are not extended to Activity. How to do it in a right way?</p><p>regardspenny</p>","502958","","471164","","2010-12-15 17:31:38","2010-12-15 18:24:50","how to call getResouces() in a class that is not extended Activity?","<java><android>","4","0","","",""
"4453116","1","4485304","","2010-12-15 17:43:51","0","4465","<p>I'm using a custom view which has a background picture and is used to draw stuff on it. </p><p>This view is ignoring <strong>android:layout_width=""wrap_content</strong>  and <strong>android:layout_height=""wrap_content</strong>, it is not wrapping the background picture and is stretching and pushing the controls under the view out of the screen.</p><p>The custom view is in main LinearLayout, but where ever I put it, it behaves the same way.</p><p>I tried with <strong>setLayoutParams</strong>, but physical size is somehow still the same under visible controls and the size is important because of the coordinates I save for other times. It is even present under the custom title, and coordinates are returned as negatives and thats also a problem. </p><p>I don't like the idea of statically setting the size because of different screen sizes.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;org.danizmax.tradar.MapViewandroid:id=""@+id/mapView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""/&gt;&lt;!-- koordinate --&gt;&lt;LinearLayout android:id=""@+id/controls""android:orientation=""horizontal""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:paddingLeft=""10sp""android:paddingRight=""10sp""&gt;    &lt;TextView android:id=""@+id/coordsText""     android:layout_width=""wrap_content""     android:layout_height=""fill_parent""    android:textStyle=""bold""    android:textSize=""15sp""    android:gravity=""center""    android:layout_weight=""1""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;!-- radij --&gt;&lt;LinearLayoutandroid:orientation=""horizontal""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:paddingBottom=""10sp""android:paddingLeft=""-5sp""android:paddingRight=""-5sp""&gt;    &lt;Button android:text=""""         android:id=""@+id/ButtonInc""        android:background=""@drawable/leftbuttonani""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_weight=""1""&gt;        &lt;/Button&gt;    &lt;TextView android:id=""@+id/radiusSize""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:textStyle=""bold""        android:textSize=""16sp""        android:gravity=""center""        android:layout_weight=""1""        android:paddingLeft=""0sp""        android:paddingRight=""0sp""&gt;        &lt;/TextView&gt;    &lt;Button android:text=""""         android:id=""@+id/ButtonDec""        android:background=""@drawable/rightbuttonani""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_weight=""1""&gt;        &lt;/Button&gt;&lt;/LinearLayout&gt;&lt;!-- alert togle --&gt;&lt;LinearLayoutandroid:orientation=""horizontal""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:paddingLeft=""-5sp""android:paddingRight=""-5sp""&gt;    &lt;Button android:text=""""         android:id=""@+id/ButtonDec""        android:background=""@drawable/buttonani""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_weight=""1""&gt;        &lt;/Button&gt;    &lt;ToggleButton        android:id=""@+id/toggleAlert""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:textColor=""#D8D8D8""        android:background=""@drawable/buttonani""        android:textOn=""@string/alertOn""        android:textOff=""@string/alertOff""        android:textStyle=""bold""        android:layout_weight=""0.5""        android:paddingTop=""1sp""&gt;        &lt;/ToggleButton&gt;    &lt;Button android:text=""""         android:id=""@+id/ButtonDec""        android:background=""@drawable/buttonani""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:layout_weight=""1""&gt;        &lt;/Button&gt;&lt;/LinearLayout&gt;&lt;!-- izpis zadnjega dogodka --&gt;&lt;TextView android:id=""@+id/timeStatText"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:textStyle=""bold""android:textSize=""10sp""android:gravity=""center""&gt;&lt;/TextView&gt;</code></pre><p></p><p>This is how it should look, the blue part is <strong>MapView</strong>:</p><p><img src=""http://i.stack.imgur.com/3EjxK.png"" alt=""alt text""></p><p>any idea?</p>","491320","","491320","","2010-12-15 18:16:22","2010-12-19 21:47:33","Android custom view is ignoring layout params im xml completely, and is stretching over the whole screen","<android><view><android-layout>","2","8","","",""
"4453140","1","4453290","","2010-12-15 17:47:08","1","7904","<p>I am interested in starting Android development, I have significant experience with .NET and WP7 development with several applications on the WP7 Marketplace and a couple on the iPhone App Store.  What is the best Android (and cheapest) device to get so that I can test my Android applications on,  I realize there is an emulator but in my experience its a pretty big difference from emulator to device when testing comes and performance.</p><p>I also understand there is some fragmenetation concerns around Android, is there any guidance around how to programatically handle these issues? Such as tips/tricks?  </p><p>Update: I forgot to mention to the phone needs to be unlocked.</p><p>Thanks everyone!</p>","109550","","109550","","2010-12-15 19:21:09","2011-09-08 04:55:30","Best Android Phone for Development?","<android>","6","4","2","",""
"4453328","1","4453380","","2010-12-15 18:07:42","4","3851","<p>Would it be possible to take the ip address of a wireless router that an android phone would connect to and determine in the app the relative location of the ip?  </p>","458955","","","","","2010-12-15 19:15:08","Get location of wifi ip in android","<android><location><ip>","2","0","2","",""
"4453379","1","","","2010-12-15 18:13:43","2","2028","<p>I'm new to Android development, and am having a tough time working something out. I want to make a composite view (called SkillDiceGroup) of a TextView, EditText, and SkillDiceButton (which is an extension of the Button class). I have it working when declaring my SkillDiceGroup as pure code, and putting this in my XML layout:</p><pre><code>   &lt;com.jeremybush.d20.SkillDiceGroup android:id=""@+id/skillDiceTest""     android:title=""Foobar!""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;   &lt;/com.jeremybush.d20.SkillDiceGroup&gt;</code></pre><p>And I have this code:</p><pre><code>public class SkillDiceGroup extends LinearLayout{ // The View components private TextView mTitle; private EditText mSkill; private SkillDiceButton mDice; public SkillDiceGroup(Context context, AttributeSet attrs) {  super(context);  this.setOrientation(HORIZONTAL);  mTitle = new TextView(context);        mTitle.setText(""foobar"");  addView(mTitle, new LinearLayout.LayoutParams(   LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT  ));  mSkill = new EditText(context);  addView(mSkill, new LinearLayout.LayoutParams(   LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT  ));  mDice = new SkillDiceButton(context, attrs);  mDice.setText(""d20"");  addView(mDice, new LinearLayout.LayoutParams(   LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT  )); } private class SkillDiceButton extends DiceButton {  public SkillDiceButton(Context context, AttributeSet attrs) {   super(context, attrs);  }  public void onClick(View view)  {   modifier = Integer.parseInt(mSkill.getText().toString());   super.onClick(view);  } }}</code></pre><p>This works how I want it, but I would like to declare the three items in the xml view on their own. How can I do this?</p>","99514","","","","","2010-12-15 18:51:36","Android XML Composite View","<android>","2","0","","",""
"4453653","1","4453832","","2010-12-15 18:48:20","1","828","<p>I have an iPhone app that does image manipulation via blending two <code>UIImage</code> objects via CoreGraphics, specifically <code>CGContextSetBlendMode</code>. I am currently researching porting it to Android. I've gone through the process of combining to <code>Bitmap</code> objects on Android using PorterDuff modes. However, I want much more complicate compositing. For example, I'm using <code>kCGBlendModeHardLight</code> for many blends:</p><blockquote>  <p>Either multiplies or screens colors,  depending on the source image sample  color. If the source image sample  color is lighter than 50% gray, the  background is lightened, similar to  screening. If the source image sample  color is darker than 50% gray, the  background is darkened, similar to  multiplying. If the source image  sample color is equal to 50% gray, the  source image is not changed. Image  samples that are equal to pure black  or pure white result in pure black or  white. The overall effect is similar  to what you’d achieve by shining a  harsh spotlight on the source image.  Use this to add highlights to a scene.</p></blockquote><p>But don't know of anyway (if it's even possible) to emulate this via Porter-Duff. Does Android not support better Image Manipulation algorithms out of the box? Is it possible to use Porter-Duff in some way to emulate more advanced blend modes?</p>","157921","","157921","","2010-12-15 19:06:58","2010-12-15 19:09:32","Mapping CoreGraphics Blend Modes to Porter-Duff","<iphone><android><core-graphics><blending><porter-duff>","1","0","2","",""
"4453691","1","4453721","","2010-12-15 18:53:59","2","174","<p>I am trying to look inside a couple of Android core classes to see about overriding some methods.  I have looked into getting the Android source code, but the process described on the Android dev site is all about installing and setting up some kind of development environment.  This is not necessary to me.  I just want to open a class or two in a text editor and look at its contents.  Does anyone know if this is possible without going through the multitude of steps described on the Android dev forums?</p><p>Thanks!</p>","538576","","","","","2010-12-15 20:10:24","How do I see the core Android classes?","<android>","3","0","2","",""
"4453927","1","","","2010-12-15 19:21:03","1","1407","<p>Anyone have a handy link where I can download the full Android vector-based icon set?</p>","208427","","","","","2010-12-15 20:12:47","Android vector graphics icon set","<android><vector><vector-graphics>","2","0","2","",""
"4454107","1","4454616","","2010-12-15 19:42:00","31","15106","<p>I have an Android project in Eclipse I would like to convert to be built with <strong>Ant</strong> instead.</p><p>How can I achieve this? I have tried exporting an Ant build file but I'm pretty sure that's not going to work (nor does it when running ant with the exported file). I do not know much about Ant either so some explanation would also help.</p><p>EDIT: now I seem to have managed to create the needed build file but I need to add the projects libs like admob.jar to be seen by ant and used to build.as I am getting the following error </p><pre><code>        -dex:     [echo] Converting compiled files and external libraries into C:\Users\Jason\Documents\Programming\Android\Android SVN\trunk\GPSAlarm\BusSnooze\bin\classes.dex...    [apply]    [apply] UNEXPECTED TOP-LEVEL EXCEPTION:    [apply] com.android.dx.util.ExceptionWithContext    [apply]     at com.android.dx.util.ExceptionWithContext.withContext(ExceptionWithContext.java:46)    [apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:340)    [apply]     at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)    [apply]     at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)    [apply]     at com.android.dx.command.dexer.Main.processClass(Main.java:297)    [apply]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)    [apply]     at com.android.dx.command.dexer.Main.access$100(Main.java:56)    [apply]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)    [apply]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)    [apply]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)    [apply]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)    [apply]     at com.android.dx.command.dexer.Main.processOne(Main.java:245)    [apply]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)    [apply]     at com.android.dx.command.dexer.Main.run(Main.java:139)    [apply]     at com.android.dx.command.dexer.Main.main(Main.java:120)    [apply]     at com.android.dx.command.Main.main(Main.java:87)    [apply] Caused by: java.lang.NullPointerException    [apply]     at com.android.dx.cf.code.ConcreteMethod.&lt;init&gt;(ConcreteMethod.java:84)    [apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:243)    [apply]     ... 14 more    [apply] ...while processing &lt;init&gt; ()V    [apply] ...while processing com/google/android/apps/analytics/AnalyticsReceiver.class    [apply]    [apply] 1 error; aborting</code></pre>","407133","","56285","","2013-08-14 11:42:49","2013-08-14 11:42:49","How to convert an Eclipse Android project to use Ant for build?","<android><eclipse><ant><build><android-build>","3","2","14","",""
"4454260","1","4454722","","2010-12-15 19:56:48","0","414","<p>I want to parse the result of a specific URL using Simple Ajax for XML. This is basically my Code:</p><pre><code>URL link = new URL(url); // url is just a string representing the urlSAXParserFactory spf = SAXParserFactory.newInstance();SAXParser sp = spf.newSAXParser();XMLReader xr = sp.getXMLReader();xr.setContentHandler(myHandler);  // the class of myHandler extends from DefaultHandlerInputStream stream = link.openStream();InputSource inputSource = new InputSource(stream);inputSource.setEncoding(""ISO-8859-1""); xr.parse(inputSource);</code></pre><p>But how can I add a cookie? I know I can add Cookies to HttpClients like so:</p><pre><code>BasicClientCookie cookie = new BasicClientCookie(""access_token"", accessToken);mHttpClient.getCookieStore().addCookie(cookie);HttpGet request = new HttpGet(""www.reeple.net/xml/login/"" + uid);mHttpClient.execute(request);</code></pre><p>But how can I add a cookie to a request, that is handlet by the SAX-Api?</p>","351723","","244296","","2010-12-15 20:00:49","2010-12-15 20:48:39","Android, SAX and Cookies: How to add a cookie when trying to parse XML from an URL","<android><xml><parsing><cookies><sax>","1","0","","",""
"4454288","1","","","2010-12-15 19:59:01","2","831","<p>I'm currently trying to catch states for ACTION_SCO_AUDIO_STATE_CHANGED as specified by:<a href=""http://developer.android.com/reference/android/media/AudioManager.html#ACTION_SCO_AUDIO_STATE_CHANGED"" rel=""nofollow"">http://developer.android.com/reference/android/media/AudioManager.html#ACTION_SCO_AUDIO_STATE_CHANGED</a></p><p>I have registered the intent on my manifest but I'm not getting anything when connecting to a bluetooth device.  Any particular permission I need or something?</p><p>Manifest:</p><pre><code>    &lt;receiver android:name=""com.app.receiver.BluetoothReceiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.media.SCO_AUDIO_STATE_CHANGED"" /&gt;            &lt;action android:name=""android.bluetooth.device.action.ACL_CONNECTED"" /&gt;            &lt;action android:name=""android.bluetooth.device.action.ACL_DISCONNECTED"" /&gt;            &lt;action android:name=""android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED"" /&gt;              &lt;action android:name=""android.bluetooth.device.action.BOND_STATE_CHANGED"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>I can't get any of the calls from BOND_STATE_CHANGED, SCO_AUDIO_STATE_CHANGED or ACL_DISCONNECT_REQUESTED.  The other intents I'm receiving them just fine.</p><p>Thanks,</p><p>-Jona</p>","398248","","398248","","2010-12-15 20:08:02","2013-06-29 21:48:37","I can't seem to catch ACTION_SCO_AUDIO_STATE_CHANGED intent why?","<android><android-manifest>","2","2","1","",""
"4454422","1","","","2010-12-15 20:14:27","6","2301","<p>When using android styles, one can specify a parent style like:</p><pre><code>&lt;style name=""MyStyle"" parent=""@style/ParentStyle""&gt;&lt;/style&gt;</code></pre><p>Is is possible to specify multiple parents? If so, how?</p>","113246","","","","","2011-02-02 09:27:13","Multiple parents in Android styles xml","<android><android-layout>","1","3","1","",""
"4454456","1","4454779","","2010-12-15 20:17:47","5","8875","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2691235/double-tap-zoom-on-android-mapview"">Double Tap -&gt; Zoom on Android MapView?</a>  </p></blockquote><p>I have an <code>Activity</code> that extends <code>MapActivity</code>. I use Google Maps.<br>I need to zoom in by double clicking or double tapping.</p><p>Can someone help me with this?</p><p>I have already looked at the below, but they are not what I'm looking for.</p><p><a href=""http://stackoverflow.com/questions/2691235/double-tap-zoom-on-android-mapview"">Double Tap -&gt; Zoom on Android MapView?</a></p><p><a href=""http://stackoverflow.com/questions/937313/android-basic-gesture-detection"">Android - basic gesture detection</a></p><p>I realized that <code>onTouchListener</code> is being called only once, why is that so?</p><pre><code>// set Gesturedetector = new GestureDetector(new GestureReactor());mapView.setOnTouchListener(new OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {        System.out.println(""Inside onTouch"");        return detector.onTouchEvent(event);    }});</code></pre><p>I have private class:</p><pre><code>private class GestureReactor extends SimpleOnGestureListener {    @Override    public boolean onDoubleTap(MotionEvent e) {        System.out.println(""inside onDouble"");        controller.zoomInFixing((int) e.getX(), (int) e.getY());        return super.onDoubleTap(e);    }}</code></pre><p>and</p><pre><code>private GestureDetector detector;</code></pre>","536853","","1711796","","2013-10-17 14:24:24","2013-10-17 14:24:24","double click/tap map zoom (Android)","<android><google-maps>","6","6","0","2012-09-30 03:36:24",""
"4454626","1","","","2010-12-15 20:38:16","1","617","<p>Since the OpenCV libraries according to <a href=""http://opencv.willowgarage.com/wiki/Android"" rel=""nofollow"">http://opencv.willowgarage.com/wiki/Android</a> do not run on my Android phone (HTC Wildfire) -- crash when loading the libs -- I want to reduce the modules being compiled and linked into the resulting .so-library.</p><p>Does anyone know how to prevent 'make' from compiling some particular modules in OpenCV? I found the files CMakeLists.txt useful (located in every folder) that let me remove some folders from compilation but then I get stuck into dependency problems. Is it the right way to use CMakeLists.txt to exclude some folders?</p><p>In my particular case I need the cvMatchTemplate and some color conversion methods of OpenCV only. Thanks for any hint!</p>","543875","","543875","","2010-12-15 22:44:28","2010-12-15 22:44:28","Build a subset of OpenCV only (in particular for Android)","<android><opencv>","0","3","1","",""
"4454653","1","","","2010-12-15 20:41:08","-1","8794","<p>I was just suggested to port some signal processing code to use the Android NDK to speed up the process, but I'm wondering 1. where to install it to and 2. what tool-chain to use</p><p>I'd prefer <strong>not downloading</strong> the 3.5GB Mac Developer Tools if possible.  I don't have access to an install cd that has it.  Want to try and get this done asap.  Does anyone know a way to get NDK development running quickly on OSX(snow leopard)?</p>","235708","","235708","","2011-01-07 19:46:44","2014-02-26 11:59:28","Android NDK on Mac OSX - quick install w/o Developer Tools","<android><osx><osx-snow-leopard><android-ndk>","3","2","","",""
"4454794","1","4455982","","2010-12-15 20:56:27","3","3479","<p>Is there a way to set a GUI screen (Activity) to be 200dip wide and 150dip high, either using XML or programmatically? </p><p>I found getWindow().setLayout(), but that only take predefined constants for width and height.</p>","440093","","","","","2010-12-15 23:22:47","Android: How to set the absolute size of an Activity's Window?","<android>","2","0","","",""
"4454911","1","","","2010-12-15 21:09:14","22","2610","<p>As part of internationalizing an Android application I have come across the need to dynamically word wrap or hyphenate at the right position. </p><p>All my strings are externalized in strings.xml files but I have not found any documentation about hyphenation in Android.</p><p>I would like to be able to suggest hyphenation positions similar to how I can do it in LaTeX:</p><p><a href=""http://en.wikipedia.org/wiki/Hyphenation_algorithm"">http://en.wikipedia.org/wiki/Hyphenation_algorithm</a></p><p>but have no found any indication if this is possible? Is there anything in the framework I have missed? What are other people doing e.g. with Japanese strings that have no obvious position to break up a sentence? Do you just add spaces at the correct positions? </p><p>I could dynamically size the font to fit into certain layouts but for longer messages that go across multiple lines that wont work. What to do?</p>","136445","","","","","2012-09-09 18:22:02","Hyphenation in Android","<android>","3","8","8","",""
"4454943","1","","","2010-12-15 21:13:49","0","585","<p>I'm getting a returned response that is too long for the window when printing to LogCat; even when I copy the line, pasting shows that the response is cut off.  How am I able to get the full string text?</p>","375566","","","","","2010-12-15 22:53:08","Android 2.2 SDK - System.out.println JSON string to long for LogCat?","<java><android><eclipse><mobile>","3","0","","",""
"4454959","1","","","2010-12-15 21:15:48","1","1359","<p>I have a class that extend ListActivity.This class show a AbsListView filled with bus IDs and a bus Names on each row...I try to handle the bus Name of a row when I make a swipe gesture on...('onFling') but when I do that, the gesture is handled correctly but I can just get the Views (with findViewByID()) of the first row ....I need to get the  Views of the Flinged row!</p><p>Thank you!</p><p>This is my code...:</p><pre><code>public class dayBusList extends ListActivity{     AbsListView lv; AABDatabaseManager db;     GestureDetector mGestureDetector = null; View.OnTouchListener mGestureListener = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        db = new AABDatabaseManager(dayBusList.this);        setListAdapter(new SpeechListAdapter(this));        lv = getListView();        lv.setTextFilterEnabled(true);        lv.setBackgroundColor(0xffffffff);        lv.setFastScrollEnabled(true);        lv.setSoundEffectsEnabled(true);        //Gesture detector for swipe...         mGestureDetector = new GestureDetector(new MyGestureDetector());             mGestureListener = new View.OnTouchListener() {                public boolean onTouch(View v, MotionEvent aEvent) {                    if (mGestureDetector.onTouchEvent(aEvent))                        return true;                    else                        return false;                    }                };       lv.setOnTouchListener(mGestureListener);</code></pre><p>.......>THE ADAPTER FOR THE LIST VIEW</p><pre><code>private class SpeechListAdapter extends BaseAdapter {         private Context mContext;         private String[] busIDS = db.getDayBusIds();         private String[] busNAMES = db.getDayBusNames();            public SpeechListAdapter(Context context) {                mContext = context;            }            public int getCount() {                return busNAMES.length;            }            public Object getItem(int position) {                return position;            }            public long getItemId(int position) {                return position;            }            public View getView(int position, View convertView, ViewGroup parent) {                SpeechView sv;                if (convertView == null) {                    sv = new SpeechView(mContext, busIDS[position],                            busNAMES[position]);                } else {                    sv = (SpeechView) convertView;                    sv.setTitle(busIDS[position]);                    sv.setDialogue(busNAMES[position]);                }                return sv;            }         }        private class SpeechView extends LinearLayout {            private TextView busID;            private TextView busNAME;            public SpeechView(Context context, String title, String words) {                super(context);                this.setOrientation(HORIZONTAL);                ImageView busIcon = new ImageView(context);                busIcon.setImageResource(R.drawable.stm);                busIcon.setPadding(2, 20, 5, 20);                addView(busIcon,new LinearLayout.LayoutParams(                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));                busID = new TextView(context);                busID.setId(1);                busID.setTextSize(30);                busID.setTextColor(Color.BLUE);                busID.setPadding(5, 15, 5, 20);                //busID.setPadding(0, 0,10, 0);                busID.setText(title);                addView(busID, new LinearLayout.LayoutParams(                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));                busNAME = new TextView(context);                busNAME.setId(2);                busNAME.setGravity(Gravity.TOP);                busNAME.setTextSize(15);                busNAME.setPadding(0, 0, 0, 0);                busNAME.setText(words);                busNAME.setTextColor(Color.GREEN);                busNAME.setWidth(160);                addView(busNAME, new LinearLayout.LayoutParams(                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));             }            public void setTitle(String id) {                busID.setText(id);            }            public void setDialogue(String name) {                busNAME.setText(name);            }        }</code></pre><p>.......>THE class for the gesture detection</p><pre><code>class MyGestureDetector extends SimpleOnGestureListener {    private static final int SWIPE_MIN_DISTANCE = 200;    private static final int SWIPE_MAX_OFF_PATH = 100;    private static final int SWIPE_THRESHOLD_VELOCITY = 100;    @Override            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {                float dX = e2.getX()-e1.getX();                float dY = e1.getY()-e2.getY();                if (Math.abs(dY)&lt;SWIPE_MAX_OFF_PATH &amp;&amp;                    Math.abs(velocityX)&gt;=SWIPE_THRESHOLD_VELOCITY &amp;&amp;                    Math.abs(dX)&gt;=SWIPE_MIN_DISTANCE ) {                    if (dX&gt;0) {                        Toast.makeText(getApplicationContext(), ((TextView) findViewById(1)).getText()+""Right Swipe"", Toast.LENGTH_SHORT).show();                    } else {                        Toast.makeText(getApplicationContext(), ((TextView) findViewById(1)).getText()+""Left Swipe"", Toast.LENGTH_SHORT).show();                    }                    return true;                }                 return false;            }        }</code></pre>","543930","","180538","","2010-12-15 22:46:31","2011-02-18 08:54:04","Android findViewById() with onFling in ListView problem","<android><listview><gesture-recognition>","2","0","","",""
"4455006","1","4455086","","2010-12-15 21:21:29","0","2156","<p>I sometimes get an <code>OutOfMemoryError</code> when posting a large file in Android. This is the code I'm using. Am I doing something wrong? </p><pre><code>HttpURLConnection con = (HttpURLConnection) url.openConnection();con.setRequestMethod(""POST"");con.setDoInput(true);con.setDoOutput(true);ostream = new DataOutputStream(con.getOutputStream());byte[] buffer = new byte[1536];int count;while ((count = fileInput.read(buffer)) != -1) {    ostream.write(buffer, 0, count); // This sometimes causes OutOfMemoryError}ostream.flush();</code></pre><p>Would calling <code>ostream.flush()</code> inside the <code>while</code> loop do any good?</p>","143378","","143378","","2010-12-15 21:31:14","2013-04-03 21:21:18","Posting a large file in Android","<android><post><file-upload><out-of-memory><httpurlconnection>","2","6","0","",""
"4455558","1","4456322","","2010-12-15 22:21:38","48","22934","<p>Like many here, I'm new to Android development. What I'm trying to do seems very simple, but after a few days of searching I can't quite figure it out. </p><p>I have an application that allows the user to select multiple(up to 5) images. I'm using an ImageView. When the user clicks on the ImageView, I'd like to allow them the option to a)select the image from the gallery, or b)use the camera to capture an image.</p><p>I started by using the ACTION_GET_CONTENT intent, and that works well for getting to the gallery. So then I tried using the ACTION_PICK_ACTIVITY intent to allow the user to choose camera or gallery:</p><pre><code>Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);Intent gallIntent=new Intent(Intent.ACTION_GET_CONTENT);gallIntent.setType(""image/*""); Intent camIntent = new Intent(""android.media.action.IMAGE_CAPTURE"");pickIntent.putExtra(Intent.EXTRA_INTENT, camIntent);pickIntent.putExtra(Intent.EXTRA_INTENT, gallIntent)pickIntent.putExtra(Intent.EXTRA_TITLE, ""Select Source"");startActivityForResult(pickIntent, IMAGE_SELECTOR);</code></pre><p>But it appears I can only add one EXTRA_INTENT. The menu show up as expected, but the only options are Gallery and Files....no Camera). </p><p>Is there a better/easier way to do this that I'm missing? Thanks for any help. </p>","543998","","","","","2012-11-28 21:51:18","Allow user to select camera or gallery for image","<android>","3","0","48","",""
"4455624","1","4455900","","2010-12-15 22:29:28","2","881","<p>I am having trouble figuring out the best way to set up animation with collision detection. I have a fully functional version of falldown (the popular calculator game), using a handler and onDraw() to draw rectangles for the rows and a bitmap ball. However, this animation skips (looks laggy) and so I am trying to switch the animation over to a tween animation.</p><p>My question is a conceptual one: how do i detect collisions in the middle of an animation? I see the sideways animation as taking one of two routes:a) I animate in very small steps. However, I imagine this would look just as bad as the current animation set-up.b) I set an animation all the way to the left or right of the screen, but every step in the animation checks to make sure the ball is not going through a row. </p><p>I face a similar problem with the downward motion of the ball. Is it possible to constantly access/update the position of the ball (stored as an integer) and then cut the animation short if it is colliding with something? Is it possible to have the ball animate downward if and only if it is not above a piece of the row? There must be some way to detect collisions inside of the animation but I don't know how. </p><p>edit: if the animation class isn't suitable for games, how am I supposed to animate my game? Like I said, the handler-ondraw system I have makes the ball skip around, even when i set the delay to 1 millisecond. </p>","544007","","544007","","2010-12-15 22:53:52","2010-12-15 23:09:10","animation with collision detection?","<android><animation><collision-detection>","1","3","1","",""
"4455629","1","","","2010-12-15 22:30:13","1","711","<p>I am trying to Install Android and Phone Gap. When i try to create a android project using Phone Gap command prompt <code>C:/Ruby192/bin/ruby bin/droidgap create ""C:/Users/sureshn/Desktop/PhoneGap/Android/PhoneGapAndroid/phonegap-phonegap-android-ab8950a/SureshWorld</code>I get the following error</p><pre><code>""C:/Users/sureshn/Desktop/PhoneGap/Android/PhoneGapAndroid/phonegap-phonegap-android-ab8950a/lib/create.rb:24:in ``': No such file or directory - android-sdk-path.bat android.bat (Errno::ENOENT)        from C:/Users/sureshn/Desktop/PhoneGap/Android/PhoneGapAndroid/phonegap-phonegap-android-ab8950a/lib/create.rb:24:in `guess_paths'        from C:/Users/sureshn/Desktop/PhoneGap/Android/PhoneGapAndroid/phonegap-phonegap-android-ab8950a/lib/create.rb:7:in `initialize'        from bin/droidgap:24:in `new'        from bin/droidgap:24:in `&lt;main&gt;'""</code></pre><p>My Path is set to </p><pre><code>C:/Ruby192/bin;C:/Users/sureshn/Desktop/PhoneGap/Android/Apache Ant/apache-ant-1.8.1/bin;C:/Program Files/Java/jdk1.6.0_23/bin;C:/Users/sureshn/Desktop/PhoneGap/Android/AndroidSDK/android-sdk-windows/tools;C:/Users/sureshn/Desktop/PhoneGap/Android/PhoneGapAndroid/phonegap-phonegap-android-ab8950a/bin;</code></pre><p>I have also set the <code>ANDROID_HOME</code>, <code>ANT_HOME</code>, <code>JAVA_HOME</code> variables. Can the gurus throw me the light where i am doing wrong? Thanks</p>","490601","","142162","","2010-12-15 22:33:02","2010-12-15 22:33:02","Android Phone Gap Throws Error on Creating a project","<android><phonegap>","0","2","","",""
"4455644","1","4473092","","2010-12-15 22:32:29","0","9534","<p>I use ksoap to connect to a soap web service. And get a Soapobject in return. How would I parse this complex soapobject.</p><p>My problem is that a <a href=""http://ksoap2.sourceforge.net/doc/api/org/ksoap2/serialization/SoapObject.html"" rel=""nofollow"">SoapObject</a> returns an object for getProperty, this can be a leaf or a node in the tree. I have a complex resultobject that consists of some ints and strings and a list of complex objects. I now somehow have to decide if the property is a leaf or another complex object that can be parsed as an SoapObject. </p><p>Is there an example on how to parse this?</p>","114066","","","","","2012-05-10 14:05:25","How to parse a complex object with ksoap?","<android><ksoap2>","3","0","","",""
"4455783","1","10160140","","2010-12-15 22:52:51","16","14924","<p>This article <a href=""http://cobworks.ca/2010/04/19/why-android-market-has-no-games/"" rel=""nofollow"">http://cobworks.ca/2010/04/19/why-android-market-has-no-games/</a> suggests that it does not, but I was hoping something might have changed since April.</p>","333984","","918414","","2013-02-01 22:41:50","2013-07-22 02:58:14","Does the Android Emulator support OpenGL ES 2.0?","<android><mobile><opengl-es>","4","1","3","",""
"4455802","1","","","2010-12-15 22:54:58","2","1282","<pre><code>if (gps_enabled)    _locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps);if (network_enabled)    _locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListenerNetwork);</code></pre><p><strong>Condition:</strong></p><ul><li>You are in the building where you have wifi connection, but no GPS signal.</li></ul><p><strong>Result:</strong></p><p>This works when Setting->""Use wireless networks"" is on and ""Use GPS satellites"" is off.However, when both are checked, above code sometimes works (through network) but sometimes times out trying to get location from GPS.</p><p>I tested on nexus one.</p>","432056","","","","","2012-11-01 15:24:36","Android: If both GPS & Network are requested at the same time, network provider doesn't work","<android><gps><location>","0","4","2","",""
"4455838","1","","","2010-12-15 23:00:43","0","56","<p>Hey guys... My application requires that I be informed of any changes to the UI of my application. Is there anyway that I can be informed of this? Perhaps through means of an event or something?</p>","544038","","","","","2011-01-20 08:50:02","How can I be informed that the UI has been redrawn in Android?","<android><events><gui><notifications>","1","1","","",""
"4455889","1","4498888","","2010-12-15 23:07:25","0","868","<p>I'm trying to launch an intent from my application that will play audio from a streaming server.  I've got a url for that stream and I'm using bit.ly to simplify the url to launch (I've tried without bit.ly and have the same results)</p><pre><code>intent = new Intent( Intent.ACTION_VIEW, Uri.parse( ""http://bit.ly/gKltQE"" ) );intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); // i tried with and without this, no luckstartActivity( intent );</code></pre><p>The browser starts, loads up the bit.ly link, redirects to the audio link then closes and returns to my app</p><pre><code>12-15 14:27:58.559  1259  8370 I ActivityManager: Starting activity: Intent { act=android.intent.action.VIEW dat=http://bit.ly/gKltQE flg=0x10000000 cmp=com.android.browser/.BrowserActivity (has extras) }12-15 14:14:23.903  1259  1383 I ActivityManager: Starting activity: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=http://216.235.81.102:15532/play?now=65&amp;membername;=&amp;session=kxlu1:0&amp;tag=live365&amp;s=kxlu1&amp;d=live365&amp;r=0&amp;app_id=live365:BROWSER%28pro%29 cmp=com.android.browser/.BrowserActivity }12-15 14:14:24.387  8848  8848 D webviewglue: nativeDestroy view: 0x3bb01812-15 14:14:24.387  1259  1600 I ActivityManager: Starting activity: Intent { act=android.intent.action.VIEW dat=http://216.235.81.102:15532/play?now=65&amp;membername;=&amp;session=kxlu1:0&amp;tag=live365&amp;s=kxlu1&amp;d=live365&amp;r=0&amp;app_id=live365:BROWSER%28pro%29 typ=audio/mpeg cmp=com.android.music/.StreamStarter }12-15 14:14:24.387  1259  1929 I ActivityManager: moveTaskToBack: 12</code></pre><p>When I launch the same bit.ly link in the browser manually, it works fine (launches the audio streaming app):</p><pre><code>12-15 14:26:21.403  8848  8848 D SearchDialog: launching Intent { act=android.intent.action.VIEW dat=http://bit.ly/gKltQE flg=0x10000000 cmp=com.android.browser/.BrowserActivity (has extras) }12-15 14:26:21.411  8848  8848 I SearchDialog: Starting (as ourselves) http://bit.ly/gKltQE#Intent;action=android.intent.action.VIEW;launchFlags=0x10000000;component=com.android.browser/.BrowserActivity;S.query=http%3A%2F%2Fbit.ly%2FgKltQE;S.user_query=bit;end12-15 14:26:21.411  1259  1259 I ActivityManager: Starting activity: Intent { act=android.intent.action.VIEW dat=http://bit.ly/gKltQE flg=0x10000000 cmp=com.android.browser/.BrowserActivity (has extras) }12-15 14:26:21.879  1259  1267 V DeviceStorageMonitorService: freeMemory=621088768012-15 14:26:21.879  1259  1267 V DeviceStorageMonitorService: Threshold Percentage=1012-15 14:26:21.879  1259  1267 V DeviceStorageMonitorService: mTotalMemory = 7026491312-15 14:26:21.879  1259  1267 I DeviceStorageMonitorService: Posting Message again12-15 14:26:21.997  8848  8864 D dalvikvm: GC_FOR_MALLOC freed 14790 objects / 467656 bytes in 85ms12-15 14:26:22.192  1259  1436 D dalvikvm: GC_FOR_MALLOC freed 47823 objects / 2142584 bytes in 154ms12-15 14:26:22.208  1259  1263 I ActivityManager: Starting activity: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=http://216.235.81.102:15532/play?now=65&amp;membername;=&amp;session=kxlu1:0&amp;tag=live365&amp;s=kxlu1&amp;d=live365&amp;r=0&amp;app_id=live365:BROWSER%28pro%29 cmp=com.android.browser/.BrowserActivity }12-15 14:26:22.676  1259  1259 I ActivityManager: Starting activity: Intent { act=android.intent.action.VIEW dat=http://216.235.81.102:15532/play?now=65&amp;membername;=&amp;session=kxlu1:0&amp;tag=live365&amp;s=kxlu1&amp;d=live365&amp;r=0&amp;app_id=live365:BROWSER%28pro%29 typ=audio/mpeg cmp=com.android.music/.StreamStarter }12-15 14:26:22.770  1259  8719 I AudioService:   Remote Control   registerMediaButtonEventReceiver() for ComponentInfo{com.android.music/com.android.music.MediaButtonIntentReceiver}12-15 14:26:22.801  8217  8217 V MediaPlaybackService: reloadQueue end12-15 14:26:22.809  8217  8217 V MediaPlaybackService: onCreate end12-15 14:26:22.809  8217  8217 V MediaPlaybackService: onStartCommand end</code></pre><p>I've tried fiddling with various intent.setFlags parameters but to no avail.  Maybe a permissions issue?  Or something to do with how I'm calling startActivity?</p>","214240","","","","","2010-12-21 11:45:03","Unable to launch audio link from Android app","<android><android-intent>","1","0","","",""
"4455891","1","","","2010-12-15 23:07:50","3","1591","<p>I am working on a small, but nice open source project: A <code>RealViewSwitcher</code> that allows to switch between multiple views by performing a horizontal fling - like the Launcher of Android does. It is just a simple <code>ViewGroup</code> that implements <a href=""http://developer.android.com/reference/android/view/ViewGroup.html#onInterceptTouchEvent%28android.view.MotionEvent%29"" rel=""nofollow""><code>onInterceptTouchEvent</code></a> and <a href=""http://developer.android.com/reference/android/view/View.html#onTouchEvent%28android.view.MotionEvent%29"" rel=""nofollow""><code>onTouchEvent</code></a> to make things work. In fact most of the code is taken from the file <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/Workspace.java;h=2e04311f530003dbd76695f46876a785164acb99;hb=HEAD#l572"" rel=""nofollow""><code>Workspace.java</code></a> (line 572 and following), so are the two methods to handle touch events - without many changes.</p><p>However, I don't get this thing to work. My current working class is posted here (on pastebin because it is pretty large):<a href=""http://pastebin.com/8p8GCEZK"" rel=""nofollow"">http://pastebin.com/8p8GCEZK</a></p><p>If I execute my class (just creating it, adding some TextViews and then setting it as the content view of the activity) I get the following output if I do a quick fling:</p><pre><code>12-15 23:53:04.797: INFO/RealViewSwitcher(7477): intercept ACTION_DOWN12-15 23:53:04.797: INFO/RealViewSwitcher(7477): touch ACTION_DOWN12-15 23:53:04.807: INFO/RealViewSwitcher(7477): touch ACTION_MOVE12-15 23:53:04.840: INFO/RealViewSwitcher(7477): touch ACTION_MOVE12-15 23:53:04.867: INFO/RealViewSwitcher(7477): touch ACTION_MOVE12-15 23:53:04.897: INFO/RealViewSwitcher(7477): touch ACTION_MOVE12-15 23:53:04.897: INFO/RealViewSwitcher(7477): touch ACTION_UP</code></pre><p>My problem now is: Whatever I do, I don't get the <code>ACTION_MOVE</code> in my <code>onInterceptTouchEvent</code> method. I read the documentation multiple times and tried to play with the return values, but I don't get any other events than the <code>ACTION_DOWN</code> there - which is ugly, because the actual code that starts the fling resides in the <code>ACTION_MOVE</code> case.</p><p>Can you help me out here? The annoying thing which I can not get: It seems to be implemented the same way in the official Launcher application. But their code works, mine doesn't. What am I missing?</p>","446461","","","","","2012-02-05 00:46:48","Android: Use RealViewSwitcher to switch between views like the home screen does","<android><gui><event-handling><intercept><ontouchevent>","3","2","2","",""
"4455941","1","4456030","","2010-12-15 23:15:45","32","26649","<p>What is wrong with my make file?</p><p>Android.mk</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE    := fooLOCAL_SRC_FILES := foo.cLOCAL_EXPORT_LDLIBS := -lloginclude $(BUILD_SHARED_LIBRARY)</code></pre><p>foo.c</p><pre><code>#include &lt;string.h&gt;#include &lt;jni.h&gt;#include &lt;android/log.h&gt;#define  LOG_TAG    ""foo""#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)void test() {    LOGI(""test"");}</code></pre><p>ndk-build</p><pre><code>foo.c:9: undefined reference to `__android_log_print'</code></pre>","62192","","62192","","2010-12-15 23:23:27","2014-04-15 08:24:14","undefined reference to `__android_log_print'","<android><jni><logging><android-ndk>","3","0","4","",""
"4456088","1","4456106","","2010-12-15 23:38:53","2","10173","<p>Is it just me or can I not find a simple tutorial on accessing the accelerometer in android via google search?Every other time I search for some simple tutorial(countdowntimers, activities, handlers, threads) I can find some but for some reason the accelerometer subject is vague.I use the examples from the sdk as a second or 3rd source once I get a clearer understanding from a simpler(as in for beginners) source, which are the sample tutorials other's provide on their blogs/site.Where can I get a simple accelerometer tutorial?Two books that I own don't have anything on the matter either.</p>","507007","","","","","2012-06-17 09:42:49","Android accelerometer","<java><android><accelerometer>","3","0","2","2012-06-18 11:54:27",""
"4456111","1","4456132","","2010-12-15 23:42:11","2","6121","<p>I am trying to create a <strong>custom Gallery view</strong>.  Or maybe I'm not understanding what I'm supposed to do here.  I need to overwrite the <strong>onFling()</strong> method of the <strong>Gallery</strong> class, but I do not see how I can do this as my main class must extend from <strong>Activity</strong>.</p><p>I have tried making a class called <strong>CustomGallery</strong> that extends <strong>Gallery</strong>, but If I try and run the app I get a force close.</p><p>How does one overwrite the <strong>onFling()</strong> method for a Gallery View?</p><p>Thanks!</p><p><strong>EDIT</strong></p><p>I am attempting Christian's solution below however, this class has errors all over it.  Clearly I am doing this wrong.  Suggestions?</p><pre><code>import android.content.Context;import android.util.AttributeSet;import android.widget.Gallery;public class CustomGallery extends Gallery{    public CustomGallery(Context context)    {        super(context);    }    @Override    public Gallery(Context context)    {        this(context, null);    }    @Override    public Gallery(Context context, AttributeSet attrs)    {        this(context, attrs, R.attr.galleryStyle);    }    @Override    public Gallery(Context context, AttributeSet attrs, int defStyle)    {        //    }}</code></pre><p><strong>EDIT 2</strong></p><p>ok this got it working, thx Christian!</p><pre><code>import android.content.Context;import android.util.AttributeSet;import android.widget.Gallery;public class CustomGallery extends Gallery{    public CustomGallery(Context context, AttributeSet attrs)    {        super(context, attrs);    }}</code></pre>","538576","","538576","","2010-12-16 00:24:04","2010-12-16 00:24:04","How to make a custom Gallery view in android","<android><gallery>","1","0","3","",""
"4456121","1","","","2010-12-15 23:43:24","0","291","<p>I'm running into a strange problem.</p><p>I have a CheckBox defined in a resource file:</p><p></p><p>When trying to see if the checkbox is checked or not, I use the following code:</p><p>CheckBox cb1 = (CheckBox)findViewById(R.id.check1);</p><p>when I execute the following:</p><p>if (cb1.isChecked()){}</p><p>I get a null exception error. I cannot figure out why this is happening.</p><p>Thanks for any help.</p>","490698","","","","","2010-12-16 03:27:01","Android problem: null exception error when dereferencing CheckBox","<android><checkbox>","1","1","","",""
"4456372","1","4464364","","2010-12-16 00:28:45","0","1432","<p>When my activity is started it creates a service that acts as a server. The server receives raw data from my python script on my desktop. The Service creates and maintains DataManagers that handle all the data from my python script in a hash map keyed to the DM's name. At any given time I need an activity to bind to the service request some data from the service and process, when the activity pauses, stops or is destroyed it will unbind.</p><p>I believe I have the binding correct, but when I start the service the passed ServiceConnection is always returned null. Any idea's whats going on? my code was stolen directly from the RemoteService class from AndroidThanks~Aedon</p><p>{Code addendum}</p><p>The HomeScreen Activity that binds to the PublicService</p><pre><code>@Override public void onCreate(Bundle icicle) {    super.onCreate(icicle);    doBindService();    setContentView(R.layout.homescreen);    initView();}public void initView() {    workbenchs = (Gallery)findViewById(R.id.workbenchs);    workbenchs.setMinimumHeight(h/4);    workbenchs.setAdapter(new WorkBenchAdapter(this));    workbenchs.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {            Intent it = new Intent(HomeScreen.this, Controller.class);            it.putExtra(""workbench"", arg2);            startActivity(it);        }    });} // Gallery Adapterpublic class WorkBenchAdapter extends BaseAdapter {    public WorkBenchAdapter(Context c) {   }    public int getCount() {return mBoundService.getNumBenchs();}    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(HomeScreen.this);    i.setImageBitmap(mBoundService.getWorkbench(position).toBitmap());        i.setLayoutParams(new Gallery.LayoutParams(w/4, h/4));        return i;    }} // Service Necessitiespublic boolean mIsBound = false;private PublicService mBoundService;private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder service) {        mBoundService = ((PublicService.LocalBinder)service).getService();    }    public void onServiceDisconnected(ComponentName className) {        mBoundService = null;    }};void doBindService() {    Log.d(TAG, ""Binding..."");    bindService(new Intent(this, PublicService.class), mConnection, Context.BIND_AUTO_CREATE);    mIsBound = true;    Log.d(TAG, ""Bound."");}void doUnbindService() {    if (mIsBound) {        Log.d(TAG, ""Unbinding..."");        unbindService(mConnection);        mIsBound = false;        Log.d(TAG, ""Unbound."");     }}</code></pre><p>My problem comes from the Workbench adapter. When the adapter is created it call get count (which starts as 0), but it keeps saying that the mBoundService is null. I have tried starting the service before binding and that changes nothing...</p>","480691","","244296","","2010-12-16 16:43:56","2010-12-16 18:55:44","Android service connecting?","<android><service><activity><bind><connect>","1","4","","",""
"4456642","1","4458126","","2010-12-16 01:23:42","1","729","<p>I have some rest services returning JSON that are working just fine.  BUT when I make the emulator run through a web proxy (Charles) then all of the sudden I'm getting null for the getResponse().</p><p>Whats frustrating is that I can see in Charles that the response and request look great.</p><ul><li>Anyone else seen problems with org.apache.http.client.HttpClient when the emulator is running through a proxy?</li><li>Suggestions on how to get around this?</li><li>Should I switch to another proxy? I know of fiddler but that is pc only...</li><li>Any other ideas?</li></ul><p>Thanks :)</p>","469682","","","","","2011-09-26 05:19:09","HttpClient response is null when using proxy (Charles)","<android><proxy><httpclient>","2","1","","",""
"4456643","1","4456657","","2010-12-16 01:23:53","5","3159","<p>I have a custom gallery view in which I am overriding some methods.  I would like to be able to call a function in my main activity from this class.  How do I make a reference back to my main class?</p><p>I thought I'd just push the class reference into CustomGallery by creating a setter function --->  g.setBaseClass(this);</p><pre><code>CustomGallery g = (CustomGallery) findViewById(R.id.playSelectionGallery);g.setSpacing(10);g.setCallbackDuringFling(false);g.setAdapter(new ImageAdapter(this));g.setSelection(1);registerForContextMenu(g);g.setBaseClass(this);</code></pre><p>Problem is <strong>this</strong> is of type <strong>Context</strong> and <strong>someFunctionToCall()</strong> will result in a not a member of this class error.  In my custom class I have:</p><pre><code>public void setBaseClass(Context baseClass){    _baseClass = baseClass;}private void callSomeFuntionOnMyMainActivityClass(){    _baseClass.someFunctionToCall();}</code></pre><p>All I want to do is call back to my main class, called ViewFlipperDemo.  This would be easy in As3.  Any thoughts?  Hopefully I'm missing something really simple.</p>","538576","","244296","","2010-12-16 01:32:07","2010-12-16 01:45:12","How can I call a function in my main Activity class from a custom Gallery view in Android?","<android>","1","0","6","",""
"4456697","1","4457270","","2010-12-16 01:34:43","1","2402","<p>I saw a demo of simulateKeyInput,<br>some codes as following:</p><p><code>final IWindowManager windowManager=IWindowManager.Stub.asInterface(ServiceManager.getService(""window""));</code></p><p>But I can't find ServiceManager in package android.os,<br>maybe it's not in android SDK, does anyone know where it is?</p>","542792","","","","","2013-03-01 07:01:02","Where's ServiceManager class in Android?","<android><aidl>","2","0","","",""
"4456741","1","4457051","","2010-12-16 01:43:03","0","590","<p>I've got a image selector/cropper with code taken from <a href=""http://www.androidworks.com/crop_large_photos_with_android"" rel=""nofollow"">this site</a></p><p>They create the image in the phone's external storage but I want to store this in my app's internal storage, a process documented <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"" rel=""nofollow"">here</a></p><p>This is what my function to retrieve the temp file looks like, however when I try to use the file returned from this function, the image does not change. In fact, looking at logcat, it seems resolveUri failed on bad bitmap uri on that file I generated. The error occurs when I try to set the Image URI, leading me to believe it was not saved properly. This is odd to me considering the original code from the site just creates a file in the SD card, and the code works fine for reading/writing to that. So I wonder where the problem arises.</p><pre><code>@Override  public void onActivityResult(int requestCode, int resultCode, Intent data) {    switch (requestCode) {    case PHOTO_PICKED:      if (resultCode == RESULT_OK) {        if (data != null) {          Bundle extras = data.getExtras();          if (extras != null) {            ImageView callerImage = (ImageView)findViewById(R.id.contact_image);            callerImage.setImageURI(Uri.fromFile(getTempFile()));          }        }      }      break;    }  }private File getTempFile() {    try {      FileOutputStream fos = openFileOutput(TEMP_PHOTO_FILE, Context.MODE_WORLD_WRITEABLE);      fos.close();      File f = getFileStreamPath(TEMP_PHOTO_FILE);      return f;    } catch (FileNotFoundException e) {      // To be logged later      return null;    } catch (IOException e) {      // To be logged later      return null;    }}</code></pre>","490703","","490703","","2010-12-16 02:27:28","2010-12-16 02:51:58","where/how to store an image private to my app? (Android)","<android>","1","2","2","",""
"4456826","1","6235670","","2010-12-16 02:00:40","1","8822","<p>I have 2 classes. One will be a basic instructions screen and on that screen it will have a menu that will let you go to the other class.  The other class is a MapActivity.  I believe the problem is that its not finding the other class.  I've tried a few different ways of declaring the intent to find the class.  This is the latest thing I've tried:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu){            MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.mainmenu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId()){    case R.id.goToMap:        Intent intent = new Intent();        intent.setClassName(Main.this, ""Map.Class"");        startActivity(intent);        return true;                }    return false;}</code></pre><p>Its a basic class that extends Activity and the map class is a basic class that extends MapActivity (can that cause a problem?).  And here is the important part of my Manifest file:</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".Campus_Map""              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="".Main"" android:label=""Instructions"" &gt;&lt;/activity&gt;    &lt;activity android:name="".Map"" android:label=""Map""&gt;        &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p>Edit:When looking at the LogCat to figure out what was happening, I'm getting a java.lang.NoClassDefFoundError and a few other messages saying ""Link of class ./Map failed"", ""Could Not find class ./Map referenced from method ./Main.run"" and ""VFY: unable to resolve const-class 37""</p>","549212","","549212","","2010-12-16 02:55:40","2013-08-29 16:26:58","Android start activity on Menu Item selection","<android><menu><activity><android-intent><android-2.1-eclair>","4","0","2","",""
"4456921","1","","","2010-12-16 02:19:37","1","5658","<p>I am trying to consume a web service that I created locally from an Android application.My problem is that in my Android app, at a certain point, I have to give an URL with parameters that looks like this : <a href=""http://localhost:8080/CalculatorApp/CalculatorWSService/add?i=1&amp;j=1"" rel=""nofollow"">http://localhost:8080/CalculatorApp/CalculatorWSService/add?i=1&amp;j=1</a></p><p>where <code>CalculatorWS</code> is the web service I use, <code>add</code> is the operation in it and <code>i</code> and <code>j</code> are parameters of <code>add</code> operation. For now I am using a sample app Calculator (from NetBeans) for testing and I want to retrieve the correct URL to give to my web service client (Android app) so it can give me back an XML to parse.</p><p>I tried to use that URL mentioned above but it doesn't work.</p><p>Does anybody know what is the correct URL to put ?</p>","438244","","313758","","2010-12-16 03:39:54","2014-02-24 10:14:43","Consuming a web service in an android application in localhost","<android><web-services><netbeans-6.9>","4","7","","",""
"4456940","1","","","2010-12-16 02:24:38","0","989","<p>Is it possible to create a custom InputType for the Android keyboard to use?</p><p>I want to make it so the keyboard shows the number pad first and then after a user types in a float or an integer followed by a space I want it to switch to the default alpha keyboard.</p><p>I tried using a TextWatcher instance, but this seems buggy on anything above 2.0 (sometimes it would lose a character, this doesn't happen on 1.6 or below).</p><p>Any ideas?</p><p>Thanks for reading.</p>","215056","","","","","2010-12-16 02:31:04","Create a custom InputType","<android><edittext>","1","2","","",""
"4457008","1","4457020","","2010-12-16 02:39:35","1","1145","<p>I want to update the content of a file on my res/raw folder called dbschema.xml, using a newer version of dbschema.xml that is somewhere on the phone (for exemple, at data/data//dbschema.xml)I've already done the part to check if the new file exists, and i want now to copy it to raw.Do you have any idea?Thanks.</p>","543691","","","","","2010-12-16 02:42:56","Android - update a file in res/raw folder","<android>","1","0","","",""
"4457030","1","4457063","","2010-12-16 02:46:03","44","43215","<p>I have a ImageButton and I want show a text and a image on it. But when I try </p><pre><code>&lt;ImageButton android:text=""OK"" android:id=""@+id/buttonok"" android:src=""@drawable/buttonok""android:layout_width=""match_parent"" android:layout_height=""wrap_content""/&gt;</code></pre><p>I get on Emulator the button have image  but without the text. How can i show the text, please help me !</p>","502214","","","","","2014-03-27 14:19:58","How to show the text on a ImageButton?","<android><imagebutton>","5","0","6","",""
"4457185","1","","","2010-12-16 03:26:40","0","1389","<p>I am writing an application which is composed of 02 components: a service running in the background and a UI to control the service, visualize data. I put them in one application, running the service in a different process inside the main activity. But when the activity is closed the service is terminated also. How can I leave it running in the background when the activity is closed? </p><p>Thank you all for giving me a clue to my problems!</p><p>Regards,</p>","544230","","","","","2013-01-14 23:25:20","Android: how to leave a service running after closing activities?","<android><service><background><activity>","2","2","","",""
"4457204","1","","","2010-12-16 03:32:47","0","351","<p>So I have a service that creates, plays and handles a mediaplayer (just audio), yet I have a seekbar in the main activity that I want to, naturally, show the progress of the audio file and allow the user to seek to various positions.</p><p>What I'm having a hell of a time figuring out is: what would be the best or proper way to connect the seekbar in the UI to the mediaplayer in the service?</p><p>Do I need a remote view?</p><p>Do I want to just bind the activity to the service? (and then how would I connect the seekbar?)</p><p>Do I want to simply keep throwing values back and forth using OnSharedPreferencesListener?</p><p>First of all Java is foreign to me as I only studied C/C++ and the Basics (literally Basic and Visual Basic) years ago. So because I don't have a solid grasp on these things I will be studying Java more in depth, but as of right now, I could really use a bit of insight as to what I should do, this app needs to get finished soon. I'd really appreciate any help anyone can give!</p>","544235","","","","","2010-12-16 03:35:39","How to connect seekbar in Activity with player in Service?","<java><android>","1","0","","",""
"4457208","1","","","2010-12-16 03:34:28","1","2169","<p>I'm calling a WSDL from Android, with Ksoap2 library. I've done it already, without problems, but this WSDL in particular has a lot of different namespaces and this causes big issues. All i've found is </p><p><a href=""http://ksoap.objectweb.org/project/mailingLists/ksoap/msg00454.html"" rel=""nofollow"">http://ksoap.objectweb.org/project/mailingLists/ksoap/msg00454.html</a></p><p>and</p><p><a href=""http://stackoverflow.com/questions/4162598/how-to-parse-a-complex-soap-response-in-android"">How to parse a complex SOAP response in Android</a></p><p>Where they said that you can't fix it out of the box so you have to create a QName class and change SoapObject/PropertyInfo to support it. But i have -no- idea how to do this by hand.</p><p>Is there someone out there that has done something like it?</p><p>Thanks!</p>","544237","","","","","2010-12-16 21:12:17","Calling WSDL with different namespaces with Ksoap2 in Android","<java><android><web-services><wsdl><ksoap2>","1","0","0","",""
"4457219","1","4457996","","2010-12-16 03:39:15","22","7245","<p>I am thinking of creating a core application library (a library project with all the logic), a free version)and a full version  that use this library.</p><p>As I understand some things in the manifest do not merge down like permissions and activities, does the version code merge?  Could I put a single version code in the library to apply to both the free and paid versions?</p><p>The second question is, my current application (The one I will turn into an Android library) depends on a library, therefore if I make it a library, as I understand it, you cannot have a library inherit from a library.  How do I get around this?</p>","248521","","","","","2014-01-06 01:48:07","Library Project does the manifest file merge?","<android>","3","0","4","",""
"4457235","1","","","2010-12-16 03:43:15","0","470","<p>When using GestureDetector to capture gesture on screen, I'm confused by android's screen X-Y coordinate. For example:</p><pre><code>class TouchPadGL extends GestureDetector.SimpleOnGestureListener {    public boolean onScroll(MotionEvent e1, MotionEvent e2,                            float distanceX, float distanceY) {        Log.i(""onScroll"",String.format(""dsX: %s, dsY: %s"",distanceX,distanceY));    }    public boolean onFling(MotionEvent e1, MotionEvent e2,                            float velocityX, float velocityY) {        Log.i(""onFling"",String.format(""vX: %s, vY: %s"",velocityX,velocityY));    }}</code></pre><p>According to output of the above onScroll method, it's seemed the point (0,0) is at the right-down corner of the view, with the X-axe stretch to left and Y-axe stretch upward. But when check the output of the onFling method, you will found that it's seemed (0,0) is at the top-left corner and X-axe stretch to right and Y-axe stretch downward. why could that happen ?</p><p>Is is a bug in the android api or i take it wrong ?</p><p>BTW, the code is run on API 2.1</p>","388887","","","","","2010-12-16 08:55:10","what is the gesture coordinate of a view on android","<android><gesture><coordinate>","1","0","","",""
"4457257","1","","","2010-12-16 03:47:58","0","667","<p>I am using the <code>retrace.bat</code> file to check some stack traces from clients.</p><p>The problem is that the output does not really look like they did before, there are no line numbers and there is the word <code>void</code> appended to class names and <code>(Unknown Source)</code> where line numbers should be.  Is this normal?</p>","248521","","","","","2011-07-19 17:46:07","Android proguard, mapping.txt not working so well","<android>","1","0","3","",""
"4457311","1","4457688","","2010-12-16 04:00:32","2","2861","<p>How can I expose the data in json format ..??? I tried creating a JSON string using C# code in an aspx file and outputting it. For example, On opening default.aspx on browser , it out puts only json string. But I can't use the default.aspx link while processing in android sdk as the http response will include html tags also.</p><p>Basically if I select view source when I open the dafault.aspx, I can see html tags not just the JSON string. when I open json api for twitter,google calender and select view source they does not contain html. Can anyone help me create only json out put ...??? I have data in sql server and  quite good at C# coding.</p><p>Thanks in advance ....!!!</p>","522505","","","","","2012-05-11 09:33:18","Creating JSON output file in C#","<c#><android><json>","4","0","","",""
"4457355","1","","","2010-12-16 04:10:38","1","943","<p>I am trying to make my app view multiple views I made 2 xml files (main, sub) and I switch between them using :</p><p>setContentView(R.Layout.main);</p><p>setContentView(R.Layout.sub);</p><p>When I switch to the sub, it switches fine. However, When I switch back to main, the app crashes and I have no clue why it did that. </p><p>The only line that seems to make it crash is the calling of setContentView(R.Layout.main); for the second time.any clue on that ?</p>","542726","","","","","2010-12-16 04:13:01","switching between views","<android><android-layout>","1","1","","",""
"4457406","1","","","2010-12-16 04:21:34","0","515","<p>I am wondering why the text in my scrollview is blurry when scrolling, even a little bit. I have looked at other appd and they are crisp and clear when scrolling. Anyone know what I might be going wrong?</p><p>Here is 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:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView    android:id=""@+id/breadcrumb_detail""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:padding=""5dip""    android:textColor=""@color/teal""/&gt;&lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_below=""@+id/breadcrumb_detail""&gt;&lt;TextView    android:id=""@+id/detail""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textSize=""19sp""    android:padding=""10sp""    android:layout_below=""@+id/breadcrumb_detail""/&gt;&lt;/ScrollView&gt;</code></pre><p>    </p>","485438","","","","","2010-12-16 04:21:34","Android: Text in scrollview is blurry when scrolling","<android><scrollview>","0","2","","",""
"4457414","1","","","2010-12-16 04:24:54","0","688","<p>In my application, I record some video. After recording the video I need to show the video thumbnail; I get the thumbnail but it is only an image -- it does not contain the play image on the thumbnail.</p><p>How can I add the play icon to the image?</p><pre><code>BitmapFactory.Options options=new BitmapFactory.Options();options.inSampleSize = 1;Bitmap curThumb =    MediaStore.Video.Thumbnails.getThumbnail(cr, id,    MediaStore.Video.Thumbnails.MICRO_KIND, options);image.setImageBitmap(curThumb);</code></pre>","487219","","377270","","2011-07-13 10:34:54","2011-07-13 10:34:54","Android video recording & Thumbnail","<android>","1","0","","",""
"4457492","1","4457526","","2010-12-16 04:41:42","32","62735","<p>How do I use the <code>AndroidHttpClient</code> as an HTTP client to connect to a remote server? I have not been able to find good examples in the documentation nor on the internet.</p>","538626","","707111","","2014-04-10 21:20:47","2014-04-10 21:20:47","How do I use the Simple HTTP client in Android?","<android><http>","4","5","17","2013-03-15 03:48:03",""
"4457503","1","4457557","","2010-12-16 04:43:26","2","2378","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1826535/android-nosuchalgorithmexception-sslcontext-ssl-implementation-not-found"">Android NoSuchAlgorithmException: “SSLContext SSL implementation not found”</a>  </p></blockquote><p>Has anybody experience with this error in Android? It is thrown by this line:</p><pre><code>SSLContext context = SSLContext.getInstance(""SSL"");</code></pre>","351723","","","","","2010-12-16 04:55:33","Android: SSLContext SSL implementation not found","<android><ssl>","1","0","","2013-01-29 13:22:34",""
"4457546","1","","","2010-12-16 04:52:59","3","3907","<p>Can I integrate Java DB or Apache Derby in my Android application? Or any inline or embedded database. Can anyone suggest code for it? I need some code because i have to make examples, not in theory.</p><p>Anyone knows if this databases is supported or not?</p><p>I thinks these are the inMobile DB, but i didn't find any related information in Google.</p>","543022","","382763","","2010-12-20 16:36:53","2011-02-15 11:25:55","Java DB / Apache Derby with Android","<android><derby><javadb>","3","0","1","",""
"4457671","1","","","2010-12-16 05:22:01","5","980","<p>If I have an image in a Mercator map projection with a particular upper left <code>latitude/longitude</code> and lower right latitude longitude, how would I add this to the Android MapView?  </p><p>Do I have to extend the overlay class, figure out my current MapView extents and then clip the image using like a <code>BufferedImage</code>?  Or do I have to have the image already set up in the same tile structure that Google Maps uses and then just add these tiles to the MapView using an extended Overlay class? </p>","544307","","683261","","2012-01-12 04:50:21","2012-01-12 04:50:21","Add an image to Android MapView","<android><image><google-maps><android-mapview>","2","1","1","",""
"4457755","1","","","2010-12-16 05:37:16","0","418","<p>How to change type face of <code>PreferenceScreen</code> to use a custom font? Because <code>PreferenceScreen</code> is a final class, there is no way to extend it and set its type face in <code>onBindView(View)</code>. </p>","248557","","248557","","2010-12-16 17:06:23","2010-12-16 17:06:23","Use custom type face in PreferenceScreen","<android><android-preferences>","1","1","","",""
"4457757","1","","","2010-12-16 05:37:40","0","1122","<p>I want to launch my own settings app when entering in ""Wi-Fi Settings"" (Settings/Wireless Settings). Checking the AndroidManifest.xml of the Settings app in the android source code...the intent filter created for that WifiSettings activity is this:</p><pre><code>&lt;activity android:name="".wifi.WifiSettings""                android:label=""@string/wifi_settings""                android:configChanges=""orientation|keyboardHidden""                android:clearTaskOnLaunch=""true""                &gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;action android:name=""android.settings.WIFI_SETTINGS"" /&gt;                &lt;action android:name=""android.net.wifi.PICK_WIFI_NETWORK"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;category android:name=""android.intent.category.VOICE_LAUNCH"" /&gt;                &lt;category android:name=""com.android.settings.SHORTCUT"" /&gt;            &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>For my own app, the intent-filter that I created is this: </p><pre><code>    &lt;activity android:name="".MyWifiSettings""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;action android:name=""android.settings.WIFI_SETTINGS"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>For some reason this does not work. I'm missing something and I don't know what. Any suggestions?</p><p>Thanks in advanced!!</p>","544322","","","","","2011-01-20 16:24:08","problem creating an intent-filter to launch my app","<android><android-intent><android-manifest><intentfilter>","2","0","","",""
"4457855","1","4458325","","2010-12-16 05:55:36","1","403","<p>I have an app with a single activity in it. I need to display a branding/splash screen whenever my app is started from it's icon.  My client is extremely emphatic about this, there must always be a splash screen when starting up the app.  (note that there is a legal notice on it as well, so apparently the lawyers are involved in this decision)</p><p>Of course the splash screen should <em>not</em> show up when the orientation changes, or when coming back to the app after, say, making a phone call (the app can launch the phone dialer, BTW).</p><p>I know that the app ins't always really ""starting"" when it comes up, as it may have been running recently and the activity kept alive.  However my client doesn't care about this technicality, to them if you start it from an icon you are ""starting"" the app and it must show the splash screen. </p><p>Any good strategies for this?  I don't know how to tell the difference between the various ways the activity could be initiated.</p>","226507","","","","","2010-12-16 07:58:27","do something only when app ""starts""","<android>","5","2","","",""
"4457861","1","","","2010-12-16 05:56:43","0","493","<p>I stored one image on harddisk on my computer .How can i upload that image to the webserver from my android mobile.anybody can give me example coding for that?</p>","538626","","","","","2010-12-16 06:13:51","How can i upload that image to the webserver ","<android><file><upload><webserver>","1","0","","",""
"4457897","1","4457919","","2010-12-16 06:02:59","0","299","<p>why android 2.2 phones not upgradeable to 2.3? Is there any hardware requirement?</p>","544345","","","","","2010-12-16 06:06:04","android 2.2 and 2.3","<android>","1","1","","",""
"4457931","1","4457950","","2010-12-16 06:08:00","3","659","<p>I'm new to Android platform and currently considering Admob integration into my application. I have 2 questions regarding this:</p><ol><li><p>I've managed to integrate Admob test ads into my app but don't know how to get real ads in it. Despite setting testing=""false"", it's still showing me the test ads only.</p></li><li><p>It's not supporting orientation in landscape mode. I read in a post that Admob doesn't support orientation but the post was quite old. I want to know wheather it's supported now.</p></li></ol><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2010-12-16 06:10:19","Admob orientation support in Android","<android><orientation><admob><ads>","1","0","","",""
"4457987","1","","","2010-12-16 06:15:59","0","4436","<p>I need to delete the database file.Here is my code to delete the file.</p><pre><code>String strDBFilePath=""/data/data/snow.AppStore/databases/""+strAppDBName;File file = new   File(strDBFilePath);file.delete();</code></pre><p>But it i can't delete the DB file.How to delete DB ????</p>","538642","","","","","2010-12-16 07:20:54","how to delete the database in Android?","<android>","2","0","1","",""
"4458003","1","4458075","","2010-12-16 06:18:36","1","586","<p>This question seems silly. But I'm new to javascript and sencha touch.</p><p>Can I use Ext.JS's APIs in Sencha Touch backed project? I find Ext.util.Cookies is only in Ext.JS, not in Sencha Touch. Can I use it in my project~</p><p>Thanks</p>","544343","","","","","2011-03-29 07:35:49","Can I use Ext.JS's APIs in Sencha Touch?","<javascript><iphone><android><extjs><sencha-touch>","1","0","1","",""
"4458046","1","","","2010-12-16 06:27:46","25","6287","<p>I am writing an app which lists all the certificates installed onthe device. But I found that there are two places where certificatesare stored:</p><ol><li><p><strong>System/etc/security/cacerts.bks</strong>: This file contains list of allpre-installed certificate. I am able to read this file usingKeystore class defined in frameworks/base/keystore/java/android/security.</p></li><li><p><strong>data/misc/keystore</strong>: Another way to install certificates (e.g. throughcertinstaller app) installs third party certificate and makesits entry in this directory.</p></li></ol><p>But I am not getting how to read certificate info like SerialNumber,IssuerDN etc. from this file.</p>","544365","","869458","","2012-01-04 20:20:31","2013-06-10 09:37:58","Listing all installed certificates on android","<android><certificate>","3","0","5","",""
"4458315","1","4458585","","2010-12-16 07:20:03","0","297","<p>I want to populate the android tableview's rows with an array at runtime...How to go about it....please advise</p><p>Thanks,</p>","517234","","","","","2010-12-16 08:04:18","Addint textview to tableview dynamically","<android>","2","0","","",""
"4458373","1","","","2010-12-16 07:29:04","2","1276","<p>I've got a kind of heavy Android application and want to make sure not never ANR it.</p><p>I've moved my database queries away from the UI thread (to AsyncTasks), but I still read from the cursor in the ui thread since I suppose the returned cursor is stored somewhere in memory, i.e. the actual reading of it does not go the entire way to the database. Is that correct or do i really need to move all reads of the cursor to non UI threads as well?</p><p>To be more specific:</p><p>Does for example <a href=""http://developer.android.com/reference/android/database/Cursor.html#getInt(int"" rel=""nofollow"">http://developer.android.com/reference/android/database/Cursor.html#getInt(int</a>) read from memeory, or does it aquire some kind of read lock from the actual SQLite database.</p><p>I guess the Cursor implementation in my case is an SQLiteCursor since the ContentProvider is implemented using an SQLite database.</p>","544416","","52626","","2011-03-27 21:12:56","2011-03-27 21:12:56","Does reading of a Android Cursor go all the way to the database?","<android><database>","1","0","2","",""
"4458401","1","6130417","","2010-12-16 07:33:21","6","867","<pre><code>public class Main extends Activity {    int field = 0;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        int local = 0;        field = local;        local = field;    }}</code></pre><p>I've put ""watchpoint"" on ""field"" and in ""Breakpoint Properties"" I confirmed that both access and modification are being watched. But the watchpoint didn't trigger the debugger to pause execution of program. Tried both in 2.2 AVD and on Desire with USB Debugging enabled.Anyone has experience on how watchpoint works with Android?</p><p>Thanks,Ryan</p>","368496","","","","","2011-05-25 20:23:23","Variable watchpoint doesn't work in Eclipse/ADT Android projects","<android><eclipse>","1","0","2","",""
"4458420","1","","","2010-12-16 07:36:13","3","1064","<pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;    &lt;include        layout=""@layout/view1""         android:layout_gravity=""center_vertical"" /&gt;    &lt;include        layout=""@layout/view2""        android:layout_gravity=""center_vertical"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>So, android:layout_gravity will be always ignored? That's really bad for code reusability...It seems like layout_margin doesn't supported either.</p><p>And here is view1.xml layout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""horizontal""    android:minHeight=""45dip""    android:background=""@drawable/updater_background"" &gt;    &lt;ProgressBar        style=""?android:attr/progressBarStyleSmall""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center_vertical""        android:layout_marginRight=""7dip""        android:visibility=""gone"" /&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center_vertical"" /&gt;&lt;/LinearLayout&gt;</code></pre>","544406","","544406","","2010-12-16 08:12:35","2013-04-09 11:24:14","layout ""include"" feature doesn't support layout_gravity property?","<android><layout><include>","2","4","3","",""
"4458473","1","4458596","","2010-12-16 07:46:24","1","854","<p>i am able to launch any apps which are on emulator screen from my app just with the help of their package names but after launching those apps if i press home button and if i launch the same app from my app it's being launched from initial state not where i used and left that before...for that i tried setting the <code>FLAG_ACTIVITY_REORDER_TO_FRONT</code> on the intent which is used to launch the app but there is no effect...Here is my code</p><pre><code>PackageManager packageManager = getPackageManager();Intent intent=new Intent();intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);intent=packageManager.getLaunchIntentForPackage(""com.android.email"");startActivity(intent);</code></pre>","505580","","473070","","2010-12-16 08:04:27","2010-12-16 08:06:09","How to invoke any app without losing its previous state?","<android><android-intent>","1","0","","",""
"4458529","1","","","2010-12-16 07:54:25","5","6550","<p>am using mediacontroller in my app,but it show only for 3s ,i have serached a lot but in every document i see only show function, set time out but it have no effect. How can i show mediacontroller always</p><p>i have tested show(0) ,but no effect </p>","487219","","510491","","2011-04-19 12:48:26","2014-02-17 01:30:41","Android MediaController show always","<android><mediacontroller>","5","0","","",""
"4458565","1","","","2010-12-16 08:00:05","8","6255","<p>I'm using a photo picker intent to choose an image and write it to an application-private file. Most of my important source code is shown below. Once I press a button and perform the first image selection intent, then it successfully updates the image view. However, once I press the image selection button again (in the same activity), then the image view does NOT update, unless I exit and restart the activity. So I know the image is getting successfully saved, but why would the ImageView in the layout not refresh or update?</p><pre><code>public void onResume() {    super.onResume();    ImageView myImageView = (ImageView)findViewById(R.id.contact_image);    if (hasImage) {      myImageView.setImageURI(Uri.fromFile(getFileStreamPath(TEMP_PHOTO_FILE)));    }  }  @Override  public void onActivityResult(int requestCode, int resultCode, Intent data) {    switch (requestCode) {    case PHOTO_PICKED:      if (resultCode == RESULT_OK) {        if (data != null) {          Bundle extras = data.getExtras();          if (extras != null) {            hasImage = true;            bmp = (Bitmap) extras.get(""data"");          }        }      }      break;    }  }  private OnClickListener mChooseImage = new OnClickListener() {    @Override    public void onClick(View v) {      try {        // Launch picker to choose photo for selected contact        Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);        intent.setType(""image/*"");        intent.putExtra(""crop"", ""true"");        intent.putExtra(""aspectX"", 1);        intent.putExtra(""aspectY"", 1);        intent.putExtra(""outputX"", ICON_SIZE);          intent.putExtra(""outputY"", ICON_SIZE);        intent.putExtra(""scale"", true);        intent.putExtra(""return-data"", false);        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(getTempFile()));        intent.putExtra(""outputFormat"", Bitmap.CompressFormat.JPEG.toString());        startActivityForResult(intent, PHOTO_PICKED);      } catch (ActivityNotFoundException e) {        // LOG THIS      }    }  };private File getTempFile() {    try {      if (!hasImage) {        FileOutputStream fos = openFileOutput(TEMP_PHOTO_FILE, MODE_WORLD_WRITEABLE);        fos.close();      }      return getFileStreamPath(TEMP_PHOTO_FILE);    } catch (FileNotFoundException e) {      // To be logged later      return null;    } catch (IOException e) {      // To be logged later      return null;    }  }</code></pre><p>upon activity result, I set the ImageView's image URI to this file.</p><p>When it first completes, the ImageView changes to reflect this. However, if I attempt to choose the image again (same activity), the ImageView will not update until I exit and re-enter the activity. I'm not sure why this happens, is it because I'm trying to write to the temp.jpg everytime? Or do I need to refresh my layout somehow to reflect changes in the ImageView?</p>","490703","","490703","","2010-12-16 10:20:42","2013-06-10 20:43:23","ImageView not refreshing/reflecting changes","<android>","4","3","2","",""
"4458635","1","4458821","","2010-12-16 08:12:04","3","559","<p>I'd like to display a millisecond timer value in a game. </p><p><code>String.format</code> is hellishly slow on Android, so I can't use it. I currently use this:</p><pre><code>long elapsedMillis = ...; //elapsed millisecondsint whole = (int)(elapsedMillis / 1000);int fraction = (int)(elapsedMillis % 1000);StringBuilder sb = new StringBuilder(""TIME:"");sb.append(whole);sb.append('.');if(fraction &lt; 10)sb.append(""00"");else if(fraction &lt; 100)sb.append(""0"");sb.append(fraction);g.drawText(sb.toString(), ...);</code></pre><p>but I think it could be done faster. Can you please guide me in the right direction? Thanks</p><hr><p><a href=""http://stackoverflow.com/questions/242438/java-performance-of-stringbuilder-in-a-loop"">related question</a></p>","72746","","72746","","2010-12-16 09:22:04","2010-12-16 09:22:04","How to quickly format floating point number in Android game loop?","<android><string><formatting><string-formatting>","1","3","1","",""
"4458752","1","","","2010-12-16 08:32:44","2","12890","<p>I know how to programatically get a gallery image (one by one).</p><p>Now that the gallery is organised folderwise </p><p>Is there a way to select and get the path of a folder in the gallery view...</p><p><img src=""http://i.stack.imgur.com/qkfjV.jpg"" alt=""alt text""></p>","533652","","","","","2013-10-29 12:20:02","get the path of a Gallery Folder in Android","<android><android-emulator><gallery><image-gallery>","1","1","","",""
"4458841","1","","","2010-12-16 08:43:47","3","786","<p>What is the programming language for every operating system?</p>","544485","","473070","","2011-02-01 08:52:19","2011-02-01 08:52:19","I need to create a smart phone application that could be run on all smart phones, How can i do this?","<java><iphone><android><mobile-phones><smartphone>","6","2","1","",""
"4458863","1","4459608","","2010-12-16 08:45:44","0","1420","<p>How to align view to right of the screen in Android ?</p><p>i have used </p><pre><code>&lt;LinearLayout android:id=""@+id/heading"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:orientation=""horizontal""&gt;    &lt;ImageView android:id=""@+id/widget30"" android:layout_width=""wrap_content""         android:layout_height=""wrap_content"" android:src=""@drawable/logo_cpw""&gt;    &lt;/ImageView&gt;    &lt;EditText android:id=""@+id/widget28"" android:layout_width=""134px""        android:layout_height=""35px"" android:text=""EditText""        android:textSize=""18sp"" android:background=""@drawable/rounded_edit_text_effects""        android:gravity=""right"" android:layout_alignParentRight=""true""&gt;    &lt;/EditText&gt;&lt;/LinearLayout&gt;</code></pre><p>But it is not aligning to the right ? any help ?</p>","487604","","272824","","2010-12-16 10:05:19","2011-10-06 17:36:26","How to align view to right of the screen in Android?","<android>","3","1","","",""
"4458880","1","","","2010-12-16 08:47:43","0","1249","<p>How do we use a HashMap of Weak References to Objects in android to pass complex objects between activities? I want to pass an object of a class from one activity to another how can I achive this in android. I knew i can use putExtra() method for this. But this methods does not pass any objects directly it pass simple data structures. Please help</p><p>Thanks in advance.</p>","541442","","","","","2010-12-31 04:21:09","A HashMap of Weak References to Objects in android","<android>","2","0","1","",""
"4458909","1","4505151","","2010-12-16 08:51:30","9","3034","<p>When using Proguard with Android, methods that are only invoked via reflection (e.g., callbacks defined in onClick XML attributes) are erroneously stripped out.</p><p><a href=""http://stackoverflow.com/questions/4447145/proguard-and-reflection-in-android-solved"">One solution</a> for this issue is to add each affected class and method to your proguard.cfg.</p><p>How can I use Java annotations to achieve the same effect?</p><p>I feel that would make the code self-documenting and it would avoid code and proguard.cfg drifting out of sync. However, Android's Proguard doesn't seem to ship with the annotations.jar mentioned in its documentation.</p>","2967","","","","","2010-12-22 04:56:58","How to use Java annotations to guide Android's Proguard?","<java><android><annotations><proguard>","2","0","7","",""
"4458930","1","4518006","","2010-12-16 08:53:31","3","1849","<p>i'm using this snippet to check if an app/activity is installed:</p><pre><code>    public static boolean isIntentAvailable(Context context, String action) {    final PackageManager packageManager = context.getPackageManager();    final Intent intent = new Intent(action);    List&lt;ResolveInfo&gt; list =            packageManager.queryIntentActivities(intent,                    PackageManager.MATCH_DEFAULT_ONLY);    return list.size() &gt; 0;}public static boolean isScanAvailable(Context context) {    return isIntentAvailable(context, ""com.google.zxing.client.android.SCAN"");}</code></pre><p>In the above example it checks if the Barcode Scanner App is installed, which works just fine.However, if i try to check for the Adobe Flashplayer using <code>com.adobe.flashplayer</code> it doesn't work and always returns false.</p><p>Is there a better / more reliable method to check for Flash? </p>","455958","","455958","","2010-12-17 04:14:35","2010-12-23 10:45:34","How to check if Flash is installed?","<android><flash>","1","0","5","",""
"4458988","1","4475671","","2010-12-16 09:03:00","1","336","<p>I am working with an imageview with pinchzoom. But i cannot use it with SDK version 4. geting error in ACTION_POINTER_UP,get(0) and MotionEvent.ACTION_MASK. It works fine when minimum sdk is set to 5 and Google API of API level 5 is selected.</p><p>My question is  <strong>Can i trigger ACTION_POINTER_UP with google api[level 4]</strong></p>","450487","","450487","","2010-12-16 09:30:09","2010-12-17 23:31:13","Issue with ACTION_POINTER_UP,getX(0)","<android><pinch>","1","0","","",""
"4459058","1","","","2010-12-16 09:12:17","88","78064","<p>I want to implement a schedule function in my project. So I Googled for an Alarm manager program but I can`t find any examples. </p><p>Can anyone help me with a basic alarm manager program?</p>","513162","","345078","","2012-01-20 12:23:32","2014-04-02 07:11:59","Alarm Manager Example","<android><alarmmanager>","5","2","67","",""
"4459061","1","4459090","","2010-12-16 09:12:38","0","4130","<p>How to align view to right of the screen in Android ?I have used this but not worked please help ?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/widget0""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:background=""#FFFFFF"" android:paddingLeft=""10px"" android:paddingTop=""10px""    android:paddingBottom=""10px"" android:paddingRight=""10px""&gt;    &lt;LinearLayout android:id=""@+id/heading"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:orientation=""horizontal""&gt;        &lt;ImageView android:id=""@+id/widget30"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:src=""@drawable/logo_cpw""&gt;        &lt;/ImageView&gt;            &lt;EditText android:id=""@+id/widget28"" android:layout_width=""134px""                android:layout_height=""35px"" android:text=""EditText""                android:textSize=""18sp"" android:background=""@drawable/rounded_edit_text_effects""                android:gravity=""right"" android:layout_alignParentRight=""true"" android:paddingRight=""-10px""&gt;            &lt;/EditText&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I have used absoluteLayout instead of relativelayout, but that too not worked. Please help ?</p>","487604","","1004274","","2012-11-12 07:27:59","2012-11-12 07:27:59","How to align view to right of the screen in Android?","<android>","1","0","","",""
"4459085","1","","","2010-12-16 09:15:36","0","4411","<p>Hey Friends,<br>how can i develop a video chat app,i have a channel for video chat, i need to connect my app with that,how can it possible?</p>","404183","","","","","2010-12-16 09:54:37","Video Chat using Android","<java><android>","1","1","","",""
"4459138","1","4484086","","2010-12-16 09:21:54","4","10305","<p>I am trying to <strong>add a new contact</strong> to the Android 2.2 contacts directly.</p><pre><code>//this code doesn't work    ContentValues cv=new ContentValues();cv.put(ContactsContract.Contacts.DISPLAY_NAME, ""TESTEST"");Uri u= getContentResolver().insert(ContactsContract.Contacts.CONTENT_URI, cv);</code></pre><p>gives me the error ""Aggregate contacts are created automatically.""What am I doing wrong?</p><p>This calls the Android's <strong>add contact form</strong>:</p><pre><code>//this code works but it's not idealIntent i = new Intent(Intent.ACTION_INSERT_OR_EDIT);i.setType(Contacts.CONTENT_ITEM_TYPE);i.putExtra(Insert.NAME, ""TESTTEST"");i.putExtra(Insert.PHONE, ""209384"");startActivity(i);</code></pre><p>I can't figure out how to send it a first name and a last name - only a 'name' which it puts in the first name box. Also I'd like to separate the postal code into street, city, state, and zip which right now is all being put into the street box.</p>","544531","","544531","","2010-12-19 17:28:38","2014-03-12 06:05:07","Insert contact in Android with ContactsContract","<android><activity><android-intent><contacts><contactscontract>","4","0","","",""
"4459163","1","4537737","","2010-12-16 09:25:38","0","700","<p>I have app in which i used soundmanager with 26 sounds.it works fine in simulator but when i tried it in my samsung galaxy it played twice some of the sounds.And it randomly twice any sound.</p><p>Pls help me regard abt it.if it is soundmanager have a limit or</p>","544537","","","","","2012-06-02 21:27:35","Android SoundManager Problem","<android>","1","4","","",""
"4459207","1","4460483","","2010-12-16 09:32:36","0","335","<p>I have a service to contact the server to do some data transfer from my app periodically. Its working fine. </p><p>But when i restarted(switch off and on) my phone that service can not be restarted. so my idea  is that to start that service again when the user open my app after restarting the phone. For that, i have to know about my service is running or not? how to do it? </p><p>Any other idea to handle this scenario also thankful.</p><p>Thanks in advance.</p>","267269","","267269","","2010-12-16 09:57:56","2010-12-16 11:53:29","Finding my service is running or not in Android?","<android><service><android-service>","3","0","","",""
"4459244","1","","","2010-12-16 09:36:41","-2","589","<p>how to send voicemail in android</p>","533677","","","","","2010-12-16 11:48:10","how to send voicemail in android","<android>","1","0","","2010-12-16 23:01:01",""
"4459245","1","4459435","","2010-12-16 09:36:44","0","1365","<p>I need to show the progress Message to the user.But i can't able to show that.Here is my code.What's wrong in my code.Guide me to do.</p><pre><code>public class MyProgressDemo extends Activity {/** Called when the activity is first created. */private Button clickBtn;public ProgressDialog progressDialog;Handler handler = new Handler();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    clickBtn = (Button) findViewById(R.id.Button01);    clickBtn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            progressDialog = ProgressDialog.show(MyProgressDemo.this, """",                    ""Please Wait"");            processThread();        }    });}protected void processThread() {    handler.post(new Runnable() {        @Override        public void run() {            longTimeMethod();            UI();            progressDialog.dismiss();        }    });}private void longTimeMethod() {    try {        String strMethod = ""MethodName"";        String strUrl = ""url"";        String strResponse = WebserviceCall.Mobileaappstore(strUrl,                strMethod);        Log.d(""RES"", strResponse);    } catch (Exception e) {        Log.e(""Exc"", e.getMessage());    }}private void UI() {    TextView tv = new TextView(this);    tv.setText(""This is new UI"");    setContentView(tv);}</code></pre><p>}</p>","538642","","","","","2010-12-16 09:57:00","how to show the progress Dialog in Android?","<android>","3","0","1","",""
"4459299","1","4459331","","2010-12-16 09:43:31","-1","331","<p>Is there any proper way as suggested by google or android official documentation to close an application in android with out using any task killer tools .... </p><p>I ask this question as a android use not as developer..... </p>","516982","","","","","2010-12-16 09:47:17","how to close an application in android","<android>","1","3","","",""
"4459400","1","4461534","","2010-12-16 09:53:21","2","2005","<p>How can we combine JAVA code and AIR codes for an app development in androidhere is an example,<a href=""http://rosarioconti.wordpress.com/2010/10/03/extending-your-android-air-application-using-java/"" rel=""nofollow"">http://rosarioconti.wordpress.com/2010/10/03/extending-your-android-air-application-using-java/</a>but will it work???i need to call some air codes in my android app??<br>EDIT<br>i need this code in the AIR to be called from JAVA is it possible?<a href=""http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/"" rel=""nofollow"">http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/</a>or basically i need is a service like this,is this possible in JAVA?</p>","404183","","404183","","2010-12-16 15:27:07","2011-02-03 03:28:26","Combining JAVA and AIR codes for Android app","<java><android><flex><air>","1","1","","",""
"4459458","1","4548983","","2010-12-16 09:59:02","11","11216","<p>I'm having this weird problem, where including the <code>phonegap.js</code> file in my project causes the app to crash on both the android emulator and my phone. I got the latest file from <a href=""https://github.com/phonegap/phonegap-android"">GitHub</a>, so I can't see why this isn't working.</p><p>This happens even if I try to build the sample project that's included in the PhoneGap download...</p><p>Console log:</p><pre><code>[2010-12-17 11:05:14 - sample] Android Launch![2010-12-17 11:05:14 - sample] adb is running normally.[2010-12-17 11:05:14 - sample] Performing com.phonegap.sample.sample activity launch[2010-12-17 11:05:14 - sample] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'FirstDevice'[2010-12-17 11:05:16 - sample] Uploading sample.apk onto device 'emulator-5554'[2010-12-17 11:05:16 - sample] Installing sample.apk...[2010-12-17 11:05:21 - sample] Success![2010-12-17 11:05:22 - sample] Starting activity com.phonegap.sample.sample on device emulator-5554[2010-12-17 11:05:23 - sample] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.phonegap.sample/.sample }</code></pre><p>LogCat:</p><pre><code>12-17 11:13:12.533: DEBUG/AndroidRuntime(373): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;12-17 11:13:12.533: DEBUG/AndroidRuntime(373): CheckJNI is ON12-17 11:13:13.453: DEBUG/AndroidRuntime(373): Calling main entry com.android.commands.pm.Pm12-17 11:13:13.503: DEBUG/AndroidRuntime(373): Shutting down VM12-17 11:13:13.513: DEBUG/dalvikvm(373): GC_CONCURRENT freed 101K, 71% free 297K/1024K, external 0K/0K, paused 2ms+2ms12-17 11:13:13.523: INFO/AndroidRuntime(373): NOTE: attach of thread 'Binder Thread #3' failed12-17 11:13:13.523: DEBUG/dalvikvm(373): Debugger has detached; object registry had 1 entries12-17 11:13:14.113: DEBUG/AndroidRuntime(383): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;12-17 11:13:14.113: DEBUG/AndroidRuntime(383): CheckJNI is ON12-17 11:13:14.853: DEBUG/AndroidRuntime(383): Calling main entry com.android.commands.am.Am12-17 11:13:14.894: INFO/ActivityManager(62): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.phonegap.sample/.sample } from pid 38312-17 11:13:14.973: INFO/ActivityManager(62): Start proc com.phonegap.sample for activity com.phonegap.sample/.sample: pid=391 uid=10031 gids={1006, 3003, 1015}12-17 11:13:14.983: DEBUG/AndroidRuntime(383): Shutting down VM12-17 11:13:15.053: DEBUG/dalvikvm(383): GC_CONCURRENT freed 102K, 69% free 319K/1024K, external 0K/0K, paused 2ms+2ms12-17 11:13:15.093: INFO/AndroidRuntime(383): NOTE: attach of thread 'Binder Thread #3' failed12-17 11:13:15.143: DEBUG/dalvikvm(383): Debugger has detached; object registry had 1 entries12-17 11:13:15.523: DEBUG/dalvikvm(33): GC_EXPLICIT freed 11K, 54% free 2520K/5379K, external 716K/1038K, paused 467ms12-17 11:13:15.663: DEBUG/dalvikvm(33): GC_EXPLICIT freed &lt;1K, 54% free 2520K/5379K, external 716K/1038K, paused 132ms12-17 11:13:15.772: DEBUG/dalvikvm(33): GC_EXPLICIT freed &lt;1K, 54% free 2520K/5379K, external 716K/1038K, paused 113ms12-17 11:13:16.333: INFO/ARMAssembler(62): generated scanline__00000177:03515104_00001002_00000000 [ 87 ipp] (110 ins) at [0x43aff6f0:0x43aff8a8] in 686000 ns12-17 11:13:17.493: INFO/ActivityManager(62): Displayed com.phonegap.sample/.sample: +2s540ms12-17 11:13:18.163: DEBUG/szipinf(391): Initializing inflate state12-17 11:13:18.173: DEBUG/szipinf(391): Initializing zlib to inflate12-17 11:13:18.573: WARN/dalvikvm(391): JNI WARNING: jarray 0x40567330 points to non-array object (Ljava/lang/String;)12-17 11:13:18.593: INFO/dalvikvm(391): ""WebViewCoreThread"" prio=5 tid=9 NATIVE12-17 11:13:18.603: INFO/dalvikvm(391):   | group=""main"" sCount=0 dsCount=0 obj=0x4051b880 self=0x1af76012-17 11:13:18.603: INFO/dalvikvm(391):   | sysTid=400 nice=0 sched=0/0 cgrp=default handle=177800012-17 11:13:18.623: INFO/dalvikvm(391):   | schedstat=( 851184092 892639082 140 )12-17 11:13:18.633: INFO/dalvikvm(391):   at android.webkit.LoadListener.nativeFinished(Native Method)12-17 11:13:18.633: INFO/dalvikvm(391):   at android.webkit.LoadListener.nativeFinished(Native Method)12-17 11:13:18.653: INFO/dalvikvm(391):   at android.webkit.LoadListener.tearDown(LoadListener.java:1200)12-17 11:13:18.653: INFO/dalvikvm(391):   at android.webkit.LoadListener.handleEndData(LoadListener.java:721)12-17 11:13:18.653: INFO/dalvikvm(391):   at android.webkit.LoadListener.handleMessage(LoadListener.java:219)12-17 11:13:18.672: INFO/dalvikvm(391):   at android.os.Handler.dispatchMessage(Handler.java:99)12-17 11:13:18.672: INFO/dalvikvm(391):   at android.os.Looper.loop(Looper.java:123)12-17 11:13:18.672: INFO/dalvikvm(391):   at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629)12-17 11:13:18.672: INFO/dalvikvm(391):   at java.lang.Thread.run(Thread.java:1019)12-17 11:13:18.672: ERROR/dalvikvm(391): VM aborting12-17 11:13:18.887: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***12-17 11:13:18.887: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test-keys'12-17 11:13:18.893: INFO/DEBUG(31): pid: 391, tid: 400  &gt;&gt;&gt; com.phonegap.sample &lt;&lt;&lt;12-17 11:13:18.893: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d12-17 11:13:18.893: INFO/DEBUG(31):  r0 fffffebc  r1 deadd00d  r2 00000026  r3 0000000012-17 11:13:18.893: INFO/DEBUG(31):  r4 81da45c8  r5 40567330  r6 81d8592c  r7 001b2a4812-17 11:13:18.893: INFO/DEBUG(31):  r8 43640b58  r9 42dd1ecc  10 42dd1eb4  fp 4168d82c12-17 11:13:18.893: INFO/DEBUG(31):  ip 81da4728  sp 43640410  lr afd19375  pc 81d45a02  cpsr 2000003012-17 11:13:19.183: INFO/DEBUG(31):          #00  pc 00045a02  /system/lib/libdvm.so12-17 11:13:19.183: INFO/DEBUG(31):          #01  pc 000376fc  /system/lib/libdvm.so12-17 11:13:19.183: INFO/DEBUG(31):          #02  pc 000399c4  /system/lib/libdvm.so12-17 11:13:19.193: INFO/DEBUG(31):          #03  pc 0003a4a0  /system/lib/libdvm.so12-17 11:13:19.203: INFO/DEBUG(31):          #04  pc 0032b6d6  /system/lib/libwebcore.so12-17 11:13:19.203: INFO/DEBUG(31):          #05  pc 002a4da4  /system/lib/libwebcore.so12-17 11:13:19.203: INFO/DEBUG(31):          #06  pc 001a6136  /system/lib/libwebcore.so12-17 11:13:19.213: INFO/DEBUG(31):          #07  pc 002a5870  /system/lib/libwebcore.so12-17 11:13:19.223: INFO/DEBUG(31):          #08  pc 00359e36  /system/lib/libwebcore.so12-17 11:13:19.223: INFO/DEBUG(31):          #09  pc 0035d30e  /system/lib/libwebcore.so12-17 11:13:19.223: INFO/DEBUG(31):          #10  pc 003638be  /system/lib/libwebcore.so12-17 11:13:19.233: INFO/DEBUG(31):          #11  pc 0019f6fa  /system/lib/libwebcore.so12-17 11:13:19.233: INFO/DEBUG(31):          #12  pc 0019f780  /system/lib/libwebcore.so12-17 11:13:19.243: INFO/DEBUG(31):          #13  pc 001a3d8a  /system/lib/libwebcore.so12-17 11:13:19.243: INFO/DEBUG(31):          #14  pc 000d0dca  /system/lib/libwebcore.so12-17 11:13:19.253: INFO/DEBUG(31):          #15  pc 000d0f28  /system/lib/libwebcore.so12-17 11:13:19.253: INFO/DEBUG(31):          #16  pc 000d106e  /system/lib/libwebcore.so12-17 11:13:19.253: INFO/DEBUG(31):          #17  pc 000ddef0  /system/lib/libwebcore.so12-17 11:13:19.263: INFO/DEBUG(31):          #18  pc 000ddf62  /system/lib/libwebcore.so12-17 11:13:19.263: INFO/DEBUG(31):          #19  pc 000f3ce2  /system/lib/libwebcore.so12-17 11:13:19.273: INFO/DEBUG(31):          #20  pc 002739ae  /system/lib/libwebcore.so12-17 11:13:19.273: INFO/DEBUG(31):          #21  pc 000eac5e  /system/lib/libwebcore.so12-17 11:13:19.273: INFO/DEBUG(31):          #22  pc 001b152c  /system/lib/libwebcore.so12-17 11:13:19.283: INFO/DEBUG(31):          #23  pc 00017d34  /system/lib/libdvm.so12-17 11:13:19.283: INFO/DEBUG(31):          #24  pc 00048ec0  /system/lib/libdvm.so12-17 11:13:19.283: INFO/DEBUG(31):          #25  pc 00041a6a  /system/lib/libdvm.so12-17 11:13:19.293: INFO/DEBUG(31):          #26  pc 0001cf94  /system/lib/libdvm.so12-17 11:13:19.303: INFO/DEBUG(31):          #27  pc 0002209c  /system/lib/libdvm.so12-17 11:13:19.303: INFO/DEBUG(31):          #28  pc 00020f90  /system/lib/libdvm.so12-17 11:13:19.313: INFO/DEBUG(31):          #29  pc 0005f328  /system/lib/libdvm.so12-17 11:13:19.313: INFO/DEBUG(31):          #30  pc 0005f54e  /system/lib/libdvm.so12-17 11:13:19.313: INFO/DEBUG(31):          #31  pc 00053b06  /system/lib/libdvm.so12-17 11:13:19.313: INFO/DEBUG(31): code around pc:12-17 11:13:19.313: INFO/DEBUG(31): 81d459e0 447a4479 ed0cf7d1 20004c09 ee34f7d1 12-17 11:13:19.323: INFO/DEBUG(31): 81d459f0 447c4808 6bdb5823 d0002b00 49064798 12-17 11:13:19.323: INFO/DEBUG(31): 81d45a00 700a2226 eea0f7d1 0004355f 0004511d 12-17 11:13:19.323: INFO/DEBUG(31): 81d45a10 0005ebd2 fffffebc deadd00d b510b40e 12-17 11:13:19.323: INFO/DEBUG(31): 81d45a20 4c0a4b09 447bb083 aa05591b 6b5bca02 12-17 11:13:19.323: INFO/DEBUG(31): code around lr:12-17 11:13:19.333: INFO/DEBUG(31): afd19354 b0834a0d 589c447b 26009001 686768a5 12-17 11:13:19.333: INFO/DEBUG(31): afd19364 220ce008 2b005eab 1c28d003 47889901 12-17 11:13:19.333: INFO/DEBUG(31): afd19374 35544306 d5f43f01 2c006824 b003d1ee 12-17 11:13:19.333: INFO/DEBUG(31): afd19384 bdf01c30 000281a8 ffffff88 1c0fb5f0 12-17 11:13:19.333: INFO/DEBUG(31): afd19394 43551c3d a904b087 1c16ac01 604d9004 12-17 11:13:19.333: INFO/DEBUG(31): stack:12-17 11:13:19.333: INFO/DEBUG(31):     436403d0  00000015  12-17 11:13:19.333: INFO/DEBUG(31):     436403d4  afd18407  /system/lib/libc.so12-17 11:13:19.333: INFO/DEBUG(31):     436403d8  afd4270c  /system/lib/libc.so12-17 11:13:19.343: INFO/DEBUG(31):     436403dc  afd426b8  /system/lib/libc.so12-17 11:13:19.343: INFO/DEBUG(31):     436403e0  00000000  12-17 11:13:19.343: INFO/DEBUG(31):     436403e4  afd19375  /system/lib/libc.so12-17 11:13:19.353: INFO/DEBUG(31):     436403e8  001af760  [heap]12-17 11:13:19.353: INFO/DEBUG(31):     436403ec  afd183d9  /system/lib/libc.so12-17 11:13:19.353: INFO/DEBUG(31):     436403f0  001b2a48  [heap]12-17 11:13:19.353: INFO/DEBUG(31):     436403f4  0005ebd2  [heap]12-17 11:13:19.353: INFO/DEBUG(31):     436403f8  40567330  /dev/ashmem/dalvik-heap (deleted)12-17 11:13:19.363: INFO/DEBUG(31):     436403fc  81d8592c  /system/lib/libdvm.so12-17 11:13:19.363: INFO/DEBUG(31):     43640400  001b2a48  [heap]12-17 11:13:19.363: INFO/DEBUG(31):     43640404  afd18437  /system/lib/libc.so12-17 11:13:19.363: INFO/DEBUG(31):     43640408  df002777  12-17 11:13:19.363: INFO/DEBUG(31):     4364040c  e3a070ad  12-17 11:13:19.363: INFO/DEBUG(31): #00 43640410  00000001  12-17 11:13:19.363: INFO/DEBUG(31):     43640414  81d37701  /system/lib/libdvm.so12-17 11:13:19.363: INFO/DEBUG(31): #01 43640418  00000001  12-17 11:13:19.363: INFO/DEBUG(31):     4364041c  81d399c9  /system/lib/libdvm.so12-17 11:13:22.753: INFO/BootReceiver(62): Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE)12-17 11:13:22.943: DEBUG/dalvikvm(62): GC_CONCURRENT freed 876K, 48% free 4240K/8135K, external 2269K/3469K, paused 9ms+10ms12-17 11:13:23.133: DEBUG/dalvikvm(62): GC_FOR_MALLOC freed 348K, 47% free 4318K/8135K, external 2269K/3469K, paused 147ms12-17 11:13:23.243: DEBUG/Zygote(33): Process 391 terminated by signal (11)12-17 11:13:23.253: ERROR/InputDispatcher(62): channel '406defc8 com.phonegap.sample/com.phonegap.sample.sample (server)' ~ Consumer closed input channel or an error occurred.  events=0x812-17 11:13:23.253: ERROR/InputDispatcher(62): channel '406defc8 com.phonegap.sample/com.phonegap.sample.sample (server)' ~ Channel is unrecoverably broken and will be disposed!12-17 11:13:23.323: DEBUG/dalvikvm(62): GC_FOR_MALLOC freed 134K, 47% free 4376K/8135K, external 2269K/3469K, paused 174ms12-17 11:13:23.323: INFO/ActivityManager(62): Process com.phonegap.sample (pid 391) has died.12-17 11:13:23.333: INFO/WindowManager(62): WIN DEATH: Window{406defc8 com.phonegap.sample/com.phonegap.sample.sample paused=false}12-17 11:13:23.542: DEBUG/dalvikvm(124): GC_EXPLICIT freed 61K, 51% free 2836K/5767K, external 1973K/2288K, paused 907ms12-17 11:13:23.693: WARN/InputManagerService(62): Got RemoteException sending setActive(false) notification to pid 391 uid 10031</code></pre><p>Sorry about the gigantic log posts, but I don't know what is of importance here...</p>","59242","","59242","","2010-12-17 10:16:04","2011-07-22 00:22:10","phonegap.js crashes android app","<android><phonegap>","2","7","2","",""
"4459494","1","4459560","","2010-12-16 10:03:47","0","200","<p>How to run my reminder application in background even if exit from the application.   My reminder application works fine when it is continue,but if i exit from the application it will not show my desired output.So,is there any way to run may application in background OR any service using that i make my application as service OR anything else.</p><p>Plz help me</p><p>Thanks in Advance...</p>","489902","","","","","2010-12-16 10:11:21","How to run my android reminder application running even thought i exit from it","<android>","1","0","","",""
"4459544","1","4460240","","2010-12-16 10:09:45","0","502","<p>I'm trying to get an xml feed from a website, nothing really special.My problem is, when I'm trying to get my feed from my Android application, I'm automatically redirected to the mobile version of the website at the home page. This mean that the feed I get is the HTML page of the mobile website, not the xml file expected.</p><p>I tried to open the feed this way :</p><pre><code>URL feedUrl = new URL(address);Inputstream iStream = feedURL.openStream();//orInputstream iStream = (InputStream)feedURL.getContent();</code></pre><p>So... Is there anyway other way to do it? Anyway to avoid this redirection? I have absolutely no control over the website...</p><p>Thanks everyone!</p>","483291","","","","","2010-12-16 11:23:54","Avoid mobile website redirection when trying to get an XML feed on Android","<android><website><stream><redirect><feed>","1","1","","",""
"4459563","1","4459633","","2010-12-16 10:11:30","0","1555","<p>i have implemented a try block that does some network requests but whenever it throws an exception such has a Timeout one, the android application displays a message Saying</p><p>Sorry: The application has stopped unexpectedy, please try again.</p><p>the only option presented to the user is a force close button. i want to catch this exception and simple display my own error message and let the user try the connection again instead of the user having to close the app.</p><p>Here is the code below:</p><p>all i want to do is return null after a exception is caught and what ever class that calls this will do it its own error handling like this:</p><pre><code>if(postRequest == null){ display error message}private HttpResponseObject PostRequest() {        //int response = 0;        String responseBody = """";        HttpResponseObject response = new HttpResponseObject();        try {            Log.d(TAG, ""IN POST_REQUEST_METHOD"");            Log.d(TAG, ""URL : "" + url);            httpclient = new DefaultHttpClient();            httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 1);            //httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 10000);            httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 5);            Log.d(TAG, ""httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 5000);"");            post = new HttpPost(url);//          ClientConnectionRequest connRequest = new ManagedClientConnection();//          post.setConnectionRequest((ClientConnectionRequest) connRequest.getConnection(3000, TimeUnit.MILLISECONDS));            ByteArrayEntity entity = new ByteArrayEntity(data.getBytes());            entity.setChunked(true);            post.setEntity(new StringEntity(data));            HttpResponse httpResponse = httpclient.execute(post);            HttpEntity resEntity = httpResponse.getEntity();            if (resEntity != null) {                // indicate that the content of this entity is no longer                // required                response.setResponseBody(EntityUtils.toString(resEntity));                Header[] header = httpResponse.getAllHeaders();                Log.d(TAG, ""httpResponse.getAllHeaders() = "" + header[0].getName());                response.setResponseHeader(httpResponse.getAllHeaders().toString());                resEntity.consumeContent();            }            // release all recources from the httpClient object            httpclient.getConnectionManager().shutdown();            response.setResponseCode(httpResponse.getStatusLine().getStatusCode() ) ;            Log.d(TAG, ""responseBody = "" + response.getResponseBody());            Log.d(TAG, ""response code = "" + response.getResponseCode());            Log.d(TAG, ""response header = "" + response.getResponseHeader());            return response;        } catch (SocketTimeoutException e) {            e.printStackTrace();            Log.d(TAG, ""SocketTimeoutException e  = "" + e.toString());            return null;        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();            Log.d(TAG, ""IOException e  = "" + e.toString());            return null;        }    }</code></pre>","444668","","24054","","2010-12-16 10:17:09","2010-12-16 10:21:49","Android display my own error message ifrom an exception","<android>","1","0","","",""
"4459598","1","","","2010-12-16 10:17:26","1","385","<p>everyone!!! I have got some little problem with internet permission in my android application. I have defined the permission in AndroidManifest.xml , but when I start my application, I don`t get data from internet. This is IOException tag from my LogCat:</p><p>12-16 10:08:57.736: DEBUG/IOException(281): Permission denied (maybe missing INTERNET permission)</p><p>Can anybody help me to solve this problem?</p>","521047","","","","","2010-12-16 10:39:25","Problems with internet permission in android","<android>","1","1","","",""
"4459606","1","4459655","","2010-12-16 10:18:23","0","592","<p>I purchased a HTC desire month ago and upon first usage it asked me to update to newer system version (which was to 2.3) i think.</p><p>Today i have formatted my sd card + reset to factory settings (from settings).</p><p>AFTER the reset of the device now when i go to settings > about phoneit shows me that i am running android 2.2 version.</p><p>secondly when i go to settings > about phone > system updates > check now</p><p>it says there are no updates available. </p><p>does this means i cannot move to android 2.3 now or what?</p><p>any help would be appreciated.</p><p>btw, my device aint rooted.</p><p>Android Version: 2.2Kernel Version: 2.6.32.15-g2633d94</p><p>Build Number: 2.33.161.2 CL284385 release-keys</p><p>Software Number: 2.33.161.2</p>","509837","","387076","","2012-05-12 20:34:13","2012-05-12 20:34:13","HTC desire android 2.2 (version prob after factory reset)","<android>","2","0","","",""
"4459629","1","4461205","","2010-12-16 10:21:26","0","303","<p>As per my project requirement i need to place 2 horizontal bars in a expandable view. my question is that ""is it possible to create a bar chart inside expandable list view?"" If possible, Can any one please give me a suggestion how to put a bar chart in a expandable list with an example. </p><p>Thanks in advance.</p>","524937","","","","","2010-12-16 13:29:24","Is it possible to place 2 horizontal bars in a expandable list view?","<android>","1","0","","",""
"4459719","1","4459831","","2010-12-16 10:28:43","12","18964","<p>Based on my android keystore I created some apps. now, I want to update one of my programs but I lost my keystore. can I generate another one and update my app?</p><p>Thanks</p>","513413","","","","","2014-02-20 22:20:35","Android: I lost my android key store, what should I do?","<android><keystore>","6","1","","2014-02-23 13:11:24",""
"4459840","1","4460068","","2010-12-16 10:41:35","0","128","<p>I have a particular requirement.</p><pre><code>if(condition true){    Flash the screen GREEN for 5 secs}else{    Flash the screen RED for 5 secs}</code></pre><p>Could anyone please help in this regard?</p>","544631","","544631","","2010-12-16 10:49:05","2010-12-16 11:28:32","Need to flash the screen GREEN for 5 secs","<android>","1","2","1","",""
"4459996","1","4460057","","2010-12-16 10:57:13","1","2492","<p>I am trying to create a tab UI, but I don't want to put any images on the tabHosts, so instead of using setIndicator(CharSequence label, Drawable icon) I decided to use setIndicator (CharSequence label). The tabHost is then created without an image but insead of being smaller in height and just containing the CharSeququence, it is of the same height as a regular tabHost with an image. There is a free space on top where the image is usually situated and  the text is below that empty space. Is there anyway to remove the free space reserved for the image, or to flip the two, so that the text is on top, after which I can just set a layout_height of 15dp for example. The .xml code for the main layout is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp"" /&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","539538","","","","","2010-12-16 11:03:03","Android: TabHost.TabSpec setIndicator (CharSequence label)","<android><xml><android-tabhost>","1","0","","",""
"4460149","1","4462419","","2010-12-16 11:14:22","0","132","<p>When I try to call one of my custom classes from a Thread constructor I get an exception, I've no idea why...</p><p>My Main app boils down to:</p><pre><code>public class GameView extends SurfaceView implements OnTouchListener,    SurfaceHolder.Callback{   class GameThread extends Thread   {      private GfxData   m_GraphicsData;      public GameThread(SurfaceHolder surfaceHolder, Context context, Handler handler)      {         Log.i(""****"", ""GameThread::GameThread"");         m_GraphicsData.InitGfx();;         Log.i(""****"", ""GameThread::end"");      }... (other required functions)}</code></pre><p>My GfxData class (the entire file)</p><pre><code>package mypackage.stuff;public class GfxData {   public GfxData()   {   }   public void InitGfx()   {   }} </code></pre><p>The class GameThread never reaches the end of the constructor; I've removed virtually everything from my GfxData class (which I'd intended to pass the context to so I could use it to manage my resources) but still it causes a crash; however if I remove the InitGfx() call everything is fine</p><p>I'm bamboozled! Help would be much appreciated.</p>","134101","","134101","","2010-12-16 11:27:56","2010-12-16 15:30:37","Android: crash when accessing user class from thread","<java><android>","1","5","","",""
"4460154","1","4460752","","2010-12-16 11:14:42","0","1741","<p>I set up several ClickListener events (using the setOnClickListener function). Now I'd like to disable (or deactivate, remove, delete) some of them temporarily and I can't find a way to do so.</p><p>Thanks in advance.</p>","544659","","","","","2011-02-14 05:24:37","Disable ClickListener event","<java><android><events><click>","1","4","","",""
"4460223","1","","","2010-12-16 11:22:16","0","782","<p>I would like to draw a line between two points(A and B) but I want it to be an animation, something like indiana jones map route, so that the line progress towards point B, any suggestions?</p>","544670","","","","","2011-05-26 15:30:37","Animated line between two geopoints in a MapView","<android><animation><map><overlay>","1","0","","",""
"4460508","1","4962752","","2010-12-16 11:57:01","2","4959","<p>I would like to know if it's possible to select coordinates from a path to draw a bitmap over time, for example, I have an image of a sun, and I would like to move it, over time, along an arc path.</p><p>Is there some way to define a path like this and then move along it, so that I don't have to calculate it mathematically?</p><p>Thanks.</p>","353674","","1023783","","2012-08-08 03:27:33","2012-08-08 03:27:33","Android, move bitmap along a path?","<android><animation><path><bitmap>","2","0","2","",""
"4460536","1","","","2010-12-16 11:59:53","0","476","<p>To make use of ASL library for my screen shot app on android,i need to install a script file (run.ps1) and run it on emulator ... So can any one tell me how can i do it...should i do it using ADB or using Eclipse...?</p>","505580","","","","","2010-12-16 12:25:21","installing and running a script file on android emulator","<android><eclipse><file><adb>","1","0","","",""
"4460559","1","","","2010-12-16 12:03:49","9","8348","<p>I've got a final app design made i Photoshop where everything is measured in PX.Now I realize that Android apps are using DP for font-sizes and other things.</p><p>Is there any way I can convert PX to DP ?</p>","245365","","","","","2014-04-13 08:43:39","Photoshop design from px to dp","<android>","5","0","4","",""
"4460566","1","8062568","","2010-12-16 12:05:25","15","13184","<p>I would like to use flurry and its features in my application. How can i register myself with flurry and how can i use it in my android application?</p><p>Thanks</p>","493193","","180538","","2010-12-16 13:00:35","2014-04-11 22:13:46","How to use flurry in an application?","<android><flurry>","4","6","4","",""
"4460611","1","4460807","","2010-12-16 12:11:19","22","9082","<p>I am aware that from API level 5 it is possible to specify a flag in the intent to prevent the normal animation being applied when I start a new activity:</p><pre><code>myIntent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);</code></pre><p>However, my question is: is there a way to achieve the same thing in an app supporting android 1.6?</p>","2099158","","244296","","2010-12-16 13:05:26","2012-09-18 22:52:48","Start a new activity with no transition animation in android 1.6","<android><animation><activity><android-intent>","3","0","4","",""
"4460712","1","5802804","","2010-12-16 12:24:00","4","1407","<p>I've read the article how to implement an input service method from android website.I want to develop a custom android keyboard with bigger keys. I've followed the SoftKeyboard example, everything is working well but something important is missing: the candidates view does not give me any candidate.Does anyone can help how to connect the custom candidates view to internal android suggestion list?</p><p>Thanks for help</p>","331370","","","","","2011-04-27 10:44:51","Android custom keyboard","<android>","1","0","","",""
"4460806","1","4461028","","2010-12-16 12:35:45","13","5093","<p>I'm having a look at the ""Tab Layout"" tutorial which is perfectly clear and my question is very simple : is it possible to create tabs with no icon, just a single title?</p>","544659","","244296","","2010-12-16 13:04:57","2013-06-19 08:29:43","Tabs without icon","<android><layout><tabs><icons>","5","0","1","",""
"4460808","1","","","2010-12-16 12:36:15","0","130","<p><br>I am writing an Android application in which I was using some default font. When I install the app in device and if the device changed the font in its settings to italic, then the font in my application is also changed. I want the font to  remain constant in my application irrespective of  font changes in device. <br>can anyone help me in sorting out this issue?</p><p><br>Thanks in Advance,</p>","429501","","","","","2010-12-19 18:28:22","How to keep the font remain constant for our Application irrespective of the font changes in device in Android","<android>","1","1","","",""
"4461038","1","","","2010-12-16 13:05:42","1","1296","<p>I have an android application that maintains some confidential data (encrypted) and I'm trying to handle a case where this encrypted data is maintained across an update of my application.  I want different versions of my application to have different encryption keys and I dont want new versions of the application to contain keys for every preceeding version.</p><p>My idea was to run some code on application install which would allow for re-encryption of this data, but I  android firstly doesnt seem to provide any means to execute application code in application install.  secondly, I dont see anyway for the newly installed version of the application to execute code in the previous version.</p><p>This doesnt seem so unreasonable a thing to do for me, can someone confirm that android doesnt allow this and explain why ?  In terms of solutions, I have to either use the same key for all applicaitons or have a new version of my application reconstruct this data through other means ...</p><p>[there is another question somewhat related  (link below) but it is a different case and the answer doesnt provide any reference]</p><p><a href=""http://stackoverflow.com/questions/3700974/is-there-a-way-to-make-my-android-app-run-some-custom-code-upon-installation"">Is there a way to make my Android app run some custom code upon installation?</a></p><p><a href=""http://groups.google.com/group/android-framework/browse_thread/thread/0f1617d28e8ff05e"" rel=""nofollow"">http://groups.google.com/group/android-framework/browse_thread/thread/0f1617d28e8ff05e</a></p>","544775","","","","","2010-12-16 13:31:11","execute custom code on android installation","<android><installation>","1","1","1","",""
"4461074","1","","","2010-12-16 13:10:21","0","1102","<p>HI, i want to load a flash file in my android application. Can any one guide me how to do?</p>","487604","","","","","2011-05-06 11:15:01","How to load flash in Android?","<android>","3","0","","",""
"4461127","1","","","2010-12-16 13:17:22","1","645","<p>I have a view that extends Gallery (In order to create a cover flow).Now I need the title of the currently selected (speak: The one that's shown in the front) to be displayed at the top.</p><p>So far, that's no problem since I can just use:</p><pre><code>public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) {    if(mSpinnerAdapter.getItem(position)!=null) {        mSelectedTextView.setText((CharSequence) ((MyDataItem)mSpinnerAdapter.getItem(arg2)).getName());    } }</code></pre><p>The data comes from a web service and is therefore slow, so as long as the data is not loaded, I am displaying a progress bar. I am doing this by telling the adapter to deliver a progress bar in ""getView(..)""¨and a ""1"" in ""getCount()"" as long as the data structure is not fully loaded (Hence the if(mSpinnerAdapter.getItem(position)!=null) in the code above).</p><p>Now the problem is this: When the data from the web is loaded, I call onDatasetChanged() on the adapter and the gallery view is being updated (which works), but without onItemSelected() being called. The consequence of this is that the title is not set for the first item.</p><p>How can I solve this? Or is my technique to display the progress bar wrong alltogether?</p><p>Thank you!</p>","321116","","","","","2010-12-23 06:24:49","View that extends Gallery + Adapter: How to inform view of changes?","<android><gallery><adapter>","0","0","","",""
"4461134","1","4461244","","2010-12-16 13:18:19","7","36133","<p>I created a ListView with a custom layout for each view. I have several <code>onClickListeners</code> within the list view adapter for <strong><code>TextView</code></strong> items within the custom layout. The onClickListeners work within the list view adapter and I can obtain the position of the view, but when I try to make calls within the <code>onClickListeners</code> to methods in my activity, I get the ""Cannot make a static reference to a non-static method"" errors. So I started converting things to static, which made things work as intended, but I'm sure you all know it's a big mistake, which has finally caught up with me. </p><p>How the heck do I access methods in my main activity without making the methods static?? I'm new at this, so please forgive my noobish question. Thanks </p><p>partial code listing...</p><pre><code>public class main extends Activity {    private ArrayList&lt;DataItem&gt; dataItems;    private DataItemAdapter aa;    private ListView dataListView;      @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        dataListView = (ListView)findViewById(R.id.dataListView);             dataItems = new ArrayList&lt;DataItem&gt;();        int resID = R.layout.dataitem;        aa = new DataItemAdapter(this, resID, dataItems);        dataListView.setAdapter(aa);        dataListView.setItemsCanFocus(true);    populateArray();}public void populateArray() {    DataItem newItem = new DataItem(            ""2008"",""Ferrari"",""F430"",""Red"",""ASX772""        );    dataItems.add(0, newItem);    newItem = new DataItem(            ""2008"",""Ferrari"",""F430"",""Black"",""TZB123""        );    dataItems.add(0, newItem);    newItem = new DataItem(            ""2009"",""Ferrari"",""F430"",""Red"",""MIDAS""        );    dataItems.add(0, newItem);          aa.notifyDataSetChanged();}public static void modelInfo(int pos) {    Log.i(""modelInfo"", ""="" + pos);}public static void makeInfo(int pos) {    Log.i(""makeInfo"", ""="" + pos);}public static void assetInfo(int pos) {    Log.i(""assetInfo"", ""="" + pos);}}public class DataItemAdapter extends ArrayAdapter&lt;DataItem&gt; {    private Activity activity;    private int resource;    private static LayoutInflater inflater=null;    public DataItemAdapter(Activity _activity,int _resource,List&lt;DataItem&gt; _items) {        super(_activity, _resource, _items);        inflater = (LayoutInflater)_activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        resource = _resource;        activity = _activity;    }public static class ViewHolder {    TextView carYear;    TextView carMake;    TextView carModel;    TextView carColor;    TextView assetTag;   }@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View vi=convertView;    ViewHolder holder;    if (convertView == null) {        vi = inflater.inflate(resource, null);        holder=new ViewHolder();        holder.carYear = (TextView)vi.findViewById(R.id.carYear);        holder.carMake = (TextView)vi.findViewById(R.id.carMake);        holder.carModel = (TextView)vi.findViewById(R.id.carModel);        holder.carColor = (TextView)vi.findViewById(R.id.carColor);        holder.assetTag = (TextView)vi.findViewById(R.id.assetTag);        vi.setTag(holder);    } else {        holder=(ViewHolder)vi.getTag();    }    DataItem item = getItem(position);      holder.carYear.setText(item.getCarYear());    holder.carMake.setText(item.getCarMake());    holder.carModel.setText(item.getCarModel());    holder.carColor.setText(item.getCarColor());    holder.assetTag.setText(item.getAssetTag());    holder.carYear.setTag(position);    holder.assetTag.setTag(position);    final OnClickListener makeListener = new OnClickListener() {        @Override        public void onClick(View v) {            LinearLayout ll = (LinearLayout)v.getParent();            TextView tv = (TextView)ll.getChildAt(0);            Integer pos = (Integer) tv.getTag();            main.makeInfo(pos);        }    };    holder.carMake.setOnClickListener(makeListener);    final OnClickListener modelListener = new OnClickListener() {        @Override        public void onClick(View v) {            LinearLayout ll = (LinearLayout)v.getParent();            TextView tv = (TextView)ll.getChildAt(0);            Integer pos = (Integer) tv.getTag();            main.modelInfo(pos);        }   };            holder.carModel.setOnClickListener(modelListener);    final OnClickListener assetListener = new OnClickListener() {        @Override        public void onClick(View v) {            LinearLayout ll = (LinearLayout)v.getParent();            TextView tv = (TextView)ll.getChildAt(0);            Integer pos = (Integer) tv.getTag();            main.assetInfo(pos);        }    };    holder.assetTag.setOnClickListener(assetListener);            return vi;}</code></pre>","544751","","1682268","","2013-07-26 07:38:55","2013-07-26 07:38:55","Android ListView Adapter OnClickListener issue","<android>","1","0","4","",""
"4461147","1","","","2010-12-16 13:20:35","1","850","<p>In my Android application I would like to set alarm at a particular time with some message for time entered by user.</p><p>How can I set alarm using broadcast receiver? Is it possible to pop up a message on the specified time other than the default message?</p>","420261","","785541","","2011-08-29 12:10:23","2011-08-29 12:10:23","use Alarm Manager to set alarm in Android","<android>","1","0","1","",""
"4461150","1","5573934","","2010-12-16 13:21:21","7","14341","<p>I use the official Facebook SDK in my Android Application. After the user logs in, I can get the uid and the name of the facebook user like so:</p><pre><code>Facebook mFacebook = new Facebook(APP_ID);// ... user logs in ...//String jsonUser = mFacebook.request(""me/picture""); // throws errorString jsonUser = mFacebook.request(""me"");JSONObject obj = Util.parseJson(jsonUser);String facebookId = obj.optString(""id"");String name = obj.optString(""name"");</code></pre><p>I also know that the I can access the profile picture with those links:</p><pre><code>https://graph.facebook.com/&lt;facebookId&gt;/picture https://graph.facebook.com/&lt;facebookId&gt;/picture?type=large</code></pre><p>I would love to use this code to geht the profile picture:</p><pre><code>public static Drawable getPictureForFacebookId(String facebookId) {    Drawable picture = null;    InputStream inputStream = null;    try {        inputStream = new URL(""https://graph.facebook.com/"" + facebookId + ""/picture"").openStream();    } catch (Exception e) {             e.printStackTrace();     return null;    }    picture = Drawable.createFromStream(inputStream, ""facebook-pictures"");    return picture;}</code></pre><p>But it just wont work. I always get the following error:</p><pre><code>SSL handshake failure: Failure in SSL library, usually a protocol error</code></pre><p>And I cant solve this issue. It seems to be rather complicated(look <a href=""http://stackoverflow.com/questions/3117896/problems-with-httpclient-and-selfsigned-certificates"">here</a> or <a href=""http://stackoverflow.com/questions/2642777/android-trusting-all-certificates-using-httpclient-over-https"">here</a>). So what other options are there to get the picture of a facebook user that successfully logged into my application?</p>","351723","","351723","","2010-12-16 14:00:37","2013-05-04 13:02:15","Android and Facebook: How to get picture of logged in User","<android><facebook><ssl><image>","6","0","11","",""
"4461232","1","","","2010-12-16 13:32:22","1","798","<p>I have two activities A and B. What I want is to show activity A as an intro, the user will be unable to navigate back to it. Is there some flag I can set to activity A to do this? Can I block the back button for one activity only? Activity A is of course my main activity which automatically starts activity B after some ""hard work"".</p><p>Best regards.</p>","526924","","180538","","2010-12-16 13:36:04","2010-12-16 13:50:08","block back button for ceratin activities","<android><activity>","4","0","","",""
"4461266","1","4463446","","2010-12-16 13:35:33","1","499","<p>I'm working on an Android app that will display some information from a sqlite database in a listview. I need some help sorting out my query.</p><p>The database looks like this: </p><pre><code>[monitors] 1 --- &lt;has&gt; --- * [results] 1 --- &lt;has&gt; --- * [steps]Table monitors has columns: _id | warning_threshold | alarm_threshold | monitor_nameTable results  has columns: _id | monitor_id        | timestamp       | test_infoTable steps    has columns: _id | result_id         | correct         | response_time</code></pre><p>I'm trying to make a query that would return:<br>1) All rows &amp; columns from  the monitors table.<br>2) The newest test_info for each monitor from the results table.<br>3) Count the number of correct = true for each result from the steps table.  </p><p>The returned cursor should look something like this:</p><pre><code>_id | monitor_name | warning_threshold | alarm_threshold | test_info   | correct_count1   | 'hugo'       | 1000              | 1500            | 'some info' | 72   | 'kurt'       | 800               | 1200            | 'info.....' | 5</code></pre><p>My query:</p><pre><code>SELECT * FROM  (SELECT monitors._id AS _id,  monitors.monitor_name AS monitor_name,  monitors.warning_threshold AS warning_threshold,  monitors.alarm_threshold AS alarm_threshold,  results.test_info AS test_info  FROM monitors  LEFT JOIN results  ON monitors._id = results.monitor_id  ORDER BY results.timestamp ASC) AS innerGROUP BY inner._id;</code></pre><p>I almost got it working. I am able to get the info from monitors and results, I still need to get the correct_count. Any help with sorting out this query would be greatly appreciated.</p>","434457","","","","","2010-12-17 00:47:24","SQLite query three tables","<sql><android><sqlite><cursor>","2","1","","",""
"4461360","1","4505738","","2010-12-16 13:44:36","43","117854","<p>I have created my own CA certificate and now I want to install it on my Android Froyo device (HTC Desire Z), so that the device trusts my certificate. </p><p>Android stores CA certificates in its Java keystore in <code>/system/etc/security/cacerts.bks</code>. I copied the file to my computer, added my certificate using <a href=""http://portecle.sourceforge.net/"">portecle 1.5</a> and pushed it back to the device. </p><p>Now, Android does not seem to reload the file automatically. I have read in several blog posts that I need to restart the device. Doing so results in the file being overwritten with the original one again.</p><p>My next try was to install the certificate from SD card by copying it and using the according option from the settings menu. The device tells me that the certificate has been installed, but apparently it does not trust the certificate. Moreover, when I try to copy the keystore to my computer, I still find the original stock <code>cacerts.bks</code>.</p><p>So, what is the right way to install my own root CA certificate on an Android 2.2 device as a trusted certificate? Is there a way to do it programmatically?</p>","459812","","459812","","2010-12-16 13:57:10","2014-02-26 12:08:15","How to install trusted CA certificate on Android device?","<android><ssl><installation><certificate>","6","1","22","",""
"4461383","1","","","2010-12-16 13:46:38","0","3836","<p>When I am trying to record an audio through the emulator using following code</p><pre><code>  AudioRecord recordInstance = new AudioRecord(    MediaRecorder.AudioSource.MIC, this.getFrequency(), this      .getChannelConfiguration(), this.getAudioEncoding(),    bufferSize);</code></pre><p>Then I am getting following exceptions in logcat:</p><pre><code>12-16 19:07:31.680: INFO/jdwp(223): Ignoring second debugger -- accepting and dropping12-16 19:07:31.700: ERROR/AudioHardware(34): Error opening input channel12-16 19:07:31.720: WARN/AudioHardwareInterface(34): getInputBufferSize bad sampling rate: 1102512-16 19:07:31.730: ERROR/AudioRecord(294): Recording parameters are not supported: sampleRate 11025, channelCount 1, format 112-16 19:07:31.730: ERROR/AudioRecord-JNI(294): Error creating AudioRecord instance: initialization check failed.12-16 19:07:31.730: ERROR/AudioRecord-Java(294): [ android.media.AudioRecord ] Error code -20 when initializing native AudioRecord object.12-16 19:07:31.730: WARN/dalvikvm(294): threadid=7: thread exiting with uncaught exception (group=0x4001d800)12-16 19:07:31.770: ERROR/AndroidRuntime(294): FATAL EXCEPTION: Thread-812-16 19:07:31.770: ERROR/AndroidRuntime(294): java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.12-16 19:07:31.770: ERROR/AndroidRuntime(294):     at android.media.AudioRecord.startRecording(AudioRecord.java:495)12-16 19:07:31.770: ERROR/AndroidRuntime(294):     at com.prospeak.Recorder.run(Recorder.java:84)12-16 19:07:31.770: ERROR/AndroidRuntime(294):     at java.lang.Thread.run(Thread.java:1096)</code></pre><p>Can you figure out what's wrong in this code?</p>","479007","","815724","","2012-12-23 04:26:58","2014-01-07 16:34:17","Recording in Android giving exceptions","<android><audiorecord>","7","0","","",""
"4461406","1","","","2010-12-16 13:49:39","0","377","<p>My app somehow cannot be searched by some of the model of mobile phone. like Sony Ericsson X10 mini pro, Samsung Galaxy. is that the problem of resolution of the screen? do you guys know how to fix this problem?</p><p>regardspenny</p>","502958","","502958","","2010-12-17 09:45:09","2010-12-17 09:45:09","some android phone cannot search my app in android market","<android><google-play>","2","0","","",""
"4461407","1","","","2010-12-16 13:49:40","27","9252","<p>I have a custom PieTimer View in an Android Library Project</p><pre><code>package com.mysite.android.library.pietimer;public class PieTimerView extends View {...</code></pre><p>I also have a XML attributes file which I use in my PieTimer</p><pre><code>    TypedArray a = context.obtainStyledAttributes(attrs,        R.styleable.PieTimerView);</code></pre><p>The XML styleable file looks like this</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;     &lt;declare-styleable name=""PieTimerView""&gt;        &lt;attr name=""max_size"" format=""dimension"" /&gt;        &lt;attr name=""start_angle"" format=""string"" /&gt;        &lt;attr name=""start_arc"" format=""string"" /&gt;        &lt;attr name=""ok_color"" format=""color"" /&gt;        &lt;attr name=""warning_color"" format=""color"" /&gt;        &lt;attr name=""critical_color"" format=""color"" /&gt;        &lt;attr name=""background_color"" format=""color"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>I have the PieTimer in a layout file for a  project that uses the library, like this</p><pre><code>&lt;RelativeLayout     android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/root"" android:layout_gravity=""center_horizontal""    xmlns:app=""http://schemas.android.com/apk/res/com.mysite.android.library.myapp""    xmlns:pie=""com.mysite.library.pietimer""    &gt;&lt;com.mysite.library.pietimer.PieTimerView    pie:start_angle=""270""     pie:start_arc=""0""     pie:max_size=""70dp""    pie:ok_color=""#9798AD""    pie:warning_color=""#696DC1""    pie:critical_color=""#E75757""    pie:background_color=""#D3D6FF""    android:visibility=""visible""    android:layout_height=""wrap_content"" android:id=""@+id/clock""    android:layout_width=""wrap_content""     android:layout_alignParentRight=""true""&gt;&lt;/com.mysite.library.pietimer.PieTimerView&gt;</code></pre><p>Previously I was using the <code>xmlns:app</code> as the namespace for attributes like <code>app:ok_color</code> but when I made my project a library project and has a Free and Full version implementing the library, I found it no longer worked so I added the pie namespace. </p><p>The PieTimerView displays but the attributed do not work, they use the default (this was not occurring before) so there is some namespace conflict hapenning here.</p><p>What is the correct way of doing this?</p>","248521","","248521","","2010-12-16 15:03:26","2012-04-18 20:50:47","Help with a custom View attributes inside a Android Library Project","<android>","5","4","17","",""
"4461413","1","6103332","","2010-12-16 13:50:14","1","995","<p>I want to connect a generic midp2 j2me device supporting bluetooth (jsr082) to an android device, running a similar custom application I am writing.  The Android device only appears to ""see"" other Android bluetooth devices nearby?</p><p>Is this even possible?</p>","247519","","","","","2011-08-17 21:49:53","Android <-> J2ME Bluetooth","<android><java-me><bluetooth>","2","3","1","",""
"4461468","1","","","2010-12-16 13:55:29","1","3545","<p>I have an issue while parsing a local xml file using sax parser . It throwing an exception while parsing.</p><pre><code> *org.apache.harmony.xml.ExpatParser$ParseException: At line 7, column 247: not well-formed (invalid token)org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:507)org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:492)org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:308)org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:264)*try {        String path = Environment.getExternalStorageDirectory() + ""/FlightGuide/""+stateName+""/contents.xml"";         File file = new File(path);        SAXParserFactory parserFactory=SAXParserFactory.newInstance();        SAXParser saxParser=parserFactory.newSAXParser();        XMLReader reader=saxParser.getXMLReader();        AirportHandler airportHandler = new AirportHandler();        reader.setContentHandler(airportHandler);        reader.parse(new InputSource(new InputStreamReader(new FileInputStream(file))));        statePackage = airportHandler.getpaStatePackage();    } catch (MalformedURLException e) {        e.printStackTrace();    } catch (ParserConfigurationException e) {        e.printStackTrace();    } catch (SAXException e) {        e.printStackTrace();     } catch (IOException e) {        e.printStackTrace();    }</code></pre><p>Please can any one figure out mistake I am doing? And is there any other method to parse local xml files? If so give me some sample code.</p><p>Thanking you,Srinivas</p>","414777","","473070","","2010-12-16 13:58:29","2013-07-01 06:01:58","How to parse xml from sdcard using sax parser in android?","<android><xml-parsing><saxparser>","3","0","1","",""
"4461495","1","4462220","","2010-12-16 13:58:09","0","954","<p>The current implementation of my listview displays data in different categories/sections, depending on a variable of the objects to be displayed. Just to show an example, if the dataset is e.g. {cat,one,red,five,orange,dog}, the resulting listview will be {animals: cat,dog}, {colors: red, orange}, {numbers: one, five}. For this I'm using a variation of a '<a href=""http://code.google.com/p/dicent/source/browse/src/com/dicent/SectionedAdapter.java?r=af85c7ce0fbf4027bcd161fc77757b5c53797d37"" rel=""nofollow"">SectionerAdapter</a>' I found online, which in my case uses a custom ArrayAdapter&lt;> for each of the sections. The sections provided by this code look like the ones in the Settings app of any Android device.</p><p>Now, I'm trying to filter those results. If typing 'O', the list will end up being: {animals: empty},{colors:orange},{numbers:one}. The problem is I don't get it to work with the whole list, but only with one of the sections. That's why I'm trying to use another approach for the whole listing: ExpandableListView.</p><p>Does anybody know if filtering within an ExpandableListView is possible/easy? Do you guys have any example I could use to get an idea of how to do it?</p><p>Thanks!</p>","513284","","","","","2010-12-17 13:16:00","Filterable Complex ListView","<android><listview><expandablelistview>","2","0","","",""
"4461504","1","8937666","","2010-12-16 13:58:31","3","2801","<p>I have to determine list of permission used each by the installed application on my device.</p><p>I have got the list of applications installed and there package name using the following code:</p><pre><code>PackageManager pm = this.getPackageManager();Intent intent = new Intent(Intent.ACTION_MAIN, null);intent.addCategory(Intent.CATEGORY_LAUNCHER);List&lt;ResolveInfo&gt; list = m.queryIntentActivities(intent,PackageManager.PERMISSION_GRANTED);  for (ResolveInfo rInfo : list) {      Log.d(""Installed Applications"", rInfo.activityInfo.applicationInfo     .loadLabel(pm).toString());   Log.d(""packegename"",rInfo.activityInfo.applicationInfo.packageName.           toString());     }</code></pre><p>How do I get permission used by each application?</p>","544830","","1288","","2013-07-06 14:05:27","2013-09-03 18:42:24","Determine list of permissions used by an installed application in Android","<android><permissions>","4","0","5","",""
"4461509","1","","","2010-12-16 13:58:53","1","3882","<p>On this page facebook tells you, that you can somehow use the Facebook-Query-Language: <a href=""http://developers.facebook.com/docs/reference/fql/profile"" rel=""nofollow"">http://developers.facebook.com/docs/reference/fql/profile</a></p><p>But I just dont understand what the query looks like. On Stackoverflow I just find exapmles on how to use the FQL with PHP. But I want to use it out of and Android Application. Anybody can give me URLs or Code Examples?</p>","351723","","","","","2014-04-02 16:44:19","Android and Facebook: How to use Facebook Query Language (FQL) out of Android Application","<android><facebook><facebook-fql>","4","0","4","",""
"4461575","1","4475269","","2010-12-16 14:07:04","2","2710","<p>On Windows 7 64-bit, running Eclipse 3.6 64-bit, JDK (jdk1.6.0_23) 64-bit and Android 2.3 (bitness?), running a program via Eclipse's Run|Run (Ctrl+F11) invokes the android emulator, but won't install .apk on the emulator (and certainly won't run it).</p><p>(update, answering @Computerish's question) All I am getting at Eclipse's Console is:</p><pre><code>[2010-12-16 10:23:33 - HelloAndroid] ------------------------------[2010-12-16 10:23:33 - HelloAndroid] Android Launch![2010-12-16 10:23:33 - HelloAndroid] adb is running normally.[2010-12-16 10:23:33 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch[2010-12-16 10:23:33 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'AVD23'[2010-12-16 10:23:33 - HelloAndroid] Launching a new emulator with Virtual Device 'AVD23'</code></pre><p>This problem doesn't happen on Windows XP, running Eclipse 3.5.2 and Android 2.2 (all 32-bit).</p><p>I tried the solution suggested by the accepted answer in <a href=""http://stackoverflow.com/questions/2793956/android-emulator-wont-run-application-started-from-eclipse"">this thread</a> but it didn't help. Task manager shows adb's Image Name as '<strong>adb.exe *32</strong>'. Perhaps there is a mismatch between the bitness of Eclipse+JDK (64-bit) and the Android emulator/SDK?</p><p>Is Android development using <strong>64-bit JDK</strong> not possible (yet)?</p>","418055","","52444","","2012-08-17 08:36:53","2012-08-17 08:36:53","64-bit Eclipse won't install .apk on Android emulator","<android><eclipse><64bit><android-emulator><apk>","4","8","1","",""
"4461609","1","4461935","","2010-12-16 14:10:42","8","1153","<p>I am trying to make some self-modifing native code on Android and run it in the emulator. My sample is based on the HelloJNI sample from the android-ndk. It looks like this:</p><pre><code>#define NOPE_LENGTH 4typedef void (*FUNC) (void);// 00000be4 &lt;nope&gt;://     be4: 46c0        nop         (mov r8, r8)//     be6: 4770        bx  lrvoid nope(void) {    __asm__ __volatile__ (""nop"");}void execute(void){    void *code = mmap(NULL, NOPE_LENGTH, PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);    if (code != MAP_FAILED) {        memcpy(code, nope, NOPE_LENGTH);        ((FUNC)code)();    }}</code></pre><p>The problem is that this code is crashing. What is wrong?</p>","506835","","506835","","2010-12-16 14:23:26","2013-03-01 22:48:14","Native self-modifying code on Android","<android><linux><arm><android-ndk><self-modifying>","1","1","3","",""
"4461722","1","4470545","","2010-12-16 14:23:06","0","885","<p>I'm writing Android app and need to know my public IP. In my app i'm using <a href=""http://www.igniterealtime.org/projects/smack/"" rel=""nofollow"">Smack</a> library for conversation with XMPP server (that needed not only to know my IP)</p><p>Bind message, received from server looks like:</p><pre><code>&lt;iq id=""_xmpp_bind1"" type=""result""&gt;   &lt;bind xmlns=""urn:ietf:params:xml:ns:xmpp-bind""&gt;      &lt;jid&gt;user@jabber.example.com/Smack&lt;/jid&gt;   &lt;/bind&gt;&lt;/iq&gt;</code></pre><p>But I'm waiting it looks like:</p><pre><code>&lt;iq id=""_xmpp_bind1"" type=""result""&gt;    &lt;bind xmlns=""urn:ietf:params:xml:ns:xmpp-bind""&gt;       &lt;jid&gt;user@jabber.example.com/11.22.33.44:12345&lt;/jid    &lt;/bind&gt;&lt;/iq&gt;</code></pre><p>Where instead of 11.22.33.44 should be my public IP. </p>","544820","","","","","2010-12-17 12:41:45","How to get my public IP from XMPP bind message?","<android><xmpp><ip><public><smack>","2","1","","",""
"4461804","1","","","2010-12-16 14:31:48","15","1543","<p>I have a class which implements <code>expandable list activity</code>.<br>In the XML code (or I can do it in java), I set <code>fastScrollEnabled</code> to <code>true</code>. This does in deed enable fast scroll. BUT fast scroll only works in the top portion of the list. Like I can use the fastscroll thumb bar to scroll the whole list but only works in the top section of the scroll bar. It's not proportionate to the entire list. I can drag the thumb bar to the bottom of the list but it does no scrolling since the <code>listview</code> is already scrolled to the bottom due to the odd behaviour of it only working in the top portion of the list.<br>Confusing I know, I can try to clarify more if needed....</p><p>I do implement a custom <code>BaseExpandableListAdapter.</code></p>","544872","","1049263","","2012-04-29 14:24:46","2013-06-24 14:26:04","android fastScroll only covers part of the list","<android><expandablelistview><fastscroll>","2","3","1","",""
"4461810","1","","","2010-12-16 14:32:29","0","583","<p>I'm working on one of my android widgets, which uses LauncherPlus to add scrolling functionality, and am running into a frustrating issue. My currently published version of the code, again using LauncherPlus, is working well, scrolling and all. I'm adding a requested feature, one which allows changing text sizes, but an exception is thrown when I test the update. There exception is:</p><pre><code>mobi.intuitit.android.widget.SimpleRemoteViews$ActionException: can't find view:0x7f070041</code></pre><p>I haven't changed anything in the layouts and the only code change references a view id which was already referenced in that same section of code. I looked through the R.java and found which resource was referred to and again, nothing has changed there. Here's the bit of code where the issue is coming from:</p><pre><code>itemViews.setBoundBitmap(R.id.profile, ""setImageBitmap"", SonetProvider.SonetProviderColumns.profile.ordinal(), 0);itemViews.setBoundCharSequence(R.id.friend, ""setText"", SonetProvider.SonetProviderColumns.friend.ordinal(), 0);itemViews.setBoundCharSequence(R.id.created, ""setText"", SonetProvider.SonetProviderColumns.createdtext.ordinal(), 0);itemViews.setBoundCharSequence(R.id.message, ""setText"", SonetProvider.SonetProviderColumns.message.ordinal(), 0);</code></pre><p>The exception is thrown when applying the first line. Out of curiosity, I changed the order of these lines, and each one of them will cause the exception, though again, the layout hasn't changed. After the exception is thrown the widget will build successfully, but I can't publish this update with an exception (force close) being thrown. Any ideas why there is a resource issue? Thanks!</p><p>UPDATE:I found this discussion where it seems that widget resources may not be reloaded on application updates:<a href=""http://groups.google.com/group/android-developers/browse_thread/thread/55a8e44974e8c6ad?fwc=1&amp;pli=1"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/55a8e44974e8c6ad?fwc=1&amp;pli=1</a>Does anyone have any experience with this, or a workaround? This may be what I'm facing.</p>","528934","","528934","","2010-12-17 21:44:20","2010-12-17 21:44:20","Why am I getting ""can't find view"" exceptions when the layout hasn't changed?","<android><android-widget>","1","0","","",""
"4461832","1","4562576","","2010-12-16 14:34:47","12","11745","<p>I am trying to send a Broadcast from a service out to an Activity.  I can verify the broadcast is sent from within the service, but the Activity doesn't pick up anything.</p><p>Here is the relevant service code:</p><pre><code>   Intent i = new Intent(NEW_MESSAGE);     i.putExtra(FriendInfo.USERNAME, StringUtils.parseBareAddress(message.getFrom()));   i.putExtra(FriendInfo.MESSAGE, message.getBody());   i.putExtra(""who"", ""1"");   sendBroadcast(i);</code></pre><p>And the receiving end in the activity class:  </p><pre><code>public class newMessage extends BroadcastReceiver {@Override   public void onReceive(Context context, Intent intent)    {        String action = intent.getAction();       if(action.equalsIgnoreCase(IMService.NEW_MESSAGE)){              Bundle extra = intent.getExtras();          String username = extra.getString(FriendInfo.USERNAME);             String message = extra.getString(FriendInfo.MESSAGE);          String who = extra.getString(""who"");         }   }}</code></pre><p>The BroadcastReceiver is defined within an Activity.  I am registering the receiver in the onCreate method of the Activity, not in the Manifest file.</p><p>I'm stumped as to why it won't rec. anything.</p><p>Any insight?</p><p><b>EDIT</b><br>Registering takes place as follows:</p><pre><code> registerReceiver(messageReceiver, new IntentFilter(IMService.NEW_MESSAGE));</code></pre><p>Where ""messageReceiver"" is defined as </p><pre><code>private newMessage messageReceiver = new newMessage();</code></pre><p>IMService.NEW_MESSAGE is merely a string = ""NewMessage""</p>","544884","","194894","","2012-04-02 10:16:31","2012-04-02 10:16:31","Android Broadcast from Service To Activity","<android><broadcastreceiver><smack>","3","7","2","",""
"4461874","1","","","2010-12-16 14:37:38","0","979","<p>I am writing an application which uses notifications. I want to offer theuser an option to change the default  notification sound from the device soundsettings menu programmatically. for that i'm using:<br><code>startActivityForResult(new Intent(android.provider.Settings.ACTION_SOUND_SETTINGS), 0);</code><br>the problem is, that the sound settings menu opens but I can not find a way to actually open the notification sound item.<br>Is there any way this could be done?Thanks,joel</p>","544891","","","","","2010-12-17 21:18:17","Android: How to open notification sound settings menu in","<android><menu><audio><notifications>","1","0","","",""
"4461964","1","","","2010-12-16 14:47:40","0","1040","<p>Getting error while playing/streaming  3gp format in some phones (Motorola Droid /Galaxy S) but the video is playing without any problem in Nexus 1.</p><p>How can i resolve this issue other than using FFmpeg?</p>","362088","","362088","","2010-12-17 09:51:58","2010-12-17 09:51:58","Error while playing 3gp video stream in some phones","<android><video><video-streaming><videoview><3gp>","1","0","","",""
"4461999","1","4462080","","2010-12-16 14:50:19","4","2540","<p>I have a bug in my code that made me think I don't fully understand the Android Lifecycle. Yes, I have read all the docs and looked at the diagrams, but they seem to talk only about when to save data, when the activity may loose focus or get killed. However, my question is if I don't need to save state, what happens to the variables &amp; their stored values? I expected them to be destroyed to, but a bug in my code seems to indicate otherwise.</p><p>In my case here is what happened. I have an activity that launches a custom view (no xml, I just draw bitmaps on the screen in my custom view). The only variable I currently have in my activity is just a variable for my view: GameView gameView;</p><p>Now in my view, I declare several bitmaps, simple int and float variable to deal with drawing and on touch events and I have one array of objects that contain small bitmaps, coordinates of each objects and a few other things. One of the variables in my class for this object, is a static variable that represents the current count of how many objects their are. I did it this way, so the instantiation of the objects causes it to track how man objects their are, instead of tracking this outside the object's class. </p><p>I expected the static variable to stay the same value across all objects, but I also expected this variable to be destroyed along with all the other variables and objects of that Activity's view once onDestroyed was called for that Activity. However, that doesn't seem to happen. When this Activity is launched again, this static variable still contains its previous value from its last run - even though onDestroyed was called. </p><p>Now my question is NOT how to fix this (I can write code differently to fix this bug), but I would like to understand why this happens with this static variable, since it isn't global to the whole application, it only exists inside that Activity's view? Also, this makes me wonder about the rest of the variables in that view - are they destroyed and their memory released or at least their values no longer available the next time the activity is called or do I need to do this myself - even though I didn't need to save any of this state data? </p><p>Thanks for any insight into this.</p>","503760","","503760","","2010-12-16 15:31:30","2013-03-06 23:55:06","Android - is onDestroy supposed to destroy the activity, its variables and free up memory","<android><memory><lifecycle><object-lifetime><ondestroy>","1","0","2","",""
"4462037","1","4462148","","2010-12-16 14:53:11","6","17606","<p>I have a service that can be started and stopped from a button, but within the service I want to register a receiver to listen for SMS broadcasts. I only want the service to listen for SMS while it is running. I tried registerReceiver(receiver, intentfilter), but this does not work. What am I doing wrong?</p>","544913","","","","","2013-03-31 19:33:46","register receiver in a service","<android>","3","0","5","",""
"4462045","1","6385126","","2010-12-16 14:53:48","3","743","<p>how can I catch a keypress of all characters that are on sw keyboards?Overriding onKeyDown() in the activity works only for standard ASCII characters like a-z0-9-!/... but doesn't work with all the UTF8 chars like šcrž (in that case this method is not called at all)I know the KeyEvent has a method getUnicodeChar(), which returns the unicode character that the key would produce. But I dont know how to get that KeyEvent when onKeyDown() is not called.</p>","522545","","","","","2011-06-17 11:32:56","Catch keypress of special characters with android","<android><keyboard>","1","0","1","",""
"4462132","1","","","2010-12-16 15:01:13","7","559","<p>I am wondering how can I create or use if exists feature of TextView, to automatically change it's font size to fit the place.</p><p>Sometimes it should be larger if has space, and sometimes it should shrink in font size to fit the space.</p><p>What do you say?</p>","243782","","","","","2010-12-16 15:26:43","How can I create a textview that automatically changes it's font size to fit the space?","<java><android><textview>","1","0","2","",""
"4462180","1","","","2010-12-16 15:06:17","1","115","<p>How to add trial period for application ? does Android LVL help?</p>","505011","","","","","2011-02-10 19:16:22","Persistant Data requirement","<android>","1","0","","",""
"4462341","1","","","2010-12-16 15:21:40","1","1634","<p>I tried to implement the <code>addProximityAlert</code> method, but it does not fire. Here is my code:</p><p><strong>SampleProximityAlert</strong></p><pre><code>public class SampleProximityAlert extends Activity { /** Called when the activity is first created. */ protected LocationManager locationManager; protected Location location; public static Location pLocation; protected Intent intent; protected PendingIntent pIntent; protected GeoPoint point; public float distance; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  locationManager = (LocationManager) this    .getSystemService(Context.LOCATION_SERVICE);  location = locationManager    .getLastKnownLocation(LocationManager.GPS_PROVIDER);  try {   locationManager.requestLocationUpdates(     LocationManager.GPS_PROVIDER, 1000, 1,     new ProximityListener());  } catch (RuntimeException e) {   e.printStackTrace();  }  // point = new GeoPoint(49868004, 8626971);  try {   pLocation = new Location(location.getProvider());  } catch (RuntimeException e) {   e.printStackTrace();  }  Log.i(""PROVIDER"", location.getProvider());  pLocation.setLatitude(49.868004);  pLocation.setLongitude(8.626971);  distance = methodeDistance(pLocation);  Log.i(""DISTANCE"", String.valueOf(distance));  Log.i(""POSITION"",    String.valueOf(location.getLatitude()) + "",""
      + String.valueOf(location.getLongitude()));  intent = new Intent(this, ProximityAlert.class);  intent.setAction(""ProximityAlert"");  pIntent = PendingIntent.getService(this, 0, intent, 0);  locationManager.addProximityAlert(49.868004, 8.626971, 429, 50000,    pIntent); } public float methodeDistance(Location mLocation) {  float mDistance = location.distanceTo(pLocation);  return mDistance; }}</code></pre><p><strong>ProximityAlert</strong></p><pre><code>public class ProximityAlert extends Service { @Override public IBinder onBind(Intent intent) {  // TODO Auto-generated method stub  Log.i(""Alert"", ""fired"");  return null; } @Override public void onCreate() {  super.onCreate();  Log.i(""ONCREATE"", ""create ProximityAlert as Service""); } @Override public int onStartCommand(Intent intent, int flags, int startId) {  Log.i(""ONSTARTCOMMAND"", ""OnStartCommand"");  return super.onStartCommand(intent, flags, startId); }}</code></pre><p><strong>ProximityListener</strong></p><pre><code>public class ProximityListener implements LocationListener { String DEBUG_TAG = ""ProximityListener""; @Override public void onLocationChanged(Location location) {  // TODO Auto-generated method stub  Log.d(DEBUG_TAG, location.toString());  // tvD.setText(String.valueOf(location.distanceTo(pLocation))); } @Override public void onProviderDisabled(String provider) {  // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) {  // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) {  // TODO Auto-generated method stub }}</code></pre><p><strong>XML Manifest</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.tsystems.proximityAlert""      android:versionCode=""1""      android:versionName=""1.0""&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.INTERNET""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".SampleProximityAlert""                  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="".ProximityAlert""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""ProximityAlert""/&gt;                &lt;category android:name=""com.proaktiveOrtung""/&gt;            &lt;/intent-filter&gt;        &lt;/service&gt;        &lt;service android:name="".ProximityAlert""&gt;&lt;/service&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt;</code></pre><hr><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.tsystems.proximityAlert""      android:versionCode=""1""      android:versionName=""1.0""&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.INTERNET""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".SampleProximityAlert""                  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="".ProximityAlert""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""ProximityAlert""/&gt;                &lt;category android:name=""com.proaktiveOrtung""/&gt;            &lt;/intent-filter&gt;        &lt;/service&gt;        &lt;service android:name="".ProximityAlert""&gt;&lt;/service&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>Sorry I selected not the complete code.</p>","544951","","1288","","2012-04-24 22:52:09","2012-04-24 22:52:09","Android addProximityAlert does not fire","<android>","1","1","","",""
"4462496","1","4464228","","2010-12-16 15:38:26","5","2256","<p>I'd like to implement an <a href=""http://developer.android.com/reference/android/app/IntentService.html"">IntentService</a> (<a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/app/IntentService.java"">source code</a>) that handles intents based on a simple numeric priority. Intents with higher priority should be processed first by the service than intents with lower priority.</p><p>Is there anything on Android that does this already? If not, any pointers on how to implement it?</p>","143378","","","","","2011-01-06 23:54:15","Service with priority queue in Android","<android><service><queue><android-intent><priority-queue>","2","0","6","",""
"4462532","1","","","2010-12-16 15:40:58","1","1280","<p>I've been messing about with this for a long while with still no solution. I'm populating listview images via an asynctask and it works fine in terms of populating but the problem is that when I scroll the list the images disappear for a second or two then reappear. Please note, ALL images are on my SD card, nothing is downloaded. I just adjusted the code from Android dev blog and never renamed it. The relevant portion of my getView looks like this:</p><p>image = PATH to image fileimage_main = imageViewimage_table = Table that holds imageView</p><pre><code>                list_image.setVisibility(View.VISIBLE);                                 ImageDownloader imgDwn = new ImageDownloader();                imgDwn.download(image, image_main, image_table);            } else {                list_image.setVisibility(View.GONE);                image_table.setVisibility(View.GONE);                image_main.setImageBitmap(null);            }</code></pre><p>The class that handles it looks like this:</p><p>public class ImageDownloader {</p><pre><code>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><p>}</p>","427377","","","","","2011-01-17 03:55:27","Android listview imageview frustration","<android>","1","0","","",""
"4462669","1","4463067","","2010-12-16 15:55:46","1","589","<p>I'm doing an android app and a want to restrict specific part of the app to a kind of administrator (that is only for this app).The admin will push a button to access the admin part, and a password is required.My question is about the way to store the password.Do I have to store the password on like res/string or something? do you have a better idea?Thanks</p><hr><p>I know that maybe some leaks are easy to do but my app is not something i'll spread, just for a signing app on an android smartphone, so no need to have big security, the password is just here to prevent from errors on the use of the app.</p>","543691","","50776","","2011-12-09 14:50:43","2011-12-09 14:50:43","Android - restrict access with password","<android><passwords>","4","0","0","",""
"4462735","1","4464203","","2010-12-16 16:03:12","5","2583","<p>I've defined some style resources that include TextAppearance with a defined TextColor.  I then apply the styles to some TextViews and Buttons.  All the styles come through with the TextView, but not the Button.  For some reason, the textColor attribute is not showing up.  Is this a bug, or am I missing something in the case of the Button?</p><p>Here is the style definition:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;resources&gt;    &lt;style name=""TestApp""&gt;          &lt;/style&gt;    &lt;!-- Text Appearances --&gt;    &lt;style name=""TestApp.TextAppearance""&gt;        &lt;item name=""android:typeface""&gt;sans&lt;/item&gt;        &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;        &lt;item name=""android:textSize""&gt;16px&lt;/item&gt;               &lt;item name=""android:textColor""&gt;#6666FF&lt;/item&gt;    &lt;/style&gt;    &lt;!-- Widget Styles --&gt;    &lt;style name=""TestApp.Widget""&gt;        &lt;item name=""android:layout_margin""&gt;3sp&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""TestApp.Widget.Label""&gt;        &lt;item name=""android:textAppearance""&gt;@style/TestApp.TextAppearance&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;    &lt;style name=""TestApp.Widget.Switch""&gt;        &lt;item name=""android:textAppearance""&gt;@style/TestApp.TextAppearance&lt;/item&gt;        &lt;item name=""android:layout_width""&gt;100px&lt;/item&gt;        &lt;item name=""android:layout_height""&gt;100px&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>and here's the layout where I attempt to apply them:</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    style=""@style/TestApp.Widget.Label""    android:text=""This is my label."" /&gt;&lt;TextView    style=""@style/TestApp.Widget.Label""    android:text=""This is my disabled label.""    android:enabled=""false"" /&gt;&lt;Button    style=""@style/TestApp.Widget.Switch""    android:text=""This is my switch."" /&gt;&lt;Button    style=""@style/TestApp.Widget.Switch""    android:text=""This is my disabled switch.""    android:enabled=""false"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Any help would be appreciated.</p><p>Thanks,</p><p>J</p>","512309","","","","","2014-01-14 21:52:18","TextColor defined in style being applied to TextView, but not Button?","<android>","3","0","2","",""
"4462778","1","4517746","","2010-12-16 16:07:07","2","2022","<p>I am running the Contact Manager sample app from the Android SDK. When I add a contact to my Gmail account, it gets added as an 'invisible contact'. I am assuming this is because I am not telling the contact which 'group' it should be assigned to. I have been looking around the internets for a few days and have come up empty handed.</p><p>What I really want to do is add the contact to the Contact Account that I select and have the contact associated with a Contact Group within the selected Gmail Account, so the contact's info will be displayed in the user's contacts.</p>","300129","","","","","2011-05-15 17:00:47","How to get Contact Groups into Contact Manager Sample App? (Android)","<android><contacts><groups><accounts><contactscontract>","2","1","","",""
"4462797","1","","","2010-12-16 16:09:05","0","1317","<p>I'm porting my old Hangman java game to android for my programming finals in january. I've gotten most of it working but i have found that my does not do any checks for invalid characters. The invalid characters are basicly everything but lowercase letters. I have been thinking of manually entering all valid characters into an array and check each input against that. Is there an easier way to do it?</p><p>Here is the code that catches the input from the appropriate EditText:</p><pre><code>final EditText guessedLetter = (EditText) findViewById(R.id.LetterInput);final Button enterGuess = (Button) findViewById(R.id.GuessButton);      enterGuess.setOnClickListener(new View.OnClickListener() {      public void onClick(View v) {            String guess = guessedLetter.getText().toString(); //Save text to a string            guessedLetter.setText(""""); //Clear EditText after input has been saved to a String            editor.putString(GAME_LOGIC_GUESS, guess);            editor.commit();            Log.i(GAME_DEBUG, ""Guess: "" + guess + "" parsed to guess()"");            guess();            checkWin();            updateDisplay();            }            }});</code></pre><p>Thanks again!</p>","535199","","","","","2010-12-16 19:20:14","Making sure EditText only returns single lowercase letters","<android><input><filter><edittext>","3","0","","",""
"4462829","1","","","2010-12-16 16:12:57","0","1108","<p>As part of an Activity, I have a class encapsulating functionality for a single object and want to display details of the object in a <code>ListView</code> when a particular button is pressed.</p><p><strong>Attempt One:</strong></p><p>If I pass the <code>ListView</code> and <code>this</code> to the object to store (!) and then try to call the <code>ArrayAdapter</code>, I get a runtime error:</p><blockquote>  <p>Source not found</p></blockquote><p>Code segment (method within the class)...</p><pre><code>private void displayTouch(Touch lasttouch) {    String mLine = """";    /* Build up line of analysis */    ...    /* Display line */    mAnalysis[lasttouch.mSequence] = mLine;    mViewAnalysis.setAdapter(new ArrayAdapter&lt;String&gt;     (mActivity,R.layout.simplerow,mAnalysis));} // End of method displayTouch</code></pre><p><strong>Attempt Two</strong></p><p>If I try to display data in the <code>ListView</code> from within the <code>OnClick</code> Listener, I get an error message in Eclipse:</p><blockquote>  <p>The constructor ArrayAdapter (new View.OnClickListener(){}, int, String[] is undefined.</p></blockquote><p>Code segment (within the OnClick Listener of the Activity)...</p><pre><code>/* Record details */OnClickListener CourtListener = new OnClickListener() {    public void onClick(View v) {        ...        /* Analyse  */        ...        /* Capture  analysis */            lRoster.setAdapter(new ArrayAdapter&lt;String&gt; (this,R.layout.simplerow,playerArray));         } // End of event onClick     }; // End of listener CourtListener</code></pre><p>In this code <code>playerArray</code> is dimensioned within the Activity's <code>onCreate</code>;</p><p>Both attempts have weaknesses of approach (in addition to not working) so I'll re-factor once I can get something working.</p><p>Essentially, how do I display data generated within an object to a <code>ListView</code> within an Activity from the <code>OnClick</code> Listener of another View in the same Activity?  Everything is within one package and within the Activity.</p>","541770","","688393","","2011-12-10 14:33:29","2011-12-10 14:33:29","Displaying object details in a ListView in Android","<android><class><listview><android-arrayadapter>","1","0","0","",""
"4462925","1","5692892","","2010-12-16 16:23:30","-1","816","<p>I'm developing a application that works on linux. I want to port this to the Android SDK Emulator. But everytime I start the application the emulator crashed with a segmentation fault. </p><p>Somebody has any clue why a selfmade program that's running on the Android Emulator could crash the entire emulator? </p>","359156","","","","","2011-04-17 10:08:37","Why is my Android Emulator crashing?","<android><android-emulator><porting><android-sdk-2.2>","3","1","","",""
"4462932","1","","","2010-12-16 16:24:12","0","3340","<pre><code>try {    HttpClient client = new DefaultHttpClient();      String postURL = ""http://somepostaddress.com"";    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));        }} catch (Exception e) {    e.printStackTrace();}</code></pre><p>this is the code that i found in <a href=""http://www.softwarepassion.com/android-series-get-post-and-multipart-post-requests"" rel=""nofollow"">http://www.softwarepassion.com/android-series-get-post-and-multipart-post-requests</a>. afterward i will just only use the simple POST method the variable in the php, right?</p><p>example:</p><p>$user=$_POST['user'];$pass=$_POST['pass'];</p><p>however, when i execute the code, the php showed a 0 only. may i know how to solve it? thanks</p><p>p/s: sry for bad english</p>","545028","","","","","2012-08-17 11:39:55","make use of php GET and POST in android programming","<android>","3","0","1","",""
"4463152","1","4463233","","2010-12-16 16:41:19","1","938","<p>Hey, i'm creating an application and would like to know, is there a way to automatically send an email from my application, lets say at 3:00, automatically without any input from the user. So instead of creating an intent to open gmail then user has to hit 'send' is there a way to just send it? Thanks!</p>","481082","","","","","2010-12-16 16:48:31","Send Email as Notification","<android><email><notifications>","2","0","","",""
"4463255","1","4463628","","2010-12-16 16:51:38","1","1373","<p>I've downloaded the source code for the Android default email client.  I'd like to build it to try some things out but I am unable to.  It seems I am missing a reference to the Android Calendar provider as both Eclipse and NetBeans complain about this import along with any other references:</p><pre><code>import android.provider.Calendar;</code></pre><p>When I browse the sdk it looks like this provider is not included.</p><p>So - how can I load the provider so I can build the client?  Is there any other way for me to build the default Android email client locally?  I've started to go down the road of downloading all the Android source code and building from there but I'm hoping there's a better way.</p><p>Also, ideally I'd like to build against Android 2.2/Froyo but would consider 2.1 or 2.3 if that made this easier</p>","225","","995926","","2012-05-22 08:09:01","2012-05-22 08:09:01","Trying to build Android default email client but missing Calendar provider","<android><android-2.2-froyo>","2","0","","",""
"4463342","1","","","2010-12-16 16:59:28","0","650","<p>$ sudo platform-tools/adb devicesList of devices attached</p><p>I've just spent several hours googling and trying to get it worked</p><p>Ubuntu 10.10USB debugging is turned on.</p><p>$ lsusbBus 001 Device 040: ID 0502:3212 Acer, Inc.</p><p>Played alot with /etc/udev/rules.d/*-android.rules, sudo service udev restart/reload, adb kill-server and sudo adb start-server...</p><p>Here are some of the settings I used for the rules file (one by one):</p><p>SUBSYSTEM==""usb"", SYSFS{product}==""Android Phone"", SYMLINK+=""android_adb"", MODE=""0666""SUBSYSTEM==""usb"", ATTRS{idVendor}==""0502"", MODE=""0666""SUBSYSTEM==""usb"", ATTRS{idVendor}==""0502"", ATTRS{idProduct}==""3212"", MODE=""0666""ATTRS{idVendor}==""0502"", ATTRS{idProduct}==""3212"", MODE=""0666""ATTRS{idVendor}==""0502"", ATTRS{idProduct}==""3212"", MODE=""0666"", ENV{ACL_MANAGE}=""1""</p><p>Some info which might be useful:$ dmesg|tail -5[12888.236175] usb 1-8: new high speed USB device using ehci_hcd and address 42[12888.389921] scsi41 : usb-storage 1-8:1.0[12889.394601] scsi 41:0:0:0: Direct-Access Linux File-Stor Gadget 0322 PQ: 0 ANSI: 2[12889.397545] sd 41:0:0:0: Attached scsi generic sg2 type 0[12889.411569] sd 41:0:0:0: [sdb] Attached SCSI removable disk</p><p>$ ls -l /dev/sdb /dev/sg2brw-rw-rw- 1 root disk 8, 16 2010-12-16 18:52 /dev/sdbcrw-rw-rw- 1 root disk 21, 2 2010-12-16 18:52 /dev/sg2</p><p>$ ls -l /dev/bus/usb/001/043crw-rw-r-- 1 root root 189, 42 2010-12-16 18:52 /dev/bus/usb/001/043</p><p>$ udevadm info --attribute-walk --name /dev/sdb</p><p>Udevadm info starts with the device specified by the devpath and thenwalks up the chain of parent devices. It prints for every devicefound, all possible attributes in the udev rules key format.A rule to match, can be composed by the attributes of the deviceand the attributes from one single parent device.</p><p>looking at device '/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/host42/target42:0:0/42:0:0:0/block/sdb':KERNEL==""sdb""SUBSYSTEM==""block""DRIVER==""""ATTR{range}==""16""ATTR{ext_range}==""256""ATTR{removable}==""1""ATTR{ro}==""0""ATTR{size}==""0""ATTR{alignment_offset}==""0""ATTR{discard_alignment}==""0""ATTR{capability}==""51""ATTR{stat}=="" 0 0 0 0 0 0 0 0 0 0 0""ATTR{inflight}=="" 0 0""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/host42/target42:0:0/42:0:0:0':KERNELS==""42:0:0:0""SUBSYSTEMS==""scsi""DRIVERS==""sd""ATTRS{device_blocked}==""0""ATTRS{type}==""0""ATTRS{scsi_level}==""3""ATTRS{vendor}==""Linux ""ATTRS{model}==""File-Stor Gadget""ATTRS{rev}==""0322""ATTRS{state}==""running""ATTRS{timeout}==""30""ATTRS{iocounterbits}==""32""ATTRS{iorequest_cnt}==""0x2e7""ATTRS{iodone_cnt}==""0x2e7""ATTRS{ioerr_cnt}==""0x215""ATTRS{modalias}==""scsi:t-0x00""ATTRS{evt_media_change}==""0""ATTRS{dh_state}==""detached""ATTRS{queue_depth}==""1""ATTRS{queue_type}==""none""ATTRS{max_sectors}==""240""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/host42/target42:0:0':KERNELS==""target42:0:0""SUBSYSTEMS==""scsi""DRIVERS==""""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/host42':KERNELS==""host42""SUBSYSTEMS==""scsi""DRIVERS==""""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0':KERNELS==""1-8:1.0""SUBSYSTEMS==""usb""DRIVERS==""usb-storage""ATTRS{bInterfaceNumber}==""00""ATTRS{bAlternateSetting}=="" 0""ATTRS{bNumEndpoints}==""02""ATTRS{bInterfaceClass}==""08""ATTRS{bInterfaceSubClass}==""06""ATTRS{bInterfaceProtocol}==""50""ATTRS{modalias}==""usb:v0502p3212d0322dc00dsc00dp00 ic08isc06ip50""ATTRS{supports_autosuspend}==""0""ATTRS{interface}==""Mass Storage""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-8':KERNELS==""1-8""SUBSYSTEMS==""usb""DRIVERS==""usb""ATTRS{configuration}==""Self-powered""ATTRS{bNumInterfaces}=="" 1""ATTRS{bConfigurationValue}==""1""ATTRS{bmAttributes}==""c0""ATTRS{bMaxPower}==""500mA""ATTRS{urbnum}==""3100""ATTRS{idVendor}==""0502""ATTRS{idProduct}==""3212""ATTRS{bcdDevice}==""0322""ATTRS{bDeviceClass}==""00""ATTRS{bDeviceSubClass}==""00""ATTRS{bDeviceProtocol}==""00""ATTRS{bNumConfigurations}==""1""ATTRS{bMaxPacketSize0}==""64""ATTRS{speed}==""480""ATTRS{busnum}==""1""ATTRS{devnum}==""43""ATTRS{devpath}==""8""ATTRS{version}=="" 2.00""ATTRS{maxchild}==""0""ATTRS{quirks}==""0x0""ATTRS{avoid_reset_quirk}==""0""ATTRS{authorized}==""1""ATTRS{manufacturer}==""Linux 2.6.27-nxp with pnx67xx_ehci_udc""ATTRS{product}==""File-backed Storage Gadget""ATTRS{serial}==""3230204E6F76""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1':KERNELS==""usb1""SUBSYSTEMS==""usb""DRIVERS==""usb""ATTRS{configuration}==""""ATTRS{bNumInterfaces}=="" 1""ATTRS{bConfigurationValue}==""1""ATTRS{bmAttributes}==""e0""ATTRS{bMaxPower}=="" 0mA""ATTRS{urbnum}==""969""ATTRS{idVendor}==""1d6b""ATTRS{idProduct}==""0002""ATTRS{bcdDevice}==""0206""ATTRS{bDeviceClass}==""09""ATTRS{bDeviceSubClass}==""00""ATTRS{bDeviceProtocol}==""00""ATTRS{bNumConfigurations}==""1""ATTRS{bMaxPacketSize0}==""64""ATTRS{speed}==""480""ATTRS{busnum}==""1""ATTRS{devnum}==""1""ATTRS{devpath}==""0""ATTRS{version}=="" 2.00""ATTRS{maxchild}==""8""ATTRS{quirks}==""0x0""ATTRS{avoid_reset_quirk}==""0""ATTRS{authorized}==""1""ATTRS{manufacturer}==""Linux 2.6.35-23-generic ehci_hcd""ATTRS{product}==""EHCI Host Controller""ATTRS{serial}==""0000:00:1d.7""ATTRS{authorized_default}==""1""</p><p>looking at parent device '/devices/pci0000:00/0000:00:1d.7':KERNELS==""0000:00:1d.7""SUBSYSTEMS==""pci""DRIVERS==""ehci_hcd""ATTRS{vendor}==""0x8086""ATTRS{device}==""0x265c""ATTRS{subsystem_vendor}==""0x1025""ATTRS{subsystem_device}==""0x006a""ATTRS{class}==""0x0c0320""ATTRS{irq}==""23""ATTRS{local_cpus}==""ff""ATTRS{local_cpulist}==""0-7""ATTRS{modalias}==""pci:v00008086d0000265Csv00001025 sd0000006Abc0Csc03i20""ATTRS{dma_mask_bits}==""32""ATTRS{consistent_dma_mask_bits}==""32""ATTRS{broken_parity_status}==""0""ATTRS{msi_bus}==""""ATTRS{companion}==""""</p><p>looking at parent device '/devices/pci0000:00':KERNELS==""pci0000:00""SUBSYSTEMS==""""DRIVERS==""""</p><p>Please help!</p>","545071","","","","","2011-02-28 10:57:28","Android: I cannot upload HelloWorld to Acer BeTouch E110 - adb doesn't see it. Any thoughts?","<android><adb><devices>","2","0","","",""
"4463362","1","4463486","","2010-12-16 17:01:40","0","86","<p>I have a dialog that pops up some information on a list, when a long click is performed. The information depends on which list entry the click is performed on. However, I'm noticing that when I view the information, and close it (Via calling it with a dialog.cancel() command), that the next time I open the dialog, it doesn't bother to get the information again, it just pops up the same dialog that I saw before. Any tips for overcoming this problem? Thanks!</p><p>Some further information. The dialog is generated using a showDialog(int) command. From there, it is called through an onCreateDialog(int) command in a master activity. </p><p>EDIT: I managed to get this to work by using the removeDialog(int) command in the onClickListener of the Dialog (It just removes itself when it dies). I can't for the life of me find a more elegant solution, but I'd much prefer one. Thanks guys!</p><p>Edit: NM, realized the answer was already posted here... Thanks again!</p>","544198","","544198","","2010-12-17 05:25:25","2010-12-17 05:25:25","How can I guarantee a Dialog will be re-formed after canceled?","<android><dialog><alertdialog>","2","0","","",""
"4463398","1","7979104","","2010-12-16 17:05:19","7","6673","<p>I need to scale my TabWidget background images so they maintain aspect ratio.<br>I am using a TabHost with a TabWidget.  I am then using setBackgroundDrawable to set the images.</p><p>I found a close answer here - <a href=""http://stackoverflow.com/questions/2409521/background-in-tab-widget-ignore-scaling/4462802#4462802"">Background in tab widget ignore scaling</a>.  However, I'm not sure just where to add the new Drawable code.  (Working with the HelloTabWidget example, none of my modules use RelativeLayout, and I don't see any layout for ""tabcontent"".)</p><p>I also found this thread - <a href=""http://stackoverflow.com/questions/1400782/android-scale-a-drawable-or-background-image"">Android: Scale a Drawable or background image?</a>.  According to it, it sounds like I would have to pre-scale my images, which defeats the whole purpose of making them scaleable.</p><p>I also found another thread where someone subclassed the Drawable class so it would either not scale, or it would scale properly.  I can't find it now, but that seems like a LOT to go through when you should just be able to do something simple like mTab.setScaleType(centerInside).</p><p>Here's my code:</p><p>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""    android:background=""@drawable/main_background""&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=""fill_parent""            android:layout_weight=""1""/&gt;            &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:layout_weight=""0""/&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>main activity:</p><pre><code>        tabHost.setOnTabChangedListener(new OnTabChangeListener() {             TabHost changedTabHost = getTabHost();            TabWidget changedTabWidget = getTabWidget();            View changedView = changedTabHost.getTabWidget().getChildAt(0);            public void onTabChanged(String tabId) {                 int selectedTab = changedTabHost.getCurrentTab();                TabWidget tw = getTabWidget();                if(selectedTab == 0) {                    //setTitle(""Missions Timeline"");                    View tempView = tabHost.getTabWidget().getChildAt(0);                    tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_timeline_on));                    tempView = tabHost.getTabWidget().getChildAt(1);                    tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_map_off));                    tempView = tabHost.getTabWidget().getChildAt(2);                    tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_search_off));                    tempView = tabHost.getTabWidget().getChildAt(3);                    tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_news_off));                    tempView = tabHost.getTabWidget().getChildAt(4);                    tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_license_off));                            //ImageView iv = (ImageView)tabHost.getTabWidget().getChildAt(0).findViewById(android.R.id.icon);                             //iv.setImageDrawable(getResources().getDrawable(R.drawable.tab_timeline_on));                             //iv = (ImageView)tabHost.getTabWidget().getChildAt(1).findViewById(android.R.id.icon);                             //iv.setImageDrawable(getResources().getDrawable(R.drawable.tab_map_off));                     } else if (selectedTab == 1) {                        //setTitle(""Spinoffs Around You"");                        View tempView = tabHost.getTabWidget().getChildAt(0);                        tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_timeline_off));                        tempView = tabHost.getTabWidget().getChildAt(1);                        tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_map_on));                        tempView = tabHost.getTabWidget().getChildAt(2);                        tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_search_off));                        tempView = tabHost.getTabWidget().getChildAt(3);                        tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_news_off));                        tempView = tabHost.getTabWidget().getChildAt(4);                        tempView.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_license_off));}</code></pre><p>I also tried 9patch images, but they wind up being too small.</p><p>So, what's the best way to go about this?</p>","359519","","","","","2014-03-03 09:43:32","TabHost / TabWidget - Scale Background Image?","<android><background><scale><android-tabhost><tabwidget>","3","0","4","",""
"4463409","1","4464801","","2010-12-16 17:06:15","0","1470","<p>Hi i have set up a custom title bar but the app crashes and i don't get any error log in LogCat, i'm going crazy. Here's is some code, can you experts see what's wrong?</p><pre><code>boolean isCustomTitleSupported;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        isCustomTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);        setContentView(R.layout.about);        customizeTitleBar(""My Title"");    public void customizeTitleBar(String title){        if(isCustomTitleSupported){            getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customtitlebar);            TextView customTitleText = (TextView)findViewById(R.id.customtitle);            customTitleText.setText(title);            customTitleText.setTextColor(Color.WHITE);        }    }</code></pre><p><strong>customtitlebar.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=""horizontal""         android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;    &lt;TextView android:id=""@+id/customtitle""        android:layout_width=""wrap_content""         android:layout_height=""fill_parent""        android:textStyle=""bold""        android:padding=""3px""         /&gt;&lt;/LinearLayout&gt;</code></pre><p>some help will be appreciated</p><p>Thanks!!</p><p><strong>EDIT:</strong> i noticed that i wasn't extending Activity but BaseActivity a superclass i created to have the menu available in all of my activities. So i changed back to extend Activity and it's working but this is a problem because i need menus too. Is there any tricks so i could keep extending BaseActivity and even get the title bar to work?</p>","526924","","526924","","2010-12-16 17:21:12","2011-08-09 11:57:20","custom title bar is not working android","<android>","4","0","","",""
"4463548","1","","","2010-12-16 17:19:42","0","151","<p>I want to launch multiple sounds every x miliseconds with a good precision (&lt; 5ms).</p><p>I tried <code>TimerTask</code>/<code>Handler.postDelayed</code> with <code>MediaPlayer</code>/<code>SoundPool</code>. I always have bad precision.</p><p>For instance, I launched sounds like this :</p><ul><li>launch sound1 in 500ms, 1000ms, 1500ms, 2000ms, 2500ms, ...</li><li>launch sound2 in 250ms, 500ms, 750ms, 1000ms, 1250ms, 1500ms, 1750ms, ...</li></ul><p>Do you have a better idea for this purpose ?</p><p>Thank you.</p>","545068","","2546444","","2013-08-05 15:55:00","2013-08-05 15:55:00","Android : Launch Sounds At","<android><timer><audio><media-player>","1","0","","",""
"4463765","1","4463812","","2010-12-16 17:46:51","6","4377","<p>I've got a very simplistic application:</p><pre><code>#include &lt;vector&gt;void android_main(struct android_app* state){}</code></pre><p>When I build it, I get the following error:</p><blockquote>  <p>test/jni/main.c:14:18: error: vector:  No such file or directory</p></blockquote><p>How the hell do I include STL header files? I've found stlport, and I can see the header files exist in it's directory, but how do include them?</p><p><strong>Edit:</strong> My Application.mk file has the following line:</p><pre><code>APP_STL := stlport_static</code></pre>","986","","986","","2010-12-16 20:57:45","2010-12-16 20:57:45","Can't include STL header files with Android NDK r5","<c++><android><cygwin><android-ndk><android-ndk-r5>","2","0","2","",""
"4463886","1","","","2010-12-16 18:00:39","4","4442","<p>I am trying to get an example from the Android 2 Application Development book by Reto Meier to work (page 202).  As per the instructions I have created a userpreferences.xml as follows:</p><pre><code>&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android"" &gt;  &lt;CheckBoxPreference    android:key=""PREF_AUTO_UPDATE""    android:title=""Auto refresh""    android:summary=""Select to turn on automatic updating""    android:defaultValue=""true""     /&gt;  &lt;ListPreference    android:key=""PREF_UPDATE_FREQ""    android:title=""Refresh frequency""    android:summary=""Frequency at which to refresh earthquake list""    android:entries=""@array/update_freq_options""    android:entryValues=""@array/update_freq_values""    android:dialogTitle=""Refresh frequency""    android:defaultValue=""60""  /&gt;  &lt;ListPreference    android:key=""PREF_MIN_MAG""    android:title=""Minimum magnitude""    android:summary=""Select the minimum magnitude earthquake to report""    android:entries=""@array/magnitude_options""    android:entryValues=""@array/magnitude""    android:dialogTitle=""Magnitude""    android:defaultValue=""3""  /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>My Preferences class looks like this...</p><pre><code>public class Preferences extends PreferenceActivity {  SharedPreferences prefs;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.userpreferences);  }</code></pre><p><strong>I keep getting a ClassCastException: java.lang.ClassCastException: java.lang.Integer</strong></p><pre><code>12-16 09:28:14.349: ERROR/AndroidRuntime(287): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dt.sample/com.dt.sample.Preferences}: java.lang.ClassCastException: java.lang.Integer12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.os.Handler.dispatchMessage(Handler.java:99)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.os.Looper.loop(Looper.java:123)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at java.lang.reflect.Method.invokeNative(Native Method)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at java.lang.reflect.Method.invoke(Method.java:521)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at dalvik.system.NativeStart.main(Native Method)12-16 09:28:14.349: ERROR/AndroidRuntime(287): Caused by: java.lang.ClassCastException: java.lang.Integer12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ContextImpl$SharedPreferencesImpl.getString(ContextImpl.java:2699)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.Preference.getPersistedString(Preference.java:1249)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.ListPreference.onSetInitialValue(ListPreference.java:232)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.Preference.dispatchSetInitialValue(Preference.java:1172)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.Preference.onAttachedToHierarchy(Preference.java:984)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.PreferenceGroup.addPreference(PreferenceGroup.java:156)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.PreferenceGroup.addItemFromInflater(PreferenceGroup.java:97)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.PreferenceGroup.addItemFromInflater(PreferenceGroup.java:38)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.GenericInflater.rInflate(GenericInflater.java:488)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.GenericInflater.inflate(GenericInflater.java:326)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.GenericInflater.inflate(GenericInflater.java:263)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:251)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:262)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at com.dt.sample.Preferences.onCreate(Preferences.java:24)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)12-16 09:28:14.349: ERROR/AndroidRuntime(287):     ... 11 more</code></pre><p>The arrays.xml looks like this...</p><pre><code>&lt;resources&gt;  &lt;string-array name=""update_freq_options""&gt;    &lt;item&gt;Every Minute&lt;/item&gt;    &lt;item&gt;5 minutes&lt;/item&gt;    &lt;item&gt;10 minutes&lt;/item&gt;    &lt;item&gt;15 minutes&lt;/item&gt;    &lt;item&gt;Every Hour&lt;/item&gt;  &lt;/string-array&gt;  &lt;array name=""magnitude""&gt;    &lt;item&gt;3&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;/array&gt;  &lt;string-array name=""magnitude_options""&gt;    &lt;item&gt;3&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;/string-array&gt;  &lt;array name=""update_freq_values""&gt;    &lt;item&gt;1&lt;/item&gt;    &lt;item&gt;5&lt;/item&gt;    &lt;item&gt;10&lt;/item&gt;    &lt;item&gt;15&lt;/item&gt;    &lt;item&gt;60&lt;/item&gt;  &lt;/array&gt;&lt;/resources&gt;</code></pre><p>I tried using integer-array but that didn't help.  What am I doing wrong?  Please help.  Thanks.</p>","545086","","544198","","2012-11-18 23:50:12","2013-07-05 14:05:11","ClassCastException in PreferenceActivity","<android><android-preferences>","4","1","","",""
"4463992","1","","","2010-12-16 18:12:59","2","1434","<p>I am trying to save the contact details to the android contacts through my application. I do not want to have the default contact application to do this job, instead I need to do this from my code directly. Here is the code which I use. After the button onclick, I would require to have the contact detail stored to the cntact in android, which, unfortunately is not happening.</p><p>Can someone please guide me where I am going wrong in this code and what need to be done in order to resolve the issue.</p><p>Any help in this regard is well appreciated.</p><p>Regards,Rony</p><pre><code>            ContentValues values = new ContentValues();            values.put(Phone.NUMBER, ""456456"");            values.put(Phone.TYPE, Phone.TYPE_WORK);            Uri uri = getContentResolver().insert(Phone.CONTENT_URI, values); </code></pre>","264953","","","","","2010-12-17 05:46:06","Issue in saving contacts to android - code attached","<java><android><android-emulator><android-widget>","1","5","","",""
"4464007","1","4470692","","2010-12-16 18:14:35","1","1410","<p>We can pass data to the next view while using navigator.pushview, but the data is lost when the back button is clicked (popview).</p><p>I have views that make remote calls and I want to keep the data when the user navigates back to the view using the back button so I don't have to make a remote call again.</p><p>Is there a way to set a global variable that's accessible from all views, or a way to retain data when a user navigates back to a view using the back button?</p>","545151","","","","","2012-02-02 18:23:32","Flex Hero Mobile, sharing data when popping views","<android><flex><mobile><air><adobe>","4","0","","",""
"4464031","1","","","2010-12-16 18:17:01","0","101","<p>I am at the last part of my App,so my problem is following:i must run su (superuser), then i must put in commands, but when i give su busybox cp /bla bla blait does nothing, on the phone, and also at my pcon my pc works following:at first i type su press enterand then cp /bla bla, this works</p><p>how can i use su and busybox at one runtime.exec?</p><p>thx in advance</p>","545154","","","","","2010-12-16 18:17:01","Android SDK: Runtimes","<java><android><sdk><runtime>","0","4","","",""
"4464100","1","","","2010-12-16 18:25:25","1","401","<p>I am developing an android app in which i have to load a web page and then play a movie clip from it in a customized web view. I have done almost every thing there and even movie is played in web view. But problem is that when we play it once it does not play again. Even when same link is accessed via android standard browser it works fine. But in customized web view video only played once. Any body please tell me that why is that happening and also how to over come this issue as my app is just in finish line.Thanks:</p>","497069","","","","","2012-04-18 08:30:38","how to play video more than one time in customized web view in android?","<android><html5-video>","1","1","","",""
"4464207","1","4464627","","2010-12-16 18:36:50","6","3618","<p>I am currently writing a client-server application and I ask myself if there is a better way to find a server in the local network then going trough all the available IP addresses and see if the correct answer is supplied?</p>","247002","","","","","2010-12-16 19:31:05","Android - find a server in the network","<android><networking><network-programming>","2","0","4","",""
"4464253","1","4464626","","2010-12-16 18:42:05","1","597","<p>I'm trying to compile my android project with and I can't seem to get passed this error:</p><blockquote>  <p>-dex:       [echo]       [echo]         Converting compiled files and external libraries  into K:\bin \classes.dex...       [echo]      [apply]      [apply] UNEXPECTED TOP-LEVEL EXCEPTION:      [apply] com.android.dx.util.ExceptionWithContext      [apply]     at com.android.dx.util.ExceptionWithContext.withContext(Exceptio  nWithContext.java:46)      [apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslato  r.java:340)      [apply]     at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.ja  va:131)      [apply]     at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.jav  a:85)      [apply]     at com.android.dx.command.dexer.Main.processClass(Main.java:336)</p><pre><code>[apply]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:</code></pre>    <p>315)      [apply]     at com.android.dx.command.dexer.Main.access$100(Main.java:56)      [apply]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.jav  a:266)      [apply]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(Class  PathOpener.java:244)      [apply]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPath  Opener.java:130)      [apply]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpe  ner.java:108)      [apply]     at com.android.dx.command.dexer.Main.processOne(Main.java:284)      [apply]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:2  20)      [apply]     at com.android.dx.command.dexer.Main.run(Main.java:176)      [apply]     at com.android.dx.command.dexer.Main.main(Main.java:157)      [apply]     at com.android.dx.command.Main.main(Main.java:89)      [apply] Caused by: java.lang.NullPointerException      [apply]     at com.android.dx.cf.code.ConcreteMethod.(ConcreteMethod.j  ava:84)      [apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslato  r.java:243)      [apply]     ... 14 more      [apply] ...while processing  ()V      [apply] ...while processing com/google/android/apps/analytics/AnalyticsRecei  ver.class      [apply]      [apply] 1 error; aborting</p>    <p>BUILD FAILED K:\build.xml:343: The  following error occurred while  executing this line: K:\build.xml:205:  apply returned: 1</p></blockquote><p>I believe it has something to do with using the AnalyticsReceiver.jar lib. But I know my code works as I have successfully compiled it with Eclipse</p><p>any ideas?</p>","407133","","","","","2010-12-16 19:30:54","Ant compile error while using analytics jar file","<android><ant>","1","0","","",""
"4464278","1","","","2010-12-16 18:46:01","-1","794","<p>I'm dynamically generating list of Books where the user can select more than one Book to buy.I want to have multiple select.Every List Item will have 2 TextView(Title of the book &amp; Author),1 Spinner and check list. Spinner is it order multiple copies.Any help will be  much appreciated!</p>","545190","","","","","2010-12-17 05:01:48","Multiple select from list + with multiple values","<android><select><spinner>","1","3","","",""
"4464347","1","","","2010-12-16 18:53:25","1","17162","<p>How would i create a <code>ImageView</code> with a border and round corners?</p><p>I want to corners of the <code>ImageView</code> to be round, i tried creating a shape drawable with a stroke and round corners as background drawable of the <code>ImageView</code> but that doesn't give the right effect, because the image is padded inside the container and does not fill out to the edge of the borders.</p>","246234","","244296","","2010-12-16 19:07:41","2013-02-22 20:02:56","Creating ImageView with round corners","<android>","1","0","","2013-02-23 20:43:17",""
"4464426","1","4465696","","2010-12-16 19:04:37","3","9891","<p>I am trying to determine if there is a way in android to associate a specific link key with an already existing remote bluetooth device instance.</p><p>Essentially what I want to do is create a connection with a non-discoverable bluetooth device without going through the pairing or re-pairing procedure.</p><p>I am not able to establish the link key with the device in a standard pairing procedure because I am working with a custom proprietary pairing mechanism. I would prefer to accomplish this task without using native code, but if I have to then I will.</p>","534194","","534194","","2010-12-17 17:54:19","2012-11-22 16:51:22","Specifying a link key in android without pairing","<android><bluetooth>","2","0","8","",""
"4464456","1","","","2010-12-16 19:07:35","0","2643","<p>I'm trying to show Progress Dialog while filling layout:</p><p>EDIT (here is the code):</p><pre><code>public class CalendarMonth extends Activity {    private ProgressDialog mDialog;        private int mMonth = 0;    private int mYear = 0;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.calendar_m);        filterData();    }    private void filterData() {        mDialog = ProgressDialog.show(this, ""Loading calendar"",                 ""Please wait..."", true, true);        mDialog.setCancelable(false);        mDialog.show();        new GenerateMonth().execute();    }class GenerateMonth extends AsyncTask {        protected Object doInBackground(Object... arg0) {            generateMonth();            return true;        }        protected void onPostExecute(Object result) {            mDialog.dismiss();        }    private void generateMonth() {        mCalendar = new CalendarInstance(mMonth, mYear);        mMonth = this.mCalendar.getSelectedMonth();        mYear = this.mCalendar.getSelectedYear();        TextView monthName = (TextView) findViewById(R.id.monthName);        monthName.setText(mCalendar.getMonthAndYearAsString());        Button monthPrevious = (Button) findViewById(R.id.monthPrevious);        monthPrevious.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                int month = mMonth - 1;                int year = mYear;                if (mMonth == 1) {                    month = 12;                    year = mYear - 1;                }                mMonth = month;                mYear = year;                filterData();            }        });        Button monthNext = (Button) findViewById(R.id.monthNext);        monthNext.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                int month = mMonth + 1;                int year = mYear;                if (mMonth == 12) {                    month = 1;                    year = mYear + 1;                }                mMonth = month;                mYear = year;                filterData();            }        });        GridView gridview = (GridView) findViewById(R.id.gridview);        gridview.setNumColumns(7);        gridview.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);        gridview.setBackgroundColor(Color.BLACK);        gridview.setAdapter(new CalendarMonthAdapter(this, mMonth, mYear));         }    @Override    protected void onResume() {        super.onResume();        filterData();    }    }</code></pre>","295141","","539542","","2012-01-11 06:17:11","2012-01-11 06:17:11","Using ProgressDialog with Thread on Android throws ViewRoot$CalledWrongFromThreadException","<android><android-progressbar>","3","0","","",""
"4464461","1","4464595","","2010-12-16 19:08:15","4","2407","<p>I am trying to compile my android app in ant and I keep getting this message:</p><pre><code>BUILD FAILEDK:\build.xml:359: aaptexec doesn't support the ""basename"" attribute</code></pre><p>why does this happen? I am using the template from android sdk 4.</p><p>Thanks, Jason</p>","407133","","","","","2010-12-30 04:31:30","Compile error while trying to compile android app with ant","<android><ant>","2","0","1","",""
"4464790","1","4466848","","2010-12-16 19:54:21","3","743","<p>I have a <code>GridView</code> in a layout. It is populated with <code>Foo</code> views by the activity using a extended <code>BaseAdapter</code>. </p><p>When I select an item in this grid it gets orange tinted (thus selected). That's nice. But I want to access this selection from outside the GridView and it's parent activity: from within another <code>View</code> higher in the layout hierarchy. I therefor call upon <code>gridView.getSelectedItem()</code>. However it always returns <code>null</code>.</p><p>How could I get this to work?</p>","107029","","107029","","2010-12-16 21:01:07","2010-12-17 01:01:57","How to get getSelectedView() to work in GridView?","<java><android><selection>","1","0","","",""
"4464876","1","","","2010-12-16 20:04:48","0","341","<p>I am trying to open a given URL from within my android app, but I need that URL to open in the skyfire browser, not the default browser. This is because the pages I link to only work correctly in skyfire.</p><p>How can I do this? Thanks!</p>","545277","","","","","2010-12-16 20:41:08","How to open a specific android app (skyfire browser) from within another app?","<android>","2","0","","",""
"4464892","1","4465047","","2010-12-16 20:06:17","30","37192","<p>Where should I call close() on the code?</p><p>The LogCat returns this error:</p><blockquote>  <p>close() was never explicitly called on database  android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here</p></blockquote><p>The error is this:</p><pre><code>&gt; 12-16 17:24:50.886: ERROR/Database(10982): close() was never explicitly called on database '/data/data/com.psyhclo/databases/calls.db' 12-16 17:24:50.886: ERROR/Database(10982): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here12-16 17:24:50.886: ERROR/Database(10982):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1827)12-16 17:24:50.886: ERROR/Database(10982):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)12-16 17:24:50.886: ERROR/Database(10982):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:854)12-16 17:24:50.886: ERROR/Database(10982):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:847)12-16 17:24:50.886: ERROR/Database(10982):     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:541)12-16 17:24:50.886: ERROR/Database(10982):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)12-16 17:24:50.886: ERROR/Database(10982):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:118)12-16 17:24:50.886: ERROR/Database(10982):     at com.psyhclo.CallDataHelper.&lt;init&gt;(CallDataHelper.java:27)12-16 17:24:50.886: ERROR/Database(10982):     at com.psyhclo.RatedCalls.fillList(RatedCalls.java:66)12-16 17:24:50.886: ERROR/Database(10982):     at com.psyhclo.RatedCalls.access$0(RatedCalls.java:63)12-16 17:24:50.886: ERROR/Database(10982):     at com.psyhclo.RatedCalls$RatedCallsContentObserver.onChange(RatedCalls.java:58)12-16 17:24:50.886: ERROR/Database(10982):     at android.database.ContentObserver$NotificationRunnable.run(ContentObserver.java:43)12-16 17:24:50.886: ERROR/Database(10982):     at android.os.Handler.handleCallback(Handler.java:587)12-16 17:24:50.886: ERROR/Database(10982):     at android.os.Handler.dispatchMessage(Handler.java:92)12-16 17:24:50.886: ERROR/Database(10982):     at android.os.Looper.loop(Looper.java:123)12-16 17:24:50.886: ERROR/Database(10982):     at android.app.ActivityThread.main(ActivityThread.java:3647)12-16 17:24:50.886: ERROR/Database(10982):     at java.lang.reflect.Method.invokeNative(Native Method)12-16 17:24:50.886: ERROR/Database(10982):     at java.lang.reflect.Method.invoke(Method.java:507)12-16 17:24:50.886: ERROR/Database(10982):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)12-16 17:24:50.886: ERROR/Database(10982):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)12-16 17:24:50.886: ERROR/Database(10982):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>here is my code.</p><p><strong>The Activity:</strong></p><pre><code>public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RATEDCALLSOBSERVER"";private Handler handler = new Handler();private SQLiteDatabase db;private CallDataHelper cdh; StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    registerContentObservers();    Log.d(""FILLLIST"", ""calling from onCreate()"");}class RatedCallsContentObserver extends ContentObserver {    public RatedCallsContentObserver(Handler h) {        super(h);    }    @Override    public boolean deliverSelfNotifications() {        return true;    }    @Override    public void onChange(boolean selfChange) {        Log.d(LOG_TAG, ""RatedCallsContentObserver.onChange( "" + selfChange                + "")"");        super.onChange(selfChange);        fillList();        onStop();    }}private void fillList() {    db = openHelper.getWritableDatabase();    cdh = new CallDataHelper(this);    String lastDate = cdh.selectDate();    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null,            android.provider.CallLog.Calls.DATE + "" &lt; ?"",            new String[] { lastDate },            android.provider.CallLog.Calls.DATE + "" DESC "");    Log.d(""FILLLIST"", ""Calling from filllist"");    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 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;    SimpleDateFormat dateFormat = new SimpleDateFormat(""MM-dd-yyyy"");    Date date = new Date();    ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();    cursor.moveToFirst();    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"", dateFormat.format(date));    values.put(""current_time"", currTime);    values.put(""cont"", 1);    getBaseContext().getContentResolver().notifyChange(            android.provider.CallLog.Calls.CONTENT_URI,            new RatedCallsContentObserver(handler));    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: ""            + dateFormat.format(date));    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();        }    });}public void registerContentObservers() {    this.getApplicationContext()            .getContentResolver()            .registerContentObserver(                    android.provider.CallLog.Calls.CONTENT_URI, true,                    new RatedCallsContentObserver(handler));}public void unregisterContentObservers() {    this.getApplicationContext()            .getContentResolver()            .unregisterContentObserver(                    new RatedCallsContentObserver(handler));}    }</code></pre><p><strong>And the DatabaseHelper</strong></p><pre><code>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 String selectDate() {    String date = """";    Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""date"" },            ""id = ?"", new String[] { ""max(id)"" }, null, null, null);    if (cursor.moveToFirst()) {        do {            date = cursor.getString(0);        } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();        return date;    } else {        return """";    }}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><p><strong><em>_</em>___<em>(Edited)</em>__<em>_</em>____</strong></p><p>This is what I get now. When I make a new call, the Logcat returns this.</p><pre><code>12-16 18:55:27.365: ERROR/AndroidRuntime(767): FATAL EXCEPTION: main12-16 18:55:27.365: ERROR/AndroidRuntime(767): java.lang.IllegalStateException: database not open12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1230)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1189)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1271)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at com.psyhclo.CallDataHelper.selectDate(CallDataHelper.java:61)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at com.psyhclo.RatedCalls.fillList(RatedCalls.java:98)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at com.psyhclo.RatedCalls.access$0(RatedCalls.java:96)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at com.psyhclo.RatedCalls$RatedCallsContentObserver.onChange(RatedCalls.java:91)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.database.ContentObserver$NotificationRunnable.run(ContentObserver.java:43)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.os.Handler.handleCallback(Handler.java:587)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.os.Handler.dispatchMessage(Handler.java:92)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.os.Looper.loop(Looper.java:123)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at android.app.ActivityThread.main(ActivityThread.java:3647)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at java.lang.reflect.Method.invokeNative(Native Method)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at java.lang.reflect.Method.invoke(Method.java:507)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)12-16 18:55:27.365: ERROR/AndroidRuntime(767):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p><strong>And this is my activity:</strong></p><pre><code>    public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RATEDCALLSOBSERVER"";private Handler handler = new Handler();private SQLiteDatabase db;private CallDataHelper cdh;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    registerContentObservers();    Log.d(""FILLLIST"", ""calling from onCreate()"");    cdh = new CallDataHelper(this);    db = openHelper.getWritableDatabase();}@Overrideprotected void onDestroy() {    super.onDestroy();    if (openHelper != null) {        openHelper.close();    }    if (cdh != null) {        cdh.close();    }}@Overrideprotected void onPause() {    super.onPause();    if (openHelper != null) {        openHelper.close();    }    if (cdh != null) {        cdh.close();    }}@Overridepublic void onResume() {    super.onResume();    openOrCreateDatabase(""calls.db"", SQLiteDatabase.CREATE_IF_NECESSARY,            null);}class RatedCallsContentObserver extends ContentObserver {    public RatedCallsContentObserver(Handler h) {        super(h);    }    @Override    public boolean deliverSelfNotifications() {        return true;    }    @Override    public void onChange(boolean selfChange) {        Log.d(LOG_TAG, ""RatedCallsContentObserver.onChange( "" + selfChange                + "")"");        super.onChange(selfChange);        fillList();    }}private void fillList() {    String lastDate = cdh.selectDate();    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null,            android.provider.CallLog.Calls.DATE + "" &lt; ?"",            new String[] { lastDate },            android.provider.CallLog.Calls.DATE + "" DESC "");    Log.d(""FILLLIST"", ""Calling from filllist"");    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 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;    SimpleDateFormat dateFormat = new SimpleDateFormat(""MM-dd-yyyy"");    Date date = new Date();    ArrayList&lt;String&gt; callList = new ArrayList&lt;String&gt;();    cursor.moveToFirst();    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);    stopManagingCursor(cursor);    ContentValues values = new ContentValues();    values.put(""contact_id"", 1);    values.put(""contact_name"", contactName);    values.put(""number_type"", numType);    values.put(""contact_number"", contactNumber);    values.put(""duration"", duration);    values.put(""date"", dateFormat.format(date));    values.put(""current_time"", currTime);    values.put(""cont"", 1);    getBaseContext().getContentResolver().notifyChange(            android.provider.CallLog.Calls.CONTENT_URI,            new RatedCallsContentObserver(handler));    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: ""            + dateFormat.format(date));    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();        }    });}public void registerContentObservers() {    this.getApplicationContext()            .getContentResolver()            .registerContentObserver(                    android.provider.CallLog.Calls.CONTENT_URI, true,                    new RatedCallsContentObserver(handler));}public void unregisterContentObservers() {    this.getApplicationContext()            .getContentResolver()            .unregisterContentObserver(                    new RatedCallsContentObserver(handler));} }</code></pre>","399459","","1613508","","2012-10-08 06:46:28","2012-10-08 06:46:28","Android error - close() was never explicitly called on database","<android><sqlite><android-contentprovider>","3","0","18","",""
"4464935","1","4465035","","2010-12-16 20:13:30","0","363","<p>OKay gang, forgive me if this question is ubernoobness, but i am having trouble overriding a couple of methods of the Gallery class in my CustomGallery class, which is extended from Gallery.  can someone tell me why this is okay to override:</p><pre><code>@Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {  return super.onFling(e1, e2, 0, velocityY); }</code></pre><p>but this one creates an error - ""The method onFinishedMovement() of type CustomGallery must override a superclass method"":</p><pre><code>@Override private void onFinishedMovement() {        //    }</code></pre><p>As far as I can tell they are all members of the same class, but clearly I am missing something.  Thanks for any help understanding this!</p>","538576","","","","","2010-12-16 20:24:51","Trouble overriding a method in Gallery view in Android","<android>","1","0","","",""
"4464974","1","","","2010-12-16 20:18:42","0","495","<p>I need some help creating a properties page in Android.</p><p>I have created an Activity and have a TableLayout with a title, 5 properties that include a Spinner to select a property class and a EditText that the user can type into, followed by a couple of buttons reading Accept and Cancel.</p><p>I am launching the activity by creating a new Intent with that class and using a StartActivityForResult, where I need to Bundle all of the properties back to my main activity.  I have an OnActivityResult defined in the main class.  I am having difficulty in the properties page on how to return the activity result from the button callback and how to package and return the Bundle.  Any not so simple examples would be appreciated.</p>","539111","","","","","2010-12-16 20:33:24","I am trying to create a properties page in Android","<android><activity>","2","1","","",""
"4465487","1","","","2010-12-16 21:21:00","0","237","<p>Hope some Android experts could help on this</p><p>Is it possible to load android:text=""Here""</p><p>from a XML file or TXT file on a server, so they are fetched over the internet. I need to change some button text from a XML layout remotely.</p><p>Hope someone can help and show me how? </p><p>thanks inadvance Lucy</p>","545266","","1720391","","2013-01-30 13:36:04","2013-01-30 13:36:04","Is it possible to load android:text""This text Here Remotely"" from a server via XML or a TXT file","<android><android-layout>","2","0","1","",""
"4465494","1","5640408","","2010-12-16 21:22:16","5","7599","<p>I've got to be missing something obvious here, but I can't seem to find anything to allow me to determine when MediaPlayer is buffering audio.  I'm streaming internet audio and I want to display a buffering indicator, but nothing I've tried allows me to know when MediaPlayer interrupts the audio to buffer, so I can't properly display a buffering indicator.  Any clues?</p>","545347","","","","","2014-01-09 20:51:48","Android - How to tell when MediaPlayer is buffering","<android><media-player><buffering>","5","1","2","",""
"4465529","1","","","2010-12-16 21:27:06","6","6705","<p>I'm trying to implement the search dialog and I am unable to display the search from an Activity.</p><p>I have my main activity defined in my manifest file, this activity shows the user a list of options they have to choose from. One of the options is a Search option.</p><pre><code>    &lt;activity        android:name="".MenuListActivity""        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>My Search activity is defined in my manifest file like so. </p><pre><code>&lt;activity android:name="".SearchActivity""                android:launchMode=""singleTop""                android:label=""@string/app_name""&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;</code></pre><p>Now my problem is when I call the onSearchRequested() from my MenuListActivity nothing happens. </p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View itemClicked, int position, long id) {            String strText = items[position];            if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_browse))) {                startActivity(new Intent(MenuListActivity.this, WSMobileActivity.class));            } else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_search))) {             // If i call it like this it doesn't work, nothing happens                onSearchRequested();            } else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_item_locator))) {              startActivity(new Intent(MenuListActivity.this, StoreLocatorActivity.class));            }        }  </code></pre><p>Please help, how do I invoke the search request from my MenuActivity? </p>","459255","","459255","","2010-12-16 21:40:27","2013-05-31 16:00:33","How do I invoke the search dialog using onSearchRequested()","<android>","4","1","1","",""
"4465571","1","","","2010-12-16 21:32:20","2","1597","<p>I saw that you've done some tests on Android.When I am trying to run my test with H2, I am getting FileNotFoundException.I am trying to use use embedded mode and here is my code snippet:</p><pre><code>    String url =  ""jdbc:h2:~/myTestDB"" + "";FILE_LOCK=FS"" + "";PAGE_SIZE=1024""    + "";CACHE_SIZE=8192"";    Class.forName(""org.h2.Driver"");    return DriverManager.getConnection(url, ""sa"", """");</code></pre><p>I have also tried:</p><pre><code>    String url = ""jdbc:h2:/data/data/"" + ""com.mydomain.MyApp""            + ""/data/myTestDB"" + "";FILE_LOCK=FS"" + "";PAGE_SIZE=1024""            + "";CACHE_SIZE=8192"";</code></pre><p>but with no luck.</p><p>I've put myTest.h2.db in /assets  folder of my Android project.If you can post your code sample that would be great!</p><p>Thanks</p>","545356","","","","","2010-12-18 10:19:54","Android sample using H2","<android><h2>","1","0","","",""
"4465651","1","4505492","","2010-12-16 21:43:34","2","729","<p>My application is basically a service, i.e. has no UI (there isn't any class subclassing Activity). I want to have it displayed in the list of applications and to run the service when it's started from there, with the advantage that the user can create a shortcut to display it in the home screen. </p><p>Is this possible?</p>","489765","","","","","2010-12-22 01:34:00","Start service from main application icon","<android><service>","3","2","1","",""
"4465744","1","","","2010-12-16 21:54:44","0","2384","<p>The answer to <a href=""http://stackoverflow.com/questions/3312438/how-to-open-email-program-via-intents-but-only-an-email-program"">How to open Email program via Intents (but only an Email program)</a> shows how to open a chooser with ONLY email programs displayed by calling intent.setType(""message/rfc822"").</p><p>I would like to do the exact same thing, but choose MMS capable (or even just SMS) instead of email programs.</p><p>The end goal is to create a ""share with"" chooser that sends different content depending upon the form the message will take. (Since an email can be a LOT longer than a text or a tweet, and can contain an video attachment.)</p>","431938","","","","","2013-07-31 15:47:05","Android MIME type for MMS (SMS) messages?","<android><android-intent><send>","2","2","","",""
"4465765","1","5367009","","2010-12-16 21:57:16","4","4056","<p>I have a sync adapter for my DB and at certain points in the application usage, it needs to sync the DB now.  I would like to trigger the sync adapter as if its sync-time popped and then re-establish the sync time (i.e., 4 hours from this 'sync now"" event).</p>","157804","","","","","2013-02-23 10:43:06","How to code a ""sync now"" operation on Android?","<android><android-syncadapter>","1","0","4","",""
"4465835","1","","","2010-12-16 22:07:05","5","7051","<p>I am working on an Android app that uses the phone's camera. When the picture is taken in a ""standard orientation"" (bottom of phone at the bottom or bottom of the phone to the right), the image received is as expected. On some phones, when the picture is taken in a ""non-standard orientation"" (bottom of the phone at the top or bottom of the phone to the left), the image received is upside down.  On some phones, the camera application actually handles this and returns the image the expected way.</p><p>My question is, since it seems to depend on the phone (manufacturer), is there a way to detect this and rotate the image as need without having to keep a hard coded list of phone types?</p>","421149","","","","","2012-04-06 01:36:29","Camera/picture orientation in Android","<android><android-camera>","1","2","1","",""
"4466009","1","","","2010-12-16 22:30:00","0","902","<p>I wrote an application using the API Level 9 and put my breakpoint in the onCreate() method. The simulator for 2.3 took a long time to start but eventually it was up and running. Then it just hung there. In the console this is what I saw:</p><pre><code>[2010-12-16 17:11:58 - MyProject] Android Launch![2010-12-16 17:11:58 - MyProject] adb is running normally.[2010-12-16 17:11:58 - MyProject] Performing com.company.MyProject.MainActivity activity launch[2010-12-16 17:11:58 - MyProject] Automatic Target Mode: Preferred AVD 'Android2.3' is not available. Launching new emulator.[2010-12-16 17:11:58 - MyProject] Launching a new emulator with Virtual Device 'Android2.3'[2010-12-16 17:11:59 - MyProject] New emulator found: emulator-5554[2010-12-16 17:11:59 - MyProject] Waiting for HOME ('android.process.acore') to be launched...[2010-12-16 17:12:50 - MyProject] HOME is up on device 'emulator-5554'[2010-12-16 17:12:50 - MyProject] Uploading MyProject.apk onto device 'emulator-5554'[2010-12-16 17:12:54 - MyProject] Installing MyProject.apk...[2010-12-16 17:13:23 - MyProject] Success![2010-12-16 17:13:23 - MyProject] Starting activity com.company.MyProject.MainActivity on device emulator-5554[2010-12-16 17:13:24 - MyProject] ActivityManager: [1]   Killed                  am start -D -n c...[2010-12-16 17:15:05 - MyProject] emulator-5554 disconnected! Cancelling 'com.company.MyProject.MainActivity activity launch'![2010-12-16 17:15:44 - MyProject] ------------------------------[2010-12-16 17:15:44 - MyProject] Android Launch![2010-12-16 17:15:44 - MyProject] adb is running normally.[2010-12-16 17:15:44 - MyProject] Performing com.company.MyProject.MainActivity activity launch[2010-12-16 17:15:44 - MyProject] Automatic Target Mode: Preferred AVD 'Android2.3b' is not available. Launching new emulator.[2010-12-16 17:15:44 - MyProject] Launching a new emulator with Virtual Device 'Android2.3b'[2010-12-16 17:15:45 - MyProject] New emulator found: emulator-5554[2010-12-16 17:15:45 - MyProject] Waiting for HOME ('android.process.acore') to be launched...[2010-12-16 17:17:10 - MyProject] HOME is up on device 'emulator-5554'[2010-12-16 17:17:10 - MyProject] Uploading MyProject.apk onto device 'emulator-5554'[2010-12-16 17:17:10 - MyProject] Installing MyProject.apk...[2010-12-16 17:18:29 - MyProject] Success![2010-12-16 17:18:29 - MyProject] Starting activity com.company.MyProject.MainActivity on device emulator-5554[2010-12-16 17:18:32 - MyProject] ActivityManager: [1]   Killed                  am start -D -n c...</code></pre><p>Notice now my app is killed.</p><p>I made sure my eclipse plug-ins were up to date, and that the SDK packages were also updated.</p><p><strong>UPDATE 1</strong><br>I have made some progress. The first time I start the simulator it never connects to the debugger. After the activity is killed, if I start the debugger a second time (without stopping the simulator), it seems to be connecting but not always. If it doesn't connect the second try, it never does in subsequent tries so I have to kill the simulator and restart it. It's still annoying as hell but at least now I have a workaround.</p><p><strong>Update 2</strong><br>I have given up on this.</p><p>How can I diagnose this and fix it?</p>","442512","","648313","","2011-11-14 17:40:55","2011-11-14 17:40:55","Eclipse debugger can't connect to application for 2.3 (gingerbread) simulator","<android>","1","1","","",""
"4466201","1","","","2010-12-16 22:58:15","4","7853","<p>I read that Google App Inventor went live, not just invitation today.  If I make an app with Google App Inventor is there some way I can sell it?  Thanks.</p><p>edit:  when you create something you do you keep it on your computer like an executable?  I don't have android phone but I thought I could still make something for it. (seems to be answered by faq Can you share project code with other App Inventor users?)</p>","28045","","12030","","2010-12-17 00:37:46","2011-12-01 14:22:10","Can you sell apps made with Google App Inventor?","<android><app-inventor>","3","0","","2011-12-01 14:31:08",""
"4466246","1","","","2010-12-16 23:07:37","5","8537","<p>All of my existing projects are fine but, starting new projects has problems...</p><p>It appears the Main java file has the problem and the hover say's </p><blockquote>  <p>""Java Type Language Cannot Be  Resolved, It is Indirectly Referenced  From Required .class files""</p></blockquote><p>I created the new Projects just like I created the previous 50 projects (before updating the SDK).</p><p>Very frustrating (other bugs in the new release, too)...</p><p>I deleted the new projects and Imported them as suggested in other posts but, it didn't help.</p><p>I noticed the Main Layout (in graphic mode) say's, </p><blockquote>  <p>""The project target is not set""</p></blockquote><p>I don't know what that means given that the layout is within the project folder.  The Build target is set to android 1.6</p><p>Also (this may be the issue) I get a message panel when finishing the project creation that say's the android </p><blockquote>  <p>sdk/tools/lib/proguard.cfg(No such  files or Directory)</p></blockquote><p>Which, is true, there isn't one and that was a new addition to the sdk...</p><p>Any suggestion...?  Thanks</p>","382200","","382200","","2010-12-16 23:14:22","2012-03-24 02:38:27","New Project Create Problem After Android SDK Update","<android>","3","0","1","",""
"4466329","1","","","2010-12-16 23:22:05","0","813","<p>I am developing an Android Application and since I do not know XML, I have some problems about XML gridview. </p><p>In my application, a query is sent to the server and according to server's response i need to list some data. But as I stated, I do not know how to do. As you can guess, data size can differ from query to query, so i need to have an gridview with unfixed size.</p><p>Can you help, by sending an example code, or by explaining how can I list data on my application.</p><p>Thank you!</p>","520628","","1866427","","2012-12-18 08:45:39","2012-12-18 08:45:39","How to create and use a gridview for an Android Application","<android><xml><gridview><android-gridview>","1","0","","",""
"4466429","1","","","2010-12-16 23:39:51","0","1132","<p>As the title says, if I use <strong>setUnselectedAlpha()</strong> on my gallery, the selected items never return to full opacity.  I found some of the same questions online and the only answer I found was that it had to be using a style to have the <strong>setUnselectedAlpha()</strong> work properly.  I hope this is not the case because I don't want a background or border in my gallery.  Anyway I tried that solution and it is still not working.  Has anyone ran into this before and is there a solution?</p><p>Thank you!</p>","538576","","","","","2011-08-04 15:17:41","Android setUnselectedAlpha() does not reset to full opacity on selected item in Gallery view","<android>","1","2","","",""
"4466529","1","4466561","","2010-12-16 23:55:22","1","793","<p>I have a large android app and recently I am seeing that on any uncaught exception, the exception is shown in the DDMS Logcat and following that the calling parent activity gets relaunched (onCreate get's called). Ideally the application should just exit.</p><p>We are using ARCA crash application reporting, but commented out that and still see the same activity getting relaunched. I am calling the startActivityForResults and the android manifest has android:finishOnTaskLaunch true for the activity as well as the subactivity. </p><p>Any pointers on what could be causing the activity relaunch on the exception? </p>","207552","","","","","2010-12-17 20:06:56","uncaught exception relaunching the calling activity?","<android><android-manifest>","1","0","1","",""
"4466887","1","4466975","","2010-12-17 01:09:51","0","1007","<p>I have an android application i have been working on that downloads an image from a server, reads it into a bitmap and displays it on an ImageView</p><p>This works great most of the time, but every so often, it goes through the process (There is a ProgressDialog saying ""Fetching image..."") and once its done nothing gets displayed. There has not been anything in logcat that even seems to remotely relate to this.</p><p>Here is the code:</p><pre><code>    Bitmap image = null;    HttpClient client = new DefaultHttpClient();    HttpGet get = new HttpGet(webService + ""?cmd=get"");    try    {        HttpResponse resp = client.execute(get);        Log.i(""PhotoRouletteDebug"", ""Resp buffer size: "" + (int)resp.getEntity().getContentLength());        InputStream is = resp.getEntity().getContent();        BufferedInputStream buf = new BufferedInputStream(is, (int)resp.getEntity().getContentLength());        image = BitmapFactory.decodeStream(buf);        // clean up        buf.close();        is.close();</code></pre><p>Even when nothing is getting displayed, the Resp content length always reports a correct size but still, nothing ends up getting displayed.</p><p>This code is called from an AsyncTask, but only 1 task is ever called at a time.</p><p>This is driving me insane, i have no idea why its keeps doing this.</p><p>Edit: Here is the code that sets the imageView</p><pre><code>// AsyncTask for Getting a new image from the queueprotected class GetImageTask extends AsyncTask&lt;String, String, Bitmap&gt;{    protected void onPreExecute()    {        // lets show a progress dialog so the user knows something is going on        progressDialog = ProgressDialog.show(PhotoRoulette.this, """", ""Fetching image..."", true);    }    protected void onPostExecute (Bitmap image)    {        // we got a new photo so lets display it where it needs to be displayed        try        {            photoView = (ImageView)findViewById(R.id.photoView);            photoView.setImageBitmap(image);        }        catch (Exception e)        {            Log.e(""Debug"", ""Something absolutely retarded happened"", e);        }        // hide the progress dialog - we're all done        progressDialog.dismiss();    }    protected Bitmap doInBackground(String... urls)    {        // Get a new Bitmap Queue Image        Bitmap image = imageHandler.getQueueImage();        return image;    }}</code></pre>","263115","","263115","","2010-12-17 05:54:13","2010-12-17 05:54:13","Intermittent HttpClient GET issue on android","<android><httpclient><inputstream><httpresponse><bufferedinputstream>","1","2","1","",""
"4467018","1","","","2010-12-17 01:46:22","0","1661","<p>I'm trying to make an Android view scroll when it's in landscape orientation. However, this does not work on any device I've tried it with. Any ideas on what I'm doing wrong? Here's my markup:</p><pre><code>    &lt;ScrollView     android:layout_height=""fill_parent""      android:layout_width=""fill_parent""&gt;      &lt;RelativeLayout       android:id=""@+id/sample1""       android:gravity=""top""        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""&gt;       &lt;ImageView        android:src=""@drawable/sample1""        android:layout_centerHorizontal=""true""         android:layout_width=""fill_parent""         android:padding=""10dp""         android:layout_height=""wrap_content""         android:layout_marginTop=""20dp""/&gt;      &lt;/RelativeLayout&gt;    &lt;/ScrollView&gt;&lt;LinearLayout android:id=""buttons"" xmlns:android=""schemas.android.com/apk/res/android""; android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:layout_alignParentBottom=""true"" android:padding=""3dp""&gt;...&lt;/LinearLayout&gt;</code></pre><p>Update: There is an additional linear layout that's being included into this view. I believe this may be the issue. Any ideas?</p>","469842","","469842","","2010-12-21 18:32:35","2010-12-21 18:32:35","Android scrollview doesn't with with relative layout in landscape mode","<android><layout>","1","2","","",""
"4467184","1","4467313","","2010-12-17 02:26:11","1","2499","<p>Okay, So I'm working on having an alarm that gives a notification at, lets say 3:00 PM daily, but I want this to be selectable by the user, between AM/PM, and Hours/Min freely changeable. I will probably use a <code>TimePicker</code>, and this is my code I have so far:</p><pre><code>    public void startAlarm() {            Intent intent = new Intent(currentDay.this, AlarmReceiver.class);            PendingIntent sender = PendingIntent.getBroadcast(currentDay.this,0, intent,0);            long firstTime = SystemClock.elapsedRealtime();            firstTime += 15*1000;            AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);            am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,firstTime,AlarmManager.INTERVAL_DAY, sender);        }</code></pre><p>So, I figure I'm going to be using something along the lines of:</p><pre><code>Calendar cal = Calendar.getInstance();cal.set(Calendar.HOUR_OF_DAY, 19);cal.set(Calendar.MINUTE, 45);</code></pre><p>and then using</p><pre><code>cal.getTimeInMillis()</code></pre><p>But this doesn't work, any ideas? Thanks!</p><p>EDIT: So, long story short, I know how to get the current time, then add lets say 15 seconds to it, but I want to have a definite time that WORKS for example 5:14 PM, and everything I've tried doesn't work</p>","481082","","481082","","2010-12-17 23:58:28","2010-12-18 00:46:02","Time in Milliseconds Alarm","<android><calendar><timepicker>","1","2","1","",""
"4467232","1","4488363","","2010-12-17 02:40:58","1","2118","<p>I'm working on an extend SMS application. And now i can read all the SMS message from the mmssms.db. In the SMS database table, the field 'person' indicate the '_id' in contact table. When 'person' is >= 1, that means the message is sent from people in the contact list. So i can 'managedQuery' from contact table. But the question is, in my mobile phone, the test program sometimes can NOT query the contact infomation even 'person' >= 1.  So can somebody show me some correct ways to query contact infomation by 'person' filed in SMS table ?Here is some sample code which can make my question more clear:</p><pre><code>class ContactItem {      public String mName;  }      ContactItem getContact(Activity activity, final SMSItem sms) {          if(sms.mPerson == 0) return null;          Cursor cur = activity.managedQuery(ContactsContract.Contacts.CONTENT_URI,                   new String[] {PhoneLookup.DISPLAY_NAME},                   "" _id=?"",                  new String[] {String.valueOf(sms.mPerson)}, null);         if(cur != null &amp;&amp;             cur.moveToFirst()) {             int idx = cur.getColumnIndex(PhoneLookup.DISPLAY_NAME);             ContactItem item = new ContactItem();             item.mName = cur.getString(idx);             return item;         }         return null;     }  </code></pre>","459062","","","","","2010-12-20 09:30:14","how to get the contact infomation by sms message","<android>","1","0","","",""
"4467367","1","4467466","","2010-12-17 03:19:51","2","1567","<p>I am using HttpClient to do Post request to a server URL. The server URL is redirecting me and seems like my HttpClient is getting redirected automatically. I wanted to intercept the redirect response 302. I am unable to use setFollowRedirects(false). I wanted to know if there is anyway to do intercept the 302 response and stop Auto redirection?? I saw that we can achieve this using HttpURL Connection</p><pre><code>   HttpURLConnection connection = (HttpURLConnection) url.openConnection();   connection.setRequestMethod(""POST"");   connection.setFollowRedirects(false);</code></pre><p>However I want to use HttpClient and HttpPost to avoid huge changes in my current implementation. Is there any way to achieve the same?</p>","545592","","","","","2010-12-17 03:51:18","Android redirection (return code 302) handling","<java><android><httpclient><http-post>","1","0","","",""
"4467459","1","4468791","","2010-12-17 03:41:23","0","663","<p>i have an android 1.6 application that i'm trying to get the location header of a HTTP GET response. however, when i call getLastHeader(""location"") it returns null. i even go into the response variable via debugger and there is no location header sent. i need to do this on an arbitrary site, but using google for testing purposes still produces the mishap. i thought location was a default header to be read? does android 1.6 not read the location header? my code is as followed:</p><p><pre><code>HttpClient httpClient = DefaultHttpClient();HttpGet httpGet = new HttpGet(""http://google.com"");try{ HttpResponse response = httpClient.execute(httpGet); if(response.getStatusLine().getStatusCode() == 200) {  Header h = response.getLastHeader(""location"");  String location = h.getValue(); }}</pre></code></p><p>help is greatly appreciated :) i'm either looking for a solution to get the location or an explanation why i'm not getting it :/</p>","544326","","544326","","2010-12-17 07:00:50","2010-12-17 08:30:35","android 1.6 httpresponse doesn't include a location header","<java><android><http-headers><location>","1","0","1","",""
"4467463","1","4467591","","2010-12-17 03:41:34","1","676","<p>I'm building an app that listen for changes in the CallLog.Calls content provider. So any changes on this content provider will notify the the app's observer, that will insert the data has changed. </p><p>But there is a problem, the app is notified when its not running, ie, the app will not capture the data has changed while not running.</p><p>So my question is, is there a way to capture the data that changed while the app was not running? So, example, I made 8 calls, and the app was not running, so 8 new data has been added to the CallLog.calls content provider. So is there a way to capture this 8 new data once the application starts?</p><p>Thanks!</p>","399459","","399459","","2011-07-22 16:30:21","2011-07-22 16:30:21","Listen for changes in CallLog.Calls","<android><android-contentprovider>","1","0","1","",""
"4467486","1","","","2010-12-17 03:46:03","6","1186","<p>I am developing an Android app that will run as a service most of the time. The user would be able to control it via the status bar -- including the ability to stop the service altogether.  </p><p>Even though I am able to make a custom view and put buttons on the Notifications area [see Figure 1], I would like to be able to put it above the ""Android""/Service Provider's name.  Much in the same way as the Music Player app does this [see Figure 2].  That way, even if the user clears their notifications, my app's control panel will remain active as long as the service is running.  </p><p>What's the best way to do that, please?</p><p><img src=""http://i.stack.imgur.com/kn2ZN.png"" alt=""Figures 1 and 2""></p><p><a href=""http://i.stack.imgur.com/EZV6j.png"">Original Image Link</a></p>","545590","","212275","","2010-12-17 16:32:47","2013-12-01 13:03:09","Add Buttons Above the Notifications Tab in the Status Bar","<android>","1","4","3","",""
"4467600","1","4469531","","2010-12-17 04:06:44","5","4966","<p>I'm still fresh to Android and Id think the below config works for launching my service when the app launches.</p><pre><code>    &lt;service android:name="".PlaylistUpdaterService""&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;/service&gt;</code></pre><p>But this is not the case. What did I miss?</p>","42340","","","","","2013-01-11 08:39:56","How to launch a Android Service when the app launches?","<android>","2","0","1","",""
"4467763","1","4467790","","2010-12-17 04:46:17","4","819","<p>I am currently writing a application that will eventually be going to market, but for now it will be in the Alpha stage.  I am trying to come up with the best way to ""time bomb"" the application, so if it is ran after a certain date it will prompt the user saying the alpha application is expired and close.</p><p>I will not be doing this to an application in the market, the reason I want to do this is that I will be passing out this application to a few friends and want to make sure they will not be running older version of the software.</p><p>I know that if you self-sign the application, you can sign it with a date and it can't be installed after said date, but if it is already installed it still can be ran.</p><p>Any suggestions on how to neatly do this?</p>","2206304","","2642204","","2014-01-23 21:04:26","2014-01-23 21:04:26","Android Development End of Life an application","<android>","1","0","","",""
"4467795","1","","","2010-12-17 04:53:27","0","489","<p>Hello I am trying to hide or visible keyboard on turning setting on or off by the following code but it is not working , code for the above is following</p><pre><code>if (myPrefs.getString(GlobalConfig.IsShowKeyboard, """")                .equalsIgnoreCase(""true"")) {        InputMethodManager inputMgr = (InputMethodManager) getSystemService(DialActivity.INPUT_METHOD_SERVICE);        inputMgr.toggleSoftInput(1, 0);        }        else{    {InputMethodManager inputMgr = (InputMethodManager) getSystemService(DialActivity.INPUT_METHOD_SERVICE);        inputMgr.toggleSoftInput(0, 1);        }</code></pre><p>where myPrefs is the object of SharedPreferences. Please suggest me what i am doing  wrong.Help me.Thanks.</p>","714976","","302328","","2010-12-17 05:06:29","2010-12-17 05:08:27","Hiding Keyboard on setting turn on or off ","<android>","1","0","","",""
"4467816","1","","","2010-12-17 04:58:38","8","5681","<p>I have a problem in <code>DatePicker</code> in android when I use <code>getMonth()</code> method then it will return a wrong value.</p><p>For example:</p><pre><code>DatePicker datepicker=new DatePicker();int day=date.getDayOfMonth();int month=date.getMonth();int year=date.getYear();t.setText(""""+day+"" / ""+month+"" / ""+year);</code></pre><p>If I will select aug 06 1987 then it will return 6/7/1987</p><p>I think it is an error, if not tell me the reason please.</p>","545664","","544198","","2012-12-10 12:33:28","2013-09-30 06:31:36","DatePicker shows wrong value of month","<android><date><datepicker>","5","0","2","",""
"4467835","1","4467843","","2010-12-17 05:03:04","5","8672","<p>I'm learning android development.There is an apidemo app installed in the android emulator. I'd like have it installed in my real android phone so that I can use it without starting the emulator . How to do that ?</p>","388887","","","","","2012-01-31 11:57:22","how to install android api demo app into my phone","<android><demo><emulate>","3","0","2","",""
"4467862","1","","","2010-12-17 05:10:08","1","58","<p>Is it possible to play and record speech on android emulator? or it must require physical device?</p>","545674","","","","","2010-12-17 05:15:14","MediaLauncher on emulator(virtual device)","<android>","1","0","","",""
"4467892","1","","","2010-12-17 05:16:10","0","106","<p>How to add imges from SD card in to image widget which is displaying some images in android?</p>","534667","","82515","","2011-05-04 13:03:28","2011-05-04 13:10:26","Android widgets","<java><android><eclipse><android-widget>","1","0","","",""
"4467999","1","4468115","","2010-12-17 05:36:55","2","7325","<p>i can access the my sqlite db using adb shell commands in my emulator. But can not do the same for my HTC Desire phone. it throws some permission denied messages. is there any possible to access those database for debugging purpose. Any Idea?</p><p>Thanks in Advance.</p>","267269","","","","","2013-04-20 13:22:28","How to access the Sqlite Database in Android?","<android><sqlite>","2","8","0","",""
"4468006","1","4468043","","2010-12-17 05:38:42","5","5478","<p>I want to start a service in an <code>APK</code>.  </p><p>I tried to use as following:  </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;          &lt;service android:name ="".TestServcie""&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;/service&gt;      &lt;/application&gt;</code></pre><p>Any ideas?<br>Thanks</p>","542792","","1529631","","2013-05-11 13:01:35","2013-05-11 13:01:35","Can I start a service without activity or receiver?","<android><service>","2","1","1","",""
"4468059","1","","","2010-12-17 05:47:32","0","1255","<p>Suppose, I have created an android mobile application.</p><p>What I am looking for is, once the user purchases my application from my website,he will input his IMEI number.</p><p>I want to generate a simple registration code, which can be emailed to him after purchase is successful.</p><p>The user will then enter the code in the application, application will internally fetch the IMEI number and validate the registration code.</p><p>How can I generate such registration code?</p><p>Are there algorithms/ tools available which can help me do this?</p><p>Thanks,Aseem Chiplonkar</p>","385173","","","","","2012-04-20 19:04:39","How to generate a simple registration code,based on input given by the user and verifying it after installation","<android><registration>","2","0","","",""
"4468087","1","","","2010-12-17 05:54:18","0","2276","<p>I am trying to apply image on an image view instance...but it doesnt cover it properly...please advise</p><p>here it is my image view code:</p><pre><code>    android:id=""@+id/imageViewVessel""    android:layout_width=""fill_parent""    android:scaleType=""fitStart""    android:layout_height=""170dip""    android:src=""@drawable/vessel""</code></pre><p><strong>EDIT by kcoppock: Adding code from devaditya's comment below</strong></p><pre><code>TableRow rowImage = new TableRow(this); rowImage.setBackgroundColor(Color.GRAY); rowImage.setMinimumHeight(150); rowImage.setGravity(Gravity.CENTER); rowImage.setMinimumWidth(LayoutParams.FILL_PARENT); ImageView imgViewVessel=new ImageView(this); imgViewVessel.setImageResource(R.drawable.vessel); imgViewVessel.setMinimumHeight(150); imgViewVessel.setMinimumWidth(LayoutParams.FILL_PARENT); imgViewVessel.setScaleType(ScaleType.FIT_XY); rowImage.addView(imgViewVessel);   </code></pre>","517234","","321697","","2010-12-21 14:13:37","2010-12-21 14:13:37","Image doesnt cover image view fully","<android><imageview>","2","2","1","",""
"4468248","1","4468498","","2010-12-17 06:22:32","27","23881","<p>I want some unique ID of the Android device. I've tried it with the following code</p><pre><code>String ts = Context.TELEPHONY_SERVICE;TelephonyManager telephonyManager = (TelephonyManager) this.getSystemService(ts);</code></pre><p>However I know that this works only for phones.</p><p>What if my app is running on some notebook, netbook or other type of device? How do I get an unique ID in that case?</p>","476747","","418183","","2012-04-24 07:55:00","2013-03-18 02:34:58","Unique ID of Android device","<android>","6","6","21","",""
"4468263","1","","","2010-12-17 06:25:22","0","29","<p>In Android, I am posting an intent to start an activity when a list item is clicked.<br>99% of the time, that activity is started.<br>But sometimes, when I click the list item, I get a blank screen.<br>Any idea?</p>","456936","","527702","","2012-11-21 11:47:39","2012-11-21 11:47:39","Intent not getting posted sometimes","<android><android-intent>","1","0","","",""
"4468299","1","","","2010-12-17 06:36:17","0","289","<p>i'd like to assign the resulting ""reason"" to a global variable for use with another process.  How can i achieve this from this declaration and function?</p><pre><code>private static String[] FROM = { _ID, EVENT01, EVENT02, EVENT03, REASON};private static String ORDER_BY = EVENT01;private Cursor getEvent() {    return managedQuery(CONTENT_URI, FROM, null, null, ORDER_BY);}</code></pre><p>many thanks for your help.</p>","545736","","366904","","2010-12-17 06:37:50","2010-12-17 08:23:06","android: how to assign value to a global variable from sql query?","<android><global-variables><sql>","2","0","","",""
"4468316","1","","","2010-12-17 06:39:16","1","316","<p>Hello How to hide spell suggestion of keyboard while typing in a edittext.Please help me.Thanks.</p>","714976","","","","","2012-02-03 08:19:01","Hiding suggestion giving by keyboard while typing","<android>","2","0","","",""
"4468380","1","4468714","","2010-12-17 06:53:52","14","64547","<p>I have a textfield that behaves like a local link, clicking on it fetches an image from database and shows it. It doesn't ping to server all the time.</p><p>Here is the xml code for the text view</p><pre><code>`&lt;TextView android:layout_marginLeft=""2dp"" android:linksClickable=""true""            android:layout_marginRight=""2dp"" android:layout_width=""wrap_content""            android:text=""@string/Beatles"" android:clickable=""true"" android:id=""@+id/Beatles""            android:textColor=""@color/Black""            android:textSize=""12dp"" android:layout_height=""wrap_content"" android:textColorHighlight=""@color/yellow"" android:textColorLink=""@color/yellow""  android:autoLink=""all""&gt;&lt;/TextView&gt;`</code></pre><p>The question is i want to see the color of text view should be changed in yellow, instead of the same black color, </p><p><em><strong>Just Like the button behavior but instead of changing the background color i want to change a text color</em></strong></p><p>Thanks </p>","246942","","","","","2011-01-21 20:11:54","android TextView : Change Text Color on click","<android><android-layout>","3","0","4","",""
"4468409","1","","","2010-12-17 07:00:47","2","2762","<p>I would like to know how can I get location from the best provider<br>do I have to make two separate criteria 1 for the GPS and 1 for the network or is there a way to put them all together ?<br>this is my code when I add the COARSE criteria the GPS does not go on (no GPS flashing logo on the top of the screen) and when I use the FINE criteria I dont get any thing from the network.......so do I have to write criteria for both and switch between them for what ever is available or can they both be in the same criteria ?<br>because I have the ""getBestProvider(criteria, true);"" in my code so it should get the location from the best provider....right..??!</p><pre><code>Criteria criteria = new Criteria();criteria.setAccuracy(Criteria.ACCURACY_FINE);//// criteria.setAccuracy(Criteria.ACCURACY_COARSE);criteria.setAltitudeRequired(false);criteria.setBearingRequired(false);criteria.setCostAllowed(true);criteria.setPowerRequirement(Criteria.POWER_HIGH);String provider = locationManager.getBestProvider(criteria, true);</code></pre>","545756","","281545","","2013-07-11 17:26:51","2013-07-11 17:26:51","criteria for both GPS and network","<android><gps><location>","1","2","","",""
"4468412","1","","","2010-12-17 07:01:05","0","175","<p>new to android and lovin it so far. I have this issue which i need to solve and it may need a simple solution.</p><p>Intrinsic Destinator software has a feature of receiving an sms with location info which it can recognise. However when the software is installed in the mobile device (HTC desire-Z), it gets installed directly in the SD card. This disables this feature as it has no access to the sms folder of the phone.</p><p>On a windows mobile phone it is possible to install the software on the main memory and the maps on the SD card and it works that way.</p><p>Is something similar possible to do on the android phone? OR is it a matter of the destinator developers to alter the way the software gets installed?</p><p>Can the android sms folder be linked to the destinator software somehow?</p>","545757","","15541","","2010-12-17 07:11:30","2010-12-17 21:27:05","Destinator navigation program and sms issue","<android><navigation><sms>","1","0","","",""
"4468541","1","","","2010-12-17 07:32:15","0","545","<p>Hi, I want to develop a form on a rectangle. </p><p>I have designed a rectangle using a bitmap and an image, but how do I add edit texts and buttons onto that? </p><p>Please provide some good guidelines.</p>","487604","","441574","","2012-01-20 17:56:47","2012-01-20 17:56:47","How to add a button widget to a rectangle canvas in Android?","<android>","1","0","","",""
"4468547","1","4468731","","2010-12-17 07:33:18","0","225","<p>I am working on an application where I need to stat the audio file when the timercountdown gets over. But, how do I get to know that the timer countdown has been over So, that I can start playing the audio file?</p><p>Please can anybody tell me!</p><p>Thanks,david,</p>","422859","","","","","2010-12-17 08:16:54","To fire an Event when the TimerCountDown gets over","<android><timer><countdown>","1","0","","",""
"4468568","1","4691311","","2010-12-17 07:36:46","1","183","<pre><code>[2010-12-17 07:37:12 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read /Users/macuser/android-sdk-mac/AndroidManifest.xml: java.io.FileNotFoundException: /Users/macuser/android-sdk-mac/AndroidManifest.xml (No such file or directory)</code></pre>","450487","","473070","","2010-12-17 08:13:02","2011-01-14 12:59:55","Problem with running android project after updating","<android><android-emulator>","2","1","","",""
"4468616","1","","","2010-12-17 07:46:04","2","420","<p>I have used </p><pre><code>mTts.addSpeech(text, filename.getAbsolutePath() );</code></pre><p>to map an audio file to a particular string of text.</p><p>The problem is that if the used deletes the file, which is possible/likely in my case, I need to remove the addSpeech  mapping from mTts (using removeSpeech() which does not exist) so that it reverts to computerised voice.</p><p>is this possible?</p><p>This is the stack trace I am getting after I add a file using addSpeech, then remove the file and attempt to speak again.</p><pre><code>12-17 15:41:45.016: ERROR/MediaPlayer(361): error (1, -2147483648)12-17 15:41:45.056: DEBUG/MediaPlayer(361): create failed:12-17 15:41:45.056: DEBUG/MediaPlayer(361): java.io.IOException: Prepare failed.: status=0x112-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.media.MediaPlayer.prepare(Native Method)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.media.MediaPlayer.create(MediaPlayer.java:611)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.media.MediaPlayer.create(MediaPlayer.java:588)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.tts.TtsService.processSpeechQueue(TtsService.java:1098)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.tts.TtsService.speak(TtsService.java:507)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.tts.TtsService.access$1900(TtsService.java:58)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.tts.TtsService$1.speak(TtsService.java:1256)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.speech.tts.ITts$Stub.onTransact(ITts.java:86)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at android.os.Binder.execTransact(Binder.java:288)12-17 15:41:45.056: DEBUG/MediaPlayer(361):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","248521","","248521","","2010-12-17 08:44:03","2010-12-17 09:05:54","TTS Android removing addSpeech item?","<android>","1","0","1","",""
"4468621","1","4525717","","2010-12-17 07:47:07","23","22810","<p>I want to display pdf contents on webview. </p><p>Here is my code: </p><pre><code>WebView webview = new WebView(this); setContentView(webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl(""URL/Demo_PDF.pdf"");</code></pre><h2>Problem:</h2><p>When i am trying to run the application, at that time I am getting blank screen. </p><p>And also, if there is any PDF viewer then also suggest me !!</p><p>FYI, I have already set internet permission.</p>","379693","","379693","","2010-12-17 08:01:56","2013-05-31 10:59:06","Android - Load PDF / PDF Viewer","<android>","6","1","15","",""
"4468658","1","","","2010-12-17 07:58:31","8","10948","<p>Is it possible for us to connect  multiple devices ? who can share the code for me! This problem has troubled me for a long time! Thanks!</p>","545755","","216517","","2010-12-17 09:20:15","2012-06-29 21:37:37","Android Bluetooth API connect to multiple devices","<android><bluetooth>","4","0","5","",""
"4468720","1","","","2010-12-17 08:14:14","0","3826","<p>I am new to android and I stuck with  an error when tried to access webservices using httpget. Url I requested can be got through browser, it  works fine ,got it's response code. When I tried to access it in program it   generates following exception SSL Exception :Not trusted Server</p><p>I added logcat with this </p><pre><code>  12-17 12:44:57.189: WARN/System.err(769): javax.net.ssl.SSLException: Not trusted server certificate12-17 12:44:57.189: WARN/System.err(769):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)12-17 12:44:57.199: WARN/System.err(769):     at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)12-17 12:44:57.199: WARN/System.err(769):     at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)12-17 12:44:57.209: WARN/System.err(769):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)12-17 12:44:57.209: WARN/System.err(769):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)12-17 12:44:57.209: WARN/System.err(769):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)12-17 12:44:57.219: WARN/System.err(769):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)12-17 12:44:57.219: WARN/System.err(769):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)12-17 12:44:57.229: WARN/System.err(769):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)12-17 12:44:57.229: WARN/System.err(769):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)12-17 12:44:57.229: WARN/System.err(769):     at com.mytools.HttpRequestHandler.executeRequest(HttpRequestHandler.java:131)12-17 12:44:57.240: WARN/System.err(769):     at com.mytools.HttpRequestHandler.Execute(HttpRequestHandler.java:118)12-17 12:44:57.240: WARN/System.err(769):     at com.nomadesk.webservices.WebServices.login(WebServices.java:167)12-17 12:44:57.240: WARN/System.err(769):     at com.nomadesk.Webservice_activity$1.onClick(Webservice_activity.java:35)12-17 12:44:57.249: WARN/System.err(769):     at android.view.View.performClick(View.java:2408)12-17 12:44:57.249: WARN/System.err(769):     at android.view.View$PerformClick.run(View.java:8816)12-17 12:44:57.260: WARN/System.err(769):     at android.os.Handler.handleCallback(Handler.java:587)12-17 12:44:57.260: WARN/System.err(769):     at android.os.Handler.dispatchMessage(Handler.java:92)12-17 12:44:57.260: WARN/System.err(769):     at android.os.Looper.loop(Looper.java:123)12-17 12:44:57.269: WARN/System.err(769):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-17 12:44:57.269: WARN/System.err(769):     at java.lang.reflect.Method.invokeNative(Native Method)12-17 12:44:57.280: WARN/System.err(769):     at java.lang.reflect.Method.invoke(Method.java:521)12-17 12:44:57.280: WARN/System.err(769):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-17 12:44:57.280: WARN/System.err(769):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-17 12:44:57.280: WARN/System.err(769):     at dalvik.system.NativeStart.main(Native Method)12-17 12:44:57.289: WARN/System.err(769): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.12-17 12:44:57.299: WARN/System.err(769):     at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:168)12-17 12:44:57.299: WARN/System.err(769):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:366)12-17 12:44:57.309: WARN/System.err(769):     ... 24 more12-17 12:44:57.309: WARN/System.err(769): Caused by: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.12-17 12:44:57.319: WARN/System.err(769):     at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:149)12-17 12:44:57.319: WARN/System.err(769):     at java.security.cert.CertPathValidator.validate(CertPathValidator.java:202)12-17 12:44:57.330: WARN/System.err(769):     at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:164)12-17 12:44:57.330: WARN/System.err(769):     ... 25 more</code></pre><p>How can i solve this  problem</p><p>Thanks for your time</p><p>Regards,Kariyachan</p>","482604","","473070","","2010-12-17 08:19:16","2010-12-17 08:38:25","""SSL exception :Not trusted server""- Occured when tried to access web services","<java><android><web-services><ssl>","1","0","","",""
"4468803","1","4488916","","2010-12-17 08:32:38","1","5294","<p>I'm unable to write select-where-unique query for my database.I have managed to query my db using where clause by using:</p><pre><code>        Cursor mCursor =                db.query(true, DATABASE_TABLE, new String[] {                        KEY_ROWID,                        KEY_KEYWORD},                         KEY_TIME + ""="" + strtime,                         null,                        null,                         null,                         null,                         null);</code></pre><p>Can anybody please help me insert ""DISTINCT"" keyword for column KEY_KEYWORD?</p><p>Thanx in advance.</p>","227943","","","","","2011-06-03 07:34:18","How to write select-where-column=unique query in Android","<android><sqlite><distinct>","3","0","","",""
"4468834","1","4468947","","2010-12-17 08:38:07","2","956","<p>I am making a app having login screen.The validation &amp; other stuff of login is handled by webservice.</p><p>My question is that if the user installed the application,then if for the first time user runs the application, a login screen appears to do login through the details given by user at downloading time from market.If user successfully logs in then at second time when he/she runs app,login screen should not appear.</p><p>Can anyone help me out.Thanks in advance.  </p>","536148","","","","","2010-12-17 09:10:45","How to stop user from login screen second time if app is already started once?","<android>","3","0","1","",""
"4468836","1","","","2010-12-17 08:38:13","0","449","<p>I am using below code to access soap web service. But I am getting exception .Please help.</p><p>Exception :</p><pre><code>    org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schedmas.xmlsoap.org/soap/envelope/}Envelop (position:START_TAG&lt;definitions targetNamespace='urn:schedule'&gt;@2:425 in java.io.InputStreamreader@43d36520)</code></pre><p>Code:</p><pre><code>public SoapObject soap(String METHOD_NAME, String SOAP_ACTION, String NAMESPACE, String URL) throws IOException, XmlPullParserException {         SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //set up request         request.addProperty(""access_key"", ""5rrtrtr"");         request.addProperty(""type"", ""facebook"");         request.addProperty(""access_secrete"", ""5rtrt"");         request.addProperty(""message"", ""5"");         request.addProperty(""date"", ""2010/12/16"");         request.addProperty(""time"", ""05:10:00"");         request.addProperty(""ampm"", ""AM"");         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);         envelope.setOutputSoapObject(request);  //prepare request         HttpTransportSE httpTransport = new HttpTransportSE(URL);           httpTransport.debug = true;           httpTransport.call(SOAP_ACTION, envelope); //send request         SoapObject result=(SoapObject)envelope.getResponse(); //get response         return result;      }</code></pre>","301549","","","","","2011-08-26 19:16:44","[Android]:kmlparser exception while accessing soap web service in android","<android><android-ksoap2>","1","0","","",""
"4468893","1","4482320","","2010-12-17 08:47:18","1","1609","<p>This is driving me crazy. I have created a local service which monitors the accelerometer. Sometimes the service works and sometimes it does not. It seems that the service keeps just randomly unregistering itself.</p><p>The service reacts after a certain level of movement on the phone. The thing is that if I start the service, I can end it correctly right after. However, after I shake the phone (set off how the service should act) nothing happens and then when I try to turn off the service I get an error. What is really confusing me is that I have put break codes in my code which detects the movement, and the code which is called after a movement isn't even being executed.</p><p>Any help would be MUCH appreciated. Here is my code for the service and its manager. </p><pre><code>public class AccelService extends Service {    public static boolean listening = false;    private static Context CONTEXT;    private static Sensor sensor;    private static SensorManager ASensorManager;    private static SensorEventListener accelEventListener = new SensorEventListener() {        private float x = 0;        private float y = 0;        private float z = 0;        private double max = 0;        private double force = 0;        public void onAccuracyChanged(Sensor sensor, int accuracy) {}        public void onSensorChanged(SensorEvent event) {            x = event.values[0];            y = event.values[1];            z = event.values[2];            force = Math.sqrt(x*x+y*y+z*z);            if (force &gt; max)                max = force;            if (force &gt; AccelManager.dropValue)                                AccelManager.onDrop(force);                        }     };private static void startListener() {    ASensorManager = (SensorManager) CONTEXT.getSystemService(Context.SENSOR_SERVICE);    List&lt;Sensor&gt; sensors = ASensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);    if (sensors.size() &gt; 0) {        sensor = sensors.get(0);        listening = ASensorManager.registerListener(accelEventListener, sensor, SensorManager.SENSOR_DELAY_GAME);        AccelManager.setListening(listening);    }} private final IBinder mBinder = new AccelBinder();public class AccelBinder extends Binder {    AccelService getService() {        return AccelService.this;    }}public void onCreate() {    CONTEXT = this;    startListener();}public boolean isListening() {    return listening;}@Overridepublic void onStart(Intent intent, int startId){    Log.i(""LocalService"", ""Received start id "" + startId + "": "" + intent);}    @Override    public int onStartCommand(Intent intent, int flags, int startId) {        Log.i(""LocalService"", ""Received start id "" + startId + "": "" + intent);        return AccelService.START_STICKY;    }    @Override    public void onDestroy() {        if (listening)        stopListening();        super.onDestroy();    }    public static void stopListening() {          AccelManager.setListening(false);        try {            if (ASensorManager != null &amp;&amp; accelEventListener != null)                ASensorManager.unregisterListener(accelEventListener);                    } catch (Exception e) {}         }    @Override    public IBinder onBind(Intent intent) {        return mBinder;    }</code></pre><p>Here is the Manager class.</p><pre><code>public class AccelManager extends Activity {    public static Boolean isListening = false;    private static Boolean callMade = false;    public static Context ctxt;    public static int dropValue = 100;    private static Intent i;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);    }    public void setContext(Context context) {        ctxt = context;        i = getIntent();    }    public void activateService(Boolean check) {        if (check)            doBindService();        else {            if (isListening) {                if (AccelWatch != null) {                    AccelWatch.stopSelf();                    doUnbindService();                }            }        }        }    public static void onDrop(double force){        if (!callMade) {            Toast.makeText(ctxt, ""Phone dropped: "" + force, 5000).show();            Intent i = new Intent(ctxt,DropDetected.class);            AccelWatch.stopSelf();            doUnbindService();            callMade = true;            ctxt.startActivity(i);        }    }    private void doBindService() {        if (!isListening) {            i = new Intent(ctxt,AccelService.class);            ctxt.bindService(i, AccelConnection, ctxt.BIND_AUTO_CREATE);        }    }    private static void doUnbindService() {        if (isListening)                     ctxt.unbindService(AccelConnection);    }        public void setDropValue(int drop) {        dropValue = drop;    }    public boolean isRunning(){        return AccelWatch.isListening();    }    public static void setListening(Boolean listen){        isListening = listen;    }    private static AccelService AccelWatch;    private static ServiceConnection AccelConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service)     {            AccelWatch = ((AccelService.AccelBinder)service).getService();            AccelWatch.startService(i);            Toast.makeText(ctxt, ""The service is binded."",Toast.LENGTH_SHORT).show();        }        public void onServiceDisconnected(ComponentName className) {            AccelWatch = null;            Toast.makeText(ctxt, ""The service was disconnected."",Toast.LENGTH_SHORT).show();        }    };}</code></pre>","545825","","1440731","","2013-01-25 10:30:03","2013-09-10 22:07:36","Android local service registration","<android><android-service>","2","0","3","",""
"4468905","1","","","2010-12-17 08:49:00","2","173","<p>Hi guys:   There are several methods such as <code>HttpGet</code> and <code>HttpPost</code> in this package. But the CONNECT method is lost. Do you know why ? I've tried to add my own HTTP CONNECT method following the <code>HttpGet</code> method implementation. i.e. new the class HttpConnect which extends the HttpEntityEnclosingRequestBase base class. But this does not work. :-(    May you please help? Thank you!</p>","536296","","473070","","2010-12-17 08:51:24","2011-02-01 01:56:00","org.apache.http.client.methods","<android><http>","1","0","","",""
"4469055","1","4469736","","2010-12-17 09:16:29","0","1442","<p><br>I'm launching the email program in Android from my app, using the following code...</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.setType(""message/rfc822"");sendIntent.putExtra(Intent.EXTRA_SUBJECT, ""Test subject"");sendIntent.putExtra(Intent.EXTRA_TEXT, ""Hello World!"");startActivityForResult(Intent.createChooser(sendIntent, ""Select email application.""), INTENT_REQUEST_SEND_EMAIL);</code></pre><p>In the called OnActivityResult(), is it possible to get the number of recepients the user has chosen to send the email to?</p><p>Thanks,<br>Rajath</p>","313042","","","","","2010-12-17 10:48:13","Getting the recepient count from email sent in Android","<android><email-integration>","1","0","1","",""
"4469105","1","4469302","","2010-12-17 09:22:42","1","696","<p>I am trying to implement swipe in android from left to right and right to left .its not working in emulator? some times its working can anybody tell whats is problem in my code?if anybody have working code can you give to me? </p><pre><code>package com.gesture;import android.app.Activity;import android.os.Bundle;import android.view.GestureDetector; import android.app.Activity;import android.os.Bundle; import android.view.GestureDetector; import android.view.MotionEvent;import android.view.GestureDetector.OnGestureListener;import android.widget.Toast; public class SampleGestureActivity extends Activity implements OnGestureListener  {     public final static int SWIPE_UP    = 1;         public final static int SWIPE_DOWN  = 2;         public final static int SWIPE_LEFT  = 3;         public final static int SWIPE_RIGHT = 4;          public final static int MODE_TRANSPARENT = 0;         public final static int MODE_SOLID = 1;         public final static int MODE_DYNAMIC = 2;          private final static int ACTION_FAKE = -13;             private int swipe_Min_Distance = 100;         private int swipe_Max_Distance = 350;         private int swipe_Min_Velocity = 100;          private int mode = MODE_DYNAMIC;      private GestureDetector gestureDetector;     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);        gestureDetector = new GestureDetector(this);     }     @Override     public boolean onTouchEvent(MotionEvent event) {         return gestureDetector.onTouchEvent(event);     }     @Override     public boolean onDown(MotionEvent e) {         // Do something         return true;     }     @Override     public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,             float velocityY) {            final float xDistance=Math.abs(e1.getX()-e2.getX());            final float yDistance=Math.abs(e1.getY()-e2.getY());            if(xDistance&gt;this.swipe_Max_Distance || yDistance&gt; this.swipe_Max_Distance)                return false;            velocityX = Math.abs(velocityX);            velocityY = Math.abs(velocityY);            boolean result=false;            if(velocityX &gt; this.swipe_Min_Velocity &amp;&amp; xDistance &gt; this.swipe_Min_Distance)            {                if(e1.getX() &gt; e2.getX())   // right to left Move                    Toast.makeText(SampleGestureActivity.this, ""left"", Toast.LENGTH_SHORT).show();                    //this.listener.onSwipe(SWIPE_LEFT);                else                    Toast.makeText(SampleGestureActivity.this, ""right"", Toast.LENGTH_SHORT).show();                    //this.listener.onSwipe(SWIPE_RIGHT);                result=true;            }            else if(velocityY &gt; this.swipe_Min_Velocity &amp;&amp; yDistance &gt; this.swipe_Min_Distance)            {                if(e1.getY() &gt; e2.getY())   // bottom to top Move                    Toast.makeText(SampleGestureActivity.this, ""up"", Toast.LENGTH_SHORT).show();                else                    Toast.makeText(SampleGestureActivity.this, ""down"", Toast.LENGTH_SHORT).show();                result=true;            }            return result;     }     @Override     public void onLongPress(MotionEvent e) {          // Do something     }     @Override     public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,             float distanceY) {         // Do something         return false;     }     @Override     public void onShowPress(MotionEvent e) {         // Do something     }     @Override     public boolean onSingleTapUp(MotionEvent e) {          // Do something          Toast t = Toast.makeText(SampleGestureActivity.this, ""single"", Toast.LENGTH_SHORT);          t.show();         return true;     } }Thanks</code></pre>","426344","","","","","2010-12-17 09:49:34","gesture detector problem","<android>","1","0","","",""
"4469267","1","5610948","","2010-12-17 09:45:18","2","747","<p>I am writing a 3d live wallpaper for android using the famous GLSurfaceView wrapper (http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers)</p><p>When i open the preference screen to change wallpaper settings, the settings are displayed as transparent over my wallpaper preview. This is good because it lets me preview the settings changes I make. This works great, except for one problem: The live wallpaper is paused as long as the settings are on top of it!</p><p>How can i avoid my wallpaper pausing?</p>","1035897","","","","","2012-10-03 13:55:39","How to avoid pausing android live wallpaper while settings activity is open when using GLSurfaceView","<android><opengl-es><android-2.1-eclair>","2","2","1","",""
"4469408","1","4663046","","2010-12-17 10:04:25","0","623","<p>I have completed the Hello Views tutorial from android developers (http://developer.android.com/resources/tutorials/views/hello-listview.html)</p><p>I understood the concept, but it doesn't fit my project. I'm trying to make a list and when clicked I want it to open a webView with different URL's depending of which item is clicked.</p><p>I can't figure out which code I need to use...</p>","523053","","523053","","2010-12-17 13:11:24","2011-01-11 21:52:57","Using ListView to open different WebViews","<android><android-webview><android-listview>","1","3","","",""
"4469415","1","","","2010-12-17 10:05:24","0","757","<p>I am beginning Android developer. I am currently experiencing a problem with my class. I used Login.java to separate function. Below is my code:</p><pre><code>public class GTSMobile extends Activity {@Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.login);      Login lg = new Login();     lg.Chk_Login(); } }public class Login extends Activity{public void Chk_Login() {  Button launch = (Button)findViewById(R.id.login_button);    launch.setOnClickListener( new OnClickListener()        { @Override                    public void onClick(View viewParam)             {                                  EditText usernameEditText = (EditText) findViewById(R.id.txt_username);              EditText passwordEditText = (EditText) findViewById(R.id.txt_password);                           String sUserName = usernameEditText.getText().toString();              String sPassword = passwordEditText.getText().toString();              if(sUserName.length() == 0 || sPassword.length() == 0){               ShowOKAlert();              }else{               setContentView(R.layout.main);                            }            }  }); // end of launch.setOnclickListener   } void ShowOKAlert(){  AlertDialog alertDialog = new AlertDialog.Builder(this).create();        alertDialog.setTitle(""Login Fail"");        alertDialog.setMessage(""Please Enter UserName and Password"");        alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int which) {                         }        });        alertDialog.setIcon(R.drawable.icon);        alertDialog.show(); }}</code></pre>","549407","","366904","","2010-12-17 10:57:07","2010-12-17 13:08:05","How to call and run a function from other class","<android><classpath>","1","1","","",""
"4469514","1","6042324","","2010-12-17 10:18:13","3","3503","<p>How to change the color of Title text in CheckBoxPreference?</p>","110024","","","","","2013-10-07 09:31:10","How to customize text color of the CheckBoxPreference title","<android>","3","2","3","",""
"4469519","1","4469985","","2010-12-17 10:19:07","16","3420","<p>At first I thought this was a problem with my app, but it seems to be happening in any app (though interestingly, not the home screen) in the gingerbread emulator.</p><p>To replicate my issue, open eclipse and fire up the android emulator for gingerbread (I'm using the ""Google APIs - API Level 9"" as my target)</p><p>So the procedure to duplicate once the emulator loads is</p><p>press LCtrl-F11 to shift orientation to landscape, then again to switch to portrait</p><p><b>Result:</b><br><i>In the homescreen:</i><br>The view rotates to landscape, and then back to portrait, as expected</p><p><i>In any app (i've tried browser, calculator, maps, and the app i'm currently working on):</i><br>the view rotates to landscape, and then nothing, it stays in landscape even the emulator is displaying the phone in landscape mode (see below)</p><p><img src=""http://i.stack.imgur.com/VA8nJ.jpg"" alt=""enter image description here""></p><p>Has anyone else had this issue, or have I installed the emulator in some incorrect way - this hasn't been an issue with any of the previous emulators</p>","516951","","2273628","","2013-04-16 14:59:20","2013-04-16 14:59:20","why does the gingerbread emulator orientation get stuck in apps?","<android><android-emulator><screen-orientation><android-sdk-2.3>","3","0","4","",""
"4469565","1","","","2010-12-17 10:26:22","0","1069","<p>I would like to know how to extract the data from the apk and store it in the sd card. I know that this method is possible but all the guide I found is not clear.</p>","545924","","","","","2011-06-14 10:41:18","How to split android applications","<android><split><apk>","1","4","","",""
"4469630","1","4469959","","2010-12-17 10:35:12","0","3008","<p>I have just put the first step in android,and just started with hello android example of android <a href=""http://developer.android.com/guide/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/hello-world.html</a>. Now the problem is that when i navigate to /tools directory and execute the command <code>android create avd --target 2 --name my_avd</code> ,it gives error like :</p><p>mac123:android-sdk-mac_86 mac1$ android create avd --target 2 --name my_av    -bash: android: command not found</p><p>Please mark that i am working with mac OS. Also is it any other way possible for the installation of the android SDK. </p><p>Kindly help me out.</p><p>Thank you.</p>","1004776","","473070","","2010-12-17 11:04:23","2012-03-28 04:24:19","An SDK Target must be specified error with android SDK","<android><eclipse><android-sdk-1.6>","2","0","","",""
"4469744","1","9393152","","2010-12-17 10:49:11","4","1777","<pre><code>File file = new File(imagePath); boolean deleted = file.delete(); </code></pre><p>using this code image delete on current screen But it not deleted from SDCard. so Please Anyone who know Answer please Post it. </p>","545951","","545951","","2012-12-02 09:38:30","2013-01-03 10:00:57","How to Delete Image From SDCard in Android","<android><android-sdcard>","2","1","2","",""
"4469780","1","4470350","","2010-12-17 10:54:08","2","814","<p>According to <a href=""http://developer.android.com/sdk/android-2.3.html"" rel=""nofollow"">android 2.3</a> some RTL languages such as Arabic is supported in this new version. However, emulator does not show the fount correctly. In code I have written:</p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TextView txt = (TextView) findViewById(R.id.myText);    Typeface font = Typeface.createFromAsset(getAssets(), ""Larabieb.ttf"");    txt.setTypeface(font);    txt.setTextSize(26);    txt.setText(""?????? ???? ?? ?????"");}</code></pre><p>but in the output it shows separated characters instead of connected characters.</p><p><img src=""http://i.stack.imgur.com/bLpk3.png"" alt=""alt text""> </p><p>How can I connect the characters?</p>","513413","","321731","","2014-03-21 19:45:00","2014-03-21 19:45:00","Issue in custom font (RTL labguage)","<android><right-to-left>","2","1","1","",""
"4469920","1","","","2010-12-17 11:12:49","0","121","<p>I installed my Android application on the sdcard adding the manifest directive:  <code>android:installLocation=preferExternal</code></p><p>But I can't locate my application on the sdcard if I browse its content with ES File Explorer. </p><p>Any idea?</p>","164460","","213269","","2010-12-17 23:27:03","2010-12-17 23:27:03","Where is my Android application?","<android><sd-card>","1","0","","",""
"4469922","1","4470793","","2010-12-17 11:12:57","0","293","<p>I'm fiddling around with making my first game for Android, but I'm having a lot of difficulties. To me, the API seems a bit strange at some points (for example Dialog boxes - why would they have to go through events...) but I'm slowly learning.</p><p>But right now, I'm a bit lost. I'm not sure where to put my code exactly, and I don't really know how to figure out what the best way is.</p><p>I have made my own View, GameView, which does the drawing in the onDraw event. I also put most of my code into the GameView. For example when you touch the View (in the onTouch event) I handle it and perform actions.</p><p>However now I want to display a standard Dialog box, and I read it has to be done through an Activity, with showDialog and the onDialog event. I was a bit confused that I'm not directly able to just show dialog boxes through the View.</p><p>So I started thinking, maybe I'm doing this all wrong... maybe I shouldn't put all my code into the View, but rather put my code in the Activity? When I went through the API Dialog examples, they just fetch the Buttons from the XML and attach events to them, etc, all inside the Activiy.</p><p>I hope my question/problem is a bit clear. I'm not sure which code should go where, and how to interact between the Activity and the (Game)View, etc.</p>","504451","","473070","","2010-12-17 11:32:11","2010-12-17 13:18:53","Should I put my code in the Activity or the View?","<android><view><activity>","2","0","","",""
"4469936","1","","","2010-12-17 11:14:08","3","3738","<p>How can I change android's default keyboard?I want numeric keyboard to be shown first and then on clicking ABC in the numeric keyboard, I want to show alphabets keyboard.Is that possible to implement?Thanks in advance.</p>","504162","","","","","2012-11-22 10:17:06","getting numeric keyboard default","<android>","4","0","1","",""
"4470018","1","4470141","","2010-12-17 11:27:25","2","1647","<p>I wrote code for one application.In that I wrote IME_ACTION_DONE for edit text.All other devices support for this action but in HTC desire I haven't get this 'done' softkeyboard button.How can i get this soft button in HTC desire other wise please give me alternative for this done button functionality on EditText without lot of changes in my application to use with HTC.</p>","486216","","","","","2011-10-11 13:36:00","Alternative of Action done button in HTC desire?","<android>","2","0","","",""
"4470034","1","4470723","","2010-12-17 11:29:06","0","110","<p>I have an additional component that I can not distribute inside my app. The component is a third-party viewer for a proprietary format, and it is not distributed through Android Market.</p><p>So, when a user clicks on a file of that type, I'd like to provide a way to install that third-party viewer with the least effort. By install I mean - download APK, install it and launch through an Intent.</p><p>What is the best way to do this?</p>","6533","","6533","","2010-12-17 11:45:39","2010-12-17 13:09:41","What is the easiest way to provide additional installable component for my Android app?","<android>","1","2","","",""
"4470139","1","4470288","","2010-12-17 11:47:27","2","10074","<p>Is it possible to get any information about the package or the application from the apk file without installing it in the Android environment?</p>","184860","","184860","","2010-12-17 14:57:22","2013-11-26 15:12:35","How to get application or package info from the apk file in the android application in the Android environment","<android><apk>","4","0","","",""
"4470183","1","4470206","","2010-12-17 11:54:48","2","992","<p>I upload my first app into market, and now I want to upgrade a new version, but I got this exception when I upgrade my app. "" The apk must be signed with the same certificates as the previous version.""I lost my certificate keystore, what can I do in this situation? unpublish my app and rename the package? Can I upload other app using the other keystore?</p>","522915","","473070","","2010-12-17 11:57:35","2010-12-17 12:03:39","I lost my keystore, I can't upgrade my app in the market","<android><google-play><keystore>","1","0","","",""
"4470222","1","4470320","","2010-12-17 11:59:15","1","2042","<p>I have service with thread, From activity I am calling start service(from Activity::onDestroy()) and stop service (activity::onCreate()).</p><p>StopService() returned instantly but my Service::OnDestroy called after so many time, pretty late, Why? How to make Service::OnDestroy called immediately when calling StopService().</p><p>Activity class</p><pre><code>MyActivity::OnDestroy(){  System.out.println(""MyActivity-OnDestroy Start"");  // we are leaving activity so start service  Intent svcIntent = new Intent(this,MyService.class);  svcIntent.putExtra(""SomeData"", m_iData);  startService(svcIntent);  System.out.println(""MyActivity-OnDestroy, startservice called"");  ..  ..  System.out.println(""MyActivity-OnDestroy, End"");}MyActivity::OnCreate(){  System.out.println(""MyActivity-onCreate Start"");  // if service running stop it.  if (m_bCalledFromNotification)  {   System.out.println(""Stopping Service"");   boolean b = stopService(new Intent(this,AudioService.class));   System.out.println(""Stopping Service, Status=""+b);  }  System.out.println(""MyActivity-onCreate End"");      }</code></pre><p>Service class</p><pre><code>@Overridepublic IBinder onBind(Intent intent) {    return null;}// When service is created@Overridepublic void onCreate() {    // initialize service data    System.out.println(""MyService Created"");    }@Overridepublic void onDestroy() {    System.out.println(""In MyService::onDestroy"");    m_UIUpdater.interrupt();    System.out.println(""In MyService::onDestroy, updater thread interrupted"");    ..    System.out.println(""My Service Stopped"");}// This is the old onStart method that will be called on the pre-2.0// platform.  On 2.0 or later we override onStartCommand() so this// method will not be called.@Overridepublic void onStart(Intent intent, int startId) {    StartupHandler(intent,startId);}@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {    StartupHandler(intent,startId);    // We want this service to continue running until it is explicitly    // stopped, so return sticky.    return START_STICKY;}public void StartupHandler(Intent intent, int startid) {    // send notification     System.out.println(""In MyService::StartupHandler, Sending notification"");    // start thread     m_UIUpdater = new Thread(new Runnable()         {        public void run()         {            System.out.println(""In MyService::Thread::Run"");            while (!Thread.interrupted())            {                // check update                System.out.println(""In MyService::Thread::Run::got update and loop for next update"");            }        }    }}</code></pre><p>Now here is output of logcat which show how late MyService::OnDestroy called.</p><pre><code>12-17 09:25:44.462: INFO/System.out(314): MyActivity-OnDestroy Start..12-17 09:25:44.493: INFO/System.out(314): MyActivity-OnDestroy, startservice called..12-17 09:25:51.102: INFO/System.out(314): MyActivity-OnDestroy, End 12-17 09:25:51.153: INFO/System.out(314): MyService Created12-17 09:25:51.172: INFO/System.out(314): In MyService::StartupHandler, Sending notification12-17 09:25:51.273: INFO/System.out(314): In MyService::Thread::Run12-17 09:25:51.302: INFO/System.out(314): In MyService::Thread::Run::got update and loop for next update......12-17 09:25:59.903: INFO/System.out(314): MyActivity-onCreate Start..12-17 09:26:00.461: INFO/System.out(314): Stopping Service12-17 09:26:00.471: INFO/System.out(314): Stopping Service, Status=true12-17 09:26:01.363: INFO/System.out(314): MyActivity-onCreate End12-17 09:26:01.421: INFO/System.out(314): In MyService::OnDestroy12-17 09:26:01.421: INFO/System.out(314): In MyService::OnDestroy, updater interrupted12-17 09:26:01.591: INFO/System.out(314): My Service Stopped</code></pre><p>Have i implemented service code correctly?</p><p>How can i wait for service to destroy gracefully so that i can do remaining process after service has destroyed, like reading data service has stopped.</p><p>Thanks,</p>","465751","","","","","2010-12-17 12:10:45","Android :: Service OnDestroy called very late","<android>","1","0","","",""
"4470318","1","4472784","","2010-12-17 12:10:28","0","4289","<p>I am trying to listen to new sms(Message) with the help of <strong>BroadcastReceiver</strong>, but it is keep on listening to messages throughout the application and even after closing the app, so what to do??</p><p>Whether there is any other way to listen to sms or latest method as IntentReceiver kind of solutions(available over I-net) are deprecated and not working</p>","457146","","","","","2011-06-13 20:38:41","How to listen to new Sms in Android","<android><sms>","3","0","1","",""
"4470376","1","","","2010-12-17 12:20:27","1","909","<p>I have created this little testcase:</p><pre><code>public class MainActivity extends TabActivity {    @Override    public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            TabHost tabHost = getTabHost();            TabSpec spec;        spec = tabHost.newTabSpec(getString(R.string.service));        spec.setIndicator(getString(R.string.service));        spec.setContent(R.id.first_tab);        tabHost.addTab(spec);    }}</code></pre><p>and this is the relative layout document:</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:id=""@+id/first_tab""&gt;    &lt;ToggleButton android:id=""@+id/serviceButton""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:textOn=""@string/service_on"" android:textOff=""@string/service_off""&gt;    &lt;/ToggleButton&gt;    &lt;/RelativeLayout&gt;</code></pre><p>Anyone know why i get this exception at runtime: java.lang.RuntimeException: Could not create tab content because could not find view with id 2131034112 ?</p><p>The code seems to be right!</p><p>Thanks you for any reply.</p>","546044","","","","","2010-12-17 12:39:10","Android TabActivity and setContent(int idView) ---> RuntimeException","<android>","2","0","","",""
"4470414","1","4472511","","2010-12-17 12:24:47","0","293","<p>I tried the following code it will display the ""Name"" but, doesn't display ""Number"". Could someone please indicate where I have made a mistake, any suggestions please.</p><pre><code>package org.testcont;import android.app.Activity;import android.content.ContentResolver;import android.content.ContentUris;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.provider.Contacts;import android.provider.Contacts.People;import android.widget.EditText;import android.widget.TextView;public class testcontActivity extends Activity {    /** Called when the activity is first created. */    TextView tvname;    TextView tvnumber;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        tvname = (TextView) findViewById(R.id.TextView01);        tvnumber = (TextView) findViewById(R.id.TextView02);        Cursor c=getContentResolver().query(People.CONTENT_URI,null,null,null,null);        while(c.moveToNext()){        int name=c.getColumnIndexOrThrow(People.NAME);        String nm=c.getString(name);        tvname.setText(nm);        int number=c.getColumnIndexOrThrow(People.NUMBER);        String s=c.getString(number);        }        c.close();    }}</code></pre><p>thank in advance.</p>","489902","","1104926","","2011-12-19 13:24:48","2011-12-19 13:24:48","not getting the phone number in android","<android><numbers><contact>","1","0","","",""
"4470418","1","4470454","","2010-12-17 12:25:10","4","8230","<p>i have a background service on my android APP that is getting my GPS position and sending it to a remote db. It work's fine.</p><p>The problem is when i want to stop the service.... it doesn't stops :S. Also no exception or errors on logcat have appeared... it simply doesn't stops.</p><p>this is the code to start my srvice (with a button):</p><pre><code>startService(new Intent(GPSLoc.this, MyService.class)); //enciendo el service</code></pre><p>this is the code where I stop it (on the onactivityresult method):</p><pre><code>stopService(new Intent(GPSLoc.this, MyService.class));</code></pre><p>I have been debugged the app, and i checked that the stopService codeline has been called every time that i debugged it, but it doesn't stops......</p><p>i am sure that it's not stopped cause on my database i still recive gps positions from the emulator when i have press the button to stop the service.</p><p>what i am doing bad?</p>","479886","","","","","2013-05-02 07:34:27","stopService doesn't stop's my service.... why?","<android><service>","4","0","1","",""
"4470434","1","4470834","","2010-12-17 12:28:01","1","689","<p>I would like to knowIs it possible for me as an android developer to know if the browser app is currently open, and if it is, what page is being viewed? (URL?)</p><p>If so, how would I go about doing this?If not, I would also love to know so I wouldn't search anymore.</p><p>Thanks,Omri.</p>","406682","","","","","2012-10-19 13:47:59","Get the current page being viewed in the browser (Possible?)","<android><browser><android-intent>","2","0","","",""
"4470457","1","4472252","","2010-12-17 12:30:38","5","9946","<p>In my application i wrote code for connecting to the URL like below</p><pre><code>InputStream inputStream = new URL(url).openStream();    </code></pre><p>i got the error.Iam sending my logcat</p><pre><code>12-17 15:06:55.065: WARN/System.err(4952): java.net.SocketException: The operation timed out12-17 15:06:55.065: WARN/System.err(4952):     at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)12-17 15:06:55.065: WARN/System.err(4952):     at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115)12-17 15:06:55.065: WARN/System.err(4952):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:244)12-17 15:06:55.075: WARN/System.err(4952):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)12-17 15:06:55.075: WARN/System.err(4952):     at java.net.Socket.connect(Socket.java:1055)12-17 15:06:55.075: WARN/System.err(4952):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)12-17 15:06:55.075: WARN/System.err(4952):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)12-17 15:06:55.075: WARN/System.err(4952):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)12-17 15:06:55.085: WARN/System.err(4952):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)12-17 15:06:55.085: WARN/System.err(4952):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152)12-17 15:06:55.085: WARN/System.err(4952):     at java.net.URL.openStream(URL.java:653)</code></pre><p>How to solve this problem</p>","486216","","","","","2012-09-06 02:39:11","java.net.socketexception: The operation timed out problem in android?","<android>","2","3","1","",""
"4470509","1","4483302","","2010-12-17 12:36:40","7","11467","<p>In Android, how do you display an image (<strong>of any size</strong>) from the SD card, <strong>without getting an out of memory error</strong>? </p><p>Is it necessary to put the image in the Media Store first?</p><p>A pseudo-code example would be greatly appreciated. <strong>Extra points if the displayed image is as big as the memory level of the device allows</strong>.</p>","143378","","352841","","2012-05-03 01:24:36","2012-05-03 01:50:32","Display big image from SD card in Android","<android><bitmap><mediastore><out-of-memory>","4","1","4","",""
"4470605","1","4470941","","2010-12-17 12:51:04","0","353","<p>I am writing event based android application in which I start main thread which receives some message may be from server or some third party service.. I have created handler to handle message.. that handler forwards to appropriate handler and so on.. its kind of multilevel message forwarding.. [it looks like state pattern].</p><p>Problem I am facing is the lowest leaf of handler which handles message cant access to UI...if i forward context to that level then also i cant change layout...</p><p>Please let me know the pattern I should follow to resolve this issue.. [ i am not aware much abt activities (new to android development)]</p><p>Thanks in advance,knocker</p>","432128","","432128","","2010-12-17 13:21:31","2010-12-17 13:36:44","Switch layout/start activity in hierarchy of objects","<android><design-patterns><activity>","1","0","","",""
"4470688","1","4471653","","2010-12-17 13:04:32","0","626","<p>In my app, I'm trying to listen to broadcast intents with action <code>ACTION_PACKAGE_ADDED</code>. But unless I also specify data schema <code>package</code>, my broadcast receiver doesn't ever get activated. Why do I need to specify the data schema?</p>","6533","","","","","2010-12-17 14:55:45","Why do I need to specify schema for ACTION_PACKAGE_ADDED intent filters?","<android>","1","0","1","",""
"4470934","1","","","2010-12-17 13:35:05","0","621","<p>Need your help again.I am getting byte[] from onPreviewFrame(byte[] data, Camera arg1).Now i am transferring each frame through TCP to my System and then write a JPG file with that byte[].But when i open this JPG file it says that invalid JPG file.Moreover,when i send the same byte [] from PictureCallback jpegCallback = new PictureCallback() method and then write a JPG file on my PC ,it works fine.</p><p>I know its a kind of encoding issue,actually byte[] which i get from onPreviewFrame is byte array of compressed image data.</p><p>I can only transfer this byte array of compressed image data through TCP from my Phone to PC.But i want to decode this data once i get this on PC.Can you guys please help me how should i proceed.</p><p>I would be very grateful for any kind of help.</p><p>Best regards,ZAI</p>","534910","","","","","2012-04-05 12:35:05","Android encoding/decoding issues","<android>","2","1","","",""
"4470936","1","4472300","","2010-12-17 13:35:54","3","25218","<p>i am new to android app development, what i need is i have two textbox username and password,it will post to server and check it with the DB using a php page, if the login success then go to next screen else show a msg box showing login error how can i do that?</p><pre class=""lang-java prettyprint-override""><code>public void postData() {    // Create a new HttpClient and Post Header    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(""http://google.com"");    EditText tw =(EditText) findViewById(R.id.EditText01);    try {        // Add your data        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);        nameValuePairs.add(new BasicNameValuePair(""id"", ""12345""));        nameValuePairs.add(new BasicNameValuePair(""stringdata"", ""AndDev is Cool!""));        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        // Execute HTTP Post Request        HttpResponse response = httpclient.execute(httppost);        int status = response.getStatusLine().getStatusCode();        tw.setText(status);    } catch (ClientProtocolException e) {        tw.setText(e.toString());    } catch (IOException e) {        tw.setText(e.toString());    }} </code></pre>","404183","","1765573","","2013-07-27 06:41:16","2013-07-27 06:41:16","How to do a HTTP Post in Android?","<php><android><http><http-post>","3","1","12","",""
"4470968","1","4471116","","2010-12-17 13:40:40","2","365","<p>I have a user id from a synced contact, I now try to retrieve the raw twitter accounts that the sync adapter from the official twitter client creates. How would I specify the MIME Type for needed to filter for the Twitter Account? </p><p>The content of the MIME Type Column is: </p><blockquote>  <p>Column Name is: mimetype Content is:  vnd.android.cursor.item/vnd.twitter.profile</p></blockquote>","114066","","","","","2010-12-17 13:58:17","How to obtain the synced twitter raw contact through the contacts api?","<android><contactscontract>","1","0","1","",""
"4471025","1","13790076","","2010-12-17 13:48:12","63","38493","<p>I would like to have a way to reference the project's manifest version number in the main part of the code. What I have been doing up until now is to link the version number in a String XML file to the manifest (@string/Version). What I would like to do is to do it the other way around, link a string XML variable to the version in the manifest. The reason? I'd like to only have to change the version number in one location, the manifest file. Is there any way to do this? Thanks!</p>","544198","","544198","","2013-11-23 01:58:05","2013-12-17 11:31:51","How can you get the Manifest Version number from the App's (Layout) XML variables?","<android><android-manifest><android-xml>","6","1","18","",""
"4471123","1","","","2010-12-17 13:58:58","0","355","<p>As topic says. I want to get the email a user has registered on their phone to log on into android market. This due to the fact that my application connects to a remote database that´s supposed to store who have done a specific thing in the app..</p><p>I´ve searched the web for similar problems, but i have´nt found a possible solution yet.. :/</p><p>Does anyone have a nice codesnippet that shows how to do this?</p><p>Thanks in advance!</p><p>/ Alex</p>","546136","","","","","2010-12-17 15:59:31","Retrieving users registered gmail that he/she uses to login to market?","<java><android><email>","2","1","2","",""
"4471169","1","4475600","","2010-12-17 14:04:30","1","170","<p>I want to develop an application for a website which provides user specific information. These user specific information of course are just visible as long as you're logged-in. Json-interface and parser will be hosted on a different server and I'm wondering how to handle the login + maintain a session in order to parse the data. The loginscript of the website which I want to parse is using POST and puts a cookie with username + md5 password. </p><p>These are all information I can provide. Thanks in advance.</p>","238801","","238801","","2010-12-17 14:06:20","2010-12-17 23:16:30","Cross-login and parsing user specific data","<php><android>","1","0","","",""
"4471228","1","4474540","","2010-12-17 14:11:48","0","165","<p>Is it possible to observe the date (e.g. like a ContentObserver) so that every time the date changes (either because the time elapsed or the user changed it manually), some code get's executed?</p><p><strong>EDIT:</strong><br>The reason why I need this is the following: I've got a list which is backed by a cursor. The cursor is the result of a SQLite statement containing a predicate <code>date >= strftime('%Y-%m-%d','now')</code>. So if the date changes, some list items have to be removed from the list (which will obviously happen after calling <code>requery()</code> on the cursor).</p>","272802","","272802","","2010-12-17 18:28:57","2010-12-17 20:33:09","Observe the date in android","<android><date><contentobserver>","2","1","","",""
"4471280","1","","","2010-12-17 14:16:08","0","274","<p>Android Webview component has a bug? </p><p>due to which it randomly stops responding to touch events. almost all Html element not working on Android browser/webview when i open my app in webview.</p><p>Thanks in advance,Onkar</p>","546142","","","","","2011-10-26 13:45:39","Android Webview component has a bug? due to which it randomly stops responding to touch events","<android><webview>","1","2","1","",""
"4471322","1","4471600","","2010-12-17 14:20:41","1","6266","<p>I have a JSONObject with the data structure as follows</p><pre><code>[{""distance"":""200 meters"",""location_id"":""519""},{""distance"":""300 meters"",""location_id"":""219""}]</code></pre><p>and I'm trying to traverse each array within that object, I have the following code where locationArray is the valid JSONObject</p><pre><code>for (int j = 0; j &lt; locationArray.length(); j++) {     JSONObject j_obj;     j_obj = locationArray.getJSONArray(j); //error here     location_id = j_obj.getString(""location_id"");}</code></pre><p>but i'm getting an error trying to find each sub array of locationArray with an integer.</p>","461631","","750987","","2011-06-16 04:24:13","2011-06-16 04:24:13","how do I traverse an android JSONArray witin a JSONObject","<android><arrays><json><multidimensional-array>","1","0","1","",""
"4471698","1","4475562","","2010-12-17 14:59:53","0","345","<p>I seldom get an empty response after a POST request in Android. The response headers and error stream are also empty.</p><p>Sometimes it works, sometimes it doesn't.</p><p>Is there something else I can do to debug this on the client side? I suspect it's some kind of bug of the <code>HttpURLConnection</code>, but I don't know how to get more info from it.</p><pre><code>HttpURLConnection con = (HttpURLConnection) url.openConnection();con.setRequestMethod(""POST"");con.setDoInput(true);con.setDoOutput(true);ostream = new DataOutputStream(con.getOutputStream());// Write POST params to ostreamostream.flush();return (InputStream) con.getContent(); // This sometimes returns an empty stream</code></pre>","143378","","","","","2011-12-13 08:43:29","How to debug an empty response after a POST request","<android><post><httpurlconnection>","1","0","","",""
"4471727","1","4471854","","2010-12-17 15:02:09","0","59","<p>I want to put a prompt into an app about requirements for it and such, but I only want this to show up the first time the app is opened. The only reason why I know it is possible is because I have seen it in other apps. I have no idea where to begin implementing it.</p><p>Does anyone know how to?</p>","348261","","","","","2010-12-17 16:07:38","How can I implement a 1-time feature on an app? (Android)","<android><warnings><prompt><once>","3","1","","",""
"4471798","1","4471832","","2010-12-17 15:09:15","13","22162","<p>I want to improve my coding skills, so I have planned write a Mobile Application.need to choose between Apple's iOS or Google's Android. </p><p><strong>my background:</strong>I have done basic programming in .Net,C/C++,Python and PHP in college, so got OOP concepts covered. about my skill level, I just know concepts and basic syntax. But can't write complex applications, if asked :(</p><p>So decided to hone my skills, And I wanted to know which is easier to learn for a programming n00b.</p><p>A) iOS which uses Objective CB) Android which uses Java</p><p>I want to decide based on difficulty level</p>","367985","","309086","","2012-10-23 10:04:38","2012-10-23 10:04:38","Which is Easier to code: Android App vs iOS App?","<java><android><objective-c><ios>","9","3","3","2012-07-04 11:52:29",""
"4471888","1","4472223","","2010-12-17 15:17:38","1","1087","<p>The AndroidManifest.xml file when compiled and packaged in the apk turns into a binary xml file. I give this information in case there is a difference between this one and regular binary xml files, but I'm not certain if there is. </p><p>I need to get information contained in this xml file. There are tools for java and python but I haven't found anything for .Net. How can I read this file in .NET ? </p><p>This is the most promising solution I've found but it still doesn't display the text in a human readable format.</p><pre><code>            using (BinaryReader b = new BinaryReader(File.Open(filePath, FileMode.Open), Encoding.ASCII))        {            int pos = 0;            int length = (int)b.BaseStream.Length;            while (pos &lt; length)            {                char v = b.ReadChar();                Console.Write(v);                pos += sizeof(char);            }        }</code></pre><p>Any ideas what I'm doing wrong ?</p><p>I've tried with different encodings when creating the binary reader and they haven't worked.</p><p>Thanks,</p>","146100","","146100","","2010-12-17 15:31:45","2010-12-17 15:53:45","Read binary XML as text in .NET","<.net><android><xml><parsing><binary>","3","0","0","",""
"4472016","1","","","2010-12-17 15:32:39","2","535","<p>I am now reading the Android SW arch from this link <a href=""http://developer.android.com/images/system-architecture.jpg"" rel=""nofollow"">http://developer.android.com/images/system-architecture.jpg</a></p><p>Suppose I need to have Android support in a brand new IC, is that I need to do the porting on LINUX KERNEL and APPLICATION FRAMEWORK? And for LIBRARIES, do I need to port it?</p><p>Also, for APPLICATION FRAMEWORK, what I think is the APPLICATION FRAMEWORK that show in the link is only for mobile phone, different product can have different APPLICATION FRAMEWORK. Am I right?</p><p>Thanks a lot</p>","536760","","","","","2012-01-05 15:39:11","Android OS Porting","<android><porting>","1","0","1","",""
"4472017","1","","","2010-12-17 15:32:44","1","337","<p>I am an Android developer. I've developed a media player that can play both local and streaming videos. But there is a problem. When I click a local media in the gallery how can I configure it to be played with my player? At least, there should be a list of media players including mine one and I should be able to choose it from this list. After succeeding this, I want to open rtsp protocoled files with my player as default. How can I do this? Waiting for your help.</p>","546230","","","","","2010-12-17 15:46:06","How to play media with my own media player as default","<java><android><video><media><rtsp>","1","0","","",""
"4472245","1","4475232","","2010-12-17 15:55:28","8","4519","<p>I recently received complaint from a user that my app was crashing.  I've extracted the following from the user's error logs and was able to see why issues where happening:</p><pre><code>12-17 10:31:12.446 I/PLAYLIST( 3158): PreparePlaylist12-17 10:31:12.446 I/PLAYLIST( 3158): URL: http://f69cbd7a-3d91-4bf5-b4c6-ddb1175cf9e9.d40f2093-2013-4ad9-aec2-e99b015d61ca.070305e7-a706-4626-9ecb-777835065841.groovera.com/listen.pls12-17 10:31:12.456 F/unknown ( 3158): stack corruption detected: aborted12-17 10:31:12.466 D/Zygote  ( 2204): Process 3158 terminated by signal (6)12-17 10:31:12.471 I/ActivityManager( 2256): Process com.android.Player:remote (pid 3158) has died.</code></pre><p>There was a stack corruption detected.  Great, so how do I find out why that's happening?</p><p>I think the issue is happening at this particular class since I was expecting more log output from it before it died.  This class uses sockets to download playlist and parse it.  How could I be corrupting the stack? I have dealt with stack overflows in C/C++, but how do I handle it in Java?</p><p>Thanks for your help!</p>","398248","","154306","","2012-12-19 11:54:20","2012-12-19 11:54:20","Crash due to ""stack corruption detected: aborted""","<android><stack-corruption>","1","5","4","",""
"4472246","1","4472270","","2010-12-17 15:55:29","2","592","<p>How do you determine the size of a component rather than calculating the sizes of all components including the screen and the parent component's sizes of the component?</p><p>I have developed a few apps using android 1.6 but all of them are based on the screen size of the target phones. Since Android is not like Symbian OS, I believe I can create an app that can be installed to any phone running Android OS as long as OS versions are honored.</p><p>Say, I am developing for HTC Desire HD. How do I know what should be the window screen size in pixels knowing that Desire has a screen dimension of 4.3 inches?</p><p>Thanks.</p>","546256","","","","","2010-12-17 15:57:39","Determining App's Window/Screen Size","<android><screen><dimension>","1","0","2","",""
"4472253","1","4487003","","2010-12-17 15:56:22","1","3560","<p>I followed the guide here: <a href=""http://developer.appcelerator.com/guides/en/app_structure.html"" rel=""nofollow"">http://developer.appcelerator.com/guides/en/app_structure.html</a></p><p>to use high &amp; medium density images for android.</p><p>My file structure is:</p><pre><code>/Resources/Resources/android/Resources/android/images/Resources/android/images/high/ic_menu_add.png/Resources/android/images/medium/ic_menu_add.png/Resources/android/images/default.png/Resources/user/Resources/user/super.js/Resources/app.js</code></pre><p>the default.png loads as expected.</p><p>I added 6 buttons to my menu in super.js (to try and debug this):</p><pre><code>var activity = Ti.Android.currentActivity;activity.onCreateOptionsMenu = function(e) {  var menu = e.menu;  var menuItem1 = menu.add({ title: ""1"" });  menuItem1.setIcon(""/images/ic_menu_add.png"");  menuItem1.addEventListener(""click"", function(e) {  });  var menuItem2 = menu.add({ title: ""2"" });  menuItem2.setIcon(""../images/ic_menu_add.png"");  menuItem2.addEventListener(""click"", function(e) {  });  var menuItem3 = menu.add({ title: ""3"" });  menuItem3.setIcon(""../ic_menu_add.png"");  menuItem3.addEventListener(""click"", function(e) {  });  var menuItem4 = menu.add({ title: ""4"" });  menuItem4.setIcon(""/images/ic_menu_add.png"");  menuItem4.addEventListener(""click"", function(e) {  });  var menuItem5 = menu.add({ title: ""5"" });  menuItem5.setIcon(""/ic_menu_add.png"");  menuItem5.addEventListener(""click"", function(e) {  });  var menuItem6 = menu.add({ title: ""6"" });  menuItem6.setIcon(""ic_menu_add.png"");  menuItem6.addEventListener(""click"", function(e) {  });}</code></pre><p>When I press the menu button:</p><pre><code>12-15 14:23:59.091: INFO/TiFileHlpr(537): (main) [4617,7631] /images/ic_menu_add.png not found.12-15 14:23:59.101: INFO/TiFileHlpr(537): (main) [4,7635] ../images/ic_menu_add.png not found.12-15 14:23:59.121: INFO/TiFileHlpr(537): (main) [25,7660] ../ic_menu_add.png not found.12-15 14:23:59.121: INFO/TiFileHlpr(537): (main) [3,7663] /images/ic_menu_add.png not found.12-15 14:23:59.131: INFO/TiFileHlpr(537): (main) [5,7668] /ic_menu_add.png not found.12-15 14:23:59.140: INFO/TiFileHlpr(537): (main) [5,7673] ic_menu_add.png not found.</code></pre><p>The official guide says to use just 'ic_menu_add.png' which is case 6 and doesn't work.</p><p>The build directory looks like this:</p><pre><code>/build/android/res/drawable-hdpi/ic_menu_add_ad7ef1aa68.png/build/android/res/drawable-mdpi/ic_menu_add_ad7ef1aa68.png</code></pre><p>My custom AndroidManifest.xml has this section in it:</p><pre><code>&lt;supports-screens    android:largeScreens=""true""   android:anyDensity=""true""   android:normalScreens=""true""  android:smallScreens=""true""/&gt;</code></pre><p>Anyone know the proper way to get multiple density images to work? [I'm using mobile sdk 1.5.x]</p>","545447","","1140748","","2012-05-06 16:15:34","2012-05-06 16:15:34","Titanium/Appcelerator for Android: Multiple density images not found","<android><image><titanium><appcelerator>","1","0","","",""
"4472263","1","4472545","","2010-12-17 15:57:08","0","259","<p>I have a class A which extends Activity. From the class A ,I am calling Adapter class B which extends BaseAdapter.</p><p>I am displaying ListView data from within the overriden method public View getView(final int position, View convertView, ViewGroup parent)</p><p>I am fetching the data for the ListView from SQLite. Now on clicking on a cancel button for a specific listitem , I am able to delete the record the data from the database , but unable to refresh the view . Still the data is being displayed . But if again I navigate to the screen from the home screen , the data is not being displayed , indicating there is no problem with the database , only updating display is a issue .</p><p>The skeletal code is as follows:</p><pre><code>class A extends Activity {    B adapter ;    ListView list ;    public void onCreate(Bundle savedInstanceState) {        list = (ListView) findViewById(R.id.textList);        // I am calling the adapter        adapter = new B(this, txtStr);        list.setAdapter(adapter);    }    class B extends BaseAdapter{        public View getView(final int position, View convertView, ViewGroup parent){            // on click of the delete button , record is delated for a specific            // listitem &amp; the view needs to be updated , but I am unable to update the view            holder.deleteImage.setOnClickListener(new OnClickListener() {                    private int pos = position;                    public void onClick(View v) {// (position)) -- what was this doing here? (dbreslau)                        sampleDB.execSQL(""DELETE FROM "" + Constants.TABLE_NAME + "" where id = 1"");                        adapter.notifyDataSetChanged();                    }                });        }    }}</code></pre><p><strong>Even after calling the notifyDataSetChanged , the view is not getting updated.Kindly help if anyone already implemented the same.</strong></p>","443141","","71034","","2010-12-17 16:11:54","2010-12-17 19:20:06","Unable to upate ListView data","<android>","1","2","","",""
"4472417","1","4472504","","2010-12-17 16:10:51","0","99","<p>Is there a way to tell an ImageView to be as tall as it is wide? Something like:</p><pre><code>&lt;ImageView  layout_width=""fill_parent""  layout_height=""whatever width ends up being""  /&gt;</code></pre><p>Thanks</p>","291701","","","","","2010-12-21 06:41:58","Make ImageView be as tall as it is wide?","<android>","1","1","1","",""
"4472429","1","4472612","","2010-12-17 16:12:02","31","32853","<p>can this attribute be changed dynamically in Java code? </p><p><code>android:layout_marginRight</code></p><p>I have a TextView, that has to change its position some pixels to the left dynamically.</p><p>I think it has to be done programmatically.</p><p>How can I do it?</p>","479886","","321697","","2010-12-17 16:24:17","2014-01-15 18:16:04","Change the Right Margin of a View Programmatically?","<android><layout><textview>","2","0","7","",""
"4472447","1","","","2010-12-17 16:14:20","3","3137","<p>I am using BroadCast Listener to listen to incoming phone stat then pushing a Notification like this:</p><pre><code>    CharSequence contentTitle = ""Contact: "" + number;    CharSequence contentText = ""Call From: "" + number;    Intent notificationIntent = new Intent(context, CallHandler.class);    notificationIntent.putExtra(KEYS.NUMBER, number);    notificationIntent.putExtra(KEYS.STATE, stat);    notificationIntent.putExtra(KEYS.NAME, name);    notificationIntent.putExtra(KEYS.DURATION, duration);    notificationIntent.putExtra(KEYS.START_TIME, startTime);    PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);    notif.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    notif.flags |= Notification.FLAG_AUTO_CANCEL;    notificationManager.notify((int) System.currentTimeMillis(), notif);</code></pre><p>So when there are multiple calls, I expect to have multiple call notification and when I click each notification, I expect to start an activity with the attached parameters. However, I can see that the Activities that starts later, gets the Intent of the previous call. </p><p>Here is how I am looking into intent from the Activity</p><pre><code>        Bundle extras = getIntent().getExtras();    String number = extras.getString(KEYS.NUMBER);    // String state = extras.getString(KEYS.STATE);    long duration = extras.getLong(KEYS.DURATION);    Date start = getStartDate();    ((TextView) findViewById(R.id.subject)).setText("""");    ((TextView) findViewById(R.id.start_time)).setText(tf.format(start));    ((TextView) findViewById(R.id.end_time)).setText(tf            .format(getEndDate()));    ((TextView) findViewById(R.id.caller_number)).setText(number);    ((TextView) findViewById(R.id.notes)).setText(getNotesDefaultContent(            number, duration, start));</code></pre><p>How can I keep the intents separately call independent activity?</p>","321098","","","","","2013-03-01 10:56:14","Confusing behavior when starting new activity with PendingIntent","<android>","3","2","1","",""
"4472466","1","","","2010-12-17 16:16:10","2","393","<p>I have a simple game</p><p>It displays a list of items that the user selects from with game timer.</p><p>I am using native Android widgets in an Activity and a Service to control the game.  This has turned out to be cumbersome and my Activity is getting bloated and difficult to maintain.</p><ol><li>I have a timer (currently I am using a count down timer)</li><li>I need to keep track of scores and rounds</li><li>I need to restore the state when the game changes orientation</li><li>I need to access a database.</li><li>I need different states in the game (buttons cannot be pressed, and sometimes they can)</li><li>I need to pull as much out of the Activity as I can</li></ol><p>I don't need a canvas, but can someone suggest the best pattern I could use for this?  What are the main classes I would have, do I need a game thread etc.</p>","248521","","","","","2010-12-17 16:31:10","Need a simple maintainable design pattern for a game in Android","<android>","1","0","","",""
"4472483","1","","","2010-12-17 16:17:28","-2","299","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6685027/good-tutorial-for-sqlite-and-listview"">Good Tutorial for SQLite and ListView</a>  </p></blockquote><p>I'm trying to find some code that will return to a ListView in Android all of the values of a particular field in a SQLite database.  Does anyone have a simple example?</p><p>ThanksMike</p>","490698","","","","","2011-12-21 15:34:11","Android: Returning in a Listview all values from a field in a SQLite","<android><sqlite><listview>","1","1","","2011-12-18 06:56:33",""
"4472613","1","9137857","","2010-12-17 16:30:59","4","888","<p>how can I programmatically set the system volume for voice call when using a bluetooth earpiece?</p><p>Using this:</p><pre><code>mAudioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, myVolume, 0);</code></pre><p>when a call (using the Earpice) is in progress it doesn't change anything.</p><p>I searched a lot before posting, but can't find any hint on how to do it.</p><p>Thanks in advance.</p>","476846","","","","","2012-02-04 02:15:09","Android Bluetooth Earpiece Volume","<android><bluetooth><volume>","1","0","0","",""
"4472663","1","4473170","","2010-12-17 16:35:48","0","539","<p>I have a countdown timer application, and when I change the orientation from vertical to horizontal on my phone, the countdown text no longer displays, and when I switch it back it does not come back, unless, I hit start again, which shouldn't be there in the first place, because the button changes to pause when it starts, but when I flip it, the countdown indicator goes blank and the button says start, even though the countdown is running, and displays an onFinish().</p>","484707","","","","","2010-12-17 17:28:54","When changing device orientation, I lose text input, how can I fix this","<android><layout><orientation>","3","0","","",""
"4472745","1","4474602","","2010-12-17 16:43:25","1","2066","<p>I want to create a web page that has two links.  One that downloads the agent itself (which is pretty easy, just linking to the APK file with the appropriate MIME types set), and the other to start the install process for the APK downloaded in step one.  </p><p>I know they can just pull down the bar and click on it, but that can be confusing for users (especially in the overall process we are trying to create).  Is there a special URI I can use to start the installation, sort of like the market link of ""market://""?</p><p>Also, is there a way to get meta-data surrounding where the APK was actually installed from? For example, if the link for the APK is ""http://company.com/setting=123"", that I can pull in the ""setting=123"" from the URL?  I suspect not, but I figured it couldn't hurt to ask.</p>","261513","","","","","2010-12-18 04:55:15","Android Installation of APK via Browser Link","<android><installation><apk>","2","0","1","",""
"4472835","1","4472989","","2010-12-17 16:52:56","0","733","<p>I'm developing an Android 2.2 aplication.</p><p>I use SQlite3 to store some text that would be displayed inside a TextView.</p><p>I want to add some new line and carriage return to that text, but I don't know if I can use '\n' and '\r' inside SQlite3.</p><p>Any advice?</p>","68571","","","","","2010-12-18 00:44:59","Special chars \n and \r on Android","<java><android><sqlite3>","2","2","","",""
"4472891","1","","","2010-12-17 17:00:24","70","62823","<p>I am creating a mobile web page that is basically a big form with several text inputs.</p><p>However (at least on my Android cellphone), every time I click on some input the whole page zooms there, obscuring the rest of the page. Is there some HTML or CSS command to disable this kind of zoom on moble web pages?</p>","305597","","","","","2014-01-20 22:35:13","How can I ""disable"" zoom on a mobile web page?","<android><html><css><mobile>","3","3","15","",""
"4472950","1","4473018","","2010-12-17 17:07:38","1","407","<p>I am trying to determine how to keep my app safe under various Android lifecycle conditions, such as another app being start, phone going to sleep, etc.  I understand the lifecycle states and the event methods I can hook into, but I am not sure how memory is handled in regard to things I already had references to.  I am well aware that my app may be killed at any time if the OS needs to, but what about individual references?  Here are a few example scenarios: if my app is running and the user gets a phone call, or the user starts another app, or the phone goes to sleep.  Assuming my app did not get killed, can I safely use my references or will I get random null pointers?  I guess what this comes down to is...  does Android either kill or not kill and app or will it reclaim some memory (where there are still valid references) from an app without killing it?</p>","510902","","","","","2010-12-17 17:22:08","Android Memory Management for Lifecycle","<android><memory-management><lifecycle>","2","0","","",""
"4473254","1","","","2010-12-17 17:39:39","0","503","<p>I have a problem with the softkeyboard in my application. When i press the edit text the soft keyboard appears over the edit text. I read the documentation from android and i put in AndroidManifest.xml android:windowSoftInputMode=""adjustResize""> but it's not working. Can anyone help me resolve this problem> Please, it's urgent. Thanks in advance.</p>","477758","","21234","","2010-12-17 17:40:29","2010-12-20 12:30:07","Android Resize my application when i call ssoftkeyboard","<android><resize><android-softkeyboard>","1","1","","",""
"4473397","1","","","2010-12-17 17:56:33","2","3207","<p>I have 10 <em>TextViews</em> in my code and i would like to change font size on all of them. On my layout i have used a <em>@style</em> to define common properties however i don't know how to change them all from code once layout is on screen.</p><p>What i dont want to do is update N objects but write only in one place. I know that i could use <em>applyTheme</em> but this assumes that you have an XML theme somewhere on disk, i want to be able to scale fonts to any size so this solution is not practical.</p><p>Any idea?</p>","376579","","","","","2010-12-17 19:00:57","Dynamically change size of multiple textview from code (without a ""on disk"" xml theme)?","<android><dynamic><textview><font-size>","1","1","","",""
"4473414","1","","","2010-12-17 17:58:47","-2","1018","<p>Does anyone know if Google has plans to offer the Nexus S for Android developers at a reduced price?  If not, is the best option to pay the higher price at Best Buy without the T-Mobile contract?  Thanks for your help.</p>","542713","","89806","","2011-01-02 09:50:48","2011-01-02 09:50:48","Nexus S for Android Developers","<android><nexus-s>","1","3","","2010-12-17 18:10:41",""
"4473532","1","4473685","","2010-12-17 18:13:59","2","5272","<p>i have a tabhost with some tabs, and each tab have implemented the method onresume, because i need to reload all the data from a remote database each time the user enter again in a tabhost, not only the first time he opens it.</p><p>ok, it works nice, but the problem is that when the user opens for the first time a tab, the two methods, onCreate and onResume are called, then, my app connect two times into the database to retrieve the info.... i want only to be called onCreate when the user enter for the first time into the tabhost</p><p>how to avoid this rare problem?</p>","479886","","","","","2010-12-17 20:20:46","Why onResume is called when i open for the first time the tab of a tabhost?","<android><android-tabhost><onresume>","3","0","2","",""
"4473573","1","4473843","","2010-12-17 18:19:27","6","3908","<p>I am having an issue with my application. I recently added ScrollView as the Parent of LinearLayout. When flip my device orientation to Landscape, my buttons get cut off on the top. I can see the last button just fine with extra ""black space"" at the end of it when I scroll down, only the top gets cut off. I looked around and I am not sure why this is happening. Here are some pictures so you can understand how it looks.</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center""    android:gravity=""center_vertical""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center""&gt;    &lt;Button         android:id=""@+id/BeefButton""         android:layout_height=""wrap_content""        android:layout_width=""match_parent""        android:layout_gravity=""center""        android:background=""@drawable/backgroundlayer""        android:drawableLeft=""@drawable/beefbutton""        android:text=""Beef""        android:textColor=""#FFFFFF""        android:textSize=""32px""        android:textColorHighlight=""#FF6600""/&gt;     &lt;Button         android:id=""@+id/PoultryButton""         android:layout_height=""wrap_content""        android:layout_gravity=""center""         android:layout_width=""match_parent""        android:background=""@drawable/backgroundlayer""        android:drawableLeft=""@drawable/chickenbutton""        android:text=""Poultry""        android:textColor=""#FFFFFF""        android:textSize=""32px""                android:textColorHighlight=""#FF6600""/&gt;    &lt;Button         android:id=""@+id/FishButton""         android:layout_height=""wrap_content""        android:background=""@drawable/backgroundlayer""        android:drawableLeft=""@drawable/fishbutton""        android:text=""Fish""        android:textColor=""#FFFFFF""        android:textSize=""32px""         android:textColorHighlight=""#FF6600""        android:layout_gravity=""center""         android:layout_width=""match_parent""/&gt;    &lt;Button         android:id=""@+id/PorkButton""         android:layout_height=""wrap_content""        android:background=""@drawable/backgroundlayer""        android:drawableLeft=""@drawable/porkbutton""        android:text=""Pork""        android:textColor=""#FFFFFF""        android:textSize=""32px""         android:textColorHighlight=""#FF6600""        android:layout_gravity=""center""         android:layout_width=""match_parent""/&gt;    &lt;Button         android:id=""@+id/VegetablesButton""         android:layout_height=""wrap_content""        android:background=""@drawable/backgroundlayer""        android:drawableLeft=""@drawable/vegetablesbutton""        android:text=""Vegetables""        android:textColor=""#FFFFFF""        android:textSize=""32px""         android:textColorHighlight=""#FF6600""        android:layout_gravity=""center""         android:layout_width=""match_parent""/&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","484707","","201905","","2013-11-08 17:48:56","2013-11-08 17:48:56","Android Landscape mode cutting off my buttons on top","<android><scrollview><android-linearlayout>","3","3","2","",""
"4473672","1","","","2010-12-17 18:31:38","1","1171","<p>i would like to develop a browser plugin for Android and have some questions:</p><ol><li>Will it be usable at all android devices?</li><li>Is <a href=""http://android.git.kernel.org/?p=platform/development.git;a=tree;f=samples/BrowserPlugin;h=1f803ad4df5c068089cd7f0ccb8981dccc1782f3;hb=HEAD"" rel=""nofollow"">this example</a> up-to-date?</li><li>I tried the example given above, but it fails because it doesn't find npapi.h and so on. How do i have to set up my environment (webkit?)</li></ol><p>For clarification: I need to react to an object embedden in an html site similar like this</p><pre><code>&lt;object type=""application/x-mytype"" height=50 width=250 param name=""param1"" value=""value1"" /&gt;...&lt;/object&gt;</code></pre><p>read out the parameters and start an application with them</p>","546396","","104117","","2010-12-20 10:28:39","2010-12-20 10:28:39","Android Browser Plugin Development","<android><android-ndk>","0","4","","",""
"4473747","1","","","2010-12-17 18:41:52","8","1870","<p>I'm developing an android program that shares data via POST with an App Engine program, all in java. When I POST using MultipartEntity the appengine program is unable to see any of my POST variables for some reason that I can't figure out!</p><p><strong>Appengine Code:</strong></p><pre><code>public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {    resp.setContentType(""text/plain"");    resp.getWriter().println(""Output:"");    String mRoutine = req.getParameter(""Routine"");    resp.getWriter().println(""Routine: "" + mRoutine);    String mPMode = req.getParameter(""PMode"");    resp.getWriter().println(""PMode: "" + mPMode);}</code></pre><p><strong>Working Android Snippet:</strong></p><pre><code>HttpPost post = new HttpPost(""http://XXX.appspot.com/Echo"");HttpClient client = new DefaultHttpClient();post.setEntity(new UrlEncodedFormEntity(data,HTTP.UTF_8));HttpResponse response = client.execute(post);HttpEntity resmarkMessagesReadFrom = response.getEntity();if (resmarkMessagesReadFrom != null) {    Result_STR= ""Response:\n"" + EntityUtils.toString(resmarkMessagesReadFrom);    mMSGBox.setText(Result_STR);}</code></pre><p><strong>Failing Android Snippet:</strong></p><pre><code>HttpPost post = new HttpPost(""http://XXX.appspot.com/Echo"");HttpClient client = new DefaultHttpClient();MultipartEntity reqmarkMessagesReadFrom = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);try {    reqmarkMessagesReadFrom.addPart(""Routine"", new StringBody(""Neutral""));    post.setEntity(reqmarkMessagesReadFrom);    HttpResponse response = client.execute(post);    HttpEntity resmarkMessagesReadFrom = response.getEntity();    if (resmarkMessagesReadFrom != null) {        Result_STR= ""Response:\n"" + EntityUtils.toString(resmarkMessagesReadFrom);        mMSGBox.setText(Result_STR);    }</code></pre>","325272","","130929","","2011-01-12 14:27:24","2011-01-31 08:10:54","Android Multipart POST to Google App Engine not working","<java><android><google-app-engine><http-post>","2","0","","",""
"4473748","1","4474135","","2010-12-17 18:41:57","1","511","<p>I got an activity that launches the package manager for installing an application contained in the phone's SDCard.</p><p>Is there some kind of hook that gets executed if the installation was successful|unsuccessful?</p><p>Thanks a bunch.</p>","502232","","","","","2010-12-17 19:36:56","Hook after successful installation","<android><installation><android-package-managers>","1","0","","",""
"4473772","1","4474192","","2010-12-17 18:44:11","1","594","<p>I have been attempting to play a bunch of sounds in my app as some views switch. The sound is narrative for the views and is between 3 and 10 seconds each, of which there are about 30.</p><p>First, I tried loading them all into a sound pool and passing it to a hashmap on program load, then I simply play them when required. This worked for the first 5 or 6 sounds but once I started to add more sounds to the sound pool, the later ones did not play. I assume this is due to the 1MB limit I have read about on soundpool.</p><p>I tried switching to just loading the sound and passing it straight to play on the next line however, no sounds play. Logcat just shows a reset and command cancelled for the player.</p><p>I switched then to loading the file and pointing to it with the hash map, however, even after doing an unload and loadimg a new sound at the same index it would just play the same sound every time.</p><p>I have tried MediaPlayer but it is ineffective for my desired application.</p><p>Can anyone suggest a way I should look to implement this properly? And should I be trying to load all sounds before hand or not? Thanks</p>","353674","","","","","2010-12-17 19:45:34","Android, load sounds and play immediatly?","<android><audio><media-player>","1","0","","",""
"4473781","1","4473885","","2010-12-17 18:45:15","0","226","<p>I wanted to know if there is a way to place a button on the bottom of the screen, no matter what size screen the device has. I basically want the button to have a gravity=""bottom"", not just its text. I have been trying to do this, and I cannot find a way to do it. any suggestions?</p>","484707","","","","","2010-12-17 18:59:23","Android button dynamically placed on button","<android><layout><button><gravity>","4","1","","",""
"4473940","1","4474518","","2010-12-17 19:07:44","19","22712","<p>What is the ""correct"" way to return the values to the calling activity from a complex custom dialog - say, text fields, date or time picker, a bunch of radio buttons, etc, plus a ""Save"" and ""Cancel"" button?</p><p><strong>Some</strong> of the techniques I've seen on the web include:</p><ul><li><p>public data members in the Dialog-derived class which can be read by the Activity</p></li><li><p>public ""get"" accessors . . . "" . .  ""  . . ""</p></li><li><p>Launching the dialog with an Intent (as opposed to <em>show()</em> ) plus handlers in the Dialog class which take input from the various controls and bundle them up to be passed back to the Activity so when listener hits ""Save"" the bundle is passed back using  <em>ReturnIntent()</em></p></li><li><p>Listeners in the Activity which process input from the controls that are in the dialog e.g., so the TimePicker or DatePicker's listeners are really in the Activity.  In this scheme practically all the work is done in the Activity</p></li><li><p>One Listener in the Activity for the ""Save"" button and then the Activity directly interrogates the controls in the dialog; the Activity dismisses the dialog.</p></li></ul><p>...plus more that I've already forgotten.  </p><p>Is there a particular technique that's considered the canonically correct or ""best practice"" method?</p>","424690","","2433501","","2014-02-17 21:47:15","2014-02-17 21:47:15","Android ""Best Practice"" returning values from a dialog","<android>","4","0","2","",""
"4474030","1","4475441","","2010-12-17 19:23:45","0","568","<p>World of Warcraft is off the table, because of the ""WOW Glider Lawsuit"" of 2008. Also see: <a href=""http://stackoverflow.com/questions/4473851/where-is-blizzards-official-world-of-warcraft-api"">Where is Blizzards official World of Warcraft API?</a></p><p>But, what is the most popular (in terms of usership) MMO Game that does allow programmers to develop out-of-game things (like an Android app).</p>","420259","","50776","","2012-07-26 13:40:27","2012-07-26 13:40:27","What is the most popular MMO game that has an out-of-game API","<android>","1","1","","2010-12-18 00:30:38",""
"4474070","1","4474109","","2010-12-17 19:29:18","0","305","<p>Here is my simple example. I defined a button in main.xml file, and 'on Click' property to call my onClickk method when button01 is tapped. It is perfectly fine, but I don't understand why should I pass <code>View</code> object when I want to pass simply <code>Button</code> and do no casting.</p><p>If I'm passing the button as Button the application stops unexpectedly when I tap the button.</p><pre><code>public class Als extends Activity {    Button button01;     /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button01 = (Button) findViewById(R.id.Button01);        button01.setText(""something"");    }    public void onClickk(View button01) {        Button but = (Button) button01;        but.setText(""Cooool"");    }}</code></pre>","397991","","","","","2010-12-17 22:24:12","Why should I use View argument instead of whatever I want?","<android>","2","0","","",""
"4474095","1","4474250","","2010-12-17 19:32:33","1","937","<p>I am using Secure.Android_Id for getting unique id of the device. But I need to pass it to as GUID for a service. Is there a easy way to create that? </p><p>The basic code I wrote looks something like <strong>this</strong>: </p><p><code>            String android_id = getAndroidId();        long leastSignificantBits = 0;        long mostSignificantBits = 0;        UUID uuid = null;</p><pre><code>    if (android_id != null) {        String asciiConvertedText = """";        int len = android_id.length();        for (int i = 0; i &lt; len; i++) {            asciiConvertedText += """" + ((short) android_id.charAt(i));        }        len = asciiConvertedText.length();        if (len &gt; 16) {            leastSignificantBits = Long.parseLong(asciiConvertedText.substring(0, 15));            if (asciiConvertedText.length() &gt; 31) {                mostSignificantBits = Long.parseLong(asciiConvertedText.substring(16, 31));            } else {                mostSignificantBits = Long.parseLong(asciiConvertedText.substring(32,                        asciiConvertedText.length()));            }            uuid = new UUID(mostSignificantBits, leastSignificantBits);        } else if (len &gt; 0) {            leastSignificantBits = Long.parseLong(asciiConvertedText);            uuid = new UUID(mostSignificantBits, leastSignificantBits);        } else {            uuid = UUID.randomUUID();        }    }    if (uuid != null) {        deviceUUID = uuid.toString();    }</code></pre><p></code></p>","207552","","207552","","2010-12-17 19:54:00","2010-12-18 22:13:37","Android_id to guid?","<android>","1","0","1","",""
"4474178","1","4474455","","2010-12-17 19:43:29","2","1343","<p>Here's a layout:</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;RelativeLayout        android:id=""@+id/first_tv_container""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:focusable=""true""        android:background=""@android:drawable/list_selector_background""&gt;        &lt;TextView            android:id=""@+id/first_tv""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.""            android:singleLine=""true""            android:ellipsize=""marquee""            android:duplicateParentState=""true""/&gt;    &lt;/RelativeLayout&gt;    &lt;TextView        android:id=""@+id/second_tv""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.""        android:singleLine=""true""        android:ellipsize=""marquee""        android:focusable=""true""        android:background=""@android:drawable/list_selector_background""/&gt;&lt;/LinearLayout&gt;</code></pre><p>When second_tv gets the focus, second_tv's marquee is activated as expected. When first_tv_container gets the focus, I would like first_tv's marquee to be as well. I thought adding duplicaParentState=true to first_tv would do the trick, but it doesn't. So my question would be: is there a standard, easy way to have a TextView's marquee working inside a focused ViewGroup (other than a ListView, which automatically handles the case correctly) without extending and overriding a lot of stuff?</p><p>Regards</p>","448783","","","","","2010-12-17 20:21:32","How to activate a marquee for a TextView inside a focused ViewGroup?","<android>","1","0","","",""
"4474237","1","4474533","","2010-12-17 19:50:30","27","11012","<p>How can I do something like a <code>FlowLayout</code> in Android? </p>","508377","","119895","","2012-10-31 14:53:51","2013-10-19 13:15:35","How can I do something like a FlowLayout in Android?","<android>","5","0","14","",""
"4474470","1","4474510","","2010-12-17 20:23:47","0","783","<p>Hey guys as far as i don't have real android phone I wanted to ask this question.in my MapActivity which is extended from LocationListener, the onCreate method initializes ""location"" element as following : </p><pre><code>location = locationManager.getLastKnownLocation(provider);</code></pre><p>When I start my app, the location is always null until I send points from DDMS.I wanted to know, in real device what would be the behavior? </p>","536853","","","","","2010-12-17 20:28:21","location is null - is it the same behavior in real device?","<android><location>","1","1","","",""
"4474508","1","10877432","","2010-12-17 20:27:59","8","14781","<p>Is there any way to access accelerometer data using Javascript on Android's browser?  I know it supports ""onorientationchange"", but I'd like to get everything.</p><p>Clarification: I'm asking how to do this in a website, not a native app.</p>","51759","","51759","","2010-12-19 19:31:12","2013-06-27 05:39:16","Access accelerometer via Javascript in Android?","<javascript><android><accelerometer>","7","3","3","",""
"4474627","1","4474675","","2010-12-17 20:47:21","0","1904","<p>when I call this method the blue dot is not appearing on the map, until i send location from ddms,then suddenly it appears.</p><pre><code>    private void findMyLocation(final Location location){    final MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView);    myLocationOverlay.enableMyLocation();    myLocationOverlay.enableCompass();    final GeoPoint point = new GeoPoint((int) (location.getLatitude() * 1E6),            (int) (location.getLongitude() * 1E6));    controller.animateTo(point);    controller.setCenter(point);    mapView.getOverlays().add(myLocationOverlay);    mapView.postInvalidate();}</code></pre><p>how can i show that blue dot right after calling this method?thanks a lot.</p>","536853","","","","","2010-12-17 20:54:09","MyLocationOverlay doesn't appear","<android><location>","1","1","1","",""
"4474658","1","4498602","","2010-12-17 20:51:40","1","351","<p>When I launch an Android app via Ctrl+F11 on Eclipse, there are two black command windows (DOS-like) that appear briefly with some important messages in them. Obviously, I can't read what's in them in that brief moment.</p><p>Is there a way to pause/freeze them?</p><p>Update: @Mayra's answers below provided great tips but they did not solve the problem of pausing/freezing these windows. I know for sure that they contain information <strong>not</strong> in the Console and not in the logcat. So the question remains.</p>","418055","","418055","","2010-12-17 22:23:43","2010-12-24 15:40:21","How do I pause the command window when launching an app?","<android><eclipse><debugging><android-emulator>","2","0","","",""
"4474872","1","4475078","","2010-12-17 21:24:55","1","846","<p>I have a Java class that encrypts a string and then converts it to Base64, which is used in an Android Application: (this code was used from this example (note the spaces in the hyperlink): http ://stackoverflow.com/ questions/2090765/encryption-compatable-between-android-and-c)</p><pre><code>public class encryption {public static final String TAG = ""smsfwd""private static Cipher aesCipher;private static SecretKey secretKey;private static IvParameterSpec ivParameterSpec;private static String CIPHER_TRANSFORMATION = ""AES/CBC/PKCS5Padding"";private static String CIPHER_ALGORITHM = ""AES"";//the secret key in HEX is 'secretkey'private static byte[] rawSecretKey = {Ox73, Ox65, Ox63, Ox72, Ox65, Ox74, Ox6B, Ox65, Ox79};private static String MESSAGEDIGEST_ALGORITHM = ""MD5"";public encryption(String passphrase) {    byte[] passwordKey = encodeDigest(passphrase);    try {        aesCipher = Cipher.getInstance(CIPHER_TRANSFORMATION);    } catch (NoSuchAlgorithmException e) {        Log.e(TAG, ""No such algorithm "" + CIPHER_ALGORITHM, e);    } catch (NoSuchPaddingException e) {        Log.e(TAG, ""No such padding PKCS5"", e);    }    secretKey = new SecretKeySpec(passwordKey, CIPHER_ALGORITHM);    ivParameterSpec = new IvParameterSpec(rawSecretKey);}//base 64 encryptionpublic String encryptAsBase64(byte[] clearData) {    byte[] encryptedData = encrypt(clearData);    return base64.encodeBytes(encryptedData);}public byte[] encrypt(byte[] clearData) {    try {        aesCipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec);    } catch (InvalidKeyException e) {        Log.e(TAG, ""Invalid key"", e);        return null;    } catch (InvalidAlgorithmParameterException e) {        Log.e(TAG, ""Invalid algorithm "" + CIPHER_ALGORITHM, e);        return null;    }    byte[] encryptedData;    try {        encryptedData = aesCipher.doFinal(clearData);    } catch (IllegalBlockSizeException e) {        Log.e(TAG, ""Illegal block size"", e);        return null;    } catch (BadPaddingException e) {        Log.e(TAG, ""Bad padding"", e);        return null;    }    return encryptedData;}private byte[] encodeDigest(String text) {    MessageDigest digest;    try {        digest = MessageDigest.getInstance(MESSAGEDIGEST_ALGORITHM);        return digest.digest(text.getBytes());    } catch (NoSuchAlgorithmException e) {        Log.e(TAG, ""No such algorithm "" + MESSAGEDIGEST_ALGORITHM, e);    }    return null;}</code></pre><p>}</p><p>And the base 64 encryption comes from (note the spaces in the hyperlink) http ://iharder.sourceforge.net/current/java/base64/ </p><p>What happens is that this gets passed to a C#/.net server for decryption and everything works great on the Android.  The issue is now converting this to Objective-C for use on the iPhone.</p><p>I have done a lot of research and the answer that has come closest is <a href=""http://dotmac.rationalmind.net/2009/02/aes-interoperability-between-net-and-iphone/"" rel=""nofollow"">http://dotmac.rationalmind.net/2009/02/aes-interoperability-between-net-and-iphone/</a></p><p>However, when I use that example (code taken straight from the downloaded zip), I'm getting a 'Padding is invalid and cannot be removed.' error server side.</p><p>My server side code is:</p><pre><code>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Text;using System.Security.Cryptography;namespace test.Business{    public class Crypto    {        private ICryptoTransform rijndaelDecryptor;        // Replace me with a 16-byte key, share between Java and C#        private static byte[] rawSecretKey = {Ox73, Ox65, Ox63, Ox72, Ox65, Ox74, Ox6B, Ox65, Ox79};        public Crypto(string passphrase, bool encrypt)        {            byte[] passwordKey = encodeDigest(passphrase);            RijndaelManaged rijndael = new RijndaelManaged();            if(encrypt)                rijndaelDecryptor = rijndael.CreateEncryptor(passwordKey, rawSecretKey);            else                rijndaelDecryptor = rijndael.CreateDecryptor(passwordKey, rawSecretKey);        }        public Crypto(string passphrase)        {            byte[] passwordKey = encodeDigest(passphrase);            RijndaelManaged rijndael = new RijndaelManaged();            rijndaelDecryptor = rijndael.CreateDecryptor(passwordKey, rawSecretKey);        }        private string Decrypt(byte[] encryptedData)        {            byte[] newClearData;            try            {                newClearData = rijndaelDecryptor.TransformFinalBlock(encryptedData, 0, encryptedData.Length);            }            catch            {                throw;            }            return Encoding.ASCII.GetString(newClearData);        }        internal string DecyptString(string token)        {            //UTF8Encoding utf8 = new UTF8Encoding();            return Decrypt(ASCIIEncoding.ASCII.GetBytes(token));        }        internal string DecryptFromBase64(string encryptedBase64)        {            return Decrypt(Convert.FromBase64String(encryptedBase64));        }        private byte[] encodeDigest(string text)        {            MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();            byte[] data = Encoding.ASCII.GetBytes(text);            return x.ComputeHash(data);        }        //Encryption Code        public string EncryptAsBase64(string strData)        {            byte[] clearData = Encoding.ASCII.GetBytes(strData);            byte[] encryptedData = Encrypt(clearData);            return Convert.ToBase64String(encryptedData);        }        public byte[] Encrypt(byte[] clearData)        {            byte[] test1 = new byte[clearData.Length];            try            {                               test1 = rijndaelDecryptor.TransformFinalBlock(clearData, 0, clearData.Length);                           }            catch            {                throw;            }            return test1;        }    }}</code></pre><p>Any ideas?  Thank you very very much in advance!</p>","546547","","488830","","2010-12-17 21:26:24","2010-12-17 21:55:43","Need an Objective-C version of Java Encryption and Base 64 encoding that I already have","<c#><java><iphone><android><objective-c>","1","3","2","",""
"4474931","1","4475243","","2010-12-17 21:34:27","0","97","<p>How can i make a layout in XML with four button on the same line. I need the first and last button to be of specific width (40px) and the middle two to be of their content width (wrap_content)?</p><p>Sample how I would like to position buttons...</p><p>|-b1-|....|--b2--||---b3---|....|-b4-|</p><p>Thanks in advance!</p>","546555","","","","","2010-12-17 22:15:20","Android layout problem","<android><android-layout>","1","2","","",""
"4474938","1","","","2010-12-17 21:35:44","1","341","<p>im trying to plan and build a small android app that takes in a kml file of co-ordinates, these coordinates are grouped together as a lineString with maybe a couple of dozen points in each linestring, im trying to build an app that as the user travels if they are within a set of these cordinates marked as a line on the road an alert will be prompted, there may be thousands of these lines within one kml file, I know how to prompt alerts etc. but was wondering if my approach of parsing all these cordinates when the program starts then constantly check if a user is near any of them and if inside the linestring prompt would be a good way to go about it? this way does not seem efficient at all, any ideas would be great before i get started.</p><p>ex.<br>lineStringcoordinatescordinates 1.......... 2etc........./cordinates/lineString</p><p>maybe thousands of these lines</p><p>Many thanks</p>","524156","","524156","","2010-12-17 21:52:35","2010-12-18 02:38:03","Android proximity alert,from kml file","<java><android>","1","0","2","",""
"4474993","1","4475025","","2010-12-17 21:44:50","2","177","<p>I'm an experienced iPhone(c#) and j2me programmer at a cell phone company. I'm looking to purchase a book for the company to use to train new hires after they start working here or even for experienced developers to help get started. </p><p>Are there any books / websites that you recommend to get started? Most important would be ones that focus on the Layouts, since that seems to be the most difficult to get started with.</p><p>Thanks in advance.</p>","391912","","4596","","2010-12-18 20:45:21","2011-01-14 12:59:45","What is the most helpful beginner android book/website out there?","<android><android-layout>","3","0","1","",""
"4475074","1","4505108","","2010-12-17 21:54:53","11","7023","<p>When I export android project with proguard.cfg, all referenced .jar files are obfuscated as well. How can I exclude some of that .jars from obfuscation?</p>","62192","","80714","","2011-09-05 11:58:16","2013-01-18 15:55:48","How can I exclude external .jar from obfuscation by Proguard (Android project)?","<android><obfuscation><proguard>","3","0","4","",""
"4475130","1","4475222","","2010-12-17 22:02:49","3","2952","<p>The following html when opened in the default browser on Android 2.2 registers touchstart and touchmove events properly, but not touchend events.  Any idea why?</p><pre><code>&lt;!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0//EN""&gt;&lt;html&gt;&lt;head&gt;    &lt;meta name=""viewport"" content=""width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0""/&gt;&lt;/head&gt;&lt;body&gt;&lt;div id=""a"" onTouchStart=""touchstartFunction(event);""            onTouchMove=""touchmoveFunction(event);""            onTouchEnd=""touchendFunction(event);""            style=""width:300px ; height:300px;background:red;""&gt;&lt;/div&gt;&lt;script&gt;    function touchstartFunction(event){        event.preventDefault();        var touch = event.touches[0];        document.getElementById('touchMoveTextbox').value = ""Touch start at "" + touch.pageX + ""x"" + touch.pageY;    }    function touchmoveFunction(event){        event.preventDefault();        var touch = event.touches[0];        document.getElementById('touchMoveTextbox').value = ""Touch move at "" + touch.pageX + ""x"" + touch.pageY;    }    function touchendFunction(event){        event.preventDefault();        var touch = event.touches[0];        document.getElementById('touchMoveTextbox').value = ""Touch end at "" + touch.pageX + ""x"" + touch.pageY;    }&lt;/script&gt;&lt;input type='textbox' size=""30"" id='touchMoveTextbox' &gt;&lt;/body&gt;&lt;/html&gt;</code></pre>","51759","","","","","2010-12-17 22:12:45","onTouchEnd not working for Android Froyo 2.2?","<javascript><android>","1","0","0","",""
"4475399","1","4475459","","2010-12-17 22:42:19","1","240","<p>I've released a ""Lite"" version of an app that I want to then sell the ""pro"" ""upgrade"" for - without having to release a totally new version.</p><p>My thought was to create a listener that would listen for an intent from the main application, triggering it to query the license service for itself and return to the original application the results. That way you install the trial and buy the ""pro"" license file essentially without having to reinstall or lose your data from the original install.</p><p>I started the license ""listener"" app which is not going to have it's own activity.  Unfortunately I found that code I've used before to access the license service won't work because I'm trying to run it inside a listener - but getContentResolver() doesn't exist for a listener.</p><p>Am I even going down the right road with this approach or is there an easier way?</p>","534088","","","","","2010-12-17 22:54:10","Using Android licensing without an activity","<android>","1","2","","",""
"4475568","1","","","2010-12-17 23:09:09","1","96","<p>I have built an application that records time in UTC.   I have noticed that certain devices have UTC values that are way off the scale (i.e. in years 207x).  I have read that the calendar object used  is implementation specific, but I can't really find any information onhow to handle/convert this data.If anyone has any clues for me, it would be greatly appreciated.</p><p>Thanks</p>","382504","","","","","2010-12-17 23:09:09","Can anyone explain the strange UTC values returned by certain Android devices?","<android><time><utc>","0","1","","",""
"4475579","1","","","2010-12-17 23:12:03","1","360","<p>I wonder, is there a UI recorder out there to automate unit test creation for android projects. I know the android SDK includes JUNIT support. I'm looking for tools that automate the process of creating test scripts. VS2010 has a built in recorder for instance that allows the automation of gui testing by recording the use of the application. This can then be saved as a test script and rerun after any changes are made to the application. So is there something similar for android using JUNIT or s similar testing framework? </p>","458872","","","","","2011-05-18 09:06:51","android unit testing ui recorder a'la VS2010","<android><junit><automation>","1","0","3","",""
"4475599","1","4475610","","2010-12-17 23:16:23","3","1539","<p>What's the point of defining strings in xml at the <code>res/values/string.xml</code> directory? Is it more efficient than just defining the strings as constants within your classes? <em>(e.g. Database table creation scripts, etc..)</em></p><p>Is it a matter of organization or is there some benefit in how Android handles these objects in memory?</p>","462307","","","","","2010-12-19 18:19:59","Defining Strings in res/values/string.xml?","<android>","3","0","2","",""
"4475814","1","","","2010-12-18 00:04:59","0","298","<p>I am trying to create my first android service and am having some issues. I have looked all over and do not know what I am doing wrong. My goal is to create a service that maxes out my volume when the speaker phone is turned on.</p><pre><code>package com.example;import android.app.Service;import android.content.Context;import android.content.Intent;import android.media.AudioManager;import android.os.IBinder;import android.telephony.PhoneStateListener;import android.view.View;import android.widget.Button;import android.widget.Toast;import java.util.Timer;import java.util.TimerTask;/** * Created by IntelliJ IDEA. * User: Matthew * Date: 12/17/10 * Time: 9:36 AM * To change this template use File | Settings | File Templates. */public class MyService extends Service {    private Timer timer = new Timer();//timer constructor    @Override    public IBinder onBind(Intent intent) {        return null;    }    @Override    public void onCreate()    {        Toast.makeText(this, ""Service created..."", Toast.LENGTH_LONG).show();        super.onCreate();        startService();    }    public void startService()    {         Toast.makeText(this, ""Service started..."", Toast.LENGTH_LONG).show();         timer.scheduleAtFixedRate(new TimerTask()         {              AudioManager am;              public boolean speakerPhone = false;              @Override              public void run()              {              //I am not sure what should go here...              //I want the volume to go to max volume when I turn the speaker phone on                   /*                   //if(am.isSpeakerphoneOn())                   {                        am.adjustStreamVolume(AudioManager.STREAM_VOICE_CALL,                                                 AudioManager.ADJUST_RAISE, 2);                   }                   */              }         },0,1000);    }    @Override    public void onDestroy()    {        super.onDestroy();        stopService();    }    public void stopService()    {        Toast.makeText(this, ""Service stopped..."", Toast.LENGTH_LONG).show();        if(timer != null)        {            timer.cancel();        }    }}</code></pre>","546654","","19750","","2010-12-18 00:50:26","2011-05-11 00:32:35","Android Service issue","<android><android-service>","1","1","","",""
"4475870","1","4481091","","2010-12-18 00:18:43","0","591","<p>Here's my set-up; I have a news app. This app loads a few listviews from local storage (I'm abusing sharedpreferences for that, but if that's good practice would be another question). I want to be able to update this local storage smoothly.</p><p>My first approach was to make a button trigger a service, which did the trick. But I also wanted the service to refresh the activity when it was done. I wasn't able to do that.My current approach seems to work, but not as smoothly on 3G. Activity A shows a 'Loading' box, then launches activity B and destroys itself. Activity B also shows a loading box, does the downloading, then destroys itself and relaunches activity A with the new content.However, this last approach makes the screen go black for a few seconds in transition from A to B when on 3G. </p><p>For the sake of visual smoothness, I'd like one loading popup to display continuously. When done, the activity should be refreshed.</p><p>Does anyone know how I can achieve this? </p><p>I hope my explanation was clear enough. Otherwise, I'd be happy to share some code with you.</p><p>Thanks a lot in advance</p>","484475","","","","","2010-12-19 01:00:11","Activity or service in background task?","<android><interface><service><activity>","1","2","1","",""
"4475876","1","4475974","","2010-12-18 00:21:06","0","132","<p>All of the Activities in my app are locked into portrait orientation using:</p><pre><code>android:screenOrientation=""portrait""</code></pre><p>I have ads showing at the top of a few of my Activities, and if I tilt the phone sideways and press the ad, it changes the underlying Activity into landscape orientation! I tried to override </p><pre><code>onConfigurationChanged(Configuration newConfig)</code></pre><p>by setting the configuration to portrait and calling through to super, but it has no effect. Any clue on how to fix this, or what's going on?</p>","413414","","","","","2010-12-18 00:51:27","Android: Pressing ad causes Activity with locked orientation to change orientation","<android><screen-orientation><onconfigurationchanged>","1","0","","",""
"4476320","1","","","2010-12-18 02:42:17","0","693","<p>I don't know how to write code to add a layout into a layout in android, because when I read the reference, I saw it only have ""AddView"" method, when I try to use ""AddView"" method to add a layout, it don't work. Can you suggest me some solutions, I don't use XML file to add layout?</p>","398650","","","","","2010-12-18 03:42:32","How to add a layout into a layout in android","<android>","1","3","0","",""
"4476328","1","","","2010-12-18 02:47:05","1","325","<p>I want to make startup cleaner application for Android 1.6. My query is how to manage application that starts while phone boot or starts. </p><p>Thanks </p>","546736","","","","","2010-12-18 02:59:53","Android: Manage application execution","<android>","1","0","0","",""
"4476379","1","4476592","","2010-12-18 03:04:53","0","1636","<p>EDIT: i have added in all of my code (excluding package and imports.....) and if i try to run it it crashes...... any ideas why?</p><pre><code>public class BaseConverter extends Activity {/** Called when the activity is first created. */int inputBase;int outputBase;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Spinner input_spinner = (Spinner) findViewById(R.id.InputSpinner);    Spinner output_spinner = (Spinner) findViewById(R.id.OutputSpinner);    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            this, R.array.base_numbers_array, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    input_spinner.setAdapter(adapter);    output_spinner.setAdapter(adapter);    input_spinner.setOnItemSelectedListener(new InputItemSelectedListener());    output_spinner.setOnItemSelectedListener(new OutputItemSelectedListener());}public class InputItemSelectedListener implements OnItemSelectedListener {    public void onItemSelected(AdapterView&lt;?&gt; parent,        View view, int pos, long id)        {        /*  switch (Integer.parseInt(parent.getItemAtPosition(pos).toString())            case ((Integer)parent.getItemAtPosition(pos)).intValue();                 inputBase = 2;                break;            case 8:                inputBase = 8;                break;            case 10;                inputBase = 10;                break;            case 16;                inputBase = 16;                break;                */        Toast.makeText(parent.getContext(), ""You selected input base "" +                parent.getItemAtPosition(pos).toString(), Toast.LENGTH_SHORT).show();        }    public void onNothingSelected(AdapterView parent)     {      // Do nothing.    }}public class OutputItemSelectedListener implements OnItemSelectedListener {    public void onItemSelected(AdapterView&lt;?&gt; parent,        View view, int pos, long id) {       Toast.makeText(parent.getContext(), ""You selected output base "" +          parent.getItemAtPosition(pos).toString(), Toast.LENGTH_SHORT).show();    }    public void onNothingSelected(AdapterView parent) {      // Do nothing.    }} </code></pre><p>}</p><p>and now need to have a switch - case scenario that all revolves around what the value they selected it. they are all numbers (the choices) and are stored in an Integer array. How do i set up that switch-case correctly? i tried doing a simple thing like</p><pre><code> case ((Integer.parseInt(parent.getItemAtPosition(pos).toString())</code></pre>","533108","","533108","","2010-12-18 03:20:49","2010-12-18 04:14:04","Spinner Switch Case Problem","<android>","1","2","","",""
"4476496","1","","","2010-12-18 03:39:53","0","519","<p>I am uploading my draft application .apk file myapp.apk to market.android.com  When I click upload I get the error message:</p><pre><code>The file is invalid: ERROR getting 'android:name' attribute:</code></pre><p>This app works fine in the simulator and the AndroidManifest.xml looks correct.  The app has also been signed correctly.  Any thoughts ideas or suggestions are appreciated!</p>","298335","","1351522","","2012-08-05 18:03:53","2012-08-05 18:05:09","Android upload to store error - file is invalid: ERROR getting 'android:name' attribute:","<android><upload><store>","2","3","","",""
"4476578","1","","","2010-12-18 04:07:00","0","1970","<p>I cannot build with NDK r5 on Ubuntu 9.10 (or 9.04). Gives me the followingerror (GLIBC 2.11 not found).</p><pre><code>$ /home/android-ndk-r5/ndk-build  V=1/home/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: /lib/tls/i686/cmov/libc.so.6:version `GLIBC_2.11' not found (required by /home/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc)</code></pre><p>What do I need to install - can someone point me to the relevant apt-get install command ? </p>","374999","","142162","","2010-12-18 04:28:42","2010-12-18 04:49:44","Android NDK r5 on Ubuntu - Cannot compile","<android><ubuntu><android-ndk>","1","0","","",""
"4476601","1","","","2010-12-18 04:18:29","0","788","<p>How to customize Android Os for supporting regional languages???</p><p>I was wondering what the feasibility would be for creating a custom Android build   </p><p>and deploying it on a currently available device on the market ....????</p><p>Opinion about which language,Sdk,other things  i need to use .All are welcome</p><p>I don't know where to start .I need Advice from experts</p><p>Thanks for your valuable time........</p><p>Regards,Kariyachan</p>","482604","","589206","","2012-03-21 13:44:24","2012-11-23 17:30:40","How to Customise android Os For supporting regional launguages","<android><native-code>","2","0","","",""
"4476652","1","","","2010-12-18 04:34:37","0","465","<p>In my applicatiom , am ising google maps showing some events . But i want to navigation mechanism . SO i want to open in built google maps application . Can any one tell me how to integrate inbuilt application with my application . </p><p>Thanking you ,Srinivas</p>","414777","","","","","2011-04-12 03:57:02","How to integrate android maps application to my application in android?","<android><google-maps>","1","0","","",""
"4476675","1","4477443","","2010-12-18 04:42:39","3","3380","<p>I have heard that we can create the click event of the Button by holding it for a few moments in Android. </p><p>I want to use that functionality in my application.</p><p>Can anyone please tell me how to do that?</p><p>Thanks,david</p>","422859","","","","","2010-12-18 09:15:29","Long Click event firing on the Button Click in Android","<android><button><click>","1","0","","",""
"4476711","1","4477025","","2010-12-18 04:53:21","2","3430","<p>i done one program it has a listview and each item in listview have a delete button. But delete button could not delete an item in listview. please tell me how can i delete an item listview and also in database.my program is</p><pre><code>public void onCreate(Bundle savedInstanceState){       super.onCreate(savedInstanceState);       setContentView(R.layout.sharefolioedit);       Log.e(""string"",s.toString());       add = (ImageButton) findViewById(R.id.add);       add.setOnClickListener(this);       done = (Button) findViewById(R.id.done);       done.setOnClickListener(this);       getList();       }     public void onCreate1(Bundle savedInstanceState){           super.onCreate(savedInstanceState);           delete= (ImageButton) findViewById(R.id.delete);           delete.setOnClickListener(this);     }     protected void onListItemClick(ListView l, ImageButton delete, int position,long id) {            super.onListItemClick( l, delete, position, id);             ID=id;                 final Integer index =l.getSelectedItemPosition();             Log.e(""delete method"",""delete"");                Log.e(""ID value"",index.toString());                new AlertDialog.Builder(ShareFolioEditActivity.this)                  .setTitle(""Delete"")             .setMessage(""Are you sure ??? "")                     .setNeutralButton(""no"",null)                     .setPositiveButton(""yes"", new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int whichButton) {             confirmdelete(index);                            }        })      .show();             }            public void myClickHandler(View v) {             {//               int position = 0;//              onListItemClick(lv, delete, position, ID);//               ID=id;                Log.e(""delete method"",""delete"");                final Integer a = new Integer(v.getId());                Log.e(""ID value"",a.toString());                new AlertDialog.Builder(ShareFolioEditActivity.this)                  .setTitle(""Delete"")             .setMessage(""Are you sure ??? "")                     .setNeutralButton(""no"",null)                     .setPositiveButton(""yes"", new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int whichButton) {             confirmdelete(a);                            }        })      .show();             }        }    public void onClick(View v) {        if(v.equals(add))        {            Intent in=new Intent(ShareFolioEditActivity.this,AddCategory.class);            startActivity(in);        }        if(v.equals(done))        {              Intent i=new Intent(ShareFolioEditActivity.this,ShareFolioActivity.class);            startActivity(i);        }    }    public void confirmdelete(int index)    {         db.delete(""sharelist"", ""_id=""+index, null);       Toast.makeText(this, ""row deleted""+index, Toast.LENGTH_SHORT).show();       Bundle b=null;       onCreate(b);    }     public void getList()     {  int x = 0;        String where=null;         csh=new createSqliteHelper(this);        try{            //db.open();       db=csh.getReadableDatabase();          }catch(Exception e){            System.out.println(e);        }          if (Intent.ACTION_SEARCH.equals(getIntent().getAction())) {            where=getIntent().getStringExtra(SearchManager.QUERY);            x=1;        }      if(x==1)      {         cur=db.rawQuery(""SELECT * FROM sharelist where category LIKE '%""+where+""%'"",null);       }else{      cur=db.rawQuery(""SELECT * FROM sharelist ORDER BY category"",null);}      Log.e(""cursor"",cur.toString());     SimpleCursorAdapter list=new SimpleCursorAdapter(this,R.layout.edititems,cur,s,i );     getListView();    setListAdapter(list);     }}</code></pre><p>The sharefolioedit xml layout is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;    &lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:id=""@+id/text""    android:text=""CATEGORIES""    android:layout_centerHorizontal=""true""    /&gt;    &lt;Button         android:id=""@+id/done""        android:text=""Done""         android:layout_alignParentTop=""true""        android:layout_alignParentRight=""true""         android:layout_width=""90px""        android:layout_height=""20px""        android:layout_above=""@id/android:list"" /&gt;        &lt;ImageButton         android:id=""@+id/add""        android:text=""Add""         android:layout_alignParentTop=""true""        android:layout_alignParentLeft=""true""         android:layout_width=""80px""        android:layout_height=""20px""        android:layout_above=""@id/android:list""         android:src=""@drawable/addicon""/&gt;    &lt;ListView android:layout_width=""500px""        android:layout_height=""700px""         android:id=""@id/android:list""        android:layout_alignParentBottom=""true""         /&gt; &lt;/RelativeLayout&gt;</code></pre><p>The edititems.xml is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;ImageButton    android:id=""@+id/delete""    android:layout_width=""70px""    android:paddingLeft=""2px""    android:paddingRight=""2px""    android:paddingTop=""2px""    android:text=""Delete""    android:layout_height=""wrap_content""    android:onClick=""myClickHandler""    android:src=""@drawable/removeicon""    /&gt;    &lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:padding=""10sp""&gt;    &lt;TextView    android:id=""@+id/category""    android:layout_width=""wrap_content""        android:layout_height=""wrap_content""    android:text=""""    android:layout_toRightOf=""@+id/catagory""     /&gt;     &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>In edititems.xml i defined delete button also so please check and tell me solution</p><p>Thank you </p>","745367","","345717","","2010-12-18 05:03:42","2013-04-02 20:43:27","how to delete an item from listview in android","<android><xml><listview><button>","1","0","2","",""
"4476778","1","","","2010-12-18 05:18:46","1","289","<p>I'm developing a hybrid application [web + native]. I have a webview which contains the webpage which has HTML components textarea and combobox. </p><p>But they respond to touch events very randomly. Many a times, keyboard appears when tapped on testarea but many a times it does not. And combobox never responds to touch events.</p><p>Can anybody please help?</p><p>Thanx in advance.  </p>","227943","","","","","2010-12-18 05:18:46","Android Webview component has a bug?","<android><webview><touch>","0","0","","",""
"4476803","1","4477007","","2010-12-18 05:27:19","1","1308","<p>I need to download a single image at time from the Internet and then save it on the SD card. How do I do it? I have made an attempt, but when I try to view that downloaded image, it shows the message, ""No Preview Available"". Please see my code below:</p><pre><code>public class ImgDownloader { private static final int IO_BUFFER_SIZE = 4 * 1024; public static final byte[] downloadImage(String imgURL) {  byte[] data = null;  try {   Log.v(""Down"", ""1"");   InputStream in = null;   BufferedOutputStream out = null;   in = new BufferedInputStream(new URL(imgURL).openStream(), 8 * 1024);   Log.v(""Down"", ""2"");   final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();   out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);   copy(in, out);   out.flush();   Log.v(""Down"", ""3"");   data = dataStream.toByteArray();   // bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);   Log.v(""Down"", ""4"");  } catch (Exception ex) {   ex.printStackTrace();   // System.out.println(""Exception in Image Downloader ..""   // +ex.getMessage());  }  return data; } private static void copy(InputStream in, OutputStream out)   throws IOException {  byte[] b = new byte[IO_BUFFER_SIZE];  int read;  while ((read = in.read(b)) != -1) {   out.write(b, 0, read);  } }}</code></pre><p>Note:i have download the image from the SSL connection.</p><p>Any ideas? Thanks in advance.</p>","267269","","267269","","2010-12-18 10:05:43","2011-09-28 19:30:04","Download image(SSL) and store it on SDcard in Android?","<android><imagedownload>","1","0","","",""
"4476820","1","","","2010-12-18 05:36:52","0","234","<p>I wrote the below code for compare the record with the database record.its comparing but inserting all the records </p><pre><code> public void onClick(View v) {  if(v.equals(add))  {     if(ifExisting())       {        insert();     Log.e(""Data Inserting"",""true"");     Intent i=new Intent(AddCategory.this,ShareFolioActivity.class);     startActivity(i);        //Toast.makeText(AddCategory.this, ""Already exists"",Toast.LENGTH_LONG).show();         }   else         {              Toast.makeText(AddCategory.this, ""Already exists"",Toast.LENGTH_LONG).show();              Log.e(""Data Inserting"",""false"");      }  }    }boolean ifExisting() {     Log.e(""wquery"",""SELECT * FROM  sharelist  WHERE category='""+category.getText().toString()+""'"");     Cursor c = db.rawQuery( ""SELECT category FROM  sharelist  WHERE category='""+category.getText().toString()+"";'"",null);     if(c.getCount()==-1)      {       Log.e(""Condition true"",""true"");       return false;      }       else      {       Log.e(""Condition true"",""false"");          return true;      }}</code></pre>","541719","","345717","","2010-12-18 05:40:58","2010-12-18 07:22:19","comparing the record with the database record whether exists or not","<android><sqlite>","2","0","","",""
"4476867","1","4625784","","2010-12-18 05:59:23","2","2583","<p>I have set up a xmpp server and android client <a href=""http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/"" rel=""nofollow"">using the great post here</a>... I have some pre defined users set up in the xmpp server and i could login with those credentials.</p><p>Now, from my app i want to register as new users to the xmpp server through the android client. Can anyone please suggest me how to attain this... Any help will be grately appreciated...!!!</p>","303155","","194894","","2011-08-21 19:26:35","2013-10-15 13:07:30","How to register a new user on XMPP using asmack library","<android><xmpp><smack>","4","0","1","",""
"4476876","1","4477549","","2010-12-18 06:02:25","5","1261","<pre><code>   i am developing android application using Geocoder services,   I have an application where I try to get address of a location based on    the  latitude,longitude coordinates its working fine.     my problem is how to get continent of particular address.</code></pre><p>example : double lat=17; double lon=78.49;</p><p>List addresses = new Geocoder(Shout.this,Locale.getDefault()).getFromLocation(lat, lon, 1);</p><p>i am using this code output is India,Hyderabadthis address related how to find continent ,please help me some valuable solution.</p><p>i am getting country name dynamically using geocoder is their any chance to get in continent name along with country.it is difficult to maintain statically i need dynamicallyany free services  find  continent based services</p><p>Thanks In Advance</p>","254790","","254790","","2010-12-18 10:17:52","2010-12-18 10:17:52","how to find continent in particular location using Geocoder in android app","<android><widget><reverse-geocoding>","1","0","3","",""
"4476879","1","4476892","","2010-12-18 06:02:43","1","452","<p>I was wondering if it's possible to build an app which works as a TV remote, I've been googling around but so far all I've found are apps that already do or attempt to do it, but nothing that gives me an idea of how to achieve this. Does anyone know? I want to try and do it for an android phone.</p>","28586","","","","","2013-12-18 06:37:53","TV Remote using a Cellphone","<android><tv>","2","0","","",""
"4476916","1","","","2010-12-18 06:15:50","3","751","<p>I made an app which is just working fine. But when i click on ""cancel"" or ""ok"" button, instead of linking me to result.java, the simulator give me ""The application has stopped unexpectedly please try again"" Here's the code</p><pre><code>import android.app.Activity;import android.content.ComponentName; import android.content.Intent;import android.database.CursorJoiner.Result;import android.os.Bundle;import android.view.View;import android.widget.AutoCompleteTextView;public class lib_main extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void onAddClick (View botton){        AutoCompleteTextView title = (AutoCompleteTextView)findViewById(R.id.Title);        AutoCompleteTextView author = (AutoCompleteTextView)findViewById(R.id.Author);         AutoCompleteTextView isbn = (AutoCompleteTextView)findViewById(R.id.ISBN);        Intent intent = new Intent();        intent.setClass(this,Result.class);        intent.putExtra(""Title"", title.getText().toString());        intent.putExtra(""Author"", author.getText().toString());         intent.putExtra(""ISBN"", isbn.getText().toString());        startActivity(intent);    }    public void onCancelClick(View botton){        Intent intent = new Intent();        intent.setComponent(new ComponentName(this,Result.class));        intent.putExtra(""Cancel"",""Cancel"");        startActivity(intent);    }}</code></pre><p>this is result.java</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class Result extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.result);        TextView resultText=(TextView)findViewById(R.id.resultText);        Bundle bundle =getIntent().getExtras();        if(bundle.getString(""Cancel"")!= null)        {           resultText.setText(""operation cancel"");        }        else        {             String book =bundle.getString (""Title"");           String title =bundle.getString (""Author"");           String isbn =bundle.getString (""ISBN"");           resultText.setText(getString (R.string.resultOk)+""""+book+""""+ title+""""+isbn);        }    }}</code></pre><p>the error log write ""No command output when running:'am start-n com.Library.doc/com.Library.doc.lib_main-a android.intent.action.MAIN-c android.intent.category.LAUNCHER' in device emulator-5554""</p>","546829","","1466188","","2012-10-23 07:39:22","2012-10-23 07:39:22","JAVA - Android error: The application has stopped unexpectedly please try again","<android><android-emulator><meta-tags>","0","1","","",""
"4476920","1","","","2010-12-18 06:17:10","0","86","<p>The error below occurs when I try to run my program. Can anyone tell me what it means?</p><blockquote>  <p>ERROR/AndroidRuntime(707): Caused by:  java.lang.RuntimeException: Your  content must have a ListView whose id  attribute is 'android.R.id.list'</p></blockquote>","541719","","234938","","2010-12-18 09:54:36","2010-12-18 09:54:36","What does this error mean regarding the ID of my ListView?","<android><listview>","2","1","","",""
"4476967","1","","","2010-12-18 06:34:49","0","225","<p>Follow up on the question: <a href=""http://stackoverflow.com/questions/4474095/android-id-to-guid"">Android_id to guid? </a></p><p>I want to convert android_id to guid. I can manually convert android_id to longs and pass it to UUID generator, but is there a easier way? I cannot use hashcode since the service expects the same GUID for the device even after closing the app and relaunching it (in which case, it's <em>new dvm</em> - and hence hashcode could be different). Any other pointers? </p>","207552","","","","","2010-12-18 06:34:49","android_id to guid across sessions","<android>","0","4","1","",""
"4476999","1","","","2010-12-18 06:44:59","0","515","<p>I am devloping an android application using java.now i want to place db on remote server,and want to access and upgrade the database.</p><p>Can anyone help me?</p>","546836","","69802","","2011-06-01 21:48:03","2011-06-01 21:48:03","how to place database on remote server using android","<java><android><sqlite>","2","0","","",""
"4477091","1","","","2010-12-18 07:15:29","2","1438","<p>i am devloping an android application thr java.i want to create or place the db on remote server,but not getting idea how to do this.plz help me .any code will be apriciated,thanks </p>","546836","","1065190","","2012-07-11 15:21:02","2012-07-11 15:21:02","How to create database for android application on remote webserver through java","<android>","1","0","","",""
"4477206","1","4487746","","2010-12-18 07:53:53","6","2261","<p>i create an app and install it on phone. now i want to add a feature that my app should not uninstall from the phone. so i think if one of the following issues could be solved</p><ol><li>is there anyway to stop the user from uninstall the app?   </li><li>is it possible , if user try to uninstall the app we get a message? </li><li>is it possible , if user try to uninstall the app it should prompt for a password ? </li><li>any other way to know that app got uninstalled?</li></ol><p>Please guide me in this regardthanks in advance</p>","450601","","","","","2011-01-25 16:59:21","Stop uninstallation of application","<android>","3","3","7","",""
"4477228","1","4477584","","2010-12-18 08:02:04","0","699","<p>Is it possible to password protect contact list via programatically?</p>","527617","","","","","2011-09-27 11:51:33","Android Contact List","<android>","1","0","","",""
"4477469","1","","","2010-12-18 09:24:17","0","1042","<p>I'm a bit confused about the onTap method(s) and how they work with ItemizedOverlay. I want the user to tap on the map and then I place an OverlayItem (icon) where they tapped. Then I want them to tap that OverlayItem again to confirm the location.</p><p>I can add the OverlayItem to the map no problems by overriding </p><pre><code>public boolean onTap(GeoPoint p, MapView mapView)</code></pre><p>But then I want to capture the user tapping on that item by overriding </p><pre><code>protected boolean onTap(int i)</code></pre><p>The trouble is, when I override BOTH of these methods, the second method is never executed when I tap my icon item. </p><p>I've followed all the examples but I'm still stuck. Could someone give me an idea what I'm doing wrong please?</p><p>Thanks</p>","546889","","546889","","2010-12-18 09:54:40","2010-12-18 16:54:06","Confused about onTap","<android>","2","2","","",""
"4477499","1","4478329","","2010-12-18 09:34:12","0","447","<p>I am developing an android application,I want to my application automatically invoked,when I switch on my device.so i used  this permission <code>&lt;uses-permission android:name=""android.permission.RECEIVE_BOOT_COMPLETED"" /&gt;</code> in my application's manifest.xml file and i used service , activity and register Broadcast receiver in manifest.xml file.but I got foreclose error appear in when will i start up my device.How solve this proplem.My Receiver code given bellow context.startActivity(new Intent(context,ServicesDemo.class));<br>//In my mainfest.xml for myReceiver</p><pre><code>&lt;receiver android:name="".MyReceiver""&gt; &lt;intent-filter&gt;  &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;  &lt;category android:name=""android.intent.category.HOME"" /&gt;   &lt;/intent-filter&gt; &lt;/receiver&gt;</code></pre><p>I got this exception <code>java.lang.RuntimeException: Unable to start receiver com.servicedemo.MyReceiver: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</code></p>","500595","","500595","","2010-12-18 11:57:12","2010-12-18 13:51:42","How to solve foreclose problem in start up my application?","<android>","1","2","1","",""
"4477629","1","","","2010-12-18 10:16:17","2","5574","<p>i tried to upload the image to the server for two days but i could not post the image .the coding is compiled and run sucessfully but the imag is not write into the server.</p><p>this is my coding:</p><pre><code>import java.io.BufferedInputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.HttpURLConnection;import java.net.MalformedURLException;import java.net.URL;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.widget.Toast;public class sde extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        loadtoUrl(""http://"");    }    private void loadtoUrl(String string) {        // TODO Auto-generated method stub         try {             String pathToOurFile = ""/sdcard/tamil.PNG"";             FileInputStream fileInputStream = new FileInputStream(new File(pathToOurFile) );             BufferedInputStream bis = new BufferedInputStream(fileInputStream,3000);             byte[] bt=new byte[bis.available()];            HttpURLConnection connection = (HttpURLConnection)new URL(string).openConnection();             connection.setDoOutput(true);             connection.setRequestMethod(""POST"");             connection.connect();            FileOutputStream input = (FileOutputStream) connection.getOutputStream();            input.write(bt);        } catch (MalformedURLException e) {            Context context = null;            int duration = 0;            Toast.makeText(context, ""erro in writing"", duration);            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre>","","mukesh","388787","","2011-04-25 00:58:28","2012-04-25 09:40:49","how to upload the image into server","<android><android-networking>","2","0","1","",""
"4477667","1","4478347","","2010-12-18 10:27:46","-3","1592","<pre><code>  i am working on geocoder find country and city its working fine       already i am getting country name dynamically using geocoder    is their any chance to get in continent name along with country.    it is difficult to maintain statically i need dynamically,any third party   free services u can find continent </code></pre><p>please give me valuable solution thanks in advance </p>","254790","","","","","2010-12-18 14:03:33","how can find continent along with country any free services in android","<android><google-maps><reverse-geocoding>","1","3","2","",""
"4477702","1","4482426","","2010-12-18 10:43:42","0","839","<p>I am using a sqlite database which contains some chars like ""ö"" ""s"" ""â"". sqlite encoding is utf-8. i connect to sqlite database from console with sqlite3.exe and can view the content of the database correctly. Chars are displayed correctly. However, when i connect to database and view them in android emulator in a listview, chars are corrupted and cannot view them properly. what should i don in order to display those chars correctly? Is it something related with sqlite or android or android emulator? I made many trys and i think the problem is not in the database or database encoding.</p>","538408","","","","","2010-12-19 10:04:38","Encoding and problem in viewing chars like ""ö"" ""â"" in android sqlite","<android><encoding><sqlite3><android-emulator>","1","2","1","",""
"4477802","1","4511307","","2010-12-18 11:18:33","0","1112","<p>I have set up a ViewFlipper in my Android application that will host a series of windows to display messages. Each window should correspond to a different set of messages, similar to multiple open chats.  For each window I am using the same window.xml view to bring the view onto the screen, it also has the variable for the EditText need to edit.</p><p>For reference I am creating and adding children as follows:</p><pre><code> public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);          detector = new GestureDetector(this,this);        setContentView(R.layout.viewflip);        flipper = (ViewFlipper) findViewById(R.id.viewflip);        addChild(flipper);        addChild(flipper);}private void addChild(ViewFlipper flip){     int index=0;     View view = getView();     if(flip.getChildCount()==0){         flip.addView(view,index);     }     else{     flip.addView(view,flip.getChildCount()); } } private View getView(){     LayoutInflater inflater = this.getLayoutInflater();     View view = inflater.inflate(R.layout.window, null);             return view; }</code></pre><p>As you can see, I am basically duplicating the view (I'm not sure this is the proper approach to my design).  So if I were to do something in the onCreate function after adding the children, such as </p><pre><code>EditText messageHistoryText = (EditText) findViewById(R.id.messageHistory);                 messageHistoryText.append(""Testing :\n"");</code></pre><p>I see the text on both windows.</p><p>I thought that something like this would be better:</p><pre><code>View v1 = flipper.getChildAt(1);        EditText messageHistoryText2 = (EditText) v1.findViewById(R.id.messageHistory);        messageHistoryText2.append(""Testing2 :\n"");</code></pre><p>but when I use that one, I don't see anything at all.  Perhaps there is a mistake on adding the children.  Perhaps I can't use the same view, or perhaps I am selectively changing an EditText in an incorrect way.</p><p>Tips?</p>","544884","","","","","2010-12-22 16:30:50","Android ViewFlipper How to Add Duplicate Children & Change Specific EditText in Each","<android><edittext><viewflipper><addchild>","1","0","1","",""
"4477835","1","4478275","","2010-12-18 11:27:52","0","1036","<p>im working on this app that uses gps to show position on google map. Bu there seem to be a problem, causing the app to crash at start if the gps is turned of in settings and if gps never ben used before. Other then that the app seem to work as it should</p><p>can anyone see anything that might be the cause ?</p><p>Here is my code</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);    locationManager.requestLocationUpdates(provider, 2000, 500, this);          mostRecentLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);  }@Overridepublic void onCreate(Bundle savedInstanceState){    //AdManager.setTestDevices( new String[] { AdManager.TEST_EMULATOR } );    super.onCreate(savedInstanceState);    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.main);    //getLocation();    Android_ID = Secure.getString(getContentResolver(), Secure.ANDROID_ID);            /* Kan man kickstarta GPS såhär ? */            //mostRecentLocation.getLatitude();                             getLocation();    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);        }    });    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;        }    });    if (Locale.getDefault().getLanguage().equals(""sv"")){    //webView.loadUrl(""file:///android_asset/android.html"");        webView.loadUrl(""file:///android_asset/findgps_sv.html"");    }else{    //webView.loadUrl(""http://m.bryggplatsen.se/android/polis/index.php"");    //webView.loadUrl(""file:///android_asset/android_en.html"");        webView.loadUrl(""file:///android_asset/findgps_en.html"");    }}    /** Sets up the interface for getting access to Latitude and Longitude data from device     **/private class JavaScriptInterface {    public double getLatitude(){        return mostRecentLocation != null ? mostRecentLocation.getLatitude() : Double.NaN;    }    public double getLongitude(){        return mostRecentLocation != null ? mostRecentLocation.getLongitude() : Double.NaN;    }    public String getAndroid_ID(){        return Android_ID;    }     public void sharethisapp(){     startActivity(Intent.createChooser(sharespotIntent(), ""Share this warning""));     }  }@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(""Close menu"");    item = menu.add(""Shut down"");    item.setIcon(R.drawable.exit);    item = menu.add(""Share"");    item.setIcon(R.drawable.m_share);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    if (item.getTitle() == ""Shut down"") {        System.exit(0);        finish();    }    if (item.getTitle() == ""Share"") {        if (Locale.getDefault().getLanguage().equals(""sv"")){        startActivity(Intent.createChooser(shareIntent(), ""Dela denna app""));        }else{        startActivity(Intent.createChooser(shareIntent(), ""Share this app""));        }    }    return true;}private Intent shareIntent() {        Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);        shareIntent.setType(""text/plain"");          if (Locale.getDefault().getLanguage().equals(""sv"")){        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Testa denna android app..."");        return shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""http://www.bryggplatsen.se/android/polisapp/index.php"");    }else{        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Try this cool android app..."");        return shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""http://www.bryggplatsen.se/android/polisapp/index_en.php"");             }}private Intent sharespotIntent() {    Intent sharespotIntent = new Intent(android.content.Intent.ACTION_SEND);    sharespotIntent.setType(""text/plain"");      if (Locale.getDefault().getLanguage().equals(""sv"")){    sharespotIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "" la just upp en ny varning i appen Polisradar"");    return sharespotIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""http://www.bryggplatsen.se/android/polisapp/warn.php?lat="" + mostRecentLocation.getLatitude() + ""&amp;lng="" + mostRecentLocation.getLongitude() + """");}else{    sharespotIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "" just added a new warning in the app Policeradar"");    return sharespotIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""http://www.bryggplatsen.se/android/polisapp/warn_en.php?lat="" + mostRecentLocation.getLatitude() + ""&amp;lng="" + mostRecentLocation.getLongitude() + """");           }}</code></pre><p>}</p>","523221","","523221","","2010-12-18 11:32:56","2014-03-26 16:35:04","app crashes if gps never ben used","<android>","2","4","","",""
"4477917","1","4478008","","2010-12-18 11:54:54","2","1333","<p>This is my first Android-app and prior to this I had no Java knowledge at all.</p><p>I used the following code (<a href=""http://stackoverflow.com/questions/3734981/multiple-datepickers-in-same-activity/4474007#4474007"">found in another question</a>, by <a href=""http://stackoverflow.com/users/237820/adam-l"">Adam L.</a>), I have 28 timepickers and it worked great after altering the code a bit.<br>But one thing I notice is that I get force close (nullpointerexception) when I am in a timepickerdialog (or datepickerdialog when using the code as it is displayed here) and change orientation of the screen.<br>I guess I need to save some info with onDestroy and restoring it again with onStart but I do not know how to accomplish this.<br>In my own code I use timepickerdialogs but <a href=""http://stackoverflow.com/users/237820/adam-l"">Adam L.</a>s code is cleaner so solving the problem there would also solve my own problem.</p><pre><code>import java.util.Calendar;import android.app.Activity;import android.app.DatePickerDialog;import android.app.Dialog;import android.app.DatePickerDialog.OnDateSetListener;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.DatePicker;import android.widget.TextView;public class MultiDatePickerActivity extends Activity {private TextView startDateDisplay;private TextView endDateDisplay;private Button startPickDate;private Button endPickDate;private Calendar startDate;private Calendar endDate;static final int DATE_DIALOG_ID = 0;private TextView activeDateDisplay;private Calendar activeDate;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.multidatepicker);    /*  capture our View elements for the start date function   */    startDateDisplay = (TextView) findViewById(R.id.startDateDisplay);    startPickDate = (Button) findViewById(R.id.startPickDate);    /* get the current date */    startDate = Calendar.getInstance();    /* add a click listener to the button   */    startPickDate.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDateDialog(startDateDisplay, startDate);        }    });    /* capture our View elements for the end date function */    endDateDisplay = (TextView) findViewById(R.id.endDateDisplay);    endPickDate = (Button) findViewById(R.id.endPickDate);    /* get the current date */    endDate = Calendar.getInstance();    /* add a click listener to the button   */    endPickDate.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDateDialog(endDateDisplay, endDate);        }    });    /* display the current date (this method is below)  */    updateDisplay(startDateDisplay, startDate);    updateDisplay(endDateDisplay, endDate);}private void updateDisplay(TextView dateDisplay, Calendar date) {    dateDisplay.setText(            new StringBuilder()                // Month is 0 based so add 1                .append(date.get(Calendar.MONTH) + 1).append(""-"")                .append(date.get(Calendar.DAY_OF_MONTH)).append(""-"")                .append(date.get(Calendar.YEAR)).append("" ""));}public void showDateDialog(TextView dateDisplay, Calendar date) {    activeDateDisplay = dateDisplay;    activeDate = date;    showDialog(DATE_DIALOG_ID);}private OnDateSetListener dateSetListener = new OnDateSetListener() {    @Override    public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {        activeDate.set(Calendar.YEAR, year);        activeDate.set(Calendar.MONTH, monthOfYear);        activeDate.set(Calendar.DAY_OF_MONTH, dayOfMonth);        updateDisplay(activeDateDisplay, activeDate);        unregisterDateDisplay();    }};private void unregisterDateDisplay() {    activeDateDisplay = null;    activeDate = null;}@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case DATE_DIALOG_ID:            return new DatePickerDialog(this, dateSetListener, activeDate.get(Calendar.YEAR), activeDate.get(Calendar.MONTH), activeDate.get(Calendar.DAY_OF_MONTH));    }    return null;}@Overrideprotected void onPrepareDialog(int id, Dialog dialog) {    super.onPrepareDialog(id, dialog);    switch (id) {        case DATE_DIALOG_ID:            ((DatePickerDialog) dialog).updateDate(activeDate.get(Calendar.YEAR), activeDate.get(Calendar.MONTH), activeDate.get(Calendar.DAY_OF_MONTH));            break;    }}}</code></pre><p>I think this is the interesting part of the logcat in Eclipse:</p><pre><code>12-18 11:32:52.415: INFO/ActivityManager(577): Displayed activity se.bergsland.manydatepickers/.ManyDatePickers: 993 ms12-18 11:32:57.625: DEBUG/dalvikvm(1734): GC freed 1950 objects / 104136 bytes in 192ms12-18 11:33:00.396: INFO/WindowManager(577): Config changed: { scale=1.0 imsi=0/0 locale=en_US touch=3 key=2/1/2 nav=3 orien=2 }12-18 11:33:00.535: DEBUG/StatusBar(577): updateResources12-18 11:33:00.595: DEBUG/AndroidRuntime(1763): Shutting down VM12-18 11:33:00.595: WARN/dalvikvm(1763): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)12-18 11:33:00.605: ERROR/AndroidRuntime(1763): Uncaught handler: thread main exiting due to uncaught exception12-18 11:33:00.615: INFO/WindowManager(577): onOrientationChanged, rotation changed to 012-18 11:33:00.625: ERROR/AndroidRuntime(1763): java.lang.RuntimeException: Unable to start activity ComponentInfo{se.bergsland.manydatepickers/se.bergsland.manydatepickers.ManyDatePickers}: java.lang.NullPointerException12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3278)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread.access$1900(ActivityThread.java:112)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.os.Handler.dispatchMessage(Handler.java:99)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.os.Looper.loop(Looper.java:123)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread.main(ActivityThread.java:3948)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at java.lang.reflect.Method.invokeNative(Native Method)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at java.lang.reflect.Method.invoke(Method.java:521)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at dalvik.system.NativeStart.main(Native Method)12-18 11:33:00.625: ERROR/AndroidRuntime(1763): Caused by: java.lang.NullPointerException12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at se.bergsland.manydatepickers.ManyDatePickers.onCreateDialog(ManyDatePickers.java:102)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.Activity.restoreManagedDialogs(Activity.java:857)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.Activity.performRestoreInstanceState(Activity.java:801)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1172)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)12-18 11:33:00.625: ERROR/AndroidRuntime(1763):     ... 12 more</code></pre>","546429","","546429","","2010-12-18 12:11:53","2011-07-11 12:47:51","Multiple DatePickers, force close when screen is rotated","<android><datepicker><nullpointerexception><timepicker><screen-rotation>","2","2","1","",""
"4477951","1","4478010","","2010-12-18 12:06:07","1","230","<p>I'd like to add a short text (2-3 sentences) to my preferences screen (which is created using xml with PreferenceScreen, etc), in order to provide some kind of short help/description for the user.</p><p>I tried using <code>Preference</code>, i.e.  custom preference, but i cannot see more than 1 line in the title and more than 2 lines in the summary.</p>","19868","","","","","2010-12-18 12:24:09","How can i add some text (i.e. kind of ""about"" info) in Preferences in Android","<java><android><preferences><android-preferences>","1","0","","",""
"4478040","1","4478100","","2010-12-18 12:36:27","2","851","<p>I have a doubt in xml parsing. How to do XML parsing in this type of example:</p><pre><code>&lt;companies&gt;  &lt;company name=""ramki"" symbol=""ram""/&gt;  &lt;company name=""addidas"" symbol=""ads""/&gt;  &lt;company name=""samsang"" symbol=""sam""/&gt;  .................</code></pre><p>and also tell me how to show the in ListView (name and symbol also)</p>","745367","","234938","","2010-12-18 18:34:21","2010-12-28 06:23:10","how data can be parsing in xml parsing and data show in listview in android","<android><xml><parsing><listview>","5","1","1","",""
"4478041","1","4478056","","2010-12-18 12:36:35","8","4238","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2506876/how-to-change-position-of-toast-in-android"">how to change position of Toast in android?</a>  </p></blockquote><p>I have to show a <code>Toast</code>, when the user presses a <code>Button</code>, but I want to show it a little more down on the <code>screen</code>.</p><p>How can I do this?</p><p>This is the code of my <code>Toast</code>: </p><pre><code>Toast.makeText(getApplicationContext(),getString(R.string.emailregisternotentered),Toast.LENGTH_SHORT).show();</code></pre><p>Solved:</p><pre><code>Toast toast= Toast.makeText(getApplicationContext(), getString(R.string.emailregisternotentered), Toast.LENGTH_SHORT);  //Toast.makeText(getApplicationContext(), getString(R.string.emailregisternotentered),//Toast.LENGTH_SHORT).show();toast.setGravity(Gravity.BOTTOM, 0, 0);toast.show();</code></pre>","479886","","829188","","2012-05-11 08:40:09","2012-05-11 08:40:09","It is possible to specify the position of a Toast?","<android><toast>","2","0","1","2011-10-03 11:59:09",""
"4478105","1","4580272","","2010-12-18 12:55:33","2","2340","<p>I have selected some of the languages (like Hindi, English(India), English(United Kingdom) etc.) from <strong><code>Input languages</code></strong> option in <strong><code>Android keyboard settings</code></strong> in my emulator (Android 2.3 API). But the problem is that neither it is showing HINDI characters on Soft Keyboard nor displaying some of the Numbers on the keys <code>e y u i o</code>.</p><p>Problem is exactly shown in below given screenshot:</p><p><img src=""http://i.stack.imgur.com/5WlHw.png"" alt=""alt text""></p><p>Also it is displaying rectangular boxes instead of characters.</p>","457982","","457982","","2011-01-24 06:46:37","2011-01-24 06:46:37","Problem with Hindi keyboard on Android 2.3 emulator","<android><keyboard><android-sdk-2.3><hindi>","2","3","1","",""
"4478152","1","","","2010-12-18 13:08:40","2","5968","<p>Am trying to create two tables in one database in sqlite but only the first table (sharelist) is creating and second table (usedlist) is not creating.</p><p>please help me...</p><p>public class createSqliteHelper extends SQLiteOpenHelper{</p><pre><code> private DatabaseHelper DBHelper;public static final String KEY_ROWID = ""sy_id"";    public static final String KEY_TITLE = ""symbol"";    public static final String KEY_POSITION = ""position"";        private static final String TAG = ""createSqliteHelper"";private static final String DATABASE_NAME=""tradely.db""; private static final String DATABASE_TABLE = ""sharelist"";   private static final String DATABASE_TABLE1 = ""usedlist"";private static final int SCHEMA_VERSION=1; private DatabaseHelper DBHelper;    private SQLiteDatabase db;    private static final String DATABASE_CREATE=(""CREATE TABLE IF NOT EXISTS sharelist (_id INTEGER PRIMARY KEY AUTOINCREMENT, category TEXT);"");    private static final String DATABASE_CREATE1=(""CREATE TABLE IF NOT EXISTS usedlist( sy_id INTEGER PRIMARY KEY AUTOINCREMENT, symbol TEXT, position INTEGER, FOREIGN KEY (symbol) REFERENCES sharelist(_id);"");    public createSqliteHelper(Context context) {    super(context, DATABASE_NAME, null, SCHEMA_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db) {    try {        db.execSQL(DATABASE_CREATE);        db.execSQL(DATABASE_CREATE1);    }    catch(SQLiteException e) {        Log.e(""createerr"",e.toString());    }}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    android.util.Log.w(""LunchList"", ""Upgrading database, which will destroy all old data"");    db.execSQL(""DROP TABLE IF EXISTS sharelist"");    db.execSQL(""DROP TABLE IF EXISTS usedlist"");    onCreate(db);}</code></pre>","541719","","","","","2012-10-22 07:09:12","how to create two tables in one database","<android><sqlite>","2","3","","",""
"4478243","1","","","2010-12-18 13:32:44","0","495","<p>friends,</p><p>i am using following code to fill android listview asynchronously</p><p>now problem is while running this thread i press back button or home button and comes back to activity </p><p>multiple threads are started....</p><p>can i avoid these multiple threadsactually i want if thread is running then it should not get called again and again.it should be called when previous thread is complete.</p><pre><code>private static String[] items={.......};@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        setListAdapter(                new ArrayAdapter&lt;String&gt;(this,                                android.R.layout.simple_list_item_1,                                new ArrayList()));        AddStringTask test= new AddStringTask();        test.execute();    }class AddStringTask extends AsyncTask&lt;Void, String, Void&gt; {        @Override        protected Void doInBackground(Void... unused) {            for (String item : items) {                publishProgress(item);                SystemClock.sleep(1000);            }            return(null);        }        @Override        protected void onProgressUpdate(String... item) {            ((ArrayAdapter)getListAdapter()).add(item[0]);        }        @Override        protected void onPostExecute(Void unused) {            Toast                .makeText(AsyncThread.this,                         ""Done - Finished updating Java Book List!"",                        Toast.LENGTH_SHORT)                .show();        }    }}</code></pre><p>any useful solution?</p><p>thanks in advance. </p>","249991","","","","","2010-12-18 13:44:10","How to avoid Multiple Async Thread calls?","<android>","1","1","","",""
"4478431","1","","","2010-12-18 14:20:44","0","1338","<p>I need to rotate text in Vertical by using Canvas (canvas.drawText).I need to use  that in Barchart.How to do this? </p><p>As like a following <a href=""http://www.google.co.in/imgres?imgurl=http://www.fieldcheckgroup.com/wp-content/uploads/2009/06/nts-bar-chart.png&amp;imgrefurl=http://www.fieldcheckgroup.com/blog/&amp;usg=__BYabhXXIE_IWzgmYAvRpIQdT5OI=&amp;h=382&amp;w=629&amp;sz=14&amp;hl=en&amp;start=97&amp;sig2=zZrKKxYYkcgY85nTmEt3Vg&amp;zoom=1&amp;tbnid=EBWWahP111tD0M:&amp;tbnh=118&amp;tbnw=195&amp;ei=HMoMTYvpBJDWvQPAh5DGDQ&amp;prev=/images%3Fq%3Dbar%2Bchart%26um%3D1%26hl%3Den%26sa%3DN%26rls%3Dig%26biw%3D1024%26bih%3D653%26tbs%3Disch:10,4463&amp;um=1&amp;itbs=1&amp;iact=hc&amp;vpx=536&amp;vpy=143&amp;dur=3148&amp;hovh=175&amp;hovw=288&amp;tx=189&amp;ty=93&amp;oei=4MkMTb3aIIyqrAeUtrTECw&amp;esq=9&amp;page=9&amp;ndsp=12&amp;ved=1t:429,r:6,s:97&amp;biw=1024&amp;bih=653"" rel=""nofollow"">Image</a></p>","538642","","538642","","2010-12-18 14:53:23","2010-12-18 14:53:23","Rotate text in Android?","<android>","1","0","","",""
"4478449","1","","","2010-12-18 14:27:48","0","1061","<p>I wanted to plot a stock historical graph based on google finance in my android app .The problem is I can't find the api for just the stock chart alone and I must try to find another ways to do it.</p><p>I thought of a way but don't know what whether it works</p><p>the steps are as follows..1) get the details from csv file 2) read the csv file3) plot the graph using the information of the csv file.(WHICH I DON'T KNOW HOW TO DO IT)!</p><p>so if my steps above works , I would only want to know how to plot the graph.</p>","547038","","1065190","","2012-07-02 15:12:31","2012-07-02 15:12:31","How do I plot a STOCK historical graph in  android app?","<android>","2","0","","",""
"4478587","1","4478697","","2010-12-18 15:09:07","0","903","<p>I'm writing an automation script to check my new photo gallery application. I've been trying to get am to show images using the ACTION_VIEW intent but for some reason it doesn't work. Here's what I've tried:</p><pre><code>adb shell am start -a android.intent.action.VIEW -d ""file:///sdcard/Android/test.jpg""</code></pre><p>or</p><pre><code>adb shell am start ""file:///sdcard/Android/test.jpg""</code></pre><p>however, both commands fail with the following error:</p><blockquote>  <p>Starting: Intent { act=android.intent.action.VIEW dat=/sdcard/Android/test.jpg }  Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=/sdcard/Android/test.jpg flg=0x10000000 }</p></blockquote><p>Any ideas?</p><p>Thanks.</p>","547061","","","","","2010-12-18 15:39:12","Viewing an image using the activity manager","<android><automation>","1","0","","",""
"4478760","1","","","2010-12-18 15:51:16","8","6895","<p>Getting started with Nexus S NFC/RFID. Can anyone provide any guidance?</p><p>I'm interested in creating some home brew demos using the nexus s NFC/RFID hardware.I think I need to find the appropriate tags and how to encode urls into tags that the nexus s can read by it's tags app.Not sure about iso 14443 tags or mifare etc</p><p>Does nexus s support all of libnfc?</p><p>If I root the device can I get access to write functionality?</p><p>Thanks</p>","547087","","1446598","","2013-01-04 19:17:53","2013-01-04 19:17:53","Getting started with nexus s NFC/RFID","<android><nfc><rfid><nexus-s>","6","1","4","",""
"4478762","1","","","2010-12-18 15:51:57","0","757","<p>If you have any sample code about that class, i'm interested.</p><p>Thank you.</p>","348175","","","","","2010-12-18 15:58:45","Searching about an example about SpeechRocognizer Android 2.2 class use","<android><speech-recognition><android-2.2-froyo>","1","0","","",""
"4478935","1","4478991","","2010-12-18 16:33:48","0","283","<p>i know how to open an activity from a statusbar item, but is their a way to run a small block of code without opening a new activity? thanks</p>","364727","","","","","2010-12-18 16:44:59","android status bar icon run code block","<android><activity><statusbar>","1","0","","",""
"4479043","1","4479248","","2010-12-18 16:55:28","0","2356","<p>I’m new to using JSON and am currently playing around with the FLOT graph to display a graph through WebView.</p><p><a href=""http://rapidandroid.org/wiki/Graphing"" rel=""nofollow"">http://rapidandroid.org/wiki/Graphing</a></p><p>However, when it comes to JSON parsing I'm having trouble getting my data to represented as the JavaScript equivalent. I have been playing around with this for hours and I'm unable to get my JSON output to look like the following.</p><pre><code>var datasets = {    ""Symptoms"": {        label: ""Symptoms"",        data: [[1988, 10], [1989, 20], [1990, 10], [1991, 30], [1992, 40]]    },            ""Reactions"": {        label: ""Reactions"",                    data: [[1988, 0], [1989, 0], [1990, 10], [1991, 30], [1992, 40]]    },    ""Injections"": {        label: ""Injections"",                    data: [[1988, 0], [1989, 0], [1990, 0], [1991, 30], [1992, 40]]    },};</code></pre><p>Using davids interpretation of the flot graph <a href=""http://w2davids.wordpress.com/android-charts-the-html5-and-javascript-way/"" rel=""nofollow"">http://w2davids.wordpress.com/android-charts-the-html5-and-javascript-way/</a></p><p>Thanks in advance.</p><p>P.s. the closest I have gotten is:String data= ""[0,1],[5,3],[5,6],[7,2],[10,12]"";arr.put(data);</p><p>put the problem is the out is:{""data"":[""[0,1],[5,3],[5,6],[7,2],[10,12]""]} //how can I get rid of .. "" ..also how am I able to get label: in the JSON object? also without quotation marks</p><hr><p><strong>Solution</strong></p><p>To pass a json object from android to javascript (i.e. webview)Good for anyone using the flot javascript library to displaya graph in android</p><p>Java Activity</p><pre><code>String json = ""{""             + ""  \""Symptoms\"":""             + ""{  \""label\"": \""Symptoms\"",""
             + ""  \""data\"": [[1988, 10], [1989, 20], [1990, 10], [1991, 30], [1992, 40]] ""             + ""},""
             + ""  \""Infections\"":""             + ""{  \""label\"": \""Infections\"",""
             + ""  \""data\"": [[1988, 0], [1989, 0], [1990, 10], [1991, 35], [1992, 28]] ""             + ""}""             + ""}"";        mAppView.loadUrl(""javascript:GotGraph('""+json+""');"");</code></pre><p>Javascript side (FLOT) (allows multiple lines</p><pre><code>function GotGraph(data) {    var datasets = JSON.parse(data);    // hard-code color indices to prevent them from shifting as    // countries are turned on/off    var i = 0;    $.each(datasets, function(key, val) {        val.color = i;        ++i;    });    // insert checkboxes     var choiceContainer = $(""#choices"");    $.each(datasets, function(key, val) {        choiceContainer.append('&lt;br/&gt;&lt;input type=""checkbox"" name=""' + key +                               '"" checked=""checked"" id=""id' + key + '""&gt;' +                               '&lt;label for=""id' + key + '""&gt;'                                + val.label + '&lt;/label&gt;');    });    choiceContainer.find(""input"").click(plotAccordingToChoices);    //     function plotAccordingToChoices() {        var data = [];        choiceContainer.find(""input:checked"").each(function () {            var key = $(this).attr(""name"");            if (key &amp;&amp; datasets[key])                data.push(datasets[key]);        });        if (data.length &gt; 0)            $.plot($(""#placeholder""), data, {                yaxis: { min: 0 },                xaxis: { tickDecimals: 0 }            });    }    plotAccordingToChoices();}</code></pre><p>Thanks to</p><p><a href=""http://rapidandroid.org/wiki/Graphing"" rel=""nofollow"">http://rapidandroid.org/wiki/Graphing</a></p><p><a href=""http://w2davids.wordpress.com/android-charts-the-html5-and-javascript-way/"" rel=""nofollow"">http://w2davids.wordpress.com/android-charts-the-html5-and-javascript-way/</a></p><p>and @achie</p>","425226","","425226","","2010-12-18 19:01:28","2010-12-18 19:01:28","Android and java JSON","<java><android><json><graph><webview>","2","0","","",""
"4479127","1","","","2010-12-18 17:15:35","1","1367","<p>How can I disable the logcat output of 3rd party libraries, such as AdWhirl and AdMob?</p><p>Sometimes they provide a method to disable the log output, sometimes they don't. For those who don't is there a application wide setting where I can suppress either any log output or log output from certain classes or tags?</p>","184367","","","","","2010-12-18 18:28:52","Android: disable log output from 3rd party libraries","<android><logcat>","1","0","","",""
"4479203","1","4479496","","2010-12-18 17:33:00","6","2569","<p>In the name of performance which is better to use list of webview objects with custom array adapter defined or list of textview object again with custom adapter and html content to show in it.First I try to use webview but i think webview object is kind of heavy ui element , textview seems more lightweight.</p><pre><code>WebView entryWebView = (WebView) findViewById(R.id.entryWebView);                entryWebView.loadData(""my hmtl formatted data"", ""text/html"", ""utf-8"");</code></pre><p>//suppose these defined in custom array adapter and filled with webview objects</p><pre><code>TextView entryTextView = (TextView) v.findViewById(R.id.entry);                entryTextView.setText(""my html formatted data"");</code></pre><p>//and this one again in custom array adapter and filled with textview objects</p>","155332","","","","","2010-12-19 14:57:19","Which one to use WebView or TextView in a list with HTML data in it?","<android><performance><listview><android-webview>","2","0","2","",""
"4479250","1","4479541","","2010-12-18 17:45:00","1","798","<p>I developed my application using API level 8 but the minimum SDK is 3. I did most of the testing on an emulator running 8 and my DroidX as well as some friends phones. No problems thus far. It should also be known that I did not use any API's above Level 3, and the Tab Layout was almost and exact copy of the example provided by Google <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">here</a>. So.... when running on an emulator with level 5 API I get the following error and I have no clue where it's coming from except for the references to TabWidget.</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.NullPointerException  at android.widget.TabWidget.dispatchDraw(TabWidget.java:206)  at android.view.ViewGroup.drawChild(ViewGroup.java:1524)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)  at android.view.ViewGroup.drawChild(ViewGroup.java:1524)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)  at android.view.ViewGroup.drawChild(ViewGroup.java:1524)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)  at android.view.View.draw(View.java:6539)  at android.widget.FrameLayout.draw(FrameLayout.java:352)  at android.view.ViewGroup.drawChild(ViewGroup.java:1526)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)  at android.view.View.draw(View.java:6539)  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:1348)  at android.view.ViewRoot.performTraversals(ViewRoot.java:1113)  at android.view.ViewRoot.handleMessage(ViewRoot.java:1632)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:123)  at android.app.ActivityThread.main(ActivityThread.java:4310)      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)    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, parent.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""browse"").setIndicator(""Browse"",                      res.getDrawable(R.drawable.ic_tab_browse))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, bookmarks.class);    spec = tabHost.newTabSpec(""bookmarks"").setIndicator(""Bookmarks"",                      res.getDrawable(R.drawable.ic_tab_bookmarks))                  .setContent(intent);    tabHost.addTab(spec);    // Do the same for the other tabs    intent = new Intent().setClass(this, search.class);    spec = tabHost.newTabSpec(""search"").setIndicator(""Search"",                      res.getDrawable(R.drawable.ic_tab_search))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);</code></pre>","485438","","485438","","2010-12-18 19:15:13","2011-12-27 18:08:34","Help with NullPointerException on API level 5","<android><nullpointerexception><android-tabhost><tabwidget><unhandled-exception>","2","3","2","",""
"4479306","1","4479344","","2010-12-18 18:02:25","0","1993","<p>In my android application i would like to place processed database file into raw folder and then copy the raw folder into data/data/application package path programmatically.Is it possible to achieve this in android.</p><p>Please forward your valuable suggestions to me.</p>","420261","","244296","","2010-12-22 14:17:02","2010-12-22 14:17:02","Copy db file from raw folder to data folder programatically in android","<android><sqlite>","1","0","","",""
"4479312","1","","","2010-12-18 18:04:25","-1","330","<p>can i set any setting for can't uninstall my application by user?is it possible in android code?</p><p>Thanks All</p>","500595","","","","","2010-12-19 00:12:25","never uninstall my application?","<android>","2","6","","",""
"4479316","1","","","2010-12-18 18:05:15","0","986","<p>I have a simple activity from which I call the default SMS app intent. I would like my activity to fully end after (or before) the next intent is handled.</p><p>I tried calling finish(); or return; in onStop. The problem is that the next time I launch my activity (app) it goes back to the sms app. It's as if the task never end because it is waiting for a result from an activity I have no control of.</p>","541160","","264541","","2012-05-01 14:45:13","2012-05-01 14:45:13","Finish activity before launching third party intent?","<android><activity><android-intent><exit>","1","0","","",""
"4479352","1","6718953","","2010-12-18 18:14:41","5","2232","<p>I would like to integrate my app with contact manager:</p><p>More precisely:</p><p>When I run Contact app in my phone and then I click on any avatar, a Popup (Quick Contact Badge) windows shows up with some application to choose (Contact, Mail, etc) I would like to add my Application in that place. </p><p>That is possible ?</p><p>I hope to be clear.</p><p>Thanks in advance.</p>","470322","","470322","","2010-12-23 16:35:46","2012-05-23 05:03:02","Integrate my app with Contact","<android><contacts><contact><android-contacts>","1","2","4","",""
"4479354","1","4480023","","2010-12-18 18:15:15","1","1196","<p>I have several bitmaps (game sprites) which I'd like to draw into another bitmap, however each non-transparent pixel of the source bitmap should be drawn using a single color, ignoring the original pixel color of the source.  Basically, I'm trying to use the sprite as a ""stamp"" of a single color to be drawn into the destination bitmap.</p><p>I believe I should be using canvas.drawBitmap (Bitmap bitmap, Matrix matrix, Paint paint), however I'm not exactly sure how I should initialize the paint object.  Is this approach correct?</p>","547163","","","","","2010-12-18 20:33:18","Android - Draw bitmap as one color","<android>","2","0","1","",""
"4479363","1","4750511","","2010-12-18 18:16:59","1","986","<p>I have root privileges and can access internal databases of android mobile with adb command line tool.</p><p>Is it possible to see this in ""File Explorer"" DDMS view in Eclipse as well , just like we can see all databases for emulator ?</p>","315619","","","","","2011-01-20 17:35:02","For rooted android how to see application databases in File Explorer of Eclipse DDMS tool?","<android><eclipse><file><explorer><ddms>","2","2","1","",""
"4479385","1","","","2010-12-18 18:21:55","2","2417","<p>I want a develop a web application with php, and I want a run my apps with a android device. But my device will not be connected to internet, so I must create a local server on the device to run my php code. Is it possible? And if it's possible how?</p>","400380","","229044","","2012-05-15 16:16:13","2012-05-15 16:16:13","create local server on android","<php><android>","2","3","","",""
"4479429","1","4480508","","2010-12-18 18:32:28","7","34904","<p>I hope question title gives you a good description of the problem.</p><p>I want to create this XML, but programatically (please don't suggest not doing it programmatically ^_^ )</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""android:padding=""10dip"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView   android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginBottom=""10dip""            android:text=""Messages:""/&gt;&lt;EditText   android:id=""@+id/messageHistory""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:clickable=""false""               android:layout_weight=""1""            android:editable=""false""            android:gravity=""top""            android:scrollbars=""vertical""            android:scrollbarSize=""10px""            /&gt; &lt;LinearLayout android:orientation=""horizontal""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:layout_weight=""4""&gt;        &lt;EditText   android:id=""@+id/message""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:gravity=""top""                    android:layout_weight=""1""                    /&gt;        &lt;Button android:id=""@+id/sendMessageButton""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:layout_weight=""4""                android:text=""Send""/&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>As you can see, there are two LinearLayout's, one embedded in the other.  I need to reproduce this and then add it to a ViewFlipper.</p><p>This is what I have so far:</p><pre><code>     LinearLayout l1 = new LinearLayout(this);     LinearLayout l2 = new LinearLayout(this);            Button btn=new Button(this);     EditText messageHistory = new EditText(this);     EditText newMessage = new EditText(this);     TextView windowTitle = new TextView(this);          btn.setText(""Send"");     btn.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 4f));     btn.setOnClickListener(new OnClickListener() {                 @Override        public void onClick(View v) {                Toast.makeText(getApplicationContext(), ""Clicked send in child index: ""+ flipper.getDisplayedChild(), Toast.LENGTH_SHORT).show();            }               });    windowTitle.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    windowTitle.setPadding(0, 5, 0, 10);    windowTitle.setText(""Chat with: "");    messageHistory.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    messageHistory.setGravity(Gravity.TOP);    messageHistory.setMovementMethod(new ScrollingMovementMethod());    messageHistory.setClickable(false);    messageHistory.setFocusable(false);         messageHistory.setPadding(0, 0, 0, 5);    newMessage.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, 1f));    newMessage.setGravity(Gravity.TOP);    newMessage.setMovementMethod(new ScrollingMovementMethod());    newMessage.requestFocus();          l1.setOrientation(LinearLayout.VERTICAL);    l1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    l2.setOrientation(LinearLayout.HORIZONTAL);    l2.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    l1.addView(windowTitle);    l1.addView(messageHistory);    l2.addView(newMessage);    l2.addView(btn);    l1.addView(l2);    flipper.addView(l1);</code></pre><p>Where flipper is defined as:</p><pre><code>ViewFlipper flipper = (ViewFlipper) findViewById(R.id.viewflip);</code></pre><p>Without a problem, I can see ""l1"" in the window when it loads up, but l2 is no where to be found.  Did I mess up with LayoutParams? Can I use addView to add a LinearLayout?</p>","544884","","","","","2011-02-27 16:51:48","How to programmatically add multiple LinearLayouts into one view and then add to ViewFlipper?","<android><layout><android-linearlayout><viewflipper>","1","3","4","",""
"4479431","1","","","2010-12-18 18:33:34","2","2020","<p>it's clear to me that one can use ADB to run commands on connected Android device, but how does it work internally?My assumption is that after for instance calling 'adb shell' ADB connects with some internal service running on Android device or emulator and communicates with it.What I want to do is to connect to this service which parses ADB commands directly from device (assuming it's not connected to PC) and run ADB commands directly from device. Would it be possible?</p>","547182","","","","","2010-12-18 18:53:52","ADB - how does it work?","<java><android><service><adb>","2","0","","",""
"4479452","1","4479476","","2010-12-18 18:38:34","0","1067","<p>How can I thread method readRss() so that if the internet connection is slow it doesnt slow down the rest of the app?</p><pre><code>    package com.noah.rss;    import java.io.IOException;    import java.net.MalformedURLException;    import java.net.URL;    import java.util.List;    import javax.xml.parsers.ParserConfigurationException;    import javax.xml.parsers.SAXParser;    import javax.xml.parsers.SAXParserFactory;    import org.xml.sax.InputSource;    import org.xml.sax.SAXException;    import org.xml.sax.XMLReader;    import android.app.ListActivity;    import android.content.Context;    import android.content.Intent;    import android.os.Bundle;    import android.view.Menu;    import android.view.MenuItem;    import android.view.View;    import android.view.ViewGroup;    import android.widget.ArrayAdapter;    import android.widget.ListView;    import android.widget.TextView;    import android.widget.Toast;    import android.view.LayoutInflater;    public class AndroidRssReader extends ListActivity { private RSSFeed myRssFeed = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  readRss(); } public class MyCustomAdapter extends ArrayAdapter&lt;RSSItem&gt; {  public MyCustomAdapter(Context context, int textViewResourceId,    List&lt;RSSItem&gt; list) {   super(context, textViewResourceId, list);  }  @Override  public View getView(int position, View convertView, ViewGroup parent) {   // TODO Auto-generated method stub   // return super.getView(position, convertView, parent);   View row = convertView;   if (row == null) {    LayoutInflater inflater = getLayoutInflater();    row = inflater.inflate(R.layout.row, parent, false);   }   TextView listTitle = (TextView) row.findViewById(R.id.listtitle);   listTitle.setText(myRssFeed.getList().get(position).getTitle());   TextView listPubdate = (TextView) row     .findViewById(R.id.listpubdate);   listPubdate.setText(myRssFeed.getList().get(position).getPubdate());   if (position % 2 == 0) {    listTitle.setBackgroundColor(0xff101010);    listPubdate.setBackgroundColor(0xff101010);   } else {    listTitle.setBackgroundColor(0xff080808);    listPubdate.setBackgroundColor(0xff080808);   }   return row;  } } private void readRss() {  try {   URL rssUrl = new URL(     ""http://www.gov.hk/en/about/rss/govhkrss.data.xml"");   SAXParserFactory mySAXParserFactory = SAXParserFactory     .newInstance();   SAXParser mySAXParser = mySAXParserFactory.newSAXParser();   XMLReader myXMLReader = mySAXParser.getXMLReader();   RSSHandler myRSSHandler = new RSSHandler();   myXMLReader.setContentHandler(myRSSHandler);   InputSource myInputSource = new InputSource(rssUrl.openStream());   myXMLReader.parse(myInputSource);   myRssFeed = myRSSHandler.getFeed();  } catch (MalformedURLException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (ParserConfigurationException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (SAXException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  if (myRssFeed != null) {   TextView feedTitle = (TextView) findViewById(R.id.feedtitle);   TextView feedDescribtion = (TextView) findViewById(R.id.feeddescribtion);   TextView feedPubdate = (TextView) findViewById(R.id.feedpubdate);   TextView feedLink = (TextView) findViewById(R.id.feedlink);   feedTitle.setText(myRssFeed.getTitle());   feedDescribtion.setText(myRssFeed.getDescription());   feedPubdate.setText(myRssFeed.getPubdate());   feedLink.setText(myRssFeed.getLink());   MyCustomAdapter adapter = new MyCustomAdapter(this, R.layout.row,     myRssFeed.getList());   setListAdapter(adapter);  } } @Override protected void onListItemClick(ListView l, View v, int position, long id) {  // TODO Auto-generated method stub  Intent intent = new Intent(this, ShowDetails.class);  Bundle bundle = new Bundle();  bundle.putString(""keyTitle"", myRssFeed.getItem(position).getTitle());  bundle.putString(""keyDescription"", myRssFeed.getItem(position)    .getDescription());  bundle.putString(""keyLink"", myRssFeed.getItem(position).getLink());  bundle.putString(""keyPubdate"", myRssFeed.getItem(position).getPubdate());  intent.putExtras(bundle);  startActivity(intent); } @Override public boolean onCreateOptionsMenu(Menu menu) {  // TODO Auto-generated method stub  menu.add(0, 0, 0, ""Reload"");  return true; } @Override public boolean onOptionsItemSelected(MenuItem item) {  // TODO Auto-generated method stub  switch (item.getItemId()) {  case (0):   Toast.makeText(this, ""Reading News, Please wait."",     Toast.LENGTH_LONG).show();     readRss();   break;  default:   break;  }  return true; }    }</code></pre>","545790","","216517","","2010-12-18 18:43:23","2010-12-18 18:43:23","Android thread XML reader method","<android><xml><multithreading>","1","0","","",""
"4479536","1","4497946","","2010-12-18 18:55:03","0","793","<p>I am new to Android. I am trying to develop an Alarm Application, which is actually a speaking clock. I just want the clock to use TextToSpeech API and speak out the greeting stuff and the current time as soon as the alarm time is ticked. The speech part is done. And now I want to implement the Alarm functionality. But Initially I am just trying to display a toast after 10 secs in order to check whether my classes are working properly. And I am not getting the desired response and I don't know why ? Following are the classes</p><p>Main Class aClockActivity</p><pre><code>public class aClockActivity extends Activity {    /** Called when the activity is first created. */  private PendingIntent mAlarmSender; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button button1 = (Button)findViewById(R.id.buttonOn);        button1.setOnClickListener(mStartAlarmListener);        Button button2 = (Button)findViewById(R.id.buttonOff);        button2.setOnClickListener(mStopAlarmListener);    } private OnClickListener mStartAlarmListener = new OnClickListener() {        public void onClick(View v) {            // We want the alarm to go off 30 seconds from now.            //long firstTime = SystemClock.elapsedRealtime();            EditText Ehour = (EditText) findViewById(R.id.hour);            EditText Eminute = (EditText) findViewById(R.id.minute);            CharSequence CharHour = Ehour.getText();            CharSequence CharMinute = Eminute.getText();            int hour = Integer.parseInt(CharHour.toString());            int minute = Integer.parseInt(CharMinute.toString());            Calendar cal = Calendar.getInstance();            cal.setTimeInMillis(System.currentTimeMillis());           // calendar.add(Calendar.MINUTE, 1);            cal.add(Calendar.SECOND, 10);            mAlarmSender = PendingIntent.getBroadcast(aClockActivity.this,                    0, new Intent(aClockActivity.this, Alarm_Broadcast.class), 0);            // Schedule the alarm!            AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);            am.set(AlarmManager.RTC_WAKEUP,                            cal.getTimeInMillis(), mAlarmSender);            // Tell the user about what we did.            Toast.makeText(aClockActivity.this, ""The Alarm is Set"",                    Toast.LENGTH_LONG).show();        }    };    private OnClickListener mStopAlarmListener = new OnClickListener() {        public void onClick(View v) {            // And cancel the alarm.            AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);            am.cancel(mAlarmSender);            // Tell the user about what we did.            Toast.makeText(aClockActivity.this, ""Setting off the alarm"",                    Toast.LENGTH_LONG).show();        }    };</code></pre><p>Second Class Alarm_Broadcast</p><pre><code>public class Alarm_Broadcast extends BroadcastReceiver{  @Override     public void onReceive(Context context, Intent intent) {         Toast.makeText(context, ""Alarm worked"", Toast.LENGTH_LONG).show();     }}</code></pre><p>Note: Just ignore the Edittext part in the OnClick() method, I'd use it later on.</p><p>Apart from the above problem there are few questions that I would like to ask.</p><p>1) How can I implement this app so that when the alarm is set, it can actually run as a service in the notification bar where the original AlarmClock runs. So that even if the app is closed its still running to invoke the alarm message at the right time.</p><p>2) I cannot show any Dialog box or can use TTS if the AlarmManager invokes a Class that extends either Service or BroadcastReciever.</p><p>3) I would appreciate if some one give me the idea to implement this app, I am sure there are many experts who would have gone through the same application.</p><p>Regards</p><p>Omayr </p>","385145","","","","","2010-12-21 09:47:58","Help required in Alarm Application","<android><service><broadcastreceiver><alarmmanager><android-pendingintent>","3","0","","",""
"4479596","1","4479727","","2010-12-18 19:06:31","1","123","<p>Im really confused when trying to do this:</p><p>Lets say i want to build a app which allow you to read information about animals.</p><p>on my main class i have a listview which items: Cat, Dog, Snake, Rabbit and so on.</p><p>If i tap example Dog my other class and my other layout.xml will pop up. In this details.xml layout got a Header text, a picture and a maintext.</p><p>However the text is just null or nothing. So how do i do so the text will change depend on which item i clicked.</p><p>For Example i dont want text about cat and a cat picture when o pressed the Rabbit item.</p><p>Is this possible? Ive tried to call methods but i just get a FC if the method is not in the current class. ive also tried the intent extra but that try didnt went well.</p><p>thank you!Your Friend ;D</p>","502419","","","","","2010-12-18 19:57:16","Android Development: Passing information","<android>","1","0","","",""
"4479641","1","","","2010-12-18 19:13:10","1","39","<p>I have an application that uses a countdown timer to display a view in the onFinish() using the setContentView(R.layout.id).  Everything works fine as long as the user does not hit home, timer ends and the layout it displayed plus a tone is played.</p><p>However, if the user hits home or back when the timer ends and onFinish() is called all I get is the tone, the layout is not displayed.</p><p>How do I get the layout to be displayed?  Is it even possible?</p><p>Thanks for your help.</p>","534450","","","","","2010-12-18 20:58:57","App not displaying view","<android><android-layout>","2","0","","",""
"4479785","1","4479822","","2010-12-18 19:38:56","0","500","<p>I am interested in creating an application to perform management tasks in Apache Tomcat.I have seen there are a large section of ant Tasks that can help with most of these tasks, but I am not familiar with how to run ant tasks in my code.</p><p>Can anyone help me find a resource to understand how to use these tasks, or another way I can get access to the Tomcat Management console.?</p><p>I would prefer to have REST Api access if possible.</p>","318852","","","","","2010-12-18 19:46:42","Help creating an Android app to access Tomcat Server?","<java><android><rest><ant><tomcat6>","1","0","","",""
"4479814","1","4480055","","2010-12-18 19:44:40","0","1394","<p><br>i'm not able to connect my android emulator to net<br>i am using 2.3 API based system<br>i am having permission in manifesto file.<br>i am using broadband to connect to internet,i connect directly to net<br>i am using windows xp service pack 2<br>what is my emulators problem?<br></p>","404183","","19868","","2010-12-18 20:28:06","2012-08-10 19:57:39","Not able to connect to internet using Android Emulator?","<android>","2","2","","",""
"4479897","1","","","2010-12-18 20:05:34","0","3636","<p>I am developing an Android Application, and application needs to connect server.This is the client code. 79.123.176.59 is the server's IP address. Application and the server are connected to same network. When I execute my application, it never opens a socket. So it cannot connect to server.</p><p>When I execute client code seperate from the application, it just works fine! </p><p>What is the problem ? Do you have any suggestions ? </p><p>Thank you!</p><pre><code>int port=8080;   Socket s;   String msg="""";   String err=""error"";   try{       Log.d(""Client"",""Socket"");       s=new Socket(""79.123.176.59"",port);       Log.d(""Client"",""Socket opened"");       OutputStreamWriter osw=new OutputStreamWriter(s.getOutputStream());       PrintWriter pw=new PrintWriter(osw);       BufferedReader br1=new BufferedReader(new InputStreamReader(s.getInputStream()));       Log.d(""Client"",""Streams"");       pw.println(latitude + "" "" + longitude );       Log.d(""Client"",""String send"");       pw.flush();       msg=br1.readLine();       return msg;   }   catch ( Exception e )   {       return err;   }</code></pre>","520628","","1465910","","2012-09-29 11:03:34","2012-09-29 11:03:34","Android Application cannot open socket to connect Server","<android><sockets><client>","3","0","0","",""
"4479972","1","4480035","","2010-12-18 20:20:05","0","1645","<p>I have a main activity A1 running. It sets an alarm a1 that goes off at time t1. An alarm receiver AR1 that catches the a1 alarm and creates a service S1. Service S1 creates a dialog activity A2 and also sets an alarm a2 that goes off at time t2. Another alarm receiver AR2 catches the a2 alarm and I need AR2 to kill the dialog activity A2.</p><p>I cannot see how the service can get a handle on the activity in order to kill it or call its finish() method.</p>","479542","","","","","2010-12-18 20:35:43","How to kill activity from a service","<android>","1","0","1","",""
"4480018","1","4481295","","2010-12-18 20:32:30","3","4805","<p>I'm trying to create a dynamical scrollable view.  It will keep a list of elements downloaded from a server.  This list could be thousands of elements.  Because of this elements have to be downloaded to the list as it is scrolled downwards, and also should be deleted from the top of the list to keep memory usage low.  I also need to be able to set different views as elements.</p><p>Would it be best to use a ScrollView or a ListView?  And how would I go about adding elements to a list and keeping control of when to download more elemets?</p><p>I remember stumbling across an example or tutorial about how to do this.  Especially about how to add elements as it is scrolled down, delete elements at the top, and create different xml views to use as elements.  I cannot find this example tutorial now.  It was something about how to reuse elements as they go out if scope when scrolled I think.</p>","324943","","","","","2010-12-19 02:21:32","Dynamically load elements to a ScrollView","<android><layout><view><scrollview>","2","0","2","",""
"4480071","1","4480474","","2010-12-18 20:44:50","1","723","<p>Hi my android app has a listactivity this activity called from another activity with Intent , after calling in onCreate method of the ListActivity create a new AsynchTask and call web service and put all stuff into my ArrayList data come from web service is fine , but when i try to implement getView of the customArrayAdapter things get wierd , it sometimes show content of  the list sometimes not or sometimes when i scroll.Here is my getView method of custom adapter. (Layout = textview + listView)</p><pre><code>class EntryDetailsAdapter extends ArrayAdapter&lt;Entry&gt;{      private ArrayList&lt;Entry&gt; entryDetails;      private Entry tempEntry;      public EntryDetailsAdapter(Context context, int textViewResourceId,        List&lt;Entry&gt; objects) {       super(context, textViewResourceId, objects);       // TODO Auto-generated constructor stub       entryDetails =  (ArrayList&lt;Entry&gt;) objects;      }      @Override      public View getView(int position, View convertView, ViewGroup parent) {       // TODO Auto-generated method stub       View mView = convertView;       if(mView == null){        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);        mView = inflater.inflate(R.layout.entry_rows, null);       }       tempEntry = entryDetails.get(position);       //data is fine but problem is while occur while showing data       if(tempEntry != null){        //get the textview from list row xml that i defined        TextView textView = (TextView) findViewById(R.id.entryRowTextView);        if(textView != null){        //i dont know why but this sometimes giving null so check         textView.setText(tempEntry.getEntryContent());        }       }       return mView;      }     }</code></pre><p>[NOTE] Problem might similar to <a href=""http://stackoverflow.com/questions/2955218/listview-in-arrayadapter-order-gets-mixed-up-when-scrolling"">this question</a> but i couldnt find a solution</p>","155332","","155332","","2010-12-22 17:32:41","2010-12-22 17:32:41","ListView does not show custom arrayadapter correctly?","<java><android><listview><android-arrayadapter>","2","0","","",""
"4480340","1","4497901","","2010-12-18 21:45:51","0","3347","<p>I am new to Android and trying to implement the sample AlarmController application. Everything is fine but its Alarm Service is not working. I was wondering that do I need to register these services in the AndroidManifest.xml file as the other activities a are registered and if yes. How do I do that, I guess the alarm controller code is Available on Android's website therefore I am just putting the AndroidManifest.xml code of my application.</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.AlarmController""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".AlarmActivity""                  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>","385145","","244296","","2010-12-18 22:40:53","2010-12-21 09:43:15","Sample AlarmController application Service registeration in AndroidManifest","<android><service><activity><android-manifest><broadcastreceiver>","2","0","","",""
"4480363","1","4480517","","2010-12-18 21:50:48","9","14715","<p>I am having weird character encoding issues with a JSON array that is grabbed from a web page. The server is sending back this header: </p><p>Content-Type    text/javascript; charset=UTF-8</p><p>Also I can look at the JSON output in Firefox or any browser and Unicode characters display properly. The response will sometimes contain words from another language with accent symbols and such. However I am getting those weird question marks when I pull it down and put it to a string in Java. Here is my code:</p><pre><code>HttpParams params = new BasicHttpParams();HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);HttpProtocolParams.setContentCharset(params, ""utf-8"");params.setBooleanParameter(""http.protocol.expect-continue"", false);HttpClient httpclient = new DefaultHttpClient(params);HttpGet httpget = new HttpGet(""http://www.example.com/json_array.php"");HttpResponse response;    try {        response = httpclient.execute(httpget);        if(response.getStatusLine().getStatusCode() == 200){            // Connection was established. Get the content.             HttpEntity entity = response.getEntity();            // If the response does not enclose an entity, there is no need            // to worry about connection release            if (entity != null) {                // A Simple JSON Response Read                InputStream instream = entity.getContent();                String jsonText = convertStreamToString(instream);                Toast.makeText(getApplicationContext(), ""Response: ""+jsonText, Toast.LENGTH_LONG).show();            }        }    } catch (MalformedURLException e) {        Toast.makeText(getApplicationContext(), ""ERROR: Malformed URL - ""+e.getMessage(), Toast.LENGTH_LONG).show();        e.printStackTrace();    } catch (IOException e) {        Toast.makeText(getApplicationContext(), ""ERROR: IO Exception - ""+e.getMessage(), Toast.LENGTH_LONG).show();        e.printStackTrace();    } catch (JSONException e) {        Toast.makeText(getApplicationContext(), ""ERROR: JSON - ""+e.getMessage(), Toast.LENGTH_LONG).show();        e.printStackTrace();    }private static String convertStreamToString(InputStream is) {    /*     * To convert the InputStream to String we use the BufferedReader.readLine()     * method. We iterate until the BufferedReader return null which means     * there's no more data to read. Each line will appended to a StringBuilder     * and returned as String.     */    BufferedReader reader;    try {        reader = new BufferedReader(new InputStreamReader(is, ""UTF-8""));    } catch (UnsupportedEncodingException e1) {        // TODO Auto-generated catch block        e1.printStackTrace();    }    StringBuilder sb = new StringBuilder();    String line;    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>As you can see, I am specifying UTF-8 on the InputStreamReader but every time I view the returned JSON text via Toast it has strange question marks. I am thinking that I need to send the InputStream to a byte[] instead?</p><p>Thanks in advance for any help.</p>","547276","","","","","2010-12-19 00:34:44","Android Java UTF-8 HttpClient Problem","<java><android><httpclient>","2","0","10","",""
"4480412","1","","","2010-12-18 22:03:08","0","298","<p>I have decent programming skills and could create an Android app and an iPhone app, but the application is so simple, I was wondering if anyone already knew of an app to already do this.  I have thousands of images and videos that I would like to sell.  I could either sell them in ""bundles"" where each app would have 100 pictures and 5 videos or so.. but I'd prefer to have the person purchase ""galleries"" so they would pay for each set of 100 pictures / videos Separately. </p><p>I have the skills to create an RSS feed, use my own payment processing system (although I don't think Android likes free apps to have a separate way of collecting money from the publisher).</p><p>Suggestions?  Thanks.</p>","500187","","","","","2012-10-01 12:33:55","I have a bunch of great photos that I would like to sell online, in the Android Marketplace, and Itunes for iphone and ipad. Suggestions?","<iphone><android><video><photo-gallery>","2","0","","",""
"4480472","1","","","2010-12-18 22:20:15","0","1337","<p>how to set image in top left corner position in linearlayout ?</p>","508377","","","","","2010-12-18 22:33:57","how to set image in top left corner position in linearlayout?","<android>","1","0","","",""
"4480489","1","4480521","","2010-12-18 22:26:12","5","9028","<p>I am working on my app which has 3 spinners in one view. Some of my activities will need to use 3 spinners, some 2, some 1, so I would like to hide them depending on the activity, if that is even possible. I am trying to do it like this so I can be as efficient as possible, but I have no idea if it is even possible.</p>","484707","","","","","2010-12-18 22:34:53","Can you hide an element in a layout, such as a spinner, depending on an activity?","<android><layout><spinner>","2","0","3","",""
"4480535","1","4482516","","2010-12-18 22:35:50","2","2306","<p>My issue:</p><blockquote>  <p>12-18 17:05:03.336: DEBUG/StrictMode(2112): StrictMode policy violation; ~duration=2073 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2</p></blockquote><p>From the factory method</p><blockquote>  <p>12-18 17:05:03.336: DEBUG/StrictMode(2112):     at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:299)</p></blockquote><p>Then in my code</p><blockquote>  <p>12-18 17:05:03.336:  DEBUG/StrictMode(2112):  at  blah.ImageCache.getFromCache(ImageCache.java:248)</p>    <p>12-18 17:05:03.336:  DEBUG/StrictMode(2112):<br>    at  blah2$LoaderThread$1.handleMessage(blah.java:63)</p></blockquote><p>Important snip-its</p><blockquote>  <p>class LoaderThread extends HandlerThread {</p>    <p>public Handler mHandler;</p>    <p>public LoaderThread(String name) {    super(name);   }</p>    <p>@Override   public void onLooperPrepared(){    mHandler = new Handler(){     public void handleMessage(Message msg) {      Bitmap bit =ImageCache.getInstance().getFromCache((String)msg.obj,ImageCache.USE_DISK);     }    };   }  }</p></blockquote><p>The getFromCache method in the ImageCache class calls</p><pre><code>bitmap = BitmapFactory.decodeFile(fLoc);</code></pre><p>Which seems to be running on the UI thread, but it makes no sense to me. Shouldn't this be getting called on a background thread? This was the goal of using <a href=""http://developer.android.com/reference/android/os/HandlerThread.html"" rel=""nofollow"">HandlerThread</a> after all...</p><p>The LoadThread class is created in my onCreate(bundle) like this</p><blockquote>  <p>LoaderThread loader = new LoaderThread(""imgLoader"")</p>    <p>loader.start();</p></blockquote><p>and messages are passed from the UI thread via the handler</p><blockquote>  <p>loader.mHandler.dispatchMessage(loader.mHandler.obtainMessage(args..));</p></blockquote><p>I'm wondering if this has to do with the getInstance method which is static</p><blockquote>  <p>public static synchronized ImageCache getInstance() { </p>    <p>if (_instance==null) {     _instance = new ImageCache();    }    return _instance;   } </p></blockquote>","413575","","","","","2010-12-19 10:23:55","StrictMode confusion - how is this the wrong thread?","<android><file-io><handler><looper><strictmode>","1","2","","",""
"4480652","1","6351812","","2010-12-18 23:04:34","35","21020","<p>I'm trying to make simple animation that is repeated several times (or infinite).<br/>It seems that <code>android:repeatCount</code> does not work!<br/>Here is my animation resource from <code>/res/anim/first_animation.xml</code> :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set    xmlns:android=""http://schemas.android.com/apk/res/android""    android:shareInterpolator=""false""    android:repeatCount=""infinite""    &gt;    &lt;scale        android:interpolator=""@android:anim/decelerate_interpolator""        android:duration=""500""        android:fromXScale=""1.0""        android:fromYScale=""1.0""        android:toXScale=""1.2""        android:toYScale=""1.2""        android:pivotX=""50%""        android:pivotY=""50%""        android:fillAfter=""false"" /&gt;    &lt;scale        android:interpolator=""@android:anim/accelerate_interpolator""        android:startOffset=""500""        android:duration=""500""        android:fromXScale=""1.2""        android:fromYScale=""1.2""        android:toXScale=""1.0""        android:toYScale=""1.0""        android:pivotX=""50%""        android:pivotY=""50%""        android:fillAfter=""false"" /&gt;&lt;/set&gt;</code></pre><p>First it should scale image from 1.0 to 1.2 size in 500 ms.<br/>And then scale it back to 1.0 in 500 ms.<br/>Here is how I'm using it:<br/></p><pre><code>Animation firstAnimation = AnimationUtils.loadAnimation(this, R.anim.first_animation);imgView.startAnimation(firstAnimation);</code></pre><p>It makes one cycle and then finishes. <br/>It scales up, then scales down ans then stops.<br/><br/><strong>How can I make this work as intended?</strong></p>","420951","","","","","2013-12-19 13:07:50","Android animation does not repeat","<android><animation>","16","1","7","",""
"4480768","1","4482249","","2010-12-18 23:33:46","1","988","<p>I am trying to consume a rest WCF service using java client on android 2.1.It works perfectly on small responses. When i tried to push a little further by getting 1000+ char response reader.read(buffer) failed to read all the characters. This caused the last line of the script to return: JsonException unterminated string at character 8193 ""{plate,... </p><p>My android device starts to get this error before the emulator android stars to get it (character 1194 instead of 8193). Anyone knows how get the full message?</p><p>Client Code:</p><pre><code>HttpGet request = new HttpGet(SERVICE_URI + ""/GetPlates"");request.setHeader(""Accept"", ""application/json"");request.setHeader(""Content-type"", ""application/json"");DefaultHttpClient httpClient = new DefaultHttpClient();HttpResponse response = httpClient.execute(request);HttpEntity responseEntity = response.getEntity();char[] buffer = new char[(int)responseEntity.getContentLength()];InputStream stream = responseEntity.getContent();InputStreamReader reader = new InputStreamReader(stream);reader.read(buffer);stream.close();         JSONArray plates = new JSONArray(new String(buffer));</code></pre><p>Server Config:</p><pre><code>&lt;webHttpBinding&gt;    &lt;binding name=""big_webHttpBinding"" maxReceivedMessageSize=""4097152"" maxBufferSize=""4097152"" maxBufferPoolSize=""4097152""&gt;      &lt;readerQuotas maxStringContentLength=""4097152"" maxArrayLength=""4097152"" maxBytesPerRead=""4097152"" maxNameTableCharCount=""4097152"" maxDepth=""4097152""/&gt;    &lt;/binding&gt;  &lt;/webHttpBinding&gt;</code></pre>","547297","","","","","2011-11-20 20:28:05","Java client has trouble to read big responces from wcf rest service","<java><android><httpwebrequest><wcf>","1","0","","",""
"4480882","1","4481754","","2010-12-19 00:01:27","1","798","<p>Ive used this so far:</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this,R.layout.list, R.id.label, names));</code></pre><p>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_height=""wrap_content"" android:layout_width=""match_parent""&gt;    &lt;ImageView android:id=""@+id/icon""     android:layout_height=""wrap_content""     android:src=""@drawable/icon""     android:layout_width=""22px""     android:layout_marginTop=""15px""     android:layout_marginRight=""4px""     android:layout_marginLeft=""4px""&gt;        &lt;/ImageView&gt;    &lt;TextView android:text=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""      android:id=""@+id/label"" android:textSize=""35px""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>That works however my question is how i make every item unique(i have a lot of image in R.drawable)</p><p>So on the item dog i want a dog picture and the cat item is going to be a cat. Now is every item the default app icon.</p><p>Thank you!</p>","502419","","142162","","2010-12-19 00:50:19","2011-04-12 12:57:43","Android Development: listview images","<android>","1","3","","",""
"4480943","1","4481039","","2010-12-19 00:15:33","3","3046","<p>Im new to openGL, and im trying to map an texture to a square. I followed NeHe's tutorial on texture mapping here:<a href=""http://insanitydesign.com/wp/wp-content/uploads/lesson06.zip"" rel=""nofollow"">http://insanitydesign.com/wp/wp-content/uploads/lesson06.zip</a></p><p>Right now i see my image...but its not mapping correctly. Heres the original image:<a href=""http://ge.tt/2FzsdIx"" rel=""nofollow"">http://ge.tt/2FzsdIx</a></p><p>...and heres what im seeing.<a href=""http://ge.tt/6y3cdIu"" rel=""nofollow"">http://ge.tt/6y3cdIu</a></p><p>I used the vertices and texture arrays from this great iphone tutorial (link below) so im hoping they have been mapped correctly. Below is the link to my code in Square.java, thanks!</p><pre><code>public class Square {// Our vertices.private float vertices[] = {          -1.0f,  1.0f, 0.0f,  // 0, Top Left          -1.0f, -1.0f, 0.0f,  // 1, Bottom Left           1.0f, -1.0f, 0.0f,  // 2, Bottom Right           1.0f,  1.0f, 0.0f,  // 3, Top Right    };// The order we like to connect them.private short[] indices = { 0, 1, 2, 0, 2, 3 };// Our vertex buffer.private FloatBuffer vertexBuffer;// Our index buffer.private ShortBuffer indexBuffer;/** The buffer holding the texture coordinates */private FloatBuffer textureBuffer;//the texture pointer, holds the texture name which is actually a number.private int[] textures = new int[1];public Square() {    // a float is 4 bytes, therefore we multiply the number if    // vertices with 4.    ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);    vbb.order(ByteOrder.nativeOrder());    vertexBuffer = vbb.asFloatBuffer();    vertexBuffer.put(vertices);    vertexBuffer.position(0);    // short is 2 bytes, therefore we multiply the number if    // vertices with 2.    ByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2);    ibb.order(ByteOrder.nativeOrder());    indexBuffer = ibb.asShortBuffer();    indexBuffer.put(indices);    indexBuffer.position(0);    //plot our texture    float textCoords[]={            //Mapping coordinates for the vertices            0.0f, 1.0f,            1.0f, 1.0f,            0.0f, 0.0f,            1.0f, 0.0f                                };    ByteBuffer tbb = ByteBuffer.allocateDirect(textCoords.length * 4); tbb.order(ByteOrder.nativeOrder());    textureBuffer = tbb.asFloatBuffer(); textureBuffer.put(textCoords);    textureBuffer.position(0);}//load our texture(s)static void loadTexture(GL10 gl, Context context, int resource) {    Bitmap bmp = BitmapFactory.decodeResource(context.getResources(),resource);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bmp, 0);    gl.glTexParameterx(GL10.GL_TEXTURE_2D,    GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);     gl.glTexParameterx(GL10.GL_TEXTURE_2D,    GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    bmp.recycle();      }/** * This function draws our square on screen. * @param gl */public void draw(GL10 gl) {    //use our textures    gl.glEnable(GL10.GL_TEXTURE_2D); // workaround bug 3623    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);    // Counter-clockwise winding.    gl.glFrontFace(GL10.GL_CCW); // OpenGL docs    // Enable face culling.    gl.glEnable(GL10.GL_CULL_FACE); // OpenGL docs    // What faces to remove with the face culling.    gl.glCullFace(GL10.GL_BACK); // OpenGL docs    // Enabled the vertices buffer for writing and to be used during    // rendering.    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);// OpenGL docs.    // Specifies the location and data format of an array of vertex    // coordinates to use when rendering.    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, // OpenGL docs                             vertexBuffer);    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length,// OpenGL docs              GL10.GL_UNSIGNED_SHORT, indexBuffer);    // Disable the vertices buffer.    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); // OpenGL docs    // Disable face culling.    gl.glDisable(GL10.GL_CULL_FACE); // OpenGL docs    }}</code></pre><p>iPhone tutorial:<a href=""http://www.iphonemobilephones.com/opengl-es-from-the-ground-up-part-6-textures-and-texture-mapping.html"" rel=""nofollow"">http://www.iphonemobilephones.com/opengl-es-from-the-ground-up-part-6-textures-and-texture-mapping.html</a></p>","385051","","1260028","","2012-07-04 11:28:38","2012-07-04 11:28:38","mapping a texture on a square (Android)","<android><opengl-es><textures><vertices>","3","0","1","",""
"4480999","1","4481402","","2010-12-19 00:28:03","1","255","<p>In the android Notes demo, it accepts the URI:</p><pre><code>    sUriMatcher.addURI(NotePad.AUTHORITY, ""notes"", NOTES);    sUriMatcher.addURI(NotePad.AUTHORITY, ""notes/#"", NOTE_ID);</code></pre><p>Where the difference between notes and notes/# is that notes/# returns the note who's ID matches #.</p><p>However, the managedQuery() method that is used to get data from the content provider has the following parameters:</p><pre><code>Parametersuri The URI of the content provider to query.projection  List of columns to return.selection   SQL WHERE clause.selectionArgs   The arguments to selection, if any ?s are pesentsortOrder   SQL ORDER BY clause.</code></pre><p>So, is there any particular cause for the design decision of providing a URI for that, rather than just using the selection parameter?  Or is it just a matter of taste?</p><p>Thank you.</p>","288439","","","","","2010-12-19 03:05:57","Android Notepad Uri Explanation","<sql><android><sqlite><uri>","2","2","1","",""
"4481068","1","4481109","","2010-12-19 00:50:35","0","1097","<p>I'm trying to test an application on an actual Android device (the main reason is to test the Bluetooth functionality, which the emulator cannot help with :( ). To help with my endeavor, I'm thinking about buying an Unlocked HTC G1 from eBay. My question is will I be able to use the unlocked phone without any SIM card at all? Ideally, I'd like to be able to use wi-fi and other native apps, but my main focus would be to test my application, without having a SIM card.</p><p>If there are any better phones, or alternative strategies that I should employ, I'd be grateful to hear about them.</p><p>Thanks in advance!</p>","456916","","","","","2010-12-19 01:22:42","Testing on Android Hardware without a SIM Card","<android>","3","0","","",""
"4481210","1","","","2010-12-19 01:47:37","2","866","<p>I have a very large image (a map) that I need to display. I already have the image in ""tiled"" format - 256x256 pieces.Also I got tiles for several ""zoom"" levels.</p><p>At the moment the issue is to display the deepest zoom level, where you'd have really a lot of tiles.For example, a medium sized map will contain 4 rows and 26 columns of tiles for deep level.</p><p>I tried approaching the problem using a 2 dimensional scroll view and image views inside it - 1 per tile.The problems is that it crashes. When I try displaying 4 rows and 20 columns it doesn't crash, obviously it's a memory issue.</p><p>So the question here - how to display all that, taking into account limited phone RAM.I do understand there should be a way to dealocate memory for images that are out of sight, and only display those which are currently in visible area of the scroll view, but I don't know how to do that.</p><p>Would be happy to hear any clues or maybe there's alternative approach to these things.</p><p>Thanks.</p>","547401","","","","","2010-12-19 02:46:07","Display huge tiled image on android phone","<android><maps><tiles>","1","0","0","",""
"4481226","1","4482868","","2010-12-19 01:57:26","92","46684","<p>I'm trying to create an always-op-top button/clickable-imagewhich stays on top of all the windows all the time. </p><p>The proof ofconcept is </p><ul><li>here - <a href=""http://www.appbrain.com/app/smart-taskbar-%28sidebar%29/com.smart.taskbar"">Smart Taskbar (on AppBrain)</a></li><li>and here <a href=""http://forum.xda-developers.com/showthread.php?t=865525"">V1.4.0 Sidebar style SWKey - Button savior (on xda-developers)</a> </li></ul><p>I wasfollowing sample code that used to live at this URL but the link is now dead.</p><ul><li><a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/LoadAverageService.java;h=0d86429aaa5ccf6ecf311dfb3af0f3ccbf5f8d29;hb=HEAD"">services/java/com/android/server/LoadAverageService.java (on http://android.git.kernel.org)</a></li></ul><p>I have been successful and have a running service now. The servicedisplays some text on top left corner of screen all the time whileuser can freely interact with rest of apps in normal manner. </p><p>What I'mdoing is subclass <code>ViewGroup</code> and add it to root window manager withflag <code>TYPE_SYSTEM_OVERLAY</code>. Now I want to add a button/clickable-imagein place of this text which can receive touch events on itself. Itried overriding ""onTouchEvent"" for the whole <code>ViewGroup</code> but it doesnot receive any event. </p><p>How can I receive events only on certain partsof my always-on-top view group? Kindly suggest.</p><pre><code>public class HUD extends Service {    HUDView mView;    @Override    public IBinder onBind(Intent intent) {        return null;    }    @Override    public void onCreate() {        super.onCreate();        Toast.makeText(getBaseContext(),""onCreate"", Toast.LENGTH_LONG).show();        mView = new HUDView(this);        WindowManager.LayoutParams params = new WindowManager.LayoutParams(                WindowManager.LayoutParams.WRAP_CONTENT,                WindowManager.LayoutParams.WRAP_CONTENT,                WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,                0,//              WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE//                      | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,                PixelFormat.TRANSLUCENT);        params.gravity = Gravity.RIGHT | Gravity.TOP;        params.setTitle(""Load Average"");        WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);        wm.addView(mView, params);    }    @Override    public void onDestroy() {        super.onDestroy();        Toast.makeText(getBaseContext(),""onDestroy"", Toast.LENGTH_LONG).show();        if(mView != null)        {            ((WindowManager) getSystemService(WINDOW_SERVICE)).removeView(mView);            mView = null;        }    }}class HUDView extends ViewGroup {    private Paint mLoadPaint;    public HUDView(Context context) {        super(context);        Toast.makeText(getContext(),""HUDView"", Toast.LENGTH_LONG).show();        mLoadPaint = new Paint();        mLoadPaint.setAntiAlias(true);        mLoadPaint.setTextSize(10);        mLoadPaint.setARGB(255, 255, 0, 0);    }    @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        canvas.drawText(""Hello World"", 5, 15, mLoadPaint);    }    @Override    protected void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4) {    }    @Override    public boolean onTouchEvent(MotionEvent event) {        //return super.onTouchEvent(event);        Toast.makeText(getContext(),""onTouchEvent"", Toast.LENGTH_LONG).show();        return true;    }}</code></pre>","453906","","154306","","2014-03-22 18:45:46","2014-03-22 18:45:46","Creating a system overlay window (always on top)","<android><overlay><android-ui>","7","6","108","",""
"4481350","1","4481472","","2010-12-19 02:43:07","1","326","<p>I have a customized keyboard, that is installed, and is used when you change input method.I would like to use this keyboard in my application, not as an installed soft keyboard, but as a keyboard that pops only in my application\part of the application.</p><p>How can I do this (and use same code).</p>","380490","","","","","2010-12-19 03:36:18","Using my own keyboard","<android><keyboard>","1","0","1","",""
"4481398","1","","","2010-12-19 03:04:26","1","811","<p>I want help in this respectI am calling facebook.authorize method.But the logcat gives com.facebook.android.katana.ProxyAuth has leaked window error and application force closes.</p>","529664","","","","","2010-12-19 03:04:26","Facebook android SDK gives error com.facebook.android.katana.ProxyAuth has leaked window","<android><facebook><sdk>","0","2","1","",""
"4481403","1","4544238","","2010-12-19 03:06:08","0","169","<p>Every time I run the android emulator I receive this message. What should I do to fix it?</p><blockquote>  <p>emulator: ERROR: no search paths found in this AVD's configuration.<br>  Weird, the AVD's config.ini file is malformed. Try re-creating it.</p></blockquote>","495361","","19750","","2010-12-19 03:16:42","2010-12-28 06:54:07","Android SDK win 7","<android><android-emulator>","1","0","","",""
"4481405","1","4486421","","2010-12-19 03:06:45","0","1615","<p>I'm experimenting with the SurfaceView in Android and I'm trying to create a simple drawing type application, where you ""draw"" by touch on it.  I have a thread running to handle the drawing onto the canvas but I'm hitting some performance issues.  I read on <a href=""http://developer.android.com/guide/topics/graphics/index.html"" rel=""nofollow"">http://developer.android.com/guide/topics/graphics/index.html</a> that you need to repaint the entire surface so I tried storing all the touched points in a float array mPoints and than redraw them every time.  Problem is when a lot of points build up it gets really slow.  Here is the code for that:</p><pre><code>    @Override    public void run() {         while(mIsRunning) {            Canvas c = null;            try {                                   c = mSurface.lockCanvas(null);                synchronized(mSurface) {                    int size = mPoints.getSize();                    for(int i = 0; i &lt; size; i += 2) {                        c.drawCircle(mPoints.get(i), mPoints.get(i + 1), 3, mPaint);                                                }                   }                                               }            finally {                if (c != null)                    mSurface.unlockCanvasAndPost(c);            }               }       }</code></pre><p>However when I updated it so that it cleared the float array and only drew new touched points it causes a lot of flickering.  From what I can tell this is because Android uses double buffering.  I'm not sure how to get around these problems.</p>","63155","","","","","2010-12-20 02:24:05","Problems when drawing on SurfaceView","<android><surfaceview><android-sdk-2.1>","2","0","1","",""
"4481462","1","","","2010-12-19 03:32:12","0","3845","<p>I made an app which is just working fine. But when i click on ""cancel"" or ""ok"" button when i run the program, instead of linking me to result.java, the simulator give me ""The application has stopped unexpectedly please try again"" Here's the code</p><pre><code>import android.app.Activity;import android.content.ComponentName;import android.content.Intent;import android.database.CursorJoiner.Result;import android.os.Bundle;import android.view.View;import android.widget.AutoCompleteTextView;public class lib_main extends Activity {public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);}public void onAddClick (View botton){AutoCompleteTextView title = (AutoCompleteTextView)findViewById(R.id.Title);AutoCompleteTextView author = (AutoCompleteTextView)findViewById(R.id.Author); AutoCompleteTextView isbn = (AutoCompleteTextView)findViewById(R.id.ISBN);Intent intent = new Intent();intent.setClass(this,Result.class);intent.putExtra(""Title"", title.getText().toString());intent.putExtra(""Author"", author.getText().toString()); intent.putExtra(""ISBN"", isbn.getText().toString());startActivity(intent);}public void onCancelClick(View botton){Intent intent = new Intent();intent.setComponent(new ComponentName(this,Result.class));intent.putExtra(""Cancel"",""Cancel"");startActivity(intent);}}</code></pre><p>this is Result.java</p><pre><code>import android.app.Activity; import android.os.Bundle; import android.widget.TextView;public class Result extends Activity {public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.result);TextView resultText=(TextView)findViewById(R.id.resultText);Bundle bundle =getIntent().getExtras();if(bundle.getString(""Cancel"")!= null){resultText.setText(""operation cancel"");}else{  String book =bundle.getString (""Title"");   String title =bundle.getString (""Author"");   String isbn =bundle.getString (""ISBN"");   resultText.setText(     getString (R.string.resultOk)+""""+book+""""+ title+""""+isbn); } } }</code></pre><p>the error log write ""No command output when running:'am start-n com.Library.doc/com.Library.doc.lib_main-a android.intent.action.MAIN-c android.intent.category.LAUNCHER' in device emulator-5554""</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.Library.doc""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".lib_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="".Result""              android:label=""@string/result""&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""8"" /&gt;</code></pre><p> Can anyone help me with this problem?</p>","546829","","546829","","2010-12-20 05:45:09","2011-04-05 13:49:37","JAVA - Android error: The application has stopped unexpectedly please try again","<android>","1","4","","",""
"4481605","1","4484747","","2010-12-19 04:33:24","1","1988","<p>I'm working on an android app that has a section that feels like an iPhone home screen. There's a bunch of pages that are essentially displaying the same data in different configurations and users should be able to quickly move between them. Generally there won't be more than 4 or 5 pages.</p><p>I could just replicate the experience with the iPhone home screen with multiple dots on the bottom of the page, but that doesn't feel very android-friendly. What's the design pattern in android for viewing and interacting with this type of view? I know the android home screen has a variant with dots, but I've never seen it used within an app.</p><p>Screenshots or links to existing apps would be great.</p>","9137","","9137","","2010-12-19 04:39:16","2010-12-19 19:46:01","What's the android design pattern for multiple pages?","<android><design-patterns>","2","0","2","",""
"4481685","1","4487535","","2010-12-19 05:03:28","1","1776","<p>In my code I can get Facebook to show up, show the requested permissions and authorize, everytime I return after it remembers who I am.</p><p>In my app itself though it can not seem to recognize that it is logged in, the call to Authorize never returns through the DialogListener interface. The somewhat incomplete code of my apps adapter is included.</p><pre><code>package com.metalrain.ca.newschoolshooter_full;import java.io.FileNotFoundException;import java.io.IOException;import java.net.MalformedURLException;import Hammer.App.MyLibs.APPSTATICS;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import com.facebook.android.AsyncFacebookRunner;import com.facebook.android.DialogError;import com.facebook.android.Facebook;import com.facebook.android.FacebookError;import com.facebook.android.Facebook.DialogListener;public class FacebookIntegrator implements DialogListener{ public static final String APP_ID = ""176680882361390""; private final Facebook mFacebook; //private final AsyncFacebookRunner mAsyncRunnoner; Context ctx; String[] Permissions = new String[] {""publish_stream"", ""read_stream"", ""offline_access""}; FacebookIntegrator(final Context ctx) {  this.ctx = ctx;  this.mFacebook = new Facebook(FacebookIntegrator.APP_ID);  //this.mAsyncRunner = new AsyncFacebookRunner(this.mFacebook); } public void SubmitScore() {  Log.e(""MetalRain"", ""Started SubmitScore""+mFacebook.getAccessToken());  //I use the class from the login button to do this  //final LoginButton lb = new LoginButton(this.ctx);  if (mFacebook.isSessionValid()) {   Log.i(""MetalRain"", ""There is a valid facebook sessi"");         Bundle b = new Bundle();    try {     mFacebook.request(""/me/feed"", b, ""POST"");    } catch (FileNotFoundException e) {     // TODO Auto-generated catch block     e.printStackTrace();    } catch (MalformedURLException e) {     // TODO Auto-generated catch block     e.printStackTrace();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }             b.putString(""status"", ""This is a test: name"");  } else {   Log.i(""MetalRain"",""Authorizing facebook"");   mFacebook.authorize((Activity) this.ctx,this.Permissions,     this);  }  Log.e(""MetalRain"", ""Finished SubmitScore""); }        public void onComplete(Bundle values) {            if (!values.containsKey(""post_id""))            {                try                {                    Bundle parameters = new Bundle();                    parameters.putString(""message"", ""this is a test"");// the message to post to the wall                    mFacebook.dialog(APPSTATICS.CTX, ""stream.publish"", parameters, this);// ""stream.publish"" is an API call                }                catch (Exception e)                {                    // TODO: handle exception                    System.out.println(e.getMessage());                }            }         Log.e(""MetalRain"", ""On Complete"");        }        public void onFacebookError(FacebookError error) {            Log.e(""MetalRain"",""fbFAILURE ""+error.getMessage());        }        public void onError(DialogError error) {            Log.e(""MetalRain"",""FAILURE ""+error.getMessage());        }        public void onCancel() {            Log.e(""MetalRain"",""CANCELED"");        }}</code></pre><p>I am not seeing any errors or any log messages post-return. It just returns to my activity and acts as if nothing is happening.</p>","460156","","","","","2010-12-20 07:00:30","Android Facebook API Authorizes/Remembers on it's side, but not on mine?","<android><facebook>","1","5","","",""
"4481818","1","4510848","","2010-12-19 05:57:23","1","965","<p>Has anyone tried testing SensorEvents on Nexus S with gingerbread 2.3What all SensorEvents does it support ?Specifically I am looking for these :</p><p>Sensor.TYPE_GRAVITY</p><p>Sensor.TYPE_LINEAR_ACCELERATION</p><p>and</p><p>Sensor.TYPE_ROTATION_VECTOR</p><p>Sensor.TYPE_GYROSCOPE</p><p>Can someone provide output of these events ? Does it support all of them ?This question is related to my old post for separating gravity from accelerometer readings found <a href=""http://stackoverflow.com/questions/3377288/how-to-remove-gravity-factor-from-accelerometer-readings-in-android-3-axis-accele"">here</a>.</p>","315619","","89806","","2011-01-02 09:51:18","2011-01-02 09:51:18","Nexus S sensor events -- have any one got their hands on?","<android><sensor><android-sdk-2.3><nexus-s>","1","0","","",""
"4481895","1","4481952","","2010-12-19 06:29:54","5","6109","<p>I'm trying to read all the contacts using RawContacts.entityIterator but I'm seeing this error:</p><p>android.database.CursorIndexOutOfBoundsException: Index -1 requested</p><p>Following is my code:</p><pre><code>ContentResolver cr = getContentResolver();        Cursor cur = cr.query(Contacts.CONTENT_URI,        null, null, null, null);String id = cur.getString(cur.getColumnIndex(Contacts._ID));if (cur.getCount() &gt; 0) {        while (cur.moveToNext()) {         final Uri uri = RawContactsEntity.CONTENT_URI;            final String selection = Data.CONTACT_ID + ""=?"";            final String[] selectionArgs = new String[] {id};            final Map&lt;String, List&lt;ContentValues&gt;&gt; contentValuesListMap =                new HashMap&lt;String, List&lt;ContentValues&gt;&gt;();            EntityIterator entityIterator = null;            entityIterator = RawContacts.newEntityIterator(cr.query(                    uri, null, selection, selectionArgs, null));            while (entityIterator.hasNext()) {                Entity entity = entityIterator.next();                for (NamedContentValues namedContentValues : entity.getSubValues()) {                    ContentValues contentValues = namedContentValues.values;                    String key = contentValues.getAsString(Data.MIMETYPE);                    if (key != null) {                        List&lt;ContentValues&gt; contentValuesList =                                contentValuesListMap.get(key);                        if (contentValuesList == null) {                            contentValuesList = new ArrayList&lt;ContentValues&gt;();                            contentValuesListMap.put(key, contentValuesList);                        }                        contentValuesList.add(contentValues);                    }                }            }            Log.i(tag, ""Contact index="" + id);        }     }</code></pre><p>Can somebody please tell me what's wrong with my code.</p>","538255","","293929","","2010-12-19 06:32:11","2013-08-23 08:01:27","android.database.CursorIndexOutOfBoundsException: Index -1 requested","<android>","2","1","","",""
"4481903","1","4481912","","2010-12-19 06:33:33","4","8812","<p>I always got an error when i run my created application and based on my research I haven't registered my java file in the .xml. How can I register a new activity in manifest.xml?</p>","516160","","","","","2012-08-17 20:13:44","How to register a new activity in manifest.xml?","<java><android><eclipse>","3","0","","",""
"4481928","1","7252799","","2010-12-19 06:44:25","0","1423","<p>I am using Handler for communicating between Current Activity and a subclass of Application.Subclass is having a thread which processes web service calls.Subclass may also have a ProgressDialog instance.</p><p>I want to show ProgressDialog when http call is starting and dismiss dialog when call is finished.</p><p>For this to happen, I need to access Activity from Handler. And then assign activity to Dialog using setOwnerActivity.</p><p>Is this possible? I tried and cant not get activity from Handler. The max Handler can give is Thread which sent message.</p>","547515","","21234","","2010-12-19 10:51:43","2011-08-31 05:13:22","Android getting Activity instance in Application from Handler","<android><activity><handler><progressdialog>","2","0","","",""
"4481938","1","","","2010-12-19 06:47:45","0","493","<p>I had installed jdk,sdk,eclipse,and set the path.i will show the jdk-version,sdk.</p><p>jdk version test:</p><p>C:>java -versionjava version ""1.6.0_10""Java(TM) SE Runtime Environment (build 1.6.0_10-b33)Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)</p><p>sdk test:</p><p>C:>android -helpUsage: java [-options] class [args...]           (to execute a class)   or  java [-options] -jar jarfile [args...]           (to execute a jar file)</p><p>where options include:    -client       to select the ""client"" VM    -server       to select the ""server"" VM    -hotspot      is a synonym for the ""client"" VM  [deprecated]                  The default VM is client.</p><pre><code>-cp &lt;class search path of directories and zip/jar files&gt;-classpath &lt;class search path of directories and zip/jar files&gt;</code></pre><p>the eclipse version:Eclipse IDE for Java Developers---Eclipse Galileo SR2 Packages (v 3.5.2)</p><p>but have a question when i install the ADT: i install it online,the urlthe question is : </p><p>you are installing software that contains unsigned content.The authenticity or validity of this software cannot be established.</p>","547517","","","","","2010-12-19 07:26:39","I can't install the ADT plugin for eclipse 3.5.2 on windows XP(32bit)","<android><plugins><adt>","1","0","","",""
"4482045","1","","","2010-12-19 07:38:19","11","2503","<p>I'd like develop an Alarm Application.The application should work like this:</p><ul><li>launch it</li><li>the activity show me the time</li><li>I can set the alarm</li><li>I can close the application</li><li>when the alarm time comes , it starts an activity (even if the device is locked)</li></ul><p>I have tried to adapt this sample <a href=""https://github.com/commonsguy/cwac-wakeful"" rel=""nofollow"">https://github.com/commonsguy/cwac-wakeful</a> but I cannot launch an activity when the  alarm time comes.  </p><p>I use this code to setup the alarm (for test I have inserted this code on an <code>onCreate</code> method of activity):</p><pre><code>Intent intent = new Intent(this, OnAlarmReceiver.class);PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);Calendar cal = Calendar.getInstance();cal.add(Calendar.SECOND, 10);AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);alarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, cal.getTimeInMillis(),            pendingIntent);</code></pre><p>this is the OnAlarmReceiver class:</p><pre><code>public class OnAlarmReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Log.i(ClockActivity.LOG_TAG, ""OnAlarmReceiver::onReceive"");        WakefulIntentService.sendWakefulWork(context, AlarmService.class);    }}</code></pre><p>this is the service class:</p><pre><code>public class AlarmService extends WakefulIntentService {    public AlarmService(String name) {        super(name);    }    @Override    protected void doWakefulWork(Intent intent) {        Log.i(ClockActivity.LOG_TAG, ""AlarmService::doWakefulWork"");        Intent newIntent = new Intent(getApplicationContext(), ClockActivity.class);        newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        newIntent.setAction(ClockActivity.ALARM_ACTION);        getApplicationContext().startActivity(newIntent);    }}</code></pre><p>this is the portion of Manifest where are setup the service and the receiver:</p><pre><code>&lt;receiver android:name="".OnAlarmReceiver""&gt;&lt;/receiver&gt;&lt;service android:name="".AlarmService""&gt;&lt;/service&gt;</code></pre><p>the doWakefulWork method is never called!</p>","516130","","281545","","2013-04-03 00:02:52","2013-04-03 20:19:22","Develop Alarm Application","<android><alarmmanager><commonsware><wakelock>","4","3","","",""
"4482073","1","4482109","","2010-12-19 07:51:48","0","843","<p>How would you find out what kind of information an Android app is sending back to the ""mothership""? For example, if an app is sending your ID, gender, etc. to advertisers.</p><p>Is there a way to do this in an Android app? Or would it have to be done via a packet sniffer over Wi-Fi?</p>","420377","","","","","2010-12-24 20:11:49","How to know what data an Android app is sending out","<android><privacy>","4","0","","",""
"4482075","1","","","2010-12-19 07:52:51","-1","2497","<p>I have no idea why this doesn't work. The TextView is defined from an  tag in the view. The base TextView doesn't have text set and I want to set it in the View on display.</p><p>I have tried placing the below in onCreate and onStart but it doesn't seem to work. The last two lines are just for debugging. I can verify that the header does get the text. The thing is, the TextView doesn't actually get updated. Any ideas?</p><pre><code>TextView header=(TextView) findViewById(R.id.acheader);        header.setText(R.string.accounts);        header.invalidate();        header=(TextView) findViewById(R.id.acheader);        String blah=(String) header.getText();</code></pre>","541104","","","","","2010-12-19 14:25:33","TextView.setText() followed by TextView.invalidate() doesn't update text in view","<android><android-layout>","2","2","","",""
"4482184","1","","","2010-12-19 08:43:28","1","4086","<p>I have LinearLayout and one of it attribute is android:background=""@drawable/bgImg""I want to create the background to be transparent. Do someone have any clue about this issue?Thanks</p>","508197","","","","","2011-02-18 17:16:12","How to create Transparent background?","<android>","2","1","1","",""
"4482186","1","","","2010-12-19 08:45:09","0","163","<p>I use to program with a language where, if i wanted a number from a set of different numbers i could go  x=choose(0,-1,2,5) and then it would randomly choose one of those options and give me a result but since i've been working with android and java i don't know a way to replicat that function as theres nothing i can find in the android sdk that is like it</p>","527926","","358281","","2010-12-19 08:59:14","2010-12-19 10:12:44","Getting the code to randomly choose one of x amount of choices","<java><android>","3","0","","",""
"4482261","1","4482289","","2010-12-19 09:08:07","3","5342","<p>I want to run three traslate animations below, sequentially.(I mean after one translate animation ends, start second translate animation.)However, they run concurrently.</p><p>Additionally, this anmiation will be used to overridePendingTransition() as a parameter,So, I have to solve this problem, only by using xml code.</p><p>Is there anyone who know what I should do?</p><pre><code>&lt;setxmlns:android=""http://schemas.android.com/apk/res/android""android:interpolator=""@android:anim/linear_interpolator""android:fillAfter=""true""&gt;&lt;translate    android:fromXDelta=""100%p""    android:toXDelta=""-20%p""    android:duration=""1000"" /&gt;&lt;translate    android:fromXDelta=""-20%p""    android:toXDelta=""20%p""    android:duration=""1000"" /&gt;&lt;translate    android:fromXDelta=""20%p""    android:toXDelta=""0""    android:duration=""1000"" /&gt;&lt;/set&gt;</code></pre>","527398","","","","","2010-12-19 11:17:41","how to run translate animation sequentially?","<android>","2","0","7","",""
"4482334","1","5326702","","2010-12-19 09:31:06","0","16261","<p>Facebook Android SDK when running example apps gives</p><pre><code>11-14 23:17:58.484: ERROR/HttpOperation.run(1139): class java.net.UnknownHostException api.facebook.com [http://api.facebook.com/restserver.php?api_key=882a8490361da98702bf97a021ddc14d&amp;call_id=1289744278460&amp;format=JSON&amp;method=fql.query&amp;migrations_override=%7B%27empty_json%27%3A+true%7D&amp;query=SELECT+uid%2Cfirst_name%2Clast_name%2Cname%2Cpic_square%2Ccell%2Cother_phone%2Ccontact_email%2Cbirthday_date+FROM+user+WHERE+%28uid+IN+%28SELECT+uid2+FROM+friend+WHERE+uid1%3D1825058169%29%29%3B&amp;session_key=f9902bc179f7592f8ed273ed-1825058169&amp;sig=e299638eb114e77fef3eb2088f270683&amp;v=1.0]11-14 23:17:58.484: ERROR/HttpOperation(1139): Encountered exception: java.net.UnknownHostException: api.facebook.com11-14 23:17:58.484: WARN/System.err(1139): java.net.UnknownHostException: api.facebook.com11-14 23:17:58.484: WARN/System.err(1139): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)11-14 23:17:58.484: WARN/System.err(1139): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)11-14 23:17:58.484: WARN/System.err(1139): at java.net.InetAddress.getAllByName(InetAddress.java:242)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)11-14 23:17:58.484: WARN/System.err(1139): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)11-14 23:17:58.484: WARN/System.err(1139): at com.facebook.katana.service.method.HttpOperation.run(HttpOperation.java:163)</code></pre>","529664","","741249","","2012-11-22 11:27:30","2012-11-22 11:27:30","Facebook Android SDK unknownHostException","<android><facebook><sdk>","2","3","4","",""
"4482335","1","","","2010-12-19 09:31:13","0","254","<p>why cant android os be more like apple os on the the ituch/iphone? where the app doesn't run until it is selected. it is also closed; stays closed until it is opened again. </p><p>i think this would make the android phones run faster and more efficiently(battery would last longer).</p>","547591","","310971","","2010-12-20 09:58:17","2010-12-20 09:58:17","why does the android os need to have apps running in the backround that are not ever selected","<android><operating-system>","2","0","","",""
"4482370","1","","","2010-12-19 09:46:18","1","420","<p>My scenario is that I have a activity which shows the cursor stored in SQLite DB. The main layout contains textview at top and a listview. And then I use simplecursoradapter to populate cursor into listadapter and put listadapter into listview. simplecursoradapter use another layout. The problem now is that when I use simplecursoradapter I bring three columns into listview, example: item name, date and price. That is ok if I don't change these values.</p><p>Actually I want to add some string to price and form new string such as currency sign. According to my understanding we only can setContentView for one layout not two layouts.I also tried to populate a new layout and set value but failed</p><p>LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View textEntryView = inflater.inflate(R.layout.itemlist, null);TextView price = (TextView) textEntryView.findViewById(R.id.price);price.setText(currency + c.getString(4).toString());</p><p>Even there is no problem in syntax and run apps. But when I run the app and check listview, the price still show price only without adding currency sign. I only can add currency sign under the main layout not the second layout used in simplecursoradapter.</p><p>In fact, currency is chosen in user preference, and I use sharedpreference to retrieve its value and add to price value in cursor. It seems that simplecursoradapter is using different layout, so cannot do that.</p><p>Does anyone has ideas about this case ?</p><p>I would be appreciated if methods and codes are provided for similar approach.</p><p>Thanks !!</p>","471567","","21234","","2010-12-19 10:28:44","2010-12-22 09:29:48","How to change values in second layout in same Activity?","<android><layout><simpleadapter>","2","0","","",""
"4482439","1","7188231","","2010-12-19 10:06:54","2","8562","<p>My problem is simple to explain -- I am trying to create a AudioRecord object but it fails to initialize (ie after the constructor, getState returns 0, indicating failure).  I am running this from Eclipse on a MotoDroid 1 running OS 2.2.1.  My AndroidManifest.xml is, AFAIK, using the right permission, RECORD_AUDIO (I don't know how to confirm this):</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;uses-permission android:name=""android.permission.RECORD_AUDIO""/&gt;    &lt;activity android:name="".SphinxMic""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p>I do the following to create the AudioRecord:</p><pre><code>bufferSize = AudioRecord.getMinBufferSize(8000, CHANNEL_IN_MONO, ENCODING_PCM_8BIT);audioRecorder = new AudioRecord(AudioSource.MIC, 8000, CHANNEL_IN_MONO, ENCODING_PCM_8BIT, 50*bufferSize);if (audioRecorder.getState() != AudioRecord.STATE_INITIALIZED)  throw new Exception(""AudioRecord init failed"");</code></pre><p>audioRecorder.getState() returns 0 (ie STATE_UNINITIALIZED)</p><p>I have not found any complete examples of using this API and I'm very much an Android beginner so the solution may well be something simple.  What can I do to find out why it fails?</p><p>A few people have asked similar questions, but they must have been having different problems than me because the fixes they approve haven't helped me.  Most notably <a href=""http://stackoverflow.com/questions/4161666/android-audiorecord-fails-to-initialize"">this</a>.  But the approved solution is perplexing and didn't work for me anyway.  I have also tried a variety of bit rates (8000, 16000, 11025, 44100), both mono and stereo and 8 and 16 bit.  No combination comes back as successfully initialized.</p>","88804","","1534123","","2012-10-26 15:46:36","2012-10-26 15:46:36","Android AudioRecord initialization fails every time","<android><microphone><audiorecord><android-audiorecord>","2","2","1","",""
"4482480","1","","","2010-12-19 10:16:07","9","701","<p>I want to group multiple apps under the same icon in the application launcher.For example, 5 apps each displaying 1 different image. But those 5 apps should appear as separate apps on the Android market, therefore they need to have different package name.</p><p>But different package name, means that on the Android device they will appear as 5 separate apps in the application launcher, which I am trying to avoid.</p><p>The closest solution that I found is to listen for PACKAGE_ADDED broadcast event, and every time another app from those 5 are installed on the device, all  the already installed apps would call setApplicationEnabledSetting from PackageManager to hide their icons and let the app that was just installed to handle things.But the icons are hidden only after rebooting the device.</p><p>Is there a way to force the application launcher to refresh at runtime?Or is there any other way to solve my goal?I am running out of options.</p><p>Thanks,Miha</p>","526451","","","","","2012-03-19 04:58:21","group multiple apps under the same icon in Application launcher","<android>","1","0","1","",""
"4482658","1","","","2010-12-19 11:12:02","2","10249","<p>Any idea why this is not working on a HTC Hero running on Android API 1.5 ?</p><pre><code>    private static void Save_to_SD (Bitmap bm, String image_name){  String extStorageDirectory = Environment.getExternalStorageDirectory().toString();  String meteoDirectory_path = extStorageDirectory + ""/Weather_Belgium"";  OutputStream outStream = null;  File file = new File(meteoDirectory_path, ""/""+ image_name);  try {   outStream = new FileOutputStream(file);   bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);   outStream.flush();   outStream.close();   Log.i(""Hub"", ""OK, Image Saved to SD"");   Log.i(""Hub"", ""height = ""+ bm.getHeight() + "", width = "" + bm.getWidth());  } catch (FileNotFoundException e) {   e.printStackTrace();   Log.i(""Hub"", ""FileNotFoundException: ""+ e.toString());  } catch (IOException e) {   e.printStackTrace();   Log.i(""Hub"", ""IOException: ""+ e.toString());  } }</code></pre><p>Logcat doesn't show any error and my images are normally 340x380:</p><blockquote>  <p>12-19 12:06:41.035: INFO/Hub(1762): directory exists</p>    <p>12-19 12:06:41.035: INFO/Hub(1762): isDirectory = true</p>    <p>12-19 12:06:41.045: INFO/Hub(1762): OK, Image Saved to SD</p>    <p>12-19 12:06:41.045: INFO/Hub(1762): height = 340, width = 380</p>    <p>12-19 12:06:41.055: INFO/Hub(1762): OK, Image Saved to SD</p></blockquote><p>When I then browse my SD card and take a look at my saved images, these are saved as ""Invalid Image"" 48 octets images !?</p><p>What's happening ?</p><p>Manifest:</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 android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.VIBRATE"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;</code></pre><p>EDIT :it looks like this code is working properly for PNG, JPG images but the problem has to do with the fact that my images are GIF images initially (downloaded from the web).</p>","116573","","116573","","2010-12-19 17:39:58","2011-09-22 16:03:50","Save Bitmap image to SD card - problem in API 1.5?","<android><bitmap><save><sd-card>","0","4","1","",""
"4482670","1","","","2010-12-19 11:15:37","0","1455","<p>I am new to Android programming.Received this error when i try to run my Hello Android program.The emulator doesn't show the ""Hello Android"" after that.</p><p>error log:</p><pre><code>eclipse.buildId=M20100909-0800java.version=1.6.0_23java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_MYCommand-line arguments:  -os win32 -ws win32 -arch x86ErrorSun Dec 19 19:11:04 SGT 2010No command output when running: 'am start -n com.example.helloandroid/com.example.helloandroid.HelloAndroid -a android.intent.action.MAIN -c android.intent.category.LAUNCHER' on device emulator-5554com.android.ddmlib.ShellCommandUnresponsiveExceptionat com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)at com.android.ddmlib.Device.executeShellCommand(Device.java:276)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.simpleLaunch(Unknown Source)at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.access$3(Unknown Source)at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController$3.run(Unknown Source)</code></pre>","547644","","119895","","2010-12-19 14:05:49","2010-12-19 14:06:49","No command output error in eclipse when running HelloAndroid program","<android><android-emulator>","1","1","","",""
"4482779","1","4483234","","2010-12-19 11:48:32","0","393","<p>I am currently working on an application that makes use of a MapView and adds overlays to it. Basically at anyone one given time the overlay list should never exceed two.</p><p>Heres what I have tried to do...</p><p>I have extended the ItemizedOverlay class (MyFriendOverlay) and then created a private ArrayList object inside that extended class that I would attach the overlays to. However; I have come across a problem that I am unsure how to fix. If you look at this segment of code:</p><p><code>ImageView mapMarker = new ImageView(getApplicationContext());mapMarker.setImageResource(R.drawable.markertrp);</p><p>myPointsToShow = new myFriendOverlay(mapMarker.getDrawable(), getApplicationContext());</code></p><p>As can be noted here I am created a ImageView with an icon based on my drawables. After this I have my extended class from ItemizedOverlay. In the constructor it takes two parameter the drawable and the context.</p><p>From what I know the constructor below is required (perhaps it can be modified):</p><p><code>public myFriendOverlay(Drawable defaultMarker, Context context)</code></p><p>Problem here is that I keep creating a new instance of myPointsToShow, which is a problem because I have a ArrayList that I want to use in the extended class so I have direct control over the overlays. And by instantiating a new one every time, I don't really add to the list itself.</p><p><B>In short:</B></p><p>All I want is for my application to have two points (A and B) where if a new location is detected for say B, then remove B from the overlay list, and replace it with the new location. And the same for A as well. In order to simplify it, I want to attach index 0 to A and index 1 to B, so that it doesn't span over two points.</p><p>I am unable to come up with a solution for this because of the problem of the necessary constructor, perhaps I'm thinking too hard about it...</p><p>Please offer any feedback! :)</p><p>Thanks for reading. </p>","529691","","","","","2010-12-19 13:57:14","Android application structure question","<android><android-mapview><code-structure>","1","0","","",""
"4482865","1","4482888","","2010-12-19 12:11:20","4","4575","<p>I've looked through the developer.android.com and googled quite a bit, but I can't seem to find a layout object that does this: A speech bubble sort of thing that has within it a list of buttons, which may be scrollable if not all of the buttons fit within the screen width. The Twitter app, Handcent SMS, and HTC's Sense messaging app all use this, and it looks more or less the same in all of them, which is what makes me think it's a standard object. The pic below is from Handcent. What are they using?</p><p><img src=""http://i.stack.imgur.com/gSWTe.png"" alt=""alt text""></p>","434731","","434731","","2010-12-19 12:17:19","2010-12-19 12:17:19","What layout object is used to produce a ""bubble"" popup in an Android UI? (Not Toast or Dialog)","<android><gui>","1","0","4","",""
"4482866","1","4558574","","2010-12-19 12:11:42","1","1950","<p>I'm making an app that records uncompressed (wav format) audio. I'm using <a href=""http://rehearsalassist.svn.sourceforge.net/viewvc/rehearsalassist/android/releases/RehearsalAssistant_0_8_2/src/urbanstew/RehearsalAssistant/RehearsalAudioRecorder.java?revision=90&amp;view=markup"" rel=""nofollow"">this class</a> to actually record the audio. Currently, my application records fine (I can play the file), however when I click the button to stop the recording, the app hangs for 10 seconds or so, with no log output or any signs of life. Finally it comes round, dumps a load of errors into the log, updates the UI etc. I'm using AsyncTasks to try and avoid this kind of thing but it's not working. Here's my code:</p><pre><code>//Called on clicks of the record button. rar is the instance of RehearsalAudioRecorderprivate OnClickListener RecordListener = new OnClickListener(){        @Override        public void onClick(View v) {            Log.d(""Record"",""Click"");            if (recording){                new stopRecordingTask().execute(rar,null,null);                startStop.setText(""Record"");                statusBar.setText(""Recording Finished, ready to Encode"");            }else{                recording = true;                new startRecordingTask().execute(rar,null,null);                startStop.setText(""Stop"");                statusBar.setText(""Recording Started"");            }        }    };private class startRecordingTask extends AsyncTask&lt;RehearsalAudioRecorder,Void,Void&gt;{        @Override        protected Void doInBackground(RehearsalAudioRecorder... rs) {            RehearsalAudioRecorder r = rs[0];            r.setOutputFile(""/sdcard/rarOut.wav"");            r.prepare();            r.start();            return null;        }    }    private class stopRecordingTask extends AsyncTask&lt;RehearsalAudioRecorder,Void,Void&gt;{        @Override        protected Void doInBackground(RehearsalAudioRecorder... rs) {            RehearsalAudioRecorder r = rs[0];            r.stop();            r.reset();            return null;        }    }</code></pre><p>In Logcat, I always get output like this, which has me stumped. I have no idea what's causing it (I'm logging the RehearsalAudioRecorder class, and it's being started/stopped correctly by the button clicks. This output occurs after the log output for the button click and correct stop() method call)</p><pre><code>12-19 11:59:11.172: ERROR/AudioRecord-JNI(22662): Unable to retrieve AudioRecord object, can't record12-19 11:59:11.172: ERROR/uk.ac.cam.tfmw2.steg.RehearsalAudioRecorder(22662): Error occured in updateListener, recording is aborted12-19 11:59:11.172: ERROR/uk.ac.cam.tfmw2.steg.RehearsalAudioRecorder(22662): stop() called on illegal state: STOPPED12-19 11:59:11.172: ERROR/AudioRecord-JNI(22662): Unable to retrieve AudioRecord object, can't record12-19 11:59:11.172: ERROR/uk.ac.cam.tfmw2.steg.RehearsalAudioRecorder(22662): Error occured in updateListener, recording is aborted12-19 11:59:11.172: ERROR/uk.ac.cam.tfmw2.steg.RehearsalAudioRecorder(22662): stop() called on illegal state: ERROR12-19 11:59:11.172: ERROR/AudioRecord-JNI(22662): Unable to retrieve AudioRecord object, can't record12-19 11:59:11.172: ERROR/uk.ac.cam.tfmw2.steg.RehearsalAudioRecorder(22662): Error occured in updateListener, recording is aborted12-19 11:59:11.172: ERROR/uk.ac.cam.tfmw2.steg.RehearsalAudioRecorder(22662): stop() called on illegal state: ERROR... 10 or more times</code></pre><p>I've been fiddling with this all day and I'm not getting anywhere, any input would be greatly appreciated.</p><p><strong>Update</strong>I've replace the AsyncTasks with Threads, still doesn't work, the app completely hangs when I click record, despite the fact the Log indicates there's nothing going on in the main thread. Still completely stumped.</p>","319618","","319618","","2010-12-26 19:23:01","2010-12-29 22:52:36","Android app hanging, sometimes until Force Close / Wait dialog appears","<android><freeze>","3","2","1","",""
"4482964","1","","","2010-12-19 12:39:15","2","268","<p>How can I implement an IP tables packet filter using an XML schema to validate IP packets and to generate firewall rule-sets that will be saved in separate xml file? Later this rule-sets will be used to compare incoming packets. </p><p>I want to use this functionality for a open source firewall application which I want to design for Android phone.</p>","545643","","920539","","2012-04-11 04:45:54","2012-04-11 04:45:54","how to write XML schema for iptables packet filter to validate IP packets?","<android><xml-schema><firewall>","0","2","","",""
"4483001","1","","","2010-12-19 12:49:13","9","1363","<p>What's the scope of <a href=""http://developer.android.com/reference/java/lang/System.html#setProperty%28java.lang.String,%20java.lang.String%29"">System.setProperty</a> in Android? </p><p>If I set a property (say <code>System.setProperty(""http.keepAlive"", ""false"")</code>), does it affect all apps in the system, the current app, the current task or the current thread only?</p><p>Where is this documented?</p>","143378","","473070","","2010-12-19 13:14:08","2010-12-19 13:14:08","Scope of System.setProperty","<java><android><scope><system>","1","0","3","",""
"4483048","1","","","2010-12-19 13:04:36","0","614","<p>I'm working on a college project, and I'm struggling to connect an ArrayAdapter to a ListView. Everything seems perfect to me, and in fact I've used this code earlier in another app (it's in fact from the IBM tutorial on RSS Readers for Android).</p><p>The parsing is working perfectly, which I'm able to see in the Log. I'm also able to see in the Log that the List of RSSItems has the required data, but when I connect the ArrayAdapter to a list view and the List of RSSItem objects, and then to the listview using setAdapter, nothing appears in the app (as in, the ListView is still empty)</p><p>Anyone who can point out why this might be happening? I'm attaching the code below</p><p>import java.util.List;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageButton;import android.widget.ListView;import android.widget.AdapterView.OnItemClickListener;</p><p>public class HomePage extends Activity implements OnClickListener, OnItemClickListener {    private String TAG=""TheSportsCampus"";    private RSSFeed feed= null;    private List _itemlist;    /** Called when the activity is first created. */</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    Log.d(TAG, ""onCreate Started"");    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Log.d(TAG, ""Layout expanded"");    ImageButton cricket=(ImageButton) findViewById(R.id.ImageButtonCricket);    ImageButton football=(ImageButton) findViewById(R.id.ImageButtonFootball);    ImageButton tennis=(ImageButton) findViewById(R.id.ImageButtonTennis);    ImageButton motorsports=(ImageButton) findViewById(R.id.ImageButtonMotorsports);    ImageButton other=(ImageButton) findViewById(R.id.ImageButtonOther);    ImageButton newsbytes=(ImageButton) findViewById(R.id.ImageButtonNewsBytes);    ImageButton live=(ImageButton) findViewById(R.id.ImageButtonLive);    ImageButton calendar=(ImageButton) findViewById(R.id.ImageButtonCalendar);   Log.d(TAG, ""ImageButtons invoked in code"");    cricket.setOnClickListener(this);    football.setOnClickListener(this);    tennis.setOnClickListener(this);    motorsports.setOnClickListener(this);    other.setOnClickListener(this);    newsbytes.setOnClickListener(this);    Log.d(TAG, ""ImageButtons ClickListeners created"");live.setOnClickListener(this);/*    calendar.setOnClickListener(this);  */  }@Overridepublic void onClick(View v) {    Log.d(TAG, ""ImageButton clicked"");    String option=""http://www.appsculture.com/tsc/"";    switch (v.getId())    {    case R.id.ImageButtonCricket: option=option.concat(""cricket/cricket.xml"");         break;    case R.id.ImageButtonFootball: option=option.concat(""football/football.xml"");         break;    case R.id.ImageButtonTennis:option=option.concat(""tennis/tennis.xml"");             break;    case R.id.ImageButtonMotorsports: option=option.concat(""motorsports/motorsports.xml"");         break;    case R.id.ImageButtonOther: option=option.concat(""others/others.xml"");         break;    case R.id.ImageButtonNewsBytes:option=option.concat(""news/news.xml"");         break;    case R.id.ImageButtonLive: option=""http://www.thesportscampus.com/feed/rss?format=feed"";        break;    case R.id.ImageButtonCalendar:        break;    }    Log.d(TAG, option);    feed= new RSSFeed();    feed=feed.getFeed(option);    Log.d(TAG, ""feed.getFeed() executed and returned"");    UpdateDisplay();} private void UpdateDisplay()    {     Log.d(TAG, ""Function UpdateDisplay() launched"");     _itemlist=feed.getAllItems();     Log.d(TAG,""Received itemlist with itemcount= ""+_itemlist.size());     Log.d(TAG,""List of articles: &lt;""+_itemlist.get(0)+"",""+_itemlist.get(1).getTitle()+"",""+_itemlist.get(2).getTitle()+"",""+_itemlist.get(3).getTitle()+""&gt;"");     if (feed == null)         Log.d(TAG,""FEED is NULL!"");ArrayAdapter&lt;RSSItem&gt; adapter = new    ArrayAdapter&lt;RSSItem&gt;(this,android.R.layout.simple_list_item_1,_itemlist);Log.d(TAG, ""RSSItems added to ArrayAdapter"");        ListView mainList=(ListView)findViewById(R.id.ListViewMain);        mainList.setAdapter(adapter);        Log.d(TAG, ""ArrayAdapter added to mainList"");     //   mainList.setSelection(0);        Log.d(TAG, ""mainList Selection done"");        //mainList.setOnItemClickListener(this);                }@Overridepublic void onItemClick(AdapterView parent, View v, int position, long id){    //Log.i(tag,""item clicked! ["" + feed.getItem(position).getTitle() + ""]"");    Intent itemintent = new Intent(this,ShowDescription.class);    Bundle b = new Bundle();    b.putString(""title"", feed.getItem(position).getTitle());    b.putString(""description"", feed.getItem(position).getDescription());    b.putString(""link"", feed.getItem(position).getLink());    b.putString(""cmsurl"", feed.getItem(position).getCmsURL());    itemintent.putExtra(""android.intent.extra.INTENT"", b);    startActivity(itemintent);}</code></pre><p>}</p><p>EDIT: I'm also attaching the layout in case there's an error that I haven't noticed</p><pre><code>&lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:background=""@color/Black""&gt;&lt;HorizontalScrollView android:layout_width=""fill_parent"" android:background=""@color/Black"" android:layout_gravity=""center_horizontal"" android:scrollbars=""none"" android:layout_height=""wrap_content""&gt;&lt;LinearLayout android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:background=""@color/Black"" android:layout_width=""fill_parent""&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/cricket"" android:id=""@+id/ImageButtonCricket"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:background=""@drawable/football"" android:id=""@+id/ImageButtonFootball"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/tennis"" android:id=""@+id/ImageButtonTennis"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/motorsports"" android:id=""@+id/ImageButtonMotorsports"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:background=""@drawable/other"" android:id=""@+id/ImageButtonOther"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/newsbytes"" android:id=""@+id/ImageButtonNewsBytes"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/live"" android:id=""@+id/ImageButtonLive"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/ImageButtonCalendar"" android:background=""@drawable/calendar"" android:layout_weight=""1""&gt;&lt;/ImageButton&gt;&lt;/LinearLayout&gt;&lt;/HorizontalScrollView&gt;&lt;ListView android:id=""@+id/ListViewMain"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:padding=""5dp""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","547702","","644450","","2011-12-15 11:28:52","2011-12-15 11:28:52"," Not able to connect ArrayAdapter to a ListView","<android><android-listview>","2","2","","",""
"4483159","1","","","2010-12-19 13:36:50","0","611","<p>I am trying to use the C2DMI Push notification but have compilation problems.  Can anyone please help?</p><p>Thanks</p>","543483","","","","","2011-04-19 22:35:21","Unable to import C2DMBaseReceiver - Android 2.2Version: 8.0.1.v201012062107-82219 on Eclipse 3.6.0","<android>","1","0","","",""
"4483216","1","","","2010-12-19 13:53:12","0","418","<p>I'm trying to get google adsense into my android app. However, as soon as I add the GoogleAdView.jar eclipse throws me the error</p><blockquote>  <p>Conversion to Dalvik format failed with error 1   Android Packaging Problem</p></blockquote><p>If I scan the console I notice the following </p><pre><code>[2010-12-19 14:45:20 - Myapp]: DxUNEXPECTED TOP-LEVEL EXCEPTION:java.util.zip.ZipException: error in opening zip file</code></pre><p>But I don't have any clue what to do about it? Give up adsense support?</p><p><em>EDIT</em> Created a new ""Hello World"" project. Worked fine until I added GoogleAdView.jar to Build Path, then again I received that error. So - for ads there's only admob untiul google feel like creating a new jar file I guess.. </p><p>Regards</p>","498112","","498112","","2010-12-20 16:51:42","2010-12-20 16:51:42","android, google adview gives an exception","<android><adsense>","0","2","","",""
"4483224","1","","","2010-12-19 13:55:57","2","1765","<p>Does anyone know if the Android market has an API which enables to automatically submitting new applications, without having to fill-up the market form manually.</p>","146634","","119895","","2010-12-19 14:22:29","2012-08-29 14:03:31","Android market API","<android><google-play>","1","1","","",""
"4483326","1","4483497","","2010-12-19 14:19:05","2","974","<p>Hi I have web service that return a date object like this as a return of the Json</p><pre><code> ""/Date(922312800000+0200)/""</code></pre><p>However i need to show it on the textview in this pattern </p><pre><code>""19.12.2011 16:15"" </code></pre><p>how can I convert that return to this pattern ?</p><p>Edit : Here is my code still giving java.lang.IllegalArgumentException</p><pre><code>SimpleDateFormat date = new SimpleDateFormat(""dd/MM/yy"");String dateText = date.format(tempEntry.getCreatedDate());</code></pre><p>Edit : Here is the code that work for me </p><pre><code>String dateText = tempEntry.getCreatedDate();String dateString = dateText.replace(""/Date("", """").replace("")/"", """");String[] dateParts = dateString.split(""[+-]"");Date dateFormat = new Date(Long.parseLong(dateParts[0]))</code></pre>","155332","","203907","","2010-12-20 09:44:39","2010-12-20 15:10:36","Date time object from webservice showing on Android textview with pattern?","<java><android><json>","2","0","","",""
"4483433","1","4483524","","2010-12-19 14:45:22","9","5318","<p>I'm trying to inflate an inner class view and getting the ""error inflating class"" problem.  I've referenced <a href=""http://stackoverflow.com/questions/2098318/error-referencing-an-inner-class-view-in-layout-main-xml"">this post</a> which was helpful, but I'm still lost as to why I can't get this to work.</p><p>Here is a code excerpt, my XML, and logcat.</p><p>Edit:  Also I noticed that logcat states a ""no such method exception"" for ""CupcakeMessageView(Context, AttributeSet) when I clearly have it.</p><p>THANKS ALL!</p><pre><code>public class CupcakeMessage extends Activity {    class CupcakeMessageView extends View {        private static final int TEXT_SIZE = 12;        private static final int X_OFFSET = 15;        private Paint mPaint;           public CupcakeMessageView(Context context) {            super(context);        }        public CupcakeMessageView(Context context, AttributeSet attrs) {            super(context, attrs);            mContext = context;            ...        }        more class stuff...     }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.cupcake_message);         ...          }}</code></pre><p>Here is the XML</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;view class=""com.cmllc.zcc.CupcakeMessage$CupcakeMessageView""        android:id=""@+id/cupcake_message_view""        android:screenOrientation=""portrait""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;    more views...</code></pre><p>Logcat:</p><pre><code>12-19 09:31:24.249: ERROR/AndroidRuntime(5435): FATAL EXCEPTION: main12-19 09:31:24.249: ERROR/AndroidRuntime(5435): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cmllc.zcc/com.cmllc.zcc.CupcakeMessage}: android.view.InflateException: Binary XML file line #7: Error inflating class com.cmllc.zcc.CupcakeMessage$CupcakeMessageView12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.os.Handler.dispatchMessage(Handler.java:99)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.os.Looper.loop(Looper.java:123)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at java.lang.reflect.Method.invokeNative(Native Method)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at java.lang.reflect.Method.invoke(Method.java:521)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at dalvik.system.NativeStart.main(Native Method)12-19 09:31:24.249: ERROR/AndroidRuntime(5435): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.cmllc.zcc.CupcakeMessage$CupcakeMessageView12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.createView(LayoutInflater.java:503)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.Activity.setContentView(Activity.java:1647)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at com.cmllc.zcc.CupcakeMessage.onCreate(CupcakeMessage.java:119)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     ... 11 more12-19 09:31:24.249: ERROR/AndroidRuntime(5435): Caused by: java.lang.NoSuchMethodException: CupcakeMessageView(Context,AttributeSet)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at java.lang.Class.getMatchingConstructor(Class.java:660)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at java.lang.Class.getConstructor(Class.java:477)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     at android.view.LayoutInflater.createView(LayoutInflater.java:475)12-19 09:31:24.249: ERROR/AndroidRuntime(5435):     ... 21 more</code></pre>","432209","","432209","","2010-12-19 14:54:35","2010-12-19 15:07:19","Error inflating inner class view","<android><view><inflate>","1","4","3","",""
"4483515","1","","","2010-12-19 15:03:09","0","532","<p>How do i close the apk or in other words to EXIT the APK .  i have try finish but it just closing the current activity and i need to close all the activities in the apk??</p>","508197","","","","","2010-12-19 17:59:06","Question about close or exit apk","<android>","2","1","","",""
"4483545","1","4484381","","2010-12-19 15:11:27","2","1817","<p>I know how to do quads and that was pretty intuitive with the u,v texture coordinates but I'm having a hard time figuring this out. Any help is appreciated.</p>","256062","","44729","","2010-12-19 19:02:10","2010-12-19 19:02:10","How do I texture map a cylinder in OpenGL?","<iphone><android><graphics><opengl-es><3d>","1","0","","",""
"4483604","1","","","2010-12-19 15:22:29","0","1354","<p>I'm having problems displaying ads in an Android application. I'm not seeing ads even in test mode.</p><p>The layout is taken from admob's instructions, 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""    xmlns:app=""http://schemas.android.com/apk/res/lgf.fourinarow""    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""      app:backgroundColor=""#000000""      app:primaryTextColor=""#FFFFFF""      app:secondaryTextColor=""#CCCCCC""      app:keywords=""Android Game""  /&gt;&lt;/LinearLayout&gt;</code></pre><p>The mainfest is below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""     package=""lgf.fourinarow""    android:versionCode=""1""    android:versionName=""1.0""&gt;  &lt;!-- Requires Android 2.1 or above --&gt;  &lt;uses-sdk android:minSdkVersion=""7"" /&gt;  &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".LGFFourInARow""&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;!-- Track Market installs --&gt;     &lt;receiver android:name=""com.admob.android.ads.analytics.Inst allReceiver"" android:exported=""true""&gt;      &lt;intent-filter&gt;        &lt;action android:name=""com.android.vending.INSTALL_REFERRER "" /&gt;      &lt;/intent-filter&gt;    &lt;/receiver&gt;    &lt;!-- The application's publisher ID assigned by AdMob --&gt;    &lt;meta-data android:value=""xxxxxxxxxxxxxx"" android:name=""ADMOB_PUBLISHER_ID""/&gt;  &lt;/application&gt;  &lt;!-- AdMob SDK permissions --&gt;  &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt; </code></pre><p>(I have my real publisher id in my code)In my Java code, I have included <code>AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR } );</code> in the <code>onCreate</code> section, to enable test mode. I've also added log messages in the <code>onFailedToReceiveAd</code>, <code>onFailedToReceiveRefreshedAd</code>, <code>onReceiveAd</code> and <code>onReceiveRefreshedAd</code> functions.However I have still ever seen and ad, and can't see any output in the log cat.Can anyone suggest what else I should be doing? </p>","547760","","212275","","2010-12-19 16:04:06","2012-07-25 07:27:11","Displaying Admob Ads on Android","<android><admob>","2","0","","",""
"4483623","1","","","2010-12-19 15:26:01","8","1854","<p>does anyone know how to build that kind of tabs that the ""News and Weather"" app uses?</p><p><img src=""http://img51.imageshack.us/img51/8788/tabsd.png"" alt=""see here""></p><p>This means a tab area that can be scrolled to the left &amp; right. Changing the tabs is also possible by scrolling the listview to the left / right.</p>","478605","","139010","","2011-02-22 16:57:51","2011-09-08 08:05:56","Android: ""News and Weather"" app tabs","<android><tabs>","3","3","2","",""
"4483650","1","4484451","","2010-12-19 15:36:06","1","680","<p>My Android App works fine, except the end sequence. Its a game and at the end the screen shows the score:</p><pre><code>TextView allscores = new TextView(this);allscores.setText(""Your score: ""+ mypoints);</code></pre><p>Next I want the GUI to slowdown for a few seconds so the user has time to take in the information. Maybe 2 or 3 secs is fine.</p><pre><code>try {                Thread.sleep(3000);            } catch (InterruptedException e) {                e.printStackTrace();            }                            layout.removeAllViews();</code></pre><p>Bear in mind, I'm new to thread programming. All this is done on the UI thread, I have no other threads running.Next I put in a final splash screen ending:</p><pre><code>AnView animator = new AnView(this);            layout.addView(animator);</code></pre><p>where AnView is my own extension of View.</p><p>All in all it runs great. Problem is the thread sleeps for 3 seconds without showing my final score. I don't know why. I don't know why it doesn't show my final score before sleeping. It actually goes blank, indicating that it removed all views and then slept.</p>","485498","","","","","2010-12-19 18:55:15","Slowing the GUI down in Android","<java><android><multithreading><sleep>","4","1","","",""
"4483718","1","4484734","","2010-12-19 15:53:58","0","1269","<p>So this null pointer is confusing me. I believe it is a scope issue.</p><p>My main activity looks like this:</p><pre><code>public class App extends Activity {    ProgressDialog progressDialog;    ProgressThread progressThread;</code></pre><p>Then inside of the oncreate I do this:  </p><pre><code>  ProgressDialog progressDialog = new ProgressDialog(this);    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);    progressDialog.setMessage(""Fetching Images..."");    ProgressThread progressThread = new ProgressThread(handler,mImageIds,mImages);    progressThread.start();      progressDialog.show();</code></pre><p>THEN inside <code>progressThread</code> which is a separate class I do</p><pre><code>mHandler.sendMessage(mHandler.obtainMessage());</code></pre><p>Now up until this point i believe it behaves as it should. I have my handler hanging out in class scope right underneath my oncreate</p><pre><code>final Handler handler = new Handler() {    public void handleMessage(Message msg){      progressDialog.hide();      progressThread.interrupt();    }   };</code></pre><p>The program thinks that progressDialog and progressThread are declared, but are null. Why would they be null if I instantiate in my oncreate.</p>","412554","","127013","","2010-12-19 16:04:05","2010-12-24 06:52:20","Android thread handler NullPointerException","<android><multithreading>","3","1","","",""
"4483723","1","","","2010-12-19 15:54:46","0","2251","<p>I'm trying to make a text box that allows you to begin typing the name of a contact, and shows a drop down menu of contacts in your phone whose names match the few letters you've typed in.</p><p>(Basically, I'm trying to clone the recipients box in the MMS.apk app that appears on the Compose new message screen)</p><p>I've been trying to use an AutoCompleteTextView to do this. I've got it working with a pre-written String array, as per the example on the Android developer site. However, I'm not sure how to get it to search my contacts.</p><p>I tried doing a query of the entire database of contacts, and building a List of every contact in the database. However, this takes a while, what with building a List of <em>every</em> contact in the phone. I also can't get the drop down suggestions thing to appear when doing it this way.</p><p>Is there a better way to do this searching of contacts on a phone? Or any way at all that actually works? Btw, I'm using the Android 2.1 API, so ContactsContact should be used instead of People.</p><p>The source code for what I've done so far can be seen here: <a href=""https://code.google.com/p/webtextr/source/browse/trunk/Webtextr/src/com/nomcode/webtextr/MainActivity.java?r=8"" rel=""nofollow"">https://code.google.com/p/webtextr/source/browse/trunk/Webtextr/src/com/nomcode/webtextr/MainActivity.java?r=8</a></p><p>Any help would be <em>greatly</em> appreciated! :)</p>","231450","","","","","2010-12-19 16:08:19","Search Contacts on Android with text box (like in MMS app)","<android><search><contacts><autocompletetextview>","1","0","","",""
"4483839","1","4484455","","2010-12-19 16:25:05","1","364","<p>How can I play two or more audio file in android? I had created a Class which extending Thread and have a MediaPlayer. I can hear only one audio channel, but all of the threads are running and I should to hear all of the channels, not only one. </p><p>Mybe a thread catch the hardware sound card and never get it to the other ? Any idea ? </p><p>Thank you: Karoly</p><p>PJ I'M using CyclicBarrier  for the same time playing...</p>","393809","","1228","","2013-07-10 17:13:30","2013-07-10 17:13:30","Android Threads and Audio Play on the same time","<android><multithreading><music><playback>","1","0","","",""
"4483863","1","","","2010-12-19 16:32:06","0","83","<p>hi i'm new to android programming, i want to ask about location API, i struggle to a problem here when i'm using a network provider to obtain location data, i view my log in logcat there is a change in my location data <code>12-19 23:22:08.556: DEBUG/NetworkLocationProvider(1974): onCellLocationChanged [9994,65172896]</code>, but i just can't seem update it in my phone, even the requestLocationUpdate listener method onLocationchanged() doesn't update,can you answer this?here is my code :</p><pre><code>private void initLocation(){     locman = (LocationManager) getSystemService(Context.LOCATION_SERVICE);     lokasi = locman.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);     locman.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,1 , 0,this);     lat.setText(""Latitude : 0 "");     lon.setText(""Longitude : 0 "");} @Override public void onLocationChanged(Location location) {  lon.setText(""Longitude : ""+String.valueOf(lokasi.getLongitude()));  lat.setText(""Latitude : ""+String.valueOf(lokasi.getLatitude()));  Toast.makeText(this, lokasi + """",2000).show(); }</code></pre><p>i can find anything wrong,but my location still doesn't change even when the logcat react to this thx </p>","547799","","304","","2010-12-19 19:15:42","2010-12-19 19:15:42","about location change","<java><android>","1","0","","",""
"4483872","1","4483917","","2010-12-19 16:33:58","1","7669","<p>I have a set of strings I originally was using with an <code>ArrayAdapter</code> to populate a <code>Spinner</code>.  Instead of a <code>Spinner</code>, I want to use a <code>BaseExpandableListAdapter</code>.  Is there a way I can get a set of string-array values into a <code>String</code> object?</p><p>Here is my string-array</p><pre><code>&lt;string-array name=""component2_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;item&gt;Lemon&lt;/item&gt;    &lt;item&gt;Lime&lt;/item&gt;    &lt;item&gt;Orange&lt;/item&gt;    &lt;item&gt;Strawberry&lt;/item&gt;    &lt;item&gt;Raspberry&lt;/item&gt;    &lt;item&gt;Grape&lt;/item&gt;    &lt;item&gt;Vanilla&lt;/item&gt;    &lt;item&gt;Butterscotch&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>And here is a an excerpt of code I took from ApiDemos that shows how to populate the group and children of an expandable list.</p><pre><code>public class MyExpandableListAdapter extends BaseExpandableListAdapter {    // Sample data set.  children[i] contains the children (String[]) for groups[i].    private String[] groups = { ""People Names"", ""Dog Names"", ""Cat Names"", ""Fish Names"" };    private String[][] children = {            { ""Arnold"", ""Barry"", ""Chuck"", ""David"" },            { ""Ace"", ""Bandit"", ""Cha-Cha"", ""Deuce"" },            { ""Fluffy"", ""Snuggles"" },            { ""Goldy"", ""Bubbles"" }    };</code></pre><p>I want the <code>String</code> children to use four different string-arrays.  Is there a way I could go about this?  I'm not really sure how to get started.</p><p>Edit:  I tried this, but I'm getting a resources not found exception.</p><pre><code>    private String[] groups = {UserMessage.this.getString(R.array.message_groups)};    private String[][] children = {{UserMessage.this.getString(R.array.message_group_1)},            {UserMessage.this.getString(R.array.message_group_2)},            {UserMessage.this.getString(R.array.message_group_3)},            {UserMessage.this.getString(R.array.message_group_4)}    };</code></pre>","432209","","432209","","2010-12-19 17:02:49","2010-12-19 19:26:57","Get a string-array into a string","<android><string><expandablelistview><string-array><expandablelistadapter>","1","2","1","",""
"4483902","1","4484300","","2010-12-19 16:38:56","1","644","<p>I lately updated my Android SDK manager and since then my android went koo koo.I manage to fix most of the problems but 2 of them are still exists:</p><ol><li>when I run the SDK Manager.exe I get ""Some packages were found but are not compatible updates"" message under ""Available Packages""-> android repository</li><li>under ""Available Packages""-> third party add-ons   I see some existing updates but when I update them they are still there.</li></ol><p>Did anyone bumped with this issue? how can I fix it?</p><p>thanks-Z</p>","449466","","","","","2010-12-19 17:54:27","Android: issues after updating SDK manager","<android>","1","0","","2012-12-23 09:45:02",""
"4483945","1","","","2010-12-19 16:45:24","0","186","<p>helloI've tried hardly to get scroller scroll contents of my viewGroup but i failedmy code is someting like</p><pre><code>    maxY = getChildCount() * getChildAt(0).getHeight();    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,            float velocityY) {        Log.v(""log_trace"", ""Asd50Act.AsdView.onFling()"");        scroller.fling(0, Math.round(e1.getY()), 0, Math.round(velocityY),                0, 0, 0, maxY);        invalidate();        return true;    }</code></pre><p>sure I've initialized scroller &amp; gestureDetectorscrollBy() works fineany help??</p>","533111","","1968437","","2013-01-13 03:43:39","2013-01-13 03:43:39","How to get scroller scroll contents of my viewGroup","<android><view>","1","1","","",""
"4483999","1","4484030","","2010-12-19 16:54:45","0","405","<p>I need to load several thumbnails (the images on the server are full sized images, so I need to resize them in the app), and display them in a way that allows for the user to click on one (or more) and have some associated id be given back to the app for use in a larger context. </p><p>so, in pseudo code...</p><pre><code>ImageObjArray ioa = loadImagesFromServer(""http://server/listOfImages.php"");// this returns for(ImageObj io : ioa){   drawThumbnail(io); //io contains both a jpg and a reference id}//later when a user clicks on a thumbnailclickHandler(){  passIdToBundle(this.refId);}</code></pre><p>So, I've never played with a webview before but I suspect it might be the best approach here, though I don't know how easy it is to send info back out of a webview to the larger app when the user clicks on a thumbnail. Or is there a more elegant approach?</p><p>All advice welcome. </p>","59947","","","","","2010-12-19 17:08:42","What's the best way to display a bunch of images from a web server in Android?","<android>","1","0","2","",""
"4484158","1","4495753","","2010-12-19 17:23:30","3","6083","<p>How do you get a list of all camera images of an Android device?</p><p>Is it through the MediaStore? How?</p>","143378","","143378","","2010-12-21 09:44:55","2013-06-05 18:58:44","List all camera images in Android","<android><camera><gallery><mediastore><android-contentresolver>","1","1","10","",""
"4484196","1","","","2010-12-19 17:31:54","0","364","<p>I have the following requirement.</p><p>i> I am displaying 10 items in a ListView in which each List item displays 2 text views &amp; one thumbnail image . I have coded to display the images asynchronously , since I need to fetch the images using url. The data for the list item is being fetched from server. In the response , I get the information whether any more pages are available for display.</p><p>ii> After the user scrolls to the 10 items , I need to call the webservice to fetch the next 10 list of items from the server . When the user scrolls to the 10 th element of the first page , a small progress dialog is displayed at the end of the screen &amp; information is fetched from the server &amp; the view is updated . Also if the user scrolls up , new call to the webservice is not made to the server &amp; the display contains all the list items.</p><p>I received few suggestions but am unable to implement the pagination .Kindly help as I am stuck on this problem for more than 3 weeks.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-12-19 18:36:16","Getting stuck implementing pagination in Android","<android>","1","0","0","",""
"4484217","1","","","2010-12-19 17:35:19","0","1226","<p>I tried following the instructions here <a href=""http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android"" rel=""nofollow"">link text</a> to make a scala application. However when I run the ""ant install"" command I get the following error </p><pre><code>aaptexec doesn't support the ""basename"" attribute</code></pre><p>I read this is because of the new sdk 7 version <a href=""http://scala-programming-language.1934581.n4.nabble.com/Can-t-compile-Scala-for-Android-SDK-Tools-revision-7-td2534044.html"" rel=""nofollow"">here</a>.  However noone on that thread seems to offer any solution. </p><p>Has anyone tried to do this with the new sdk?Thanks in advance</p>","242721","","","","","2012-06-18 14:24:16","android scala and eclipse","<android><eclipse><scala>","3","0","","",""
"4484229","1","4484339","","2010-12-19 17:37:46","-3","344","<p>I Need some help here, I have a service which I can start or stop whenever I want  and using the onStart() command to pass some extras using putExtras() from my activity</p><p>But I need some serious basic instructions on how to interact with the already created service.</p><p>Please don't refer me to another webpage which already have some implementations, just give me the needed code to interact from my UI activity to the service:</p><p>something like this:</p><pre><code>public class myActivity extends Activity {Object ReceivedObjectFromService;onCreate(){some stuff heremyMethod()}public class myMethod(){//do some stuff with the ReceivedObjectFromService//Don't know how to call this method from the service btw}</code></pre><p>please some help, I don't understand the tutorials on how to interact service to activity or viceversa</p>","539878","","440502","","2010-12-19 17:43:35","2010-12-19 18:04:36","help with binding a local service","<android>","1","2","","",""
"4484272","1","","","2010-12-19 17:48:23","1","258","<p>I wrote <a href=""http://www.appbrain.com/app/rage-faces/com.idunnolol.ragefaces"" rel=""nofollow"">a silly app</a> that allows people to send preset images to users.  The app mostly works fine (as long as the user has an app that can handle MMS on their phone) but I've had some users complain that the MMSes show up on their phones as video rather than as an image.  The video ends up just being a single image, over the span of a few seconds.</p><p>The way that the code works, it copies the file to the SD card, which is then passed into the EXTRA_STREAM Intent extra.  I know that all the images are PNGs, and they're all sent with the type set to ""image/png"".  Yet somehow they end up as videos on the receiver's end.</p><p>Does anyone know what might be going wrong?  Is this the fault of the MMS application, or is there something I can do on my end?</p>","60261","","","","","2010-12-19 17:48:23","Why are MMS single images sometimes displayed as videos?","<android><mms>","0","0","","",""
"4484277","1","4488931","","2010-12-19 17:49:21","0","530","<p><br>I am getting ""Conversion to Dalvik format failed with error 1""  when integrating ZXing source Code to my application. I just downloaded ZXing source for Android and imported in my Eclipse which gives lot of compilation errors and also Dalvik error. can anyone tell me how to solve this issue? <br>Thanks in Advance</p>","429501","","","","","2011-06-05 06:55:26","Conversion to Dalvik format failed with error 1 when integrating ZXing source Code","<android>","4","3","","",""
"4484444","1","4484467","","2010-12-19 18:30:46","1","7734","<pre><code>12-19 18:29:33.203: ERROR/AndroidRuntime(402): FATAL EXCEPTION: main12-19 18:29:33.203: ERROR/AndroidRuntime(402): java.lang.RuntimeException: Unable to start activity ComponentInfo{ayanoo.forms/ayanoo.forms.FullFriendView}: java.lang.NullPointerException12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.os.Handler.dispatchMessage(Handler.java:99)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.os.Looper.loop(Looper.java:123)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.main(ActivityThread.java:3647)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at java.lang.reflect.Method.invokeNative(Native Method)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at java.lang.reflect.Method.invoke(Method.java:507)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at dalvik.system.NativeStart.main(Native Method)12-19 18:29:33.203: ERROR/AndroidRuntime(402): Caused by: java.lang.NullPointerException12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONTokener.nextValue(JSONTokener.java:90)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:154)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at org.json.JSONObject.&lt;init&gt;(JSONObject.java:171)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at ayanoo.forms.FullFriendView.fullProfile(FullFriendView.java:203)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at ayanoo.forms.FullFriendView.onCreate(FullFriendView.java:93)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)12-19 18:29:33.203: ERROR/AndroidRuntime(402):     ... 11 more12-19 18:29:35.623: ERROR/InputDispatcher(60): channel '4067f010 ayanoo.forms/ayanoo.forms.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x812-19 18:29:35.623: ERROR/InputDispatcher(60): channel '4067f010 ayanoo.forms/ayanoo.forms.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!12-19 18:29:35.993: ERROR/InputDispatcher(60): Received spurious receive callback for unknown input channel.  fd=158, events=0x8</code></pre>","508377","","","","","2011-08-31 01:47:34","what does this error mean ? (android)","<android>","2","0","","",""
"4484453","1","4484620","","2010-12-19 18:33:20","14","5468","<p>I updated my ADT to the latest version after Gingerbread was released. And now</p><pre><code>&lt;string name=""date_format""&gt;%d:%d %s&lt;/string&gt;</code></pre><p>shows the following 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: Unexpected end tag string</code></pre><p>Previous ADT version worked fine. Am I doing something wrong? I get this error whenever there are more than 1 format specifiers.</p>","421372","","","","","2010-12-29 23:09:15","ADT shows error in Strings.xml","<android><xml><resources><adt>","2","0","6","",""
"4484478","1","4484556","","2010-12-19 18:39:38","0","466","<p>Alright, so I know how to create an onGoing notification, but how do I have the notification removed when the application is killed? or if it is killed, when the notification is clicked how to I restart the application? Thanks!</p>","481082","","","","","2010-12-19 19:04:47","onGoing notifications","<android><notifications>","1","0","","",""
"4484617","1","4484711","","2010-12-19 19:07:11","3","7761","<p>I've been learning Android and Phonegap development from mainly these two sources:</p><p><a href=""http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml"" rel=""nofollow"">http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml</a></p><p><a href=""http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart"" rel=""nofollow"">http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart</a></p><p>I have a Samsung Galaxy Tab.</p><p>What baffles me, though, are:</p><ol><li>What screen size do I use in development to reach the largest number of Android phones and tablets here in Q4 2010? Do you recommend WVGA800 for a 480x800 screen?</li><li>How do most Android apps resize properly into my 7"" Samsung Galaxy Tab even though it has a high resolution? What are the developers doing to achieve this? I mean, can you make your apps have a kind of <em>stretchiness</em> and the fonts stretch too? Or, is Google detecting the app was designed for a smaller screen and so it handles resizing for the Galaxy Tab? And do I need to change something in the AndroidManifest.xml?</li><li>I used the HVGA default in the emulator, and it was zippy fast. When I switched to WVGA800, it got a lot slower. Why is that?</li></ol>","105539","","492364","","2010-12-19 19:11:59","2011-06-28 05:16:53","Screen Resolutions","<android><android-emulator><screen><phonegap><screen-resolution>","2","0","4","",""
"4484681","1","4486424","","2010-12-19 19:26:49","0","987","<p>I am new to Android development with Phonegap and just got through these two tutorials:</p><p><a href=""http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml"" rel=""nofollow"">http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml</a></p><p><a href=""http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart"" rel=""nofollow"">http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart</a></p><p>Now I want to make the index.html do more spectacular things. Do you recommend I use jQuery, Zepto.js, Sencha Touch, jQTouch, or a mix of these, to do what I want? I'm confused. I know jQuery very well, but if it's bloated compared to Zepto.js (which I have only read about), then perhaps I need Zepto.js if it's not too limiting? And then there's Sencha Touch and jQTouch, and I see these provide a framework for controls, but I don't know if they also provide their own Javascript API, or require jQuery, or whatever. I just want to set up the best environment for doing general purpose apps.</p><p>My app needs so far are fairly simple and are only two kinds:</p><ol><li><p>Loads a single page and thenloads a Flash SWF component. Thiscomponent may or may not interactover AJAX with a backend web server.(I'm not a fan of Flash, but myclient requests it. She runs a lotof games for her business.)</p></li><li><p>A tabbed interface with 4 staticpages and images, but then on the5th tab, it connects to a website inan IFRAME (or perhaps uses AJAX)</p></li></ol>","105539","","132528","","2010-12-20 01:44:00","2011-01-14 22:19:36","Which Javascript Library To Use?","<jquery><android><phonegap><jqtouch><sencha-touch>","6","0","1","",""
"4484718","1","4495968","","2010-12-19 19:36:38","0","1496","<p>I am brand new to Android development and have gotten through these two resources successfully:</p><p><a href=""http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml"" rel=""nofollow"">http://news.softpedia.com/news/How-to-Run-Android-Applications-on-Ubuntu-115152.shtml</a></p><p><a href=""http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart"" rel=""nofollow"">http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart</a></p><p>Now I want to make the index.html have a button on it, that, when clicked, does a horizontal right-to-left sliding page transition to a right.html. And when I click a button in right.html, I want to do a left-to-right horizontal sliding page transition right back.</p><p>Can anyone demonstrate what I am to do in index.html and right.html to achieve this? Or, do you think it's easier to do this with some framework that goes on top of the Javascript, such as Zepto.js, or jQuery, or Sencha Touch, or jQTouch?</p><p><strong>EDIT</strong>: I think what I'm hearing is that I need to learn about Webkit Transformations, which provide the sliding effects?</p>","105539","","105539","","2010-12-20 09:36:39","2010-12-21 03:14:04","Horizontal Sliding Transition Scrolling","<android><html5><css3><horizontal-scrolling>","1","0","","",""
"4484862","1","4484868","","2010-12-19 20:11:15","1","233","<p>I am puzzled that a float does not return the fraction. The code:</p><pre><code>float max_stops;int maxBellows = 330;int lensFocal = 135;max_stops =  (maxBellows / lensFocal );</code></pre><p>returns 2.0 instead of 2.44.</p><p>Can you pls help me get this right?</p>","547931","","","","","2010-12-19 20:21:32","Problems with float: it does not return the fraction","<java><android>","5","0","","",""
"4484942","1","4485111","","2010-12-19 20:30:57","0","1306","<p>Currently I am displaying data from an SQLite database in a multiple-column ListView. However, I would like to use calculated columns in my data involving more complicated mathematical functions than those available in SQLite queries.In <a href=""http://stackoverflow.com/questions/2034348/android-sqlite-sort-on-calculated-column-co-ordinates-distance"">this thread</a> the following advice was given for this sort of situation:</p><blockquote>  <p>... if you are putting the Cursor into some sort of CursorAdapter, you could:  (1) convert the Cursor into an ArrayList, where Position is some Java class you define with your data  (2) close the Cursor, to release the RAM it takes up  (3) sort the ArrayList using Arrays.sort()  (4) wrap the ArrayList in an ArrayAdapter and use that where you had been using your CursorAdapter</p></blockquote><p>My problem is that I get stuck at step (4), because ArrayAdapter seems to be less flexible than SimpleCursorAdapter. I have been using SimpleCursorAdapter to define the mapping from the database columns to the ListView, but there seems to be no equivalent method defined for an ArrayAdapter.</p><p>I have seen references on the web to an Android object called ArrayListCursor. This sounds as if it would do just what I want, but it does not appear in the current Android Reference and it doesn't seem to be recognised by Eclipse.</p><p>If ArrayListCursor has been superseded what has replaced it?</p>","250845","","","","","2010-12-19 21:10:23","Android: Using data from a multiple-column ArrayList in a ListView","<android><multidimensional-array><cursor><arraylist><adapter>","1","0","","",""
"4484983","1","4486341","","2010-12-19 20:42:32","3","2109","<p>Is there a way in Java to write to disk a large array of, say, integers? I am doing this on an Android, and have not found a method that comes anywhere close to native C code.</p><p>The resulting file need not be portable to different machines with different representations, so logically just a bulk write of the underlying bytes should be sufficient. But I don't know how to do that efficiently from Java.</p><p>I have tried searching the net, and tested the following:</p><ul><li>Serialization - very slow, as expected.</li><li>Using NIO - still slow - Android trace reveals operations one at a time per integer:</li></ul><p>Thanks in advance</p><hr><p>NIO code:</p><pre><code>int[] array = new array[10000000];...raf = new RandomAccessFile(ti.testFileName, ""rw"");chan = raf.getChannel();MappedByteBuffer out = chan.map(FileChannel.MapMode.READ_WRITE, 0, array.length*4);ib = out.asIntBuffer();ib.put(array);out.force();raf.close();</code></pre>","547914","","281545","","2013-01-20 13:41:01","2013-01-20 13:41:01","Java Performance - How to write big array to disk/sdcard with high performance?","<java><android><performance><io>","4","8","3","",""
"4484989","1","4485029","","2010-12-19 20:45:08","4","9099","<p>I'm not familiar with where I can get the package com.sun.net.httpserver?  I like to use this package in Android.</p><p>Thanks!</p>","398248","","398248","","2012-06-19 13:05:00","2012-06-19 13:05:00","How to download com.sun.net.httpserver package?","<java><android><com.sun.net.httpserver>","2","2","1","",""
"4485034","1","4485053","","2010-12-19 20:53:58","0","777","<p>can someone tell me what script/command I need to run on a rooted phone to emulate android's hardware back button?</p><p>I'm trying to create a always-on-screen back button and its code is all set. Now I'm looking for a script/command which can emulate android's hardware back key press and set it to whatever app is active. something like <a href=""http://forum.xda-developers.com/showthread.php?p=9575198"" rel=""nofollow"">http://forum.xda-developers.com/showthread.php?p=9575198</a> and <a href=""http://forum.xda-developers.com/showthread.php?t=865525"" rel=""nofollow"">http://forum.xda-developers.com/showthread.php?t=865525</a></p><p>What i'm looking would be a shell command like ""su event_command back_key_code""</p>","453906","","453906","","2010-12-19 21:05:37","2011-12-03 04:25:15","need the script for back button emulation","<android>","2","0","","",""
"4485090","1","4485137","","2010-12-19 21:06:00","1","412","<p>I have an re-ocurring alarm manager task that needs to run nightly, However when the device is turned off then back on, it erases this task and I have no way to reset it.  I would like to know how to tell if a device has been turned off and/or if you can run specifc code before the phone turns off so I can set a flag to reset this task.  Thanks</p>","408079","","","","","2010-12-19 21:15:34","How to tell if android device has been turned off","<android><phone><alarmmanager>","1","0","3","",""
"4485170","1","4504254","","2010-12-19 21:20:36","0","3295","<p>i need some help again!</p><p>At first i really thought it was some kind of ScrollView tweak to achieve something like this: </p><p><img src=""http://i.stack.imgur.com/5EPYF.png"" alt=""alt text""></p><p>But, as far as i know, it isnt, so, how can i achieve this kinda of custom scrollbar?</p><p>Thanks in advance!</p>","2443607","","","","","2010-12-21 21:49:06","Android scrollbar with a extra View (screenshot included)","<android><scrollbar><scrollview>","3","0","3","",""
"4485299","1","4485344","","2010-12-19 21:46:01","0","257","<p>I am building an app that makes mass changes to Android phone configuration and saves the current settings. I am trying to find a way to read what is the current wallpaper in use; I'd like to replace it with no wallpaper ( wallpaperManager.clear(); ) and then restore the previous wallpaper.</p>","509498","","","","","2010-12-19 21:56:33","Android - read active wallpaper","<android><wallpaper><android-preferences>","1","0","","",""
"4485384","1","","","2010-12-19 22:06:28","0","248","<p>This code which compiles fine seems to crash my application at startup</p><pre><code>private OnClickListener teamlisten = new OnClickListener() {     public void onClick(View v) {      getListView().setVisibility(View.GONE);  }};  //this is in OnCreateButton teambtn = (Button)findViewById(R.id.teams);teambtn.setOnClickListener(teamlisten);</code></pre><p>Any help is appreciated.</p><p>Thanks,Andrew</p>","531315","","","","","2010-12-19 23:22:09","Application crashing on startup due to click listener?","<android>","2","4","","",""
"4485422","1","5771017","","2010-12-19 22:17:16","1","1876","<p>I'm starting a simple AudioRecord app that I am writing and it starts with a bunch of these:</p><pre><code>12-19 17:05:57.393: WARN/ResourceType(2233): Resources don't contain package for resource number 0x7f0800f4</code></pre><p>and then this:</p><pre><code>12-19 17:05:57.863: ERROR/AudioHardwareALSA(2182): AudioStreamInALSA::AudioStreamInALSA mMode=-112-19 17:05:57.863: ERROR/AudioHardwareALSA(2182): AudioStreamInALSA - input   - format = 1, channels = 16, rate = 4410012-19 17:05:57.863: ERROR/AudioHardwareALSA(2182): AudioStreamInALSA - default - format = 1, channels = 16, rate = 4410012-19 17:05:57.863: ERROR/AudioHardwareALSA(2182): AudioStreamInALSA - mDefaults-&gt;sampleRate = 4410012-19 17:05:57.963: ERROR/AudioFlinger(2182): readInputParameters mInputBytes 8320, mFrameSize 2 mSampleRate 44100 mChannelCount(1)12-19 17:05:57.963: ERROR/(2182): AFCCreateReSampler: avAFCInfo-&gt;bUsed[0] inSampleRate[44100] outSampleRate[44100] nChannel[1] outbitDepth[16]12-19 17:05:58.278: WARN/AudioFlinger(2182): RecordThread: buffer overflow12-19 17:05:58.328: WARN/IInputConnectionWrapper(6726): showStatusIcon on inactive InputConnection12-19 17:06:05.598: ERROR/ALSALib(2182): external/alsa-lib/src/pcm/pcm.c:7231:(snd_pcm_recover) overrun occured</code></pre><p>What might this mean?  I can post source code if necessary, but I'm looking for a basic answer of what these errors might refer to and why a buffer overflow might occur in such a situation.  Thanks.</p>","107083","","1534123","","2012-10-26 15:47:32","2012-10-26 15:47:32","AudioHardwareALSA errors with Android AudioRecord","<android><audiorecord><android-audiorecord>","1","2","","",""
"4485427","1","4540159","","2010-12-19 22:17:48","1","796","<p>I am writing an app widget which I intend to populate with a list of items. I'm trying to do it the easy way by extending <code>AppWidgetProvider</code>. I am seeing some strange behaviour where the list of items gets added to the parent widget twice.</p><p>Here's the code:</p><pre><code>@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    Log.i(""MyApp"", ""onUpdate called"");    DbAdapter dbAdapter = new DbAdapter(context);    dbAdapter.open();    final String[] columns = { DbTableCategory.KEY_NAME, DbTableCategory.KEY_CURRENTBAL };    Cursor cursor = dbAdapter.getDb().query(DbTableCategory.TABLE_NAME, columns, null,                        null, null, null, null);    final int n = appWidgetIds.length;    for (int i = 0; i &lt; n; i++) {        Log.i(""MyApp"", ""Widget instance "" + i);        final int NUM_ITEMS = 4;        int id = appWidgetIds[i];        RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget_layout);        for (int c = 0; c &lt; NUM_ITEMS; c++) {            // get item info from db            if (cursor.moveToPosition(c)) {                RemoteViews itemView = new RemoteViews(context.getPackageName(), R.layout.widget_item);                itemView.setTextViewText(R.id.widget_item_name, cursor.getString(0));                itemView.setTextViewText(R.id.widget_item_amnt, cursor.getString(1));                Log.i(""MyApp"", ""Adding subview for item "" + c);                rv.addView(R.id.widget_container, itemView);            }        }        appWidgetManager.updateAppWidget(id, rv);    }    cursor.close();    dbAdapter.close();</code></pre><p>I add four items to the list, but I actually see eight items in the widget (the same four appearing twice). From the log output, it is telling me that there are two instances of the widget (according to the <code>appWidgetIds</code> array, and the IDs are different), so the outer loop is running twice, and the inner loop (for each item) is running four times as expected. I don't understand this, as I'm positive I've only added the widget to my home screen once. It's not on any of the other home screens either - I'm using the default HTC Sense launcher.</p><p>Even if I had instantiated the widget twice, I'm creating a new RemoteViews for each widget instance. I just don't understand why the one widget instance seems to be receiving two lots of items. What am I getting wrong?</p><p>Addendum: when I run the exact same code in the emulator, it works just fine, with just one widget instance being reported. It's only showing the strange behaviour on the actual phone (HTC Desire, Froyo).</p><p>Edit: I've since noticed this in the <a href=""http://developer.android.com/reference/android/widget/RemoteViews.html"" rel=""nofollow"">documentation</a> for <code>RemoteViews.addView()</code>:</p><blockquote>  <p>In cases where consumers of RemoteViews may recycle layouts, use removeAllViews(int) to clear any existing children.</p></blockquote><p>Could it be that the same <code>RemoteViews</code> instance is being returned from the <code>RemoteViews(...)</code> constructor? That would explain why the child views are being added twice, but it would <em>not</em> explain why there seem to be two instances in the first place.</p>","385478","","385478","","2010-12-28 13:01:31","2014-02-21 02:12:17","Android app widget: content added twice","<android><widget><instance>","2","2","","",""
"4485521","1","","","2010-12-19 22:38:01","0","440","<p>How can I use an authToken string to manipulate a google calendar?  I understand how to get the authToken, but I don't understand how to use the authToken to access google calendar...</p><p>In the stackoverflow question below, the person says they append it to the url, but I just haven't been able to figure out where to put it...</p><p><a href=""http://stackoverflow.com/questions/1996686/authtoken-from-accountmanager-in-android-client-no-longer-working"">AuthToken from AccountManager in Android Client No Longer Working</a></p><p>Can anyone please help me?  Thanks.</p>","532933","","","","","2010-12-20 04:00:57","Authenticating google calendar using authToken","<android>","1","0","","",""
"4485546","1","4485558","","2010-12-19 22:44:24","1","2872","<p>If I add <code>this</code> as a LocationListener twice as follows</p><pre><code>manager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,3,this);manager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,3,this);</code></pre><p>, would it be enough to just remove <code>this</code> once as follows</p><pre><code>manager.removeUpdates(this);</code></pre>","481009","","","","","2010-12-19 22:46:48","How to remove a LocationListener from LocationManager that is added twice in android?","<android><gps><location>","1","0","0","",""
"4485563","1","","","2010-12-19 22:47:25","0","680","<p>I built my applications without specifying a minimum sdk in the beginning. However after I added that line to publish to market I found my applications are behaving very differently for example buttons are smaller, etc... In particular I'm having problems with an application that records sound which was working fine when no minimum sdk was specified, but crashes when I specify one. I've tried specifying the minsdk to that of my phone which is 7, but that doesn't seem to help. What's the default minimum sdk when none is specified? I just want my application to run like it does normally. </p>","522710","","","","","2010-12-20 01:44:29","android:minSdkVersion=""4"" causing strange problems","<android>","1","0","","",""
"4485587","1","","","2010-12-19 22:51:34","3","1779","<p>I am drawing some text on a Canvas, and on a Bitmap, respectively:</p><pre><code>protected void onDraw(Canvas canvas) {    canvas.drawText(""Canvas text"", 10, 10, mPaint);    Canvas singleUseCanvas = new Canvas();    singleUseCanvas.setBitmap(mBitmap);    singleUseCanvas.drawText(""Bitmap text"", 10, 30, mPaint);}</code></pre><p>In the former case, the text renders as you would expect, while in the latter, it appears very rough and ugly. This becomes even more problematic when using e.g.</p><pre><code>canvas.drawBitmapMesh(...);</code></pre><p>to apply transformations to the bitmap. Am I doing something wrong, or is the quality simply deteriorated when you pass from Canvas to Bitmap?</p><p>On a side note, the reason why I'm drawing text on a Bitmap is to obtain a ""magnifier"" effect on the text in question (like Apple OSX's dock), since I can then apply arbitrary transformations to it using a bitmap mesh. Is there another, perhaps better, way to do this?</p><p>Best,</p><p>Michael</p><p><strong>Edit:</strong> Solved. For those interested, the problem seems to occur when using API versions &lt; 4. When using API versions >= 4, everything works.</p>","318683","","318683","","2010-12-26 11:36:56","2010-12-26 11:36:56","Drawing text on a Bitmap (rather than Canvas)","<android>","0","1","2","2012-07-02 01:34:56",""
"4485652","1","4838813","","2010-12-19 23:06:20","4","5099","<p>I have been primarily developing iOS apps but now, I'm developing applications for both iOS and Android. As much as possible, I'm trying to write code that is platform-independent as possible. </p><p>What have people done for networking functionality? I can't seem to find any resources on making GET/POST HTTP requests in Android. </p><p>How would you approach the issue of developing a shared networking library for both iOS and Android.</p><p>EDIT: I'll be doing all my Android network programming in C/C++ and not Java!</p><p>Are there any C/C++ networking libraries for Android (and subsequently can be used for iOS)?</p>","265791","","265791","","2010-12-20 00:25:09","2011-01-29 18:59:47","Developing a shared Android / iOS network library","<android><ios><cross-platform>","6","2","7","",""
"4486034","1","4488149","","2010-12-20 00:40:33","146","111398","<p>I know how to get the root view with <a href=""http://developer.android.com/reference/android/view/View.html#getRootView%28%29"">View.getRootView()</a>. I am also able to get the view from a button's <code>onClick</code> event where the argument is a <a href=""http://developer.android.com/reference/android/view/View.html"">View</a>. But how can I get the <strong>view</strong> in an <a href=""http://developer.android.com/reference/android/app/Activity.html"">activity</a>?</p>","297119","","1129332","","2013-12-19 13:42:32","2013-12-19 13:42:32","Get root view from current activity","<android><view>","3","3","66","",""
"4486107","1","4488119","","2010-12-20 01:00:32","4","10296","<p>I have looked at <a href=""http://stackoverflow.com/questions/3588893/android-how-to-update-listview-item-that-is-currently-displayed"">Android - how to update ListView item that is currently displayed</a> and <a href=""http://commonsware.com/Android/excerpt.pdf"" rel=""nofollow"">http://commonsware.com/Android/excerpt.pdf</a> and the Android documentation but I still don't understand.</p><p>My problem:<br>Using a handler, I am trying to update a Stock data multi-column listview which I have populated from a webservice which retrieves data from a MySQL database. To update the listview, I am calling a servlet which returns an XML that I loop through using DOM. </p><p>I cannot find a working way to apply the new data (from the XML) into the Listview, though only the third column (Trade Column) has to be updated. Also when I try to cast a View from a ListView row, I get a NullPointerException and can't figure out why.   </p><p>The code I have done so far is below.</p><p><strong>java Code:</strong></p><pre><code>private void updateUI() throws Exception{            Date dt = new Date();                     int hours = dt.getHours();    int minutes = dt.getMinutes();                     int seconds = dt.getSeconds();                     String curTime = hours + "":"" + minutes + "":""+ seconds;    refreshHandler.sleep(60000);    ListView listview = (ListView) findViewById(R.id.listview);     DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();    DocumentBuilder db = dbf.newDocumentBuilder();    Document doc = db.parse(""http://10.0.0.29:8080/CI3500/FTSEXML"");    //Filter and store ALL 'update' XML elements into node array    NodeList nodeList = doc.getElementsByTagName(""update"");    View v = null;    TextView t = null;    Adapter adapter = listview.getAdapter();    for (int i = 0; i &lt; adapter.getCount(); i++)     {        v = listview.getChildAt(i);        t = (TextView)v.findViewById(R.id.item2);        String companyCode = t.getText().toString(); //Column 1        for(int j = 0; j &lt; nodeList.getLength(); j++)         {            if(companyCode == nodeList.item(j).getFirstChild().getNodeValue())            {                //TODO Update Listview Code            }        }    }           txtStatus.setText(String.valueOf(""Last Update: "" + curTime));}</code></pre><p>The listview mapping is as follows:</p><pre><code>        // create the grid item mapping    String[] columns = new String[] {""col_1"", ""col_2"", ""col_3"" };    int[] rows = new int[] { R.id.CodeColumn, R.id.NameColumn, R.id.TradeColumn };</code></pre>","548036","","1700486","","2013-01-22 13:45:28","2013-01-22 13:45:28","Android Updating ListView","<java><android><android-widget>","2","0","2","",""
"4486143","1","6029984","","2010-12-20 01:08:14","6","3172","<p>I'm working with camera preview frames, and need to make a decision about what minimum preview size I will work with. I need fairly high resolution, and am trying to figure out the highest preview resolution I can get across the more popular Android handsets and OS versions. (Judging by <a href=""http://stackoverflow.com/questions/2948874/nexus-one-camera-preview-sizes-on-android-2-2-froyo"">this question about Nexus One / Froyo preview sizes</a>, it looks like they sometimes change across OS versions for the same device.)</p><p>Is there a resource anywhere that basically lists the output of <code>android.hardware.Camera.Parameters.getSupportedPreviewSizes()</code> for lots of different devices (or device/OS version pairs)?</p><p>Alternatively, if there is no such listing, this question could become such a resource. I will very happily upvote any answers that include new individual data points for specific handsets / OS versions.</p><p>And to forestall the obvious comment: Yes, I know I will need to test my code on lots of devices anyway. But ideally I would like to make some reasonably informed decisions about resolution early on, without having to purchase a bevy of devices just to get started.</p>","190280","","","","","2013-07-10 07:46:13","Supported camera preview sizes for popular Android handsets","<android><camera>","3","3","1","",""
"4486149","1","4486167","","2010-12-20 01:09:34","2","436","<p>I want a know if it's possible to install a android application that I created but without passing by the market place, because the apps is for my company only. And the solution must also be legal.</p>","400380","","229044","","2012-05-15 16:17:54","2012-05-15 16:17:54","Android apps without marketplace","<android>","3","0","","",""
"4486204","1","","","2010-12-20 01:26:56","3","205","<p>I have an existing java interface I'd like to expose via AIDL.Is there a way to auto generate the AIDL from the Java?</p><p>I am aware of Java2IDL for Corba code, so this would be somethingsimilar to that. </p>","548103","","","","","2013-11-29 14:32:21","java to aidl utility","<android><aidl>","1","1","","",""
"4486234","1","4488221","","2010-12-20 01:32:36","3","1023","<p>Currently, I plan to port a Java desktop application, to the Android platform. Besides official <a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">Anroid SDK</a>, I also take a look on, as it will be a plus, if it is able to run in iphone with minimal effort.</p><ul><li><a href=""http://www.rhomobile.com/"" rel=""nofollow"">http://www.rhomobile.com/</a></li><li><a href=""http://www.phonegap.com/"" rel=""nofollow"">http://www.phonegap.com/</a></li><li><a href=""http://appcelerator.com"" rel=""nofollow"">appcelerator.com</a></li></ul><p>Those cross platform frameworks seem nice. However, I was wondering, what are the limitation on those frameworks?</p><ol><li>Will they still have the same look and feel as native Android application? (Or a native iPhone application)</li><li>Is there any difference in the speed and responsiveness of the application?</li><li>Are they able to provide same set of GUI components as in Android SDK? (Or iphone's)</li><li>Limitation access to I/O, network resource, hardware?</li><li>Ability to use threading?</li></ol>","72437","","72437","","2010-12-20 01:39:58","2010-12-20 15:41:23","Limitation on mobile cross platform development","<iphone><android><cross-platform><mobile-phones>","2","0","0","",""
"4486273","1","4486342","","2010-12-20 01:41:06","0","455","<p>I'm starting the research to develop my Android's calendar, and I would like to know if there's any calendar or algorithm for calendar provided by the Android system?</p>","287316","","","","","2011-05-12 12:02:58","Does Android provide a calendar algorithm ready for development?","<android><calendar>","2","0","","",""
"4486420","1","4486531","","2010-12-20 02:23:51","0","555","<p>For example, say I have a SQLite database of todos, each with a string title and an integer completed. How can I create a custom adapter (that extends CursorAdaper) that can bind the checkbox in an <code>android.R.layout.simple_list_item_checked</code> to the integer completed? I already know I have to convert the integer to a boolean, I'm using true = 1 and false = 0.</p>","200477","","200477","","2010-12-20 02:38:50","2010-12-20 02:54:43","Custom CursorAdapter to bind to simple_list_item_checked","<java><android><sqlite><cursor>","1","0","","",""
"4486489","1","","","2010-12-20 02:42:54","1","725","<p>Hi there everybody! I have some problem with VideoView when I try to play my .mp4 througn rtsp stream I got freezing pic on phone screen. At the same time sounds goes on fine, but video still freeze. For player I used standart code from api demos, mediaplayer and videoview work the same, it still freeing when play. Someone know the solution?</p><p>Here is info about the video from vlc player:mpeg AAC Audio (mp4a) 44100 GzH264 - MPEG-4 AVC 480 x 320</p>","548138","","","","","2010-12-20 08:07:55","VideoView and .mp4 freezing","<android><rtsp><videoview>","1","0","","",""
"4486619","1","","","2010-12-20 03:17:50","1","1134","<p>What would be the best way to build a sms application with adobe AIR and AS3? An application that send and receive sms. I found how to send using the uri but can't find any explanations about how to receive and display it. </p>","478801","","","","","2011-07-29 09:53:37","How to receive sms within adobe AIR app on android","<android><actionscript-3><air>","2","0","","",""
"4486652","1","","","2010-12-20 03:28:42","2","7562","<p>how can i cancel the default action if user set my action as default in my app? </p>","443407","","","","","2010-12-20 05:32:40","how can i cancel the default action if user set my action as default in my app?","<android><default>","1","2","","",""
"4486697","1","","","2010-12-20 03:37:50","4","463","<p>It's pretty clear that the current emulator does not provide Bluetooth support.  While there appears to be a third-party emulator available that might work it seems to come with warnings about bugs that tend to suggest that I might be better off spending my energies elsewhere.  Does anyone know of progress, and perhaps even a target, for getting Bluetooth support built into the device emulator in the Android SDK Tools?</p>","548175","","","","","2011-04-12 12:42:02","What's the prognosis for Bluetooth device support in the emulator?","<android><bluetooth><emulator>","1","0","1","",""
"4486718","1","","","2010-12-20 03:42:28","0","428","<p>I have a custom view. When will android call draw() on it? After it calls onMeasure and onLayout?</p><pre><code>'package global.domination.pack;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Canvas;import android.util.Log;import android.view.View;public class TileView extends View {    // rules about what can be and is on this tile    boolean bLand;    boolean bSea;    boolean bAir;    boolean bOccupied;    Character _character;    // this tile's coordinates    int nX;    int nY;    // bitmaps used for drawing this tile    Bitmap _originalBitmap;    Bitmap _finalBitmap;    // this constructor initializes all variables (creates the tile)    public TileView(Context context, boolean isLand, boolean isSea, boolean isAir, boolean isOccupied, int x_Coordinate, int y_Coordinate, Bitmap bitmap) {        super(context);        //Initialize variables and set tile graphic.        bLand           = isLand;        bSea            = isSea;        bAir            = isAir;        bOccupied       = isOccupied;        nX              = x_Coordinate;        nY              = y_Coordinate;        _originalBitmap = bitmap;        _character      = null;        _finalBitmap    = bitmap;    }    /* This method is called by parent view when it      * wants to know this view's drawing preferences     */    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        // set this tiles dimensions        this.setMeasuredDimension(50, 50);    }    /* This method is called by parent view when it wants      * this view to draw itself.     */    @Override    protected void onDraw(Canvas canvas) {              // attempt to draw the _finalBitmap (tile graphic with character graphic)        try{            canvas.drawBitmap(_finalBitmap, 0, 0, null);        }        catch(RuntimeException rtException){            Log.e(""EXCEPTION"", ""ERROR DRAWING FINAL BITMAP"" + rtException.getMessage() , rtException);        }                   }}'</code></pre>","537215","","537215","","2010-12-20 04:30:00","2010-12-20 04:38:41","ANDROID: Custom view implemtation","<android><user-interface><view>","1","1","0","",""
"4486748","1","","","2010-12-20 03:49:30","1","663","<p>Has anyone experienced a GoogleLoginService fail when authenticating to use a google service (calendar in my case) through the AccountManager?  I obtained an authentication token using...</p><pre><code>AccountManager mgr = AccountManager.get(this); Account[] accts = mgr.getAccountsByType(""com.google""); Account acct = accts[0];AccountManagerFuture&lt;Bundle&gt; accountManagerFuture = mgr.getAuthToken(acct, ""calendar"",   null, this, null, null);Bundle authTokenBundle = null;try {authTokenBundle = accountManagerFuture.getResult();}     catch (OperationCanceledException e) {e.printStackTrace();}     catch (AuthenticatorException e) {e.printStackTrace();}     catch (IOException e) {e.printStackTrace();}authtoken = authTokenBundle.get(AccountManager.KEY_AUTHTOKEN).toString();</code></pre><p>After obtaining my authentication token, I created a Calendar Service and tried to authenticate it...</p><pre><code>CalendarService myService = new CalendarService(""UserCalendar"");myService.setAuthSubToken(authtoken);</code></pre><p>When I use this on either a phone or emulator, it initially seems to work as expected... it brings up screen where google asks the user to 'allow' or 'deny' access by my app.  However, when I click allow, it says that the password of the google account is incorrect.</p><p>Now, I've tried it with multiple google accounts (both of which passwords work when I use them manually to login) and it still gives the same result.  Any ideas as per why I might be getting this?  The debug isn't extraordinarily useful... all that I get is two lines which just tell me it failed...</p><pre><code>12-19 20:40:05.756: DEBUG/GoogleLoginService(245): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }12-19 20:40:08.426: DEBUG/GoogleLoginService(245): LOGIN_FAIL</code></pre><p>Has anyone else had this issue before?  I'm assuming there is something simple I'm missing but just can't think of why it wouldn't authenticate... thanks!</p>","532933","","532933","","2010-12-20 05:21:30","2010-12-21 01:05:46","GoogleLoginService LoginFail","<android>","1","0","","",""
"4486755","1","","","2010-12-20 03:53:01","0","376","<p>An error occurred while collecting items to be installed  session context was:(profile=com.poweredbypulse.profile-1127702-rmb-1421610, phase=com.genuitec.pulse2.client.common.download.PulseCollect, operand=, action=).  Unable to retrieve binary,com.motorolamobility.preflighting.root.linux,0.6.0    Unable to retrieve artifact; see log for more details    475637 is not expected; should have been 10240</p><p>I have no idea about how to deal whit it.... help me please!!</p>","528900","","","","","2010-12-20 03:53:01","using eclipse install motodev studio for android and there is a problem","<android><eclipse>","0","2","","",""
"4486795","1","4785835","","2010-12-20 04:05:11","7","3103","<p>I am new to android and have been looking for a solution to this but so far no luck. I would like to create a layout that is something like the picture below.</p><p>I would like to have a linearLayout that is the size of the screen.Then have another linearLayout that is also the size of the screen but off screen. I can then scroll between the two virtual ""screens"". (I was going to show the image but, since I am new to the site I'm not allowed...link to the image is <a href=""http://postimage.org/image/2ugwp52sk/"">here</a></p><p>There is an interesting article that explained how to extend the scrollView class so that I could get a cool snapping effect, so if I can get this to work, my app will feel much like scrolling between home screens.</p><p>I have read about weights and also about scrollView's fillViewport=""true"". I am afraid that I don't understand how these can be used with a horizontalScrollView to have the linearLayouts fill the screen. I have attempted all kinds of combinations of fill_parent and wrap_content but to no avail.</p><p>As I see it, this functionality will not hurt the portability of the app between devices that have different screens as long as I build the sub views (the elements in each ""screen"") with screen variability in mind.</p><p>Here is a simple example of the XML I was trying:</p><pre><code>&lt;HorizontalScrollViewxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/HorizontalScrollView01""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:fillViewport=""true""&gt;&lt;LinearLayout     android:orientation=""horizontal""    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;EditText            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/txtTestBox""            &gt;        &lt;/EditText&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout         android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;Button            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""Button 1""        /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;/HorizontalScrollView&gt;</code></pre><p>Unfortunately, that does not even get close to what I am looking for. Hopefully this can be done...</p><p>Thanks for any help or suggestions.</p>","547371","","547371","","2010-12-21 05:31:02","2011-01-24 18:46:51","Layout inside horizontalScrollView that is the size of the screen","<android>","2","2","","",""
"4486828","1","4487259","","2010-12-20 04:13:17","2","5253","<p>I'm able to stream audio and stop it without any problem, but when It try to start it again after stop it doesn't start and I get IllegalState exception.</p><p>Here is what I'm doing</p><p>Start Playing</p><blockquote>  <p>mediaPlayer.setDataSource(PATH);</p>    <p>mediaPlayer.prepare();</p>    <p>mediaPlayer.start();</p></blockquote><p>Stop Playing</p><blockquote>  <p>mediaPlayer.stop</p></blockquote><p>======</p><p>Now If I want to start playing again the same media then what I will have to do. *PATH is the url of a continuous running radio station.</p>","343679","","343679","","2010-12-20 19:33:46","2010-12-20 19:33:46","Android Media Player Restart Audio After Calling Stop","<android><audio><media-player>","2","2","","",""
"4486864","1","4793288","","2010-12-20 04:25:51","10","16785","<p>In my map application, I am displaying a set of overlays on a map. Whenever I tap on an overlay I need to display a popup, like this</p><p><img src=""http://i.stack.imgur.com/22tPY.png"" alt=""Image of MapView with overlay popup""></p><p>Can any one help me to sort out this?</p>","414777","","984393","","2012-08-10 19:03:27","2013-05-30 15:39:33","How to display popup on tapping overlay in android?","<android><google-maps><android-mapview>","2","7","11","",""
"4487045","1","","","2010-12-20 05:09:20","0","546","<p>I am trying to open an SQLite database to update it with new rows. The trouble is, opening the database seems to delete all rows in it. Here is my code:</p><pre><code>    String sdPath = Environment.getExternalStorageDirectory() + ""/myApp"";    String databasePath = sdPath + ""/myApp.db"";    File file = new File( databasePath );    if( file.exists() )    {        Log.w( getClass().getSimpleName() , ""myApp Database size: "" + file.length() );        database = SQLiteDatabase.openOrCreateDatabase( file, null );        Log.w( getClass().getSimpleName() , ""myApp Database size: "" + file.length() );        Log.w( getClass().getSimpleName() , ""myApp Database opened"" );    }    else    {        File directory = new File( sdPath );        directory.mkdir();        Log.w( getClass().getSimpleName() , ""Creating myApp Database"" );        database = SQLiteDatabase.openOrCreateDatabase( file, null );        Log.w( getClass().getSimpleName() , ""myApp Database opened"" );        database.execSQL( DATABASE_CREATE_TABLE_OBJECT );        database.execSQL( DATABASE_CREATE_TABLE_ZONE );        database.execSQL( DATABASE_CREATE_TABLE_OBJECT_ZONE );        database.execSQL( DATABASE_CREATE_TABLE_POINT );        database.execSQL( DATABASE_CREATE_INDEX_POINT );        database.execSQL( DATABASE_CREATE_INDEX_ZONE );    }</code></pre><p>On my two output statements, the first tells me the size of the file before opening it, and then after opening, the file size always returns to approximately 13KB. What am I doing wrong?</p><p>EDIT: I should probably mention that I'm writing this nor Android API level 7.</p>","504055","","504055","","2010-12-21 00:34:52","2010-12-22 02:37:52","Android: SQLite Database deleting all rows when opening pre-existing database","<android><sqlite>","2","2","","",""
"4487055","1","4487102","","2010-12-20 05:10:25","3","651","<p>i want to add a button or menu item  in the Contacts menu . Is it possible.???Im using Android 2.2 and Eclipse 3.6.1</p>","548218","","345717","","2011-01-04 22:33:40","2011-01-04 22:33:40","Android - add menu item to Android's built-in apps","<android>","1","0","","",""
"4487115","1","","","2010-12-20 05:21:04","1","1047","<p>I am writing an application which is composed of an underlying service and a GUI controller. The service collects data and sends to the controller, I used Messenger and put an array of parcelable objects into the bundle of the message. But when it is received at the controller side, error occurs:</p><p>android.os.BadParcelableException: ClassNotFoundException in unmarshalling MyData ...</p><p>I am sure that MyData implements correctly Parcelable interface. It seems I have to do something with ClassLoader? or what else? Please help me. Thank you very much!</p>","548235","","","","","2011-01-09 07:48:46","ClassNotFoundException when transfer data between service and activity","<android><ipc><bundle>","2","1","","",""
"4487185","1","4527226","","2010-12-20 05:36:52","1","1044","<p>I need to turn on screen back-light and keyboard backlight when my application receive notification. I have tried with PowerManager It it wasn't successful. </p><p>Is there any way to turn on screen and keyboard backlights?</p><p>Thank You.  </p>","377438","","","","","2010-12-24 16:12:49","Android Trun on backlight","<android>","1","3","2","",""
"4487220","1","9048734","","2010-12-20 05:45:56","1","2131","<p>I'm having some trouble getting an object to follow a path that is drawn with a touch event.The problem is more in the smoothness of which the object follows the path. </p><pre><code>/* the ACTION_MOVE code */Hashtable&lt;String, Integer&gt; ht = new Hashtable&lt;String, Integer&gt;();for (int h = 0; h &lt; historySize; h++) {  for (int p = 0; p &lt; pointerCount; p++) {      int newX = (int) event.getHistoricalX(p, h);      int newY = (int) event.getHistoricalY(p, h);      ht.put(""x"", newX);      ht.put(""y"", newY);      droid.path.add(ht);}droid.p.lineTo(x, y);}/* There's a game loop that calls a move() method on this droid object.  In move I read the path list   and see the next coordinate to move the object to. */</code></pre><p>I grab the coordinates as the user drags their finger across the screen using thehistoric methods so I don't miss any points.</p><p>The problem is the smoothness that the object moves along this path.</p><p>If you draw your path slow then the droid will move slowly across the screen( because more x,y points are captured? )But if you draw the line fast then the droid moves really fast.</p><p>I need the object to move at a consistent speed across the path.  </p><p>I somehow need to regulate the spacing between the points added to the hashTable or the sample rate at which points are read in so its consistent and the object looks smoothfollowing the path.</p><p>I've googled this one a good bit and i'm having some trouble finding anything.Any shove in the right direction would be appreciated.  </p><p>Thanks so much!</p>","215708","","105224","","2010-12-20 06:56:56","2012-01-28 21:21:58","How to get an object to follow a path","<java><android><path>","1","0","","",""
"4487272","1","","","2010-12-20 05:57:56","1","1554","<p>I have created a TabActivity in my android application. When user selects the second tab, an alert dialog will appear. Is there any way to navigate to the previous tab when user clicks the cancel button for the dialog box. </p><p>regardsdj</p><hr><p>I found the solution here:</p><p><a href=""http://stackoverflow.com/questions/2541802/android-switch-tabs-from-within-an-activity-within-a-tab"">Android - Switch Tabs from within an Activity within a tab</a></p><p>In my case, I have used the solution of 'GrandPrix'.  </p>","395959","","1288","","2012-11-01 11:06:40","2012-11-01 11:06:40","How to navigate between Tabs in android","<android><tabactivity>","1","0","2","",""
"4487346","1","4488186","","2010-12-20 06:16:36","1","610","<p>The time is displayed in Logcat,<br>and I want to get it by codes because Logcat doesn't always display the time.<br>Any of the ways of solving it will be acceptable<br>Thanks and Regards,</p>","542792","","","","","2010-12-20 09:05:01","I want to get the time of starting an application","<android>","2","0","","",""
"4487368","1","4488332","","2010-12-20 06:23:38","0","2144","<p>I have been new to android. I have just gone through my slideshow app.</p><p>I want to make image slide using touch event just like facebook app. when we click on image and swipe it to left then new image shown and when swipe finger towards right then last old image is shown.</p><p>I don't know how this works and how to start with it. Can any one help me in this case to start with like providing tutorials and tips ?</p><p>I just want effect on the image.</p>","490031","","544198","","2013-01-31 21:20:20","2013-01-31 21:20:20","Starting on gesture events handling","<android><slideshow><android-imageview><gestures>","2","0","","",""
"4487465","1","","","2010-12-20 06:46:44","2","4476","<pre><code>street = (EditText) findViewById(R.id.street);InputFilter filter = new InputFilter() {    public CharSequence filter(CharSequence source, int start, int end,Spanned dest, int dstart, int dend) {         for (int i = start; i &lt; end; i++) {              if (!Character.isLetterOrDigit(source.charAt(i)) || !Character.isSpaceChar(source.charAt(i))) {                  return """";                  }             }        return null;       }  };street.setFilters(new InputFilter[] { filter });</code></pre><p>my edittext is able to filter character &amp; number on the virtual keyboard but not taking the space character.. plz help</p>","548292","","212389","","2011-03-17 16:03:20","2013-11-30 05:47:14","android edittext inputfilter should accept space,character & number","<android><numbers><character><space>","2","1","","",""
"4487491","1","","","2010-12-20 06:51:09","-1","6474","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2634991/android-1-6-android-view-windowmanagerbadtokenexception-unable-to-add-window"">Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application”</a>  </p></blockquote><blockquote>  <p>android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application  at android.view.ViewRoot.setView(ViewRoot.java:509)  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)</p></blockquote><p>my code:</p><pre><code>    public class aaaa extends View {  private WindowManager mWindowManager; public aaaa(Context context) {  super(context); }@Overrideprotected void onDraw(Canvas canvas) {  canvas.drawBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.icon), 0, 0, null);  super.onDraw(canvas); } @Override public boolean onTouchEvent(MotionEvent event) {  ddd();  return super.onTouchEvent(event); } void ddd(){     mWindowManager = WindowManagerImpl.getDefault();        WindowManager.LayoutParams lp = new LayoutParams(50,50);        lp.x = 50;        lp.y = 50;        mWindowManager.addView(this, lp);   }</code></pre>","543077","","85950","","2013-01-11 22:22:13","2013-01-11 22:22:13","Android: unable to add window - token null is not for an application","<android>","1","1","","2013-01-12 14:09:31",""
"4487508","1","4489288","","2010-12-20 06:54:28","0","1422","<p>Hi Friends<br>i am using following code to get data from the Server and if the value from server is GEEK then it will load to next class,but new view is not loading,can u say what is the problem?</p><pre>    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        login = (Button) findViewById(R.id.login);        username = (EditText) findViewById(R.id.username);        password = (EditText) findViewById(R.id.password);        login.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {String Re;                String   mUsername = username.getText().toString();                String  mPassword = password.getText().toString();                Re=tryLogin(mUsername, mPassword);                if(Re==""GEEK"")                {                    Intent i = new Intent();                    i.setClassName(v.getContext(),""com.httplogin.MainScreen"");                    startActivity(i);                }            }        });    }    protected String tryLogin(String mUsername, String mPassword)    {                   HttpURLConnection connection;       OutputStreamWriter request = null;            URL url = null;               String response = null;                     String parameters = ""username=""+mUsername+""&password=""+mPassword;               try            {                url = new URL(""http://serverspace/script.php"");                connection = (HttpURLConnection) url.openConnection();                connection.setDoOutput(true);                connection.setRequestProperty(""Content-Type"", ""application/x-www-form-urlencoded"");                connection.setRequestMethod(""POST"");                    request = new OutputStreamWriter(connection.getOutputStream());                request.write(parameters);                request.flush();                request.close();                            String line = """";                               InputStreamReader isr = new InputStreamReader(connection.getInputStream());                BufferedReader reader = new BufferedReader(isr);                StringBuilder sb = new StringBuilder();                while ((line = reader.readLine()) != null)                {                    sb.append(line + ""\n"");                }                // Response from server after login process will be stored in response variable.                                response = sb.toString();                isr.close();                reader.close();            }            catch(IOException e)            {                Toast.makeText(this,e.toString(),0).show();            }            return response;    }}</pre>","404183","","","","","2010-12-20 11:49:15","Getting Data From the Server and Loading New Screen using Android","<android>","3","0","","",""
"4487581","1","4487839","","2010-12-20 07:09:50","0","275","<p>I want to how can I record a sound or audio in android and make sure that it will not be accessed by other apps. The sound recorded through the app should be played by that app only and no other audio playing app should be able to open that audio file.</p>","261566","","","","","2010-12-20 08:03:44","Record and save audio in Android which should not be accessed by other apps?","<android><security><audio>","1","0","","",""
"4487587","1","","","2010-12-20 07:10:57","1","579","<p>I want to connect the android phone with harware which only accepts the data at 19600 baudrate, how can I solve this problem? Is it possible to change android phone baud rate dynamicly</p>","533281","","1348709","","2012-10-16 19:32:33","2012-10-16 19:32:33","How to change the baud rate in android phone","<android><baud-rate>","0","1","1","",""
"4487727","1","4489044","","2010-12-20 07:44:24","0","190","<p>In my map i used to given route,from and to directions in CAR mode but the lines in curving place are breaking.I want to give smooth lines without breaking.Please give me guidance.    </p>","486216","","486216","","2010-12-20 11:05:57","2010-12-20 11:08:23","problem with drawing line(directions) on Map?","<android>","1","0","","",""
"4487787","1","4516816","","2010-12-20 07:53:29","1","2064","<p>guys.  I want make my application support https connection.  My  HttpClient code as follow:</p><pre><code>        HttpParams params = new BasicHttpParams();        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_0);        HttpProtocolParams.setContentCharset(params, HTTP.UTF_8);        HttpProtocolParams.setUseExpectContinue(params, true);        HttpConnectionParams.setConnectionTimeout(params, SO_TIMEOUT);        HttpConnectionParams.setSoTimeout(params, SO_TIMEOUT);        HttpConnectionParams.setSocketBufferSize(params, DEFAULT_BUFFER_SIZE);    SchemeRegistry schReg = new SchemeRegistry();    schReg.register(new Scheme(""http"", PlainSocketFactory            .getSocketFactory(), HTTP_PORT));    schReg.register(new Scheme(""https"", new CustomSSLSocketFactory(),            HTTPS_PORT));    ClientConnectionManager connMgr = new ThreadSafeClientConnManager(params, schReg);                  PersistentCookieStore store = new PersistentCookieStore();    store.clearExpired(new Date());    client = new DefaultHttpClient(connMgr, params);    client.setCookieStore(store);    client.addRequestInterceptor(new HttpRequestInterceptor() {        public void process(HttpRequest request, HttpContext context) {            // Add header to accept gzip content            if (!request.containsHeader(HEADER_ACCEPT_ENCODING)) {                request.addHeader(HEADER_ACCEPT_ENCODING, ENCODING_GZIP);            }        }    });    client.addResponseInterceptor(new HttpResponseInterceptor() {        public void process(HttpResponse response, HttpContext context) {            // Inflate any responses compressed with gzip            final HttpEntity entity = response.getEntity();            if(entity != null){                final Header encoding = entity.getContentEncoding();                if (encoding != null) {                    for (HeaderElement element : encoding.getElements()) {                        if (element.getName().equalsIgnoreCase(ENCODING_GZIP)) {                            response.setEntity(new InflatingEntity(response                                    .getEntity()));                            break;                        }                    }                }            }        }    });    requests = new ArrayList&lt;HttpUriRequest&gt;();}*</code></pre><p>but it will occur an exception in logcat : </p><pre><code>*12-20 07:42:41.895: DEBUG/com.ceosoft.alumlife.http.HttpClient(504): GET https://174.129.95.184:8443/AlumniFinderServer/ws/event/all12-20 07:42:42.125: WARN/SingleClientConnManager(504): Invalid use of SingleClientConnManager: connection still allocated.12-20 07:42:42.125: WARN/SingleClientConnManager(504): Make sure to release the connection before allocating another one.12-20 07:42:42.134: WARN/SingleClientConnManager(504): Invalid use of SingleClientConnManager: connection still allocated.12-20 07:42:42.134: WARN/SingleClientConnManager(504): Make sure to release the connection before allocating another one.12-20 07:42:42.144: INFO/System.out(504): cookies  == None12-20 07:42:42.164: WARN/SingleClientConnManager(504): Invalid use of SingleClientConnManager: connection still allocated.12-20 07:42:42.164: WARN/SingleClientConnManager(504): Make sure to release the connection before allocating another one.12-20 07:42:42.239: WARN/SingleClientConnManager(504): Invalid use of SingleClientConnManager: connection still allocated.12-20 07:42:42.239: WARN/SingleClientConnManager(504): Make sure to release the connection before allocating another one.12-20 07:42:54.734: INFO/System.out(504): IOException e java.io.IOException: Unable to make socket non blocking     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:316)     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.&lt;init&gt;(OpenSSLSocketImpl.java:520)     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:461)     at org.apache.http.impl.io.SocketInputBuffer.&lt;init&gt;(SocketInputBuffer.java:93)     at org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:83)     at org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:170)     at org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:106)     at org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:129)     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:171)     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)     at com.ceosoft.alumlife.http.HttpClient.getResponse(HttpClient.java:440)     at com.ceosoft.alumlife.http.HttpClient.getPublicData(HttpClient.java:317)     at com.ceosoft.alumlife.http.Client.getEventList(Client.java:423)     at com.ceosoft.alumlife.data.manager.DataManager$8.launch(DataManager.java:330)     at com.ceosoft.alumlife.data.DataTask.doInBackground(DataTask.java:93)     at com.ceosoft.alumlife.data.DataTask.doInBackground(DataTask.java:1)     at android.os.AsyncTask$2.call(AsyncTask.java:185)     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)     at java.util.concurrent.FutureTask.run(FutureTask.java:137)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)     at java.lang.Thread.run(Thread.java:1096)*</code></pre><p><strong>_</strong>------------------------------------------------------------CustomSSLSocketFactory.java :</p><p>import java.io.IOException;import java.net.InetAddress;import java.net.InetSocketAddress;import java.net.Socket;import java.net.UnknownHostException;import java.security.KeyManagementException;import java.security.KeyStoreException;import java.security.NoSuchAlgorithmException;</p><p>import javax.net.ssl.SSLContext;import javax.net.ssl.SSLSocket;import javax.net.ssl.TrustManager;</p><p>import org.apache.http.conn.ConnectTimeoutException;import org.apache.http.conn.scheme.LayeredSocketFactory;import org.apache.http.conn.scheme.SocketFactory;import org.apache.http.params.HttpConnectionParams;import org.apache.http.params.HttpParams;</p><p>/** * Factory for create ssl socket and accept self  * certificate */public class CustomSSLSocketFactory implements SocketFactory,                                     LayeredSocketFactory {</p><pre><code>private static final String SSL_PROTOCOL_NAME = ""TLS"";private SSLContext sslContext = null;/** * Creates a new CustomSSLSocket object. *  * @return the SSL context * @throws NoSuchAlgorithmException *             the no such algorithm exception * @throws KeyManagementException *             the key management exception * @throws KeyStoreException *             the key store exception */private static SSLContext createSSLContext() throws                         NoSuchAlgorithmException,                         KeyManagementException,                         KeyStoreException {    SSLContext context = SSLContext.getInstance(SSL_PROTOCOL_NAME);    context.init(null, new TrustManager[] { new MyTrustManager() }, null);    //context.init(null, new TrustManager[] { new CustomX509TrustManager(null) }, new SecureRandom());    return context;}/** * Gets the SSL context. Create new context and handle exceptions.  *  * @return the sSL context * @throws IOException *             Signals that an I/O exception has occurred. */private SSLContext getSSLContext() throws IOException {    if (sslContext == null) {        try {            sslContext = createSSLContext();        } catch (KeyManagementException e) {            throw new IOException(e.getLocalizedMessage());        } catch (NoSuchAlgorithmException e) {            throw new IOException(e.getLocalizedMessage());        } catch (KeyStoreException e) {            throw new IOException(e.getLocalizedMessage());        }    }    return sslContext;}/* (non-Javadoc) * @see org.apache.http.conn.scheme.SocketFactory#createSocket() */public Socket createSocket() throws IOException {    return getSSLContext().getSocketFactory().createSocket();}/* (non-Javadoc) * @see org.apache.http.conn.scheme.SocketFactory#isSecure(java.net.Socket) */public boolean isSecure(Socket socket) throws IllegalArgumentException {    return true;}/* (non-Javadoc) * @see org.apache.http.conn.scheme.LayeredSocketFactory# * createSocket(java.net.Socket, java.lang.String, int, boolean) */public Socket createSocket(Socket socket, String host, int port,        boolean autoClose) throws IOException, UnknownHostException {    return getSSLContext().getSocketFactory().createSocket();}/* (non-Javadoc) * @see org.apache.http.conn.scheme.SocketFactory# * connectSocket(java.net.Socket, java.lang.String, int,  * java.net.InetAddress, int, org.apache.http.params.HttpParams) */@Overridepublic Socket connectSocket(Socket socket, String reqHost, int reqPort,        InetAddress arg3, int arg4, HttpParams params) throws IOException,        UnknownHostException, ConnectTimeoutException {    int connTimeout = HttpConnectionParams.getConnectionTimeout(params);    int soTimeout = HttpConnectionParams.getSoTimeout(params);    InetSocketAddress remoteAddress = new InetSocketAddress(reqHost, reqPort);    SSLSocket sslSocket = null;    if (socket != null) {        sslSocket = (SSLSocket) socket;    } else {        sslSocket = (SSLSocket) createSocket();    }    InetSocketAddress inetSocketAddress = new InetSocketAddress(arg3, arg4);    sslSocket.bind(inetSocketAddress);    sslSocket.connect(remoteAddress, connTimeout);    sslSocket.setSoTimeout(soTimeout);    return sslSocket;}</code></pre><p>}</p><hr><p>import java.security.cert.CertificateException;import java.security.cert.X509Certificate;</p><p>import javax.net.ssl.X509TrustManager;</p><p>/** * * @file MyTrustManager.java * @author Samuel.Cai * @date 2010-12-21 */public class MyTrustManager implements X509TrustManager{</p><pre><code>@Overridepublic void checkClientTrusted(X509Certificate[] chain, String authType)        throws CertificateException {    // TODO Auto-generated method stub}@Overridepublic void checkServerTrusted(X509Certificate[] chain, String authType)        throws CertificateException {    // TODO Auto-generated method stub}@Overridepublic X509Certificate[] getAcceptedIssuers() {    // TODO Auto-generated method stub    return null;}</code></pre><p>}</p>","517055","","1845869","","2012-12-07 08:03:29","2012-12-07 08:03:29","Unable to make socket non blocking","<android><https>","1","2","","",""
"4487793","1","4487823","","2010-12-20 07:54:59","4","3213","<p>I have an Android app with a database called ""myTestDB"" with a table called ""list_items"".  I want to use the Cursor getContentResolver().query() method to get a cursor to add to a SimpleCursorAdapter.  The first argument of the query() method is a URI and I'm not sure what the URI should look like.</p>","166117","","","","","2014-01-24 15:02:01","How do I get the URI of my SQLite database in my Android app?","<android><database><uri>","3","0","","",""
"4487819","1","4530397","","2010-12-20 08:00:01","2","1396","<p>I want to Split Single Image in Four Pieces  and Display it Like Single Image. How can achieve it. I split image through bitmap but it is not fixing in like one single image. </p>","532774","","","","","2013-12-12 11:37:35","Split Single Image in Four Pices","<android><image><split>","1","0","3","",""
"4487849","1","","","2010-12-20 08:05:37","0","1239","<p>I have following things layed out in my xml file:</p><ol><li>Webview</li><li>Bottom image/ Admob</li></ol><p>Since I wanted my Admob to be displayed at the bottom, I chose two different layouts LinearLayout for Admob as suggested and RelativeLayout for other views.</p><p>Also, since I'm displaying splashscreen first and then webview, my logic goes such that I want both of them in a framelayout. My bottom image and Admob lay one above the other.So, my code goes as:</p><pre><code>&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/app.news""android:layout_width=""wrap_content""android:layout_height=""fill_parent""&gt; &lt;FrameLayoutandroid:id=""@+id/views""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt; &lt;ImageView       android:id=""@+id/splash_screen""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:scaleType=""center""            android:src=""@drawable/splash_screen""            android:visibility=""visible""    /&gt;&lt;WebView android:id=""@+id/webvw""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:gravity=""fill_vertical""android:scrollbars=""none"" android:visibility=""invisible""/&gt;             &lt;ImageView       android:id=""@+id/bottomImage""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:scaleType=""fitEnd""            android:src=""@drawable/logo""            android:visibility=""visible""    /&gt;&lt;/FrameLayout&gt;&lt;LinearLayoutandroid:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_alignParentBottom=""true""android:gravity=""bottom""android:layout_alignBottom=""@id/views""&gt;&lt;com.admob.android.ads.AdViewandroid:id=""@+id/ad""android:layout_width=""fill_parent""android:layout_height=""wrap_content""myapp:backgroundColor=""#000000""myapp:primaryTextColor=""#FFFFFF""myapp:secondaryTextColor=""#CCCCCC""myapp:testing=""false""/&gt;&lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I want webview to occupy all the space except for the bottom image, I'm not sure how to make it happen using webview height to be ""fill_parent"".</p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2010-12-20 08:08:52","Make webview fill_parent stay above the bottom image in Android","<android><layout>","1","0","1","",""
"4487867","1","7310411","","2010-12-20 08:08:56","3","1965","<p>I have developed my own media player and I want that when I want to watch a video from Youtube, it shall be opened from my app. At least, there should be a list of media apps on the view and I should be able to choose my app from the list. I don't know much about intent-filters. How can I provide this in my manifest file? I am working for to make it for local files to train but I haven't been able to make it yet, too. I really need your help :/</p>","511853","","","","","2011-09-05 16:05:24","Intent Filter for Media Player ( Youtube Video Play)","<java><android><youtube><android-intent><media>","1","0","3","",""
"4487911","1","4488025","","2010-12-20 08:18:13","8","13947","<p>I am getting the following error:</p><pre><code>The constructor Intent(new View.OnClickListener(){},                        Class&lt;DrinksTwitter&gt;) is undefined</code></pre><p>In the following code snippet:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // Get the EditText and Button References    etUsername = (EditText)findViewById(R.id.username);    etPassword = (EditText)findViewById(R.id.password);    btnLogin = (Button)findViewById(R.id.login_button);    btnSignUp = (Button)findViewById(R.id.signup_button);    lblResult = (TextView)findViewById(R.id.result);    // Set Click Listener    btnLogin.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            // Check Login            String username = etUsername.getText().toString();            String password = etPassword.getText().toString();            if(username.equals(""test"") &amp;&amp; password.equals(""test"")){                final Intent i = new Intent(this, DrinksTwitter.class);  //error on this line                startActivity(i);                // lblResult.setText(""Login successful."");                } else {                lblResult.setText(""Invalid username or password."");            }        }    });    final Intent k = new Intent(Screen2.this, SignUp.class);    btnSignUp.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            startActivity(k);        }    });}</code></pre><p>What am I doing wrong with the line:</p><pre><code>final Intent i = new Intent(this, DrinksTwitter.class); </code></pre>","554786","","257111","","2012-05-05 21:48:24","2013-02-19 16:43:56","The constructor Intent(new View.OnClickListener(){}, Class<DrinksTwitter>) is undefined","<android><android-intent>","3","2","2","",""
"4488121","1","","","2010-12-20 08:53:33","3","652","<p>Google should really document their contacts API, its really irritating to find out how to insert specific details.</p><p>Anyways,</p><p>I want to send following contact details to <code>Contact</code> native application of android:</p><ol><li>Name</li><li>Last Name [Family Name]</li><li>Street Address</li><li>City</li><li>State</li><li>Zip Code</li><li>Contact Phone no.</li></ol><p>I have figured out that Family name is stored in <code>ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME</code></p><p>Anyhelp will really be appreciated. And if you know any other columns insertion beyond these mentioned. I am ready to buy it. Only condition is it should use ContactsContract i.e. above android 2.1 API Level 5</p><p>Thankx :)</p>","447238","","","","","2011-11-24 18:02:44","Insert contacts Last Name using Intent android","<android><insert><contacts><contactscontract>","1","1","1","",""
"4488172","1","","","2010-12-20 09:02:06","0","436","<p>Is there any event to let us know that we almost reach the last data in gridview?I have a lot of data in my server, i want to load the data every 100 data, so if the user keep scrolling until the end of 100th data, i want to load another 100 data and put it in my gridview.</p><p>or is there any other solution?</p><p>Thanks.</p>","430926","","430926","","2010-12-20 09:27:46","2011-06-22 08:43:35","GridView Android","<android><android-gridview>","1","0","","",""
"4488198","1","","","2010-12-20 09:07:54","1","328","<p>I am playing a stereo wav file in android in my application using SoundPool in a infinite loop.</p><p>I am changing the left right channel sound using setVolume, every one second like </p><pre><code>int looper = 0;timerhandler(){ if(looper == 0) {  soundPool.setVolume(sid, 0, 1) ;  looper = 1; } else {  soundPool.setVolume(sid, 1, 0) ;  looper = 0;  }}</code></pre><p>Its working fine in emulator. but on device not getting stereo effect. </p><p>Can somebody help what could be the issue.  </p>","480040","","104117","","2010-12-20 10:31:44","2010-12-20 10:31:44","Playing stereo wav file in android","<android><audio>","1","0","","",""
"4488324","1","4488426","","2010-12-20 09:25:24","1","610","<p>The SMS thread view is like this:</p><pre><code>==here is the icon of 'someone'==someone: xxxxxxme: xxxsomeone: xxxxxxme: xxx===here is an editbox== =button=</code></pre><p>Ok, i hope with the ugly sample above can make my question more clear to you.  As i suppose, the view is not a ListView, either a TextView. It seems the TextView does not support scroll function. And ListView will hightlight the list item when i click it.  </p><p>I'm not very familiar with GUI programming, so i hope someone can give me some advance. Thanks.</p>","459062","","","","","2010-12-20 09:39:46","how to build a view like the default SMS thread view?","<android><view>","1","0","","",""
"4488338","1","5719200","","2010-12-20 09:26:54","17","12402","<p>I know how to setting proxy manually and to use it in my WebView.</p><p>Settings -> Wireless Networks ->mobile networks-> access point names->telkila. Now enter the proxy server address and port (which will be 80).WebView.enablePlatformNotifications();</p><p>But can i set the proxy setting from code?So my user didn't have to set manually?</p><p>Thanks</p>","430926","","","","","2014-04-04 17:11:08","WebView android proxy","<android><proxy><android-webview>","7","0","16","",""
"4488422","1","4488488","","2010-12-20 09:39:19","0","1610","<p>I need to draw the Pie Chart Manually .I need some basic Ideas to do that.Can anyone help Me ??</p>","548435","","","","","2013-08-02 13:19:58","How to draw Pie Chart Manually?","<android>","5","0","1","",""
"4488468","1","","","2010-12-20 09:45:18","0","1822","<p>I have some images, i want it to rotate like circularly in a Carousel  fashion. please let me know how to do it in android platform if anybody knows...</p>","548441","","310574","","2010-12-20 09:47:09","2010-12-20 10:36:19","How to do carousel animation in Android?","<java><android><carousel>","2","0","2","",""
"4488495","1","","","2010-12-20 09:51:08","3","987","<p>In Android, after a call to <a href=""http://developer.android.com/reference/android/view/View.html#setLayoutParams%28android.view.ViewGroup.LayoutParams%29"" rel=""nofollow"">View.setLayoutParams</a>, how can you find out the dimensions (width &amp; height) and position (x &amp; y coordinates) of a view?</p><p>If I query these properties immediately after <code>setLayoutParams</code> they return invalid values.</p><p>According to the documentation, <a href=""http://developer.android.com/reference/android/view/View.html#onSizeChanged%28int,%20int,%20int,%20int%29"" rel=""nofollow"">View.onSizeChanged</a> is called after the size of the view is changed. Does this means that I have to subclass the widget whose dimensions I want to query, override <code>onSizeChanged</code> and notify my activity of the change?</p>","143378","","143378","","2010-12-20 09:57:07","2010-12-20 14:37:52","Get dimensions after setLayoutParams in Android","<android><layout><view>","1","0","","",""
"4488521","1","4489027","","2010-12-20 09:55:38","0","217","<p>Hey everyone I'm not a professional coder by any stretch, but I've been playing around with a simple to-do list to learn the basics of android development.</p><p>I've been able to get just about everything I want working, but there is one problem with my listview that has me totally stumped.  I've extended SimpleCursorAdapter in order to format the data coming from my sqlite database and change the color of the duedate text based on whether or not the duedate has expired.  The formatting works flawlessly, but I'm getting some odd results with the colors.  </p><p>The first few entries in the listview look as I expect them to, but as I scroll down, inconsistencies start popping up where items with no due date set will be colored red or green.  The more I scroll up and down in the list, the more inconsistencies appear until eventually every row is colored whether it should be or not. </p><p>Can someone help me understand what is going on here?  Please see my custom adapter below.  </p><pre><code>public class ProAdapter2 extends SimpleCursorAdapter {  private static int[] TO = {R.id.priority, R.id.projectname, R.id.duedate};  private static String[] FROM = {""priorities"", ""projectName"", ""dueDate""};  private Context context;  private int layout;  //constructor  public ProAdapter2(Context context, int layout, Cursor c) {    super(context,layout, c, FROM, TO);    this.context=context;    this.layout = layout;  }      @Override  public View newView(Context context, Cursor curso, ViewGroup parent){    Cursor c = getCursor();    final LayoutInflater inflater = LayoutInflater.from(context);    View v = inflater.inflate(layout, parent, false);    TextView txtName = (TextView) v.findViewById(R.id.projectname);    txtName.setText(c.getString(1));    TextView txtPriority = (TextView) v.findViewById(R.id.priority);    txtPriority.setText(c.getString(2));    return v;  }     @Override  public void bindView(View v, Context context, Cursor c) {    TextView txtDueDate = (TextView) v.findViewById(R.id.duedate);    TextView txtDueDateLabel = (TextView) v.findViewById(R.id.duedate_label);    TextView txtPriority = (TextView) v.findViewById(R.id.priority);    TextView txtPriorityLabel = (TextView) v.findViewById(R.id.priority_label);    TextView txtName = (TextView) v.findViewById(R.id.projectname);    LinearLayout pridate = (LinearLayout) v.findViewById(R.id.pridate);    String dueDate = c.getString(3);    String cDate = c.getString(4);    String dueDateFormated;     MyTime t = new MyTime();     Long cTimeLong = c.getLong(6);     Long dTimeLong = c.getLong(5);     dueDateFormated = t.getFormatedTime(c.getString(3));          txtDueDate.setText(dueDateFormated);     if (c.getInt(5)==0){        txtDueDate.setText(""Not Set"");     }     else if (cTimeLong &lt; dTimeLong){                txtDueDate.setTextColor(Color.GREEN);     }     else if (cTimeLong &gt; dTimeLong){        txtDueDate.setTextColor(Color.RED);    }  }}</code></pre><p><img src=""http://i.stack.imgur.com/t2IRk.png"" alt=""image""><a href=""http://i.stack.imgur.com/bt4Z8.png"" rel=""nofollow"">http://i.stack.imgur.com/bt4Z8.png</a></p>","548369","","1022826","","2011-12-17 00:23:00","2011-12-17 00:23:00","ListView color issue","<android>","1","2","0","",""
"4488561","1","4488606","","2010-12-20 10:02:55","2","581","<p>I want to automatically invoke my application  at 12.00 am,This kind of process ,how to implement in android,is it possible?</p>","500595","","35681","","2010-12-20 19:53:25","2010-12-21 08:32:22","how to automatically invoke my application in android","<android><alarm>","2","0","3","",""
"4488564","1","4489452","","2010-12-20 10:03:20","0","134","<p>I wanna write a application with push email capablity. Can some one guide me over the same ?</p>","155196","","","","","2010-12-20 12:05:16","Android Push Email Applicaition","<android><push-notification>","1","0","","",""
"4488654","1","","","2010-12-20 10:14:47","1","2299","<p>I am new to Java and Android development, so please keep this in mind.  My goal is to deserialize data from xml files packaged into my application.  I'm attempting to do this using Simple 2.4 but I get an ""Unhandled Exception type exception"" error in the code when using .read or .write</p><p>My code looks something like this:</p><pre><code>import java.io.InputStream;import android.app.Activity;import android.os.Bundle;import android.view.View;import org.simpleframework.xml.Serializer;import org.simpleframework.xml.core.Persister;public class ftRoster extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        //Load in all available ship files here    }    public void myClickHandler(View view)    {     InputStream iStream = getResources().openRawResource(R.raw.ship);     Serializer serializer = new Persister();     ShipSystem newSystem = serializer.read(ShipSystem.class, iStream); }}</code></pre><p>And my class looks like this:</p><pre><code>import org.simpleframework.xml.Element;import org.simpleframework.xml.Root;@Rootpublic class ShipSystem{ @Element public String id = null; @Element public boolean destroyed = false; @Element public int systemValue = 0;}</code></pre><p>If I put a try / catch around it, of course the error goes away, but then the deserilization never occurs as well.  There is little discussion on Simple and the documentation makes it look as simple as C# serialization.  Any help would be appreciated on the problem.</p><p>A global view of what I'm wanting to do is have an xml file for each ""shipSystem"" and at the boot of application deserialize each one into it's own class instance and have all of these available in an array for lookup.</p><p>Thanks for taking the time to read and think about this.</p>","548448","","603516","","2013-03-22 17:33:13","2013-03-22 17:33:13","Using ""Simple"" XML Serialization to load data from res/raw on Android","<java><android><xml><eclipse><simple-framework>","2","1","","",""
"4488679","1","","","2010-12-20 10:19:14","1","1903","<p>Is there any android development phone available? and at what cost? and what is the specialty of this phone comparing with normal android phone? </p>","548476","","","","","2012-05-09 03:17:06","android development phone","<android>","2","0","","",""
"4488725","1","4488833","","2010-12-20 10:25:17","0","168","<p>I wanna create an application that will interact with social networks like twitter and facebook. get the feeds and display it on the screen. is there any api i can use to do it ?</p>","155196","","","","","2010-12-20 10:39:11","Android Social Stack","<android><facebook><api><twitter>","1","0","2","",""
"4488745","1","","","2010-12-20 10:26:51","0","711","<p>Hallo,</p><p>I'm using my Android (Archos 43) only as an extended display in an industrial application. I just need a single programm to display data received and send user inputs by bluetooth. This little programm should start directly after booting and should disable (fade out) the android-buttons (search, home, menu and back). That's my plan.</p><p>Here's my problem:</p><p>I know, there are some applications which can fade out these search/home/menu/back-buttons (like DeskClock or some videoplayers). But how does it work? Just using </p><p>android:theme=""@android:style/Theme.Light.NoTitleBar.Fullscreen""</p><p>only disables the titlebar, not the 4 android-buttons.</p><p>Thanks,</p><p>Dennis</p>","548472","","","","","2011-12-15 04:31:32","Android: How to fade out search / home / menu / back buttons?","<android><fullscreen>","2","0","","",""
"4489061","1","","","2010-12-20 11:10:16","5","2119","<p>I am facing problem in getting a sequence of animation on a particular view.I used animationset in my code and i have set the offset for each animation and the duration for the animation correctly.</p><p>somebody pls help with this.</p><p>Thanks...</p>","542975","","","","","2013-04-23 05:21:03","Android animation sequence","<android>","2","1","1","",""
"4489067","1","5142810","","2010-12-20 11:11:51","5","1939","<p>I synced my address book with facebook and can now access my facebook profile through my addressbook.I want to read the facebook data that is connected to the account from another application and get the facebook id of the synced user. </p><p>I can't find a mimetype or a datafield in the ContactContracts.Data table that contains something related to facebook. Has anybode done this successfully?</p><p>It seems that facebook somehow restricts the permissions to this data. How is this done and which permissions do I need to access the facebook contact informations that are synced in the address book?</p>","114066","","114066","","2011-01-24 08:34:23","2011-02-28 13:50:30","How to get the facebook id from a user through the ContactsContracts API?","<android><facebook><contactscontract>","3","1","3","",""
"4489069","1","4489257","","2010-12-20 11:12:06","21","62024","<p>Normal button looks like:</p><p><img src=""http://i.stack.imgur.com/6s8UX.png"" alt=""alt text""></p><p>Now, please let me know, How can i make a simple button same as an attached image button (i.e. button corner shape is round and also there is no gap between two buttons)</p><p><img src=""http://i.stack.imgur.com/YIaXy.png"" alt=""alt text""></p>","379693","","21234","","2011-07-13 06:48:44","2014-02-24 14:53:06","android - button style","<android><button>","9","0","23","",""
"4489138","1","4489181","","2010-12-20 11:22:04","1","2222","<p>I am new to android and stuck up with an issue.</p><p>I want to know how to force close the application programmatically and restart it again.I am trying this because i am really stuck up with <code>OutOfMemmoryError</code> i want to free up the memory and restart  the app again.</p><p>Please guide me if i am wrong.</p>","438676","","119895","","2010-12-20 11:28:34","2013-06-12 05:20:33","force close the application","<android><out-of-memory>","4","0","2","",""
"4489173","1","4489192","","2010-12-20 11:27:48","1","634","<p>first of all, i have to tell you that i have searched here and on google and i can't find a easy way to do it (im newbie on this), then i need your help please</p><p>i have this button, that removes a friend from the remote database:</p><pre><code>removeButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                con.deletePermission(settings.getString(""login"",""""),bundle.getString(""email""));                finish();                Toast.makeText(getApplicationContext(), getString(R.string.friendsuccessfullyremoved), Toast.LENGTH_LONG).show();            }        }); </code></pre><p>i just want to show a simple ""Are you sure? YES or NOT"" dialog with two buttons (YES AND NOT) and when the user press YES, it have to be called this code: </p><pre><code>con.deletePermission(settings.getString(""login"",""""),bundle.getString(""email""));                    finish();                    Toast.makeText(getApplicationContext(), getString(R.string.friendsuccessfullyremoved), Toast.LENGTH_LONG).show();</code></pre><p>exist's a easy way to do it?</p><p>thanks</p><p>EDIT: i try to do it with this: <a href=""http://developer.android.com/guide/topics/ui/dialogs.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/dialogs.html</a>  but it doesn't works, nothing happens when i press the button, no dialog appear</p><p>my new code:</p><pre><code>bundle = this.getIntent().getExtras();//get the intent &amp; bundle passed by X        builder = new AlertDialog.Builder(this);        removeButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                /*                con.deletePermission(settings.getString(""login"",""""),bundle.getString(""email""));                finish();                Toast.makeText(getApplicationContext(), getString(R.string.friendsuccessfullyremoved), Toast.LENGTH_LONG).show();                */                builder.setMessage(""Are you sure?"")                       .setCancelable(false)                       .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                           public void onClick(DialogInterface dialog, int id) {                                con.deletePermission(settings.getString(""login"",""""),bundle.getString(""email""));                                finish();                                Toast.makeText(getApplicationContext(), getString(R.string.friendsuccessfullyremoved), Toast.LENGTH_LONG).show();                           }                       })                       .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                           public void onClick(DialogInterface dialog, int id) {                                dialog.cancel();                           }                       });                AlertDialog alert = builder.create();            }        }); </code></pre>","479886","","479886","","2010-12-20 11:38:32","2010-12-20 11:48:12","How to show a ""are u sure YES OR NOT"" dialog when user press a button?","<android><dialog>","2","0","","",""
"4489193","1","5071910","","2010-12-20 11:31:19","1","346","<p>I have an application in in which initially for a month its free and after 30 days its paid.. n every month the user needs to subscribe for the services. How to do that?</p>","411893","","","","","2011-02-21 22:32:11","I want to give monthly subscription to my android application","<android><subscriptions>","3","0","1","2011-09-27 12:45:02",""
"4489230","1","","","2010-12-20 11:35:05","3","1100","<p>I want 2 marquees in my application. But only one is working always. If i comment the first one, then the second one will work. Otherwise the first one. Or only one marquee is getting focus at a time. If we press the down arrow, then the second one will get focus. How can both of these marquees get focus?</p><p>How can I display 2 marquees at the same  time?Following are my code :</p><pre><code> &lt;RelativeLayout        android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:id=""@+id/imgLogotb""&gt;      &lt;TextView                     android:id=""@+id/txt1""                     android:layout_width=""wrap_content""                     android:text=""START | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | END""                     android:layout_height=""20dip""                    android:singleLine=""false""                    android:ellipsize=""marquee""                       android:marqueeRepeatLimit=""marquee_forever""                    android:scrollHorizontally=""true""                     android:focusable=""true""                     android:focusableInTouchMode=""true""                    android:freezesText=""true""&gt;     &lt;/TextView&gt;     &lt;TextView                     android:id=""@+id/txt2""                     android:layout_width=""wrap_content""                     android:text=""START | lunch 1.00 | Dinner 2.00 | Travel 3.00 | Doctor 4.00 | lunch 5.00 | Dinner 6.00 | Travel 7.00 | Doctor 8.00 | END""                     android:layout_height=""20dip""                    android:singleLine=""false""                    android:ellipsize=""marquee""                       android:marqueeRepeatLimit=""marquee_forever""                    android:scrollHorizontally=""true""                     android:focusable=""true""                     android:focusableInTouchMode=""true""                     android:freezesText=""true""&gt;      &lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>Please help me by giving the solution....Thank you...</p>","523058","","523058","","2011-01-10 13:24:48","2011-08-02 05:37:47","Android : How to display more than one Marquee simultaneously (focus for two marquees)","<android><marquee>","1","4","","",""
"4489274","1","4489313","","2010-12-20 11:42:30","0","2943","<p>I want to add a button on the home screen and want to code in the click event of that button.I have an application which has an activate button,As soon as this activate button is clicked i want that a Button gets created on the home screen and i want to code some database queries in its click event.I have already created that application,Now i want to place the button on the home screen.How do i do that.</p><p>Thanks in Anticipation.</p>","548551","","21234","","2010-12-20 12:27:52","2010-12-20 12:27:52","how to Add a Button on the home screen in android?","<android><button><android-widget>","2","0","","",""
"4489280","1","4489359","","2010-12-20 11:43:10","0","790","<p>How to show ProgressDialog in separate UI thread?</p><p>I have the following code:</p><pre><code>public boolean myMethod() {  // show here ProgressDialog in thread  // long operation, MUST BE NOT in thread, as there's a return value...  return value;}</code></pre><p>Using Handler, Thread, AsyncTask didn't help...</p><p>Is there any way to run ProgressDialog in separate thread and main (long) operation in main thread?</p><p>Thanks,</p>","136834","","","","","2010-12-20 11:54:56","Android ProgressDialog thread","<java><android><multithreading><return-value><progressdialog>","1","2","","",""
"4489310","1","","","2010-12-20 11:46:31","2","7061","<p>I create the following code to create the Bar Chart and Pie Chart using Canvas.</p><p>Here is my code</p><pre><code>public class ChartDemo extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //ScrollView sv = new ScrollView(this);    LinearLayout llay = new LinearLayout(this);    llay.setOrientation(LinearLayout.VERTICAL);    float[] values = { 50, 100, 50, 20, 30, 60, 100, 90 };    // Bar Chart    BarGraph BarChart = new BarGraph(this, values);    llay.addView(BarChart);    //Pie Chart    PieChartView Pie = new PieChartView(this, values);    llay.addView(Pie);    //sv.addView(llay);    setContentView(llay);    //setContentView(sv);   } }</code></pre><p>The above code show the BarChart only.I change my code like the following it gives the Black(blank)Screen only.With out no error and exception</p><pre><code>  public class ChartDemo extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ScrollView sv = new ScrollView(this);    LinearLayout llay = new LinearLayout(this);    llay.setOrientation(LinearLayout.VERTICAL);    float[] values = { 50, 100, 50, 20, 30, 60, 100, 90 };    // Bar Chart    BarGraph BarChart = new BarGraph(this, values);    llay.addView(BarChart);    //Pie Chart    PieChartView Pie = new PieChartView(this, values);    llay.addView(Pie);    sv.addView(llay);    setContentView(sv);   } }</code></pre><p>And i create my Chart Views like the following </p><pre><code>public class PieChartView extends View {private float[] Values; public PieChartView(Context context, float[] Values) {    super(context);    this.Values = Values;}protected void onDraw(Canvas canvas) {    super.onDraw(canvas);               .......               .........        }}</code></pre><p>I need to add both chart in Single Screen with Scroll View . But i am not able to add Both in the single Activity.How to do this ?? </p>","548435","","548435","","2010-12-20 12:40:36","2012-02-19 18:36:17","How to Add Views to the Scroll View in Android?","<android>","1","2","","",""
"4489337","1","","","2010-12-20 11:50:49","1","2290","<p>I'm trying to create a custom view (or better, layout) in android, that serves as a container for 2 child views (Think of it as a bar that separates 2 containers vertically, that can be swiped up and down).</p><p>I'd like to use it like a layout in xml, so that you can nest any views in it.I thought of something like that:    </p><pre><code>            &lt;view class=""at.calista.quatscha.views.SwipebarLayout""            android:id=""@+id/sbl""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;!-- Top View --&gt;            &lt;Button android:text=""Top"" android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;            &lt;!-- Bottom View --&gt;            &lt;Button android:text=""Bottom"" android:id=""@+id/Button02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/view&gt;</code></pre><p>This xml should give me the swipeable bar between the two buttons.</p><p>However, I don't know how to accomplish this, I'm extending LinearLayout atm, but how do I tell my children how to position themselves?</p>","337591","","","","","2010-12-20 12:16:08","Android: Creating a custom container-view","<java><android><layout><view>","1","0","0","",""
"4489399","1","4489512","","2010-12-20 11:59:20","18","26043","<p>in a AsyncTask</p><p>where goes the return value of <code>protected Boolean doInBackground(Integer... params)</code></p><p>usually we start AsyncTask with <code>new AsyncTaskClassName().execute(param1,param2......);</code>which doesn't return any value</p>","548208","","272824","","2010-12-20 12:41:49","2013-05-27 07:14:19","AsyncTask: where return value of doInBackground() goes?","<android><return-value><android-asynctask>","2","0","12","",""
"4489439","1","","","2010-12-20 12:03:40","3","4880","<p>the editText is not losing focus in my app when I click out of it, it has the orange border all time and that black line cursor..I did this a LinearLayout according to this surrounding the editText:<a href=""http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup"">Stop EditText from gaining focus at Activity startup</a>so it doesn't get focus on start of the app..</p><p>this is my code: </p><pre><code>final EditText et = (EditText)findViewById(R.id.EditText01);final InputMethodManager imm = (InputMethodManager) getSystemService(   INPUT_METHOD_SERVICE);et.setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {      imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT);   }});et.setOnFocusChangeListener(new View.OnFocusChangeListener() {   public void onFocusChange(View v, boolean hasfocus) {      if(hasfocus) {         imm.showSoftInput(et, InputMethodManager.SHOW_IMPLICIT);      } else {         imm.hideSoftInputFromWindow(et.getWindowToken(), 0);      }   }});</code></pre><p>But, it doesn't seem to be calling the onFocusChange when I click anywhere outside the editText!</p>","548481","","450580","","2012-11-13 12:30:21","2014-02-18 01:28:29","editText is not losing focus","<android><edittext>","3","1","2","",""
"4489570","1","4557375","","2010-12-20 12:23:38","11","3694","<p>I'm creating an a 1x1 widget, and no matter what I try, I just can't get the background image looking nice and crisp.  I've read just about any resource I can find, yet I still can't win.</p><p>I'm designing for the HTC Desire/Nexus 1, and would love someone to tell me when creating the background in Photoshop, what dpi/height/width to use (currently using 72/100/80).  I'll worry about other devices resolutions once I can get it looking nice on my test device first.</p><p>Also, if there's anything special I need to be putting in the @layout/main.xml and Widget_Provider.xml files.  I simply can't find any examples for 1x1 gadgets, so have the following:</p><p>main.xml</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/widget""android:layout_width=""fill_parent""android:orientation=""vertical""android:background=""@drawable/background"" android:layout_gravity=""center"" android:layout_height=""wrap_content""&gt;</code></pre><p>Widget_Provider.xml</p><pre><code>&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""android:minWidth=""72dip""android:minHeight=""72dip""android:updatePeriodMillis=""6000000""android:initialLayout=""@layout/main""/&gt;</code></pre><p>Any help would be greatly appreciated.</p>","462410","","","","","2012-07-30 21:53:59","How to create crisp background image for 1x1 Android widget?","<android><graphics><android-widget><widget><photoshop>","1","0","14","",""
"4489575","1","4489889","","2010-12-20 12:24:11","1","1699","<p>I am having a strange problem that the ADT plugin installation sticks at 49% on Eclipse Classic 3.6 for infinite time, as shown below...</p><p><img src=""http://i.stack.imgur.com/eBHXJ.jpg"" alt=""alt text""></p><p>Please help me out to solve this problem...</p><p>Thanks..</p>","186176","","","","","2013-05-06 17:11:51","ADT plugin install sticks at 49% on Eclipse Classic 3.6","<android><eclipse><adt>","4","2","","",""
"4489646","1","4489697","","2010-12-20 12:34:23","4","4400","<p>Is there a way to set the background text of an EditText? for instance, I have a login screen with 2 EditText views, one for username and one for password. I want the text ""Username"" and ""Password"" be written inside the EditText, and once the user touches those the text disappears but once user deleted his own entry, text re-appears.</p><p>Is there a property for that or should I implement this on my own with events and stuff?</p>","258429","","","","","2010-12-20 12:39:39","Android EditText background text","<android><text><edittext>","2","0","1","",""
"4489693","1","4489815","","2010-12-20 12:39:10","0","3360","<p>I have one question that can we access android device camera's flash light<br>  programmically.Is this possible to turn on and off flash light programmically?  please give me my answer .  thanks in advance.</p><pre><code>    package com.thedevelopersinfo.tutorial.android.soundrecordingexample;         import java.io.File;         import android.app.Activity;       import android.content.ContentResolver;       import android.content.ContentValues;     import android.content.Intent;       import android.hardware.Camera;     import android.media.MediaRecorder;      import android.net.Uri;     import android.os.Bundle;      import android.os.Environment;     import android.provider.MediaStore;     import android.provider.MediaStore.MediaColumns;      import android.view.View;     import android.view.View.OnClickListener;        import android.widget.Button;         public class Main extends Activity {    private MediaRecorder mediaRecorder;    private File file = null;    static final String PREFIX = ""record"";    static final String EXTENSION = "".3gpp"";    private Button b1;    Camera mCamera;    public boolean isOn=true;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         mCamera = Camera.open();        Camera.Parameters params = mCamera.getParameters();        b1=(Button)findViewById(R.id.startBtn);        b1.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                 setFlashlight();            }        });    }    public void setFlashlight()    {        if (mCamera == null)        {        }        Camera.Parameters params = mCamera.getParameters();        String value;        if (isOn) // we are being ask to turn it on        {            value = Camera.Parameters.FLASH_MODE_TORCH;        }        else  // we are being asked to turn it off        {            value =  Camera.Parameters.FLASH_MODE_AUTO;        }        try{                params.setFlashMode(value);            mCamera.setParameters(params);            String nowMode = mCamera.getParameters().getFlashMode();            if (isOn)            {                 nowMode.equals(Camera.Parameters.FLASH_MODE_TORCH);            }            if (!isOn)            {                 nowMode.equals(Camera.Parameters.FLASH_MODE_AUTO);            }        }        catch (Exception ex)        {        }        }}</code></pre><p>but i got following exception03-10 18:47:34.907: ERROR/QualcommCameraHardware(1280): Parameter AntiBanding is not supported for this sensor</p>","461503","","375874","","2010-12-20 17:43:33","2012-12-14 10:48:18","Access Device hardware (Camera Flash) Programically ina android","<android>","2","1","","",""
"4489791","1","4496457","","2010-12-20 12:54:04","7","10565","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4848067/login-failed-invalid-key-error-with-facebook-sdk"">Login failed invalid key error with Facebook SDK</a>  </p></blockquote><p>I am using a sample app for here ibm.com/developerworks/library/x-androidfacebookapi/to test facebook android SDK,I have given my APP ID in this sample app.I have done all setups and prerequisites.I have signed app with my keystore and generated hash keyI submitted hash key to facebook app settings page,I installed facebook app on my device.But after all doing the app gives Facebook error invalid_key.Pls help me in this regards,Thank you.</p>","529664","","","","","2012-07-23 22:28:04","Facebook Android SDK Invalid_key","<android><facebook><sdk>","12","0","4","2012-10-11 23:25:49",""
"4489809","1","","","2010-12-20 12:57:37","12","3717","<p>So I've built a nice, shiny HTML5 application that is targeted at mobile Safari, and Android's default browser. The Android versions I'm testing it on are 2.1 and 2.2.</p><p>My app has a textarea on one of its pages, and this textarea tends to have a good amount of text in it at times. Its basically a free-form writing field. </p><p>This works as expected in iOS. However on Android, as you type, the screen scrolls wildly up and down on every keystroke, often you can't see what it is you're typing as you type, and you get dizzy from all the jumping around. Furthermore, if the content within the textarea exceeds its height, it appears to be impossible to scroll within it.</p><p>Don't even get me started on landscape mode. The above issues are even more pronounced there. </p><p>This feels like a bug with Android as there really isn't anything fancy about my textarea. I've stripped it down to the bare essentials, and it behaves the same.</p><p>Wondering if anyone else has had this much fun with their textareas on Android, and could maybe give some advice, or at least empathize?</p><p>It seems that Google has managed to mostly solve this in the Gmail web interface for Android. I'm guessing there's some JS magic going on because my markup/CSS is identical. </p>","843373","","","","","2013-09-21 14:24:05","Android Browser textarea scrolls all over the place, is unusable","<android><html5><css3><mobile-website>","4","0","4","",""
"4489843","1","","","2010-12-20 13:01:58","2","6549","<p>I just didn't want to use ScrollView. So I have a textview with enabled vertical scrollbars.</p><pre><code>&lt;TextView    android:id=""@+id/tv_service_ticketinfo_details""    android:layout_width=""fill_parent""    android:layout_height=""150dp""               android:textColor=""@color/black""    android:autoLink=""web""    android:scrollbars=""vertical""    android:text=""empty""    android:background=""@drawable/custom_shape_grey""&gt;&lt;/TextView&gt;</code></pre><p>The problem is, that scrollbars are scrollable only for texts, which contain a web-links. For other texts I see a scrollbar, but can't scroll.</p><p>I can't explain it. And you?</p><p><strong>UPD:</strong></p><p>Another strange thing:once I set the text with links, then I can replace it by another one without links and the textView stays scrollable</p>","408780","","408780","","2010-12-20 13:18:22","2013-11-15 08:16:03","Scrollbars in TextView","<android><scrollbar>","3","0","1","",""
"4489911","1","","","2010-12-20 13:09:29","0","119","<p>Hello and thanks in advance for the help</p><p>I have a series of Android apps that I am using.  Whenever I recommend these apps to someone, I have to go over each one individually.</p><p>I wanted to know if it was possible to create a single application that will:</p><ol><li>Download all of the individual apps all at once and install them</li><li>Create an app icon that when launched creates a submenu with all of the related apps and a help file to walk the user through each one.</li></ol><p>Is this possible?  If so, how difficult is it to do?</p><p>Thanks again for your help</p><p>Dave</p>","548645","","180538","","2010-12-20 13:18:29","2010-12-20 14:04:28","Creating an App that Contains a Group of Applications","<android>","2","0","","",""
"4489942","1","4490169","","2010-12-20 13:11:49","2","2256","<p>I have an encrypted string in visual basic. NET 2008, the functions to encrypt and decrypt are the following:</p><pre><code>Imports System.Security.Cryptography Public Shared Function Encriptar(ByVal strValor As String) As String    Dim strEncrKey As String = ""key12345""     Dim byKey() As Byte = {}    Dim IV() As Byte = {&amp;H12, &amp;H34, &amp;H56, &amp;H78, &amp;H90, &amp;HAB, &amp;HCD, &amp;HEF}    Try        byKey = System.Text.Encoding.UTF8.GetBytes(strEncrKey)        Dim des As New DESCryptoServiceProvider        Dim inputByteArray() As Byte = Encoding.UTF8.GetBytes(strValor)        Dim ms As New MemoryStream        Dim cs As New CryptoStream(ms, des.CreateEncryptor(byKey, IV), CryptoStreamMode.Write)        cs.Write(inputByteArray, 0, inputByteArray.Length)        cs.FlushFinalBlock()        Return Convert.ToBase64String(ms.ToArray())    Catch ex As Exception        Return """"    End TryEnd FunctionPublic Shared Function Desencriptar(ByVal strValor As String) As String    Dim sDecrKey As String = ""key12345""     Dim byKey() As Byte = {}    Dim IV() As Byte = {&amp;H12, &amp;H34, &amp;H56, &amp;H78, &amp;H90, &amp;HAB, &amp;HCD, &amp;HEF}    Dim inputByteArray(strValor.Length) As Byte    Try        byKey = System.Text.Encoding.UTF8.GetBytes(sDecrKey)        Dim des As New DESCryptoServiceProvider        If Trim(strValor).Length = 0 Then            Throw New Exception(""Password No debe estar en Blanco"")        End If        inputByteArray = Convert.FromBase64String(strValor)        Dim ms As New MemoryStream        Dim cs As New CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write)        cs.Write(inputByteArray, 0, inputByteArray.Length)        cs.FlushFinalBlock()        Dim encoding As System.Text.Encoding = System.Text.Encoding.UTF8        Return encoding.GetString(ms.ToArray(), 0, ms.ToArray.Count)    Catch ex As Exception        Return """"    End TryEnd Function</code></pre><p>for example the word ""android"" encrypted with this function gives me the result ""B3xogi/Qfsc=""</p><p>now I need to decrypt the string ""B3xogi/Qfsc="" it from java, by the same key, which is ""key12345"", and the result should be ""android""...anyone know how to do this?</p><p>Thanks in advance.</p>","518657","","","","","2011-08-25 09:13:27","Equivalent to CryptoStream .NET in Java?","<java><.net><android><visual-studio-2008><encryption>","4","1","1","",""
"4490073","1","4490125","","2010-12-20 13:27:34","8","4728","<p>I was wondering if I could place XML within <code>/res/values/strings.xml</code>? I ask this because I am checking for the XML data file for my application, if it does not exist yet then it creates it from the default contents that will be contained as a string resource.</p><p>Eclipse tries to change the less than and greater than tags to their corresponding HTML entities when using the GUI to edit the strings. Is eclipse on the right track? Because I should think that it will be written out into my file as HTML entities too. Could I use <code>getText()</code> rather than <code>getString()</code> to convert the entities back into tags?</p><p>Thanks for any advice you can give.</p>","455137","","","","","2013-04-16 06:19:41","XML within an Android string resource?","<android><xml><string><resources>","3","0","1","",""
"4490081","1","4490413","","2010-12-20 13:28:56","1","243","<p>On advice on someone here on Stackoverflow I changed my method of parsing to the SAXParser. </p><p>Thanks to different tutorials I'm able to get it to work, and I have to say that it does work faster (which is very important for my app).</p><p>The problem, however, is that my XML file goes deeper than the tutorial's example XML's I've seen.</p><p>This a sample of my XML file:</p><pre><code>&lt;Message&gt;    &lt;Service&gt;servicename&lt;/Service&gt;  &lt;Insurances&gt;    &lt;BreakdownInsurance&gt;      &lt;Name&gt;Insurance name&lt;/Name&gt;      &lt;InsuranceNR/&gt;      &lt;LicenseNr/&gt;    &lt;/BreakdownInsurance&gt;    &lt;CarDamageInsurance&gt;      &lt;Name&gt;Insurance name 2&lt;/Name&gt;      &lt;InsuranceNR&gt;&lt;/InsuranceNR&gt;    &lt;/CarDamageInsurance&gt;  &lt;/Insurances&gt;  &lt;Personal&gt;    &lt;Name&gt;my name&lt;/Name&gt;  &lt;/Personal&gt;&lt;/Message&gt;</code></pre><p>I can get the personal details like name, but my code doesn't seem to work with the insurances. I think this is because it's one node more.</p><p>This is the code I'm using in my Handler class:</p><pre><code>@Overridepublic void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {    currentElement = true;    if (localName.equals(""Message"")) {        geg = new GegevensXML();    }}@Overridepublic void endElement(String namespaceURI, String localName, String qName) throws SAXException {    currentElement = false;    /********** Autopech **********/    if (localName.equals(""Name"")) {        geg.setAutopechMaatschappij(currentValue);    }    else if (localName.equals(""InsuranceNR"")){        geg.setAutopechPolis(currentValue);    }    else if (localName.equals(""LicenseNr"")){        geg.setAutopechKenteken(currentValue);    }@Overridepublic void characters(char ch[], int start, int length) {    if (currentElement) {        currentValue = new String(ch, start, length);        currentElement = false;    }</code></pre><p>So how must I adjust it?</p>","517460","","","","","2010-12-20 14:13:48","How to adjust my code to this situation for SAX XML parsing in Android","<java><android><xml><sax>","3","0","","",""
"4490111","1","4490293","","2010-12-20 13:33:44","1","671","<p>I have narrowing conversion error in C++ arm from Android NDK.</p><p>Have a following code:</p><pre><code>int16_t ax = li.A.x, ay = li.A.y;int16_t bx = li.B.x, by = li.B.y;Rect16 rcA = { ax - 8, ay - 8, ax + 8, ay + 8 };Rect16 rcB = { bx - 8, by - 8, bx + 8, by + 8 };</code></pre><p>And get this error, when try to compile:</p><pre><code>error: narrowing conversion of '(((int)ay) + -0x00000000000000008)' from 'int' to 'int16_t' inside { }</code></pre><p>Rect16 struct:</p><pre><code>typedef struct tagRect16 {    int16_t left, top, right, bottom;} Rect16;</code></pre>","385502","","385502","","2010-12-20 13:54:14","2010-12-20 13:58:03","Have narrowing conversion error in C++ arm from Android NDK","<c++><android><arm><android-ndk>","1","2","","",""
"4490136","1","4490463","","2010-12-20 13:37:47","6","1397","<p>I want to port an aplication written in C++ to android. Converting the application from C++ to Java will take a lot of work that I would prefer to use on making the application better for that platform instead of fixing convertion bugs and solving refactoring problems.</p><p>The NDK seems a good route to take but actually I don't want to miss a platform(if it is a considerable % of the market) just because the NDK doesn't or won't support it.</p><p>Android claims to support MIPS, ARM, X86 and others ... but actually all the implementations I have seen are only on ARM (or arm compatible).I checked that on this site:<a href=""http://www.pdadb.net/"">http://www.pdadb.net/</a></p><p>Would it be a bad desision to use the NDK?<br>Are there any non ARM devices that run or will run Android?<br>Where can I find more information about this?  </p><p>Thanks in advance!</p>","548569","","","","","2012-03-24 01:58:15","Does Android really exist on other platforms than ARM?","<android><android-ndk><multiplatform>","4","3","","",""
"4490179","1","","","2010-12-20 13:43:26","0","3152","<p>I have already created the default Android system images ( like userdata.img, system.img, ramdisk.img) by following the instructions at <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">http://source.android.com/source/download.html</a></p><p>What I would like to create is customized Android system images from AOSP(by removing the apps &amp; their code-dependencies, which are unnecessary for my target board, like the e-mail, browser) &amp; run it on my target board so as to reduce the foot-print of the resulting system images &amp; also speed-up the boot-up time of the target board.</p><p>Any pointers to do above mentioned customizations  are welcome.</p><p>Thanks,</p><p>Orng.dev</p>","548665","","1108213","","2012-02-13 22:38:37","2013-03-06 09:23:13","How to create customized Android System Images from the AOSP?","<android><android-source>","2","1","","",""
"4490403","1","4490510","","2010-12-20 14:12:02","1","1876","<p>In my application it would be nice to intercept when the user rejects a call, i.e. choose to send busy tone. Is there any way, besides being notified when there is an incoming call, to do this? I have not found anything in the docs regarding this. Is this information stored in the call log, i.e. can I poll the call log to see if a call was rejected or answered?</p><p>Any information or pointers to documentation is greatly appreciated. </p>","548723","","881229","","2014-03-18 19:18:52","2014-03-18 19:18:52","Is it possbile to detect rejected calls in Android?","<android>","2","1","3","",""
"4490467","1","","","2010-12-20 14:20:46","2","1273","<p>I have created the class which implements the Binder interface(Service). I am able to send the data to it from client.</p><p>If I want to send the asynchronous response back to client, do I need to implement Binder interface at client as well?</p>","28641","","","","","2011-05-08 00:47:44","Android binder in native code","<c++><android><native-code><binder>","1","0","","",""
"4490505","1","6283792","","2010-12-20 14:24:59","1","18471","<p>I am calling a web service from my android client application. After getting response when i am trying to display it i am getting ClassCastException. Following is my code:</p><pre><code>public void onClick(View v) {  setContentView(R.layout.report);  SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);  EpcDetails epcdetails=new EpcDetails();  epcdetails.setEpcId(input_val.getText().toString());        request.addProperty(""id"", id        SoapSerializationEnvelope sse=new SoapSerializationEnvelope(SoapEnvelope.VER11);        sse.setOutputSoapObject(request);        sse.addMapping(NAMESPACE,         ProductDetailsRequest.ProductDetailsRequest.getSimpleName(),        ProductDetailsRequest.ProductDetailsRequest);        sse.implicitTypes=true;        sse.setAddAdornments(false);        AndroidHttpTransport aht=new AndroidHttpTransport(URL);        try         {         aht.call(SOAP_ACTION, sse);         SoapObject response= (SoapObject) sse.getResponse();         item_code.setText((CharSequence)(response.getProperty(6)));         desc.setText((CharSequence) (response.getProperty(5)));         price.setText(calc_price.toString());        } catch (IOException e)         {         e.printStackTrace();        } catch (XmlPullParserException e)        {          e.printStackTrace();       }</code></pre><p>I am getting Exception at <strong>item_code.setText((CharSequence)(response.getProperty(6)));</strong>as </p><pre><code>12-20 19:26:12.864: ERROR/AndroidRuntime(811): FATAL EXCEPTION: main12-20 19:26:12.864: ERROR/AndroidRuntime(811): java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at com.trueVUE.modules.report.MainSimulation.onClick(MainSimulation.java:123)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at android.view.View.performClick(View.java:2408)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at android.view.View$PerformClick.run(View.java:8816)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at android.os.Handler.handleCallback(Handler.java:587)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at android.os.Handler.dispatchMessage(Handler.java:92)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at android.os.Looper.loop(Looper.java:123)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at java.lang.reflect.Method.invokeNative(Native Method)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at java.lang.reflect.Method.invoke(Method.java:521)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-20 19:26:12.864: ERROR/AndroidRuntime(811):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Please suggest some soln ASAP.</p><p>Regards,Rahul</p>","315140","","","","","2012-08-16 09:47:25","java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive?","<android><ksoap2>","3","0","1","",""
"4490562","1","4490681","","2010-12-20 14:32:38","0","489","<p>In My app I want to do some operations on every 3mins, 5mins, 10 mins. In android is there any APIto do it in single Timer/thread. What is the best way to that ? </p>","405747","","","","","2010-12-20 14:48:15","Multiple timerTask","<android>","1","1","","",""
"4490707","1","","","2010-12-20 14:51:36","7","25420","<p>i'm currently doing an AndAR project in group of 3. I'm the person who's in charge of video streaming into the Android phone. I got ourselves a D-Link DCS-920 IP camera and I found out that it uses MJPEG codec for the live video stream and the webserver uses Jview to view the live stream. As far as i know MJPG is not a supported file type for Android OS so i've came out with an idea, instead of using ImageView, i use WebView to stream the video. I've implemented a very simple concept and it works! But the problem is, refresh rate is terrible.I get the video image (eg: <code>http://192.168.1.10/image.jpg</code>) to view on the WebView and implement a Timer to control the refresh rate (supposed to set it to 30fps, which is refresh every 33ms) but it can only go up to 500ms interval, any lower interval i notice it will not be any smoother,sometimes the image wont load and connection is unstable (eg: dropped). Could this be I'm refreshing at a rate faster than it can receive? But over on the webserver Jview it has no problem! was trying to find the source code for the jview but i have no hope.Anyway here's the code i've written</p><pre><code>package org.example.test;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.webkit.WebView;import android.widget.Button;import android.widget.EditText;public class Webview extends Activity {public WebView webView;public Timer autoUpdate;public String url;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);            webView = (WebView) findViewById(R.id.webview);        webView.getSettings();        final EditText urlText = (EditText) findViewById(R.id.urlText);        //Buttons//////////////////------------        final Button connectB = (Button)findViewById(R.id.connectButton);        connectB.setOnClickListener(new View.OnClickListener() {         public void onClick(View v) {            //Actions goes here          url = urlText.getText().toString();          webView.loadUrl(url);          timerSetup();         }        });        final Button exitB = (Button)findViewById(R.id.exitButton);     exitB.setOnClickListener(new View.OnClickListener() {      public void onClick(View v) {       //Actions goes here       finish();      }     });   }    //refresh timer//////////////-----------------    public void timerSetup(){     autoUpdate = new Timer();     autoUpdate.schedule(new TimerTask() {      @Override      public void run() {       runOnUiThread(new Runnable() {        @Override     public void run() {         //Actions goes here         webView.loadUrl(url);        }       });      }     }, 0, 500);//refresh rate time interval (ms)    }}</code></pre><p>Is there anyway i can get the video stream in by at least 15fps/have a faster refresh rate?Are there any such thing as MJPEG viewer/source code that i can use to display these images?</p><p>here's the screenshot of the app<a href=""http://s945.photobucket.com/albums/ad295/kevinybh/?action=view&amp;current=video.jpg"">http://s945.photobucket.com/albums/ad295/kevinybh/?action=view&amp;current=video.jpg</a>(not enough points to post pictures) :(</p><p>I just need to make the video stream around 15-30fps. any suggestions/help would be very deeply appreciated :) thanks!</p>","548772","","","","","2014-04-12 15:56:20","Getting IP Cam video stream on Android (MJEPG)","<android><video><stream><camera><ip>","5","2","8","",""
"4490726","1","4490796","","2010-12-20 14:53:27","3","5413","<p>I want to test against Android 1.3 platform instead of latest 2.2.</p><p>Here is how my Android SDK and AVD Manager look likes.<img src=""http://i.stack.imgur.com/NvHU9.png"" alt=""alt text""></p><p>However, I was expecting (screen from <a href=""http://developer.android.com/sdk/installing.html#components"" rel=""nofollow"">http://developer.android.com/sdk/installing.html#components</a>), so that I can select old platform.<img src=""http://i.stack.imgur.com/nUxoe.png"" alt=""alt text""></p><p>Is there anything I had missed out?</p>","72437","","","","","2010-12-20 15:39:22","How to install old SDK platform","<android>","2","0","1","",""
"4490821","1","4492050","","2010-12-20 15:02:27","16","17828","<p>I Know people from Google have asked us not to put Scrollable view inside another Scrollable view but is there any official statement from them directing us not to do so?</p>","522448","","","","","2014-03-11 01:09:14","ScrollView Inside ScrollView","<android><scrollview>","7","4","9","",""
"4491027","1","4492430","","2010-12-20 15:23:56","0","117","<p>hai every one. i am new to android. in my project i had some problems reading xml files. In my xml i have included some audios and videos paths and i want to read the xml file  through the code  and i want to display some images n my view if there are some audio or video files. can any body tel how to read the xml file. thanking you in advance</p>","493244","","","","","2010-12-22 14:22:47","checking resources in xml and displaying icons for the resources in android","<android>","1","0","","",""
"4491090","1","","","2010-12-20 15:31:06","1","353","<p>I have 2 applications w/ the bluetooth code derived from the Bluetooth Chat sample.  Individually they work fine.  Each app connects via SPP to separate devices.  The issue I'm having is on phones with Android 2.1, after the first app connects to its device, you can press Home and get to running the other app, but as soon as the connection is made to the other device with this other app, both apps get the ""Sorry!  The application xyz (process com.xyz) has stopped unexpectedly.  FORCE CLOSE"" dialogs.  There are try/catch blocks throughout the bt code, for which the catches are not executed.  Neither app will then connect (individually) until after bluetooth is turned off then on again.  This does NOT happen when these same apps are running on a Samsung tab with Android 2.2 - both apps can run and connect to the devices simultaneously just fine and you can switch between the apps, no problems.</p><p>Is this specifically an Android 2.1 issue or something else?  Whether it is or not, I need some way to prevent the app from connecting if another app is using bluetooth.  I couldn't find anything in the Android APIs that would allow finding this out.  Is there any way to coordinate/manage this?  Does anyone have any specific insights into this whole issue?</p>","433162","","244296","","2010-12-20 15:32:54","2012-07-05 21:42:10","Multiple apps connect to bluetooth issue","<android><bluetooth>","1","3","","",""
"4491247","1","4499409","","2010-12-20 15:49:29","1","3052","<p>I have managed to make a hello world <a href=""http://www.jbox2d.org/"" rel=""nofollow"">JBox2D</a> application, and it works (I have some bouncing balls). However, I just read a <a href=""http://www.anddev.org/post19748.html#p19748"" rel=""nofollow"">comment on a forum post</a>, which claims that JBox2D produces a lot of garbage, and so causes animation to be poor. Is this true?</p><p>If yes, then what other 2D engines are available to me? I would very much like to use a physics engine for my 2D game, even if it's just a very simple one.</p><h2>Update:</h2><p>Just tried running the JBox2D bouncing balls demo on my phone, and the performance was terrible. Looks like <a href=""http://code.google.com/p/libgdx/"" rel=""nofollow"">libgdx</a> is the way to go for physics, since I think it comes with a  native version of Box2D that works well on Android. As for <a href=""http://www.andengine.org/"" rel=""nofollow"">AndEngine</a>, this is a game engine and not a physics engine, but I may use it in conjunction with libgdx to give myself a head start.</p><h2>Update 2:</h2><p>I've had a quick play with libgdx and AndEngine. I've found that they're both Android game engines, but AndEngine has a less steep learing curve at the cost of being more limiting. So if you want to build a serious game, you probably want to use libgdx as it will allow you to do more (but is harder to use).</p>","47775","","47775","","2010-12-26 14:27:24","2013-07-31 20:21:35","What is the most performant 2D graphics engine for use with Android?","<android><box2d><jbox2d>","4","2","2","",""
"4491311","1","4501315","","2010-12-20 15:56:47","0","628","<p>In my app I have 3 radiobuttons on top of the view. When i choose one the 'body' underneath that changes to the XML-view i defined.</p><p>(If you want more information + pics, I asked a question about this earlier: <a href=""http://stackoverflow.com/questions/4427278/dynamically-change-view-inside-view-in-android"">Dynamically change view inside view in Android</a>)</p><p>Now i want to call and change the text of the buttons and edittext's from the different views.</p><p>When I do <code>btnAutopech = (Button) findViewById(R.id.btnAutopech);</code> it's gives an NullPointerException.</p><p>How can I do this?</p>","517460","","","","","2010-12-21 16:12:45","Calling Button from different view in Android","<java><android><view><activity>","2","0","","",""
"4491323","1","4492956","","2010-12-20 15:58:10","1","714","<p>In Google Maps for the web, it is possible to manually adjust an automatically created route by dragging a point on the path to any other road in view.  The Android app does not have this feature built-in.  Is it possible to manually adjust routes in an application that uses the com.google.android.maps API?</p>","292412","","","","","2010-12-20 19:11:02","Manual Route Adjustment Using Google Maps API","<android><google-maps>","1","0","","",""
"4491340","1","4491418","","2010-12-20 15:59:56","3","1637","<p>It's easy to detect when phone calls come in (via phoneStateListener), but what about other notification sounds, such as email or sms?  </p><p>On some devices, these notification sounds mute but don't pause any currently running mediaPlayer instances, which is annoying for the user.  Ideally, I'd like to listen for notifications that play sound, pause playback for the duration, and then resume playback afterwards.</p>","402605","","","","","2012-04-18 08:28:13","Pause/resume mediaPlayer on notification sound","<android>","1","0","5","",""
"4491341","1","","","2010-12-20 15:59:57","0","530","<p>My app displays a series of pictures.  For memory reasons, I want to serialize these pictures when they are not in use.  The serialization seems to work (doesn't throw exceptions or crash), but the application crashes on my Picture.createFromStream() call.  I can't find anything informative in the LogCat output, nor does the failed call throw a Throwable.  Any advice?</p><pre><code>12-20 10:48:37.121: WARN/InputManagerService(53): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@438abe8812-20 10:48:37.132: DEBUG/dalvikvm(53): threadid=17: bogus mon 1+0&gt;0; adjusting12-20 10:48:50.901: DEBUG/dalvikvm(238): GC freed 15257 objects / 1725344 bytes in 99ms12-20 10:50:26.912: DEBUG/dalvikvm(238): GC freed 29 objects / 1200 bytes in 56ms12-20 10:51:03.661: INFO/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***12-20 10:51:03.661: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'12-20 10:51:03.661: INFO/DEBUG(28): pid: 238, tid: 238  &gt;&gt;&gt; com. &lt;&lt;&lt;12-20 10:51:03.661: INFO/DEBUG(28): signal 11 (SIGSEGV), fault addr 0000000412-20 10:51:03.661: INFO/DEBUG(28):  r0 00000004  r1 00000000  r2 00000004  r3 00299b9812-20 10:51:03.661: INFO/DEBUG(28):  r4 00000000  r5 00000000  r6 00000001  r7 00299b0012-20 10:51:03.661: INFO/DEBUG(28):  r8 00299ac0  r9 00000000  10 66616374  fp 00299b6012-20 10:51:03.661: INFO/DEBUG(28):  ip ac1285f4  sp bef065f0  lr ac06fc10  pc afb04408  cpsr 6000001012-20 10:51:03.771: INFO/DEBUG(28):          #00  pc 00004408  /system/lib/libcutils.so12-20 10:51:03.771: INFO/DEBUG(28):          #01  lr ac06fc10  /system/lib/libsgl.so12-20 10:51:03.771: INFO/DEBUG(28): stack:12-20 10:51:03.781: INFO/DEBUG(28):     bef065b0  00299b00  [heap]12-20 10:51:03.781: INFO/DEBUG(28):     bef065b4  ac07b4f8  /system/lib/libsgl.so12-20 10:51:03.781: INFO/DEBUG(28):     bef065b8  00000000  12-20 10:51:03.781: INFO/DEBUG(28):     bef065bc  00616374  12-20 10:51:03.781: INFO/DEBUG(28):     bef065c0  00299b78  [heap]12-20 10:51:03.781: INFO/DEBUG(28):     bef065c4  ac038f48  /system/lib/libsgl.so12-20 10:51:03.781: INFO/DEBUG(28):     bef065c8  00299ac0  [heap]12-20 10:51:03.781: INFO/DEBUG(28):     bef065cc  00000001  12-20 10:51:03.781: INFO/DEBUG(28):     bef065d0  00299b60  [heap]12-20 10:51:03.781: INFO/DEBUG(28):     bef065d4  00299b78  [heap]12-20 10:51:03.791: INFO/DEBUG(28):     bef065d8  00000000  12-20 10:51:03.791: INFO/DEBUG(28):     bef065dc  00000001  12-20 10:51:03.791: INFO/DEBUG(28):     bef065e0  00299b00  [heap]12-20 10:51:03.791: INFO/DEBUG(28):     bef065e4  00299b78  [heap]12-20 10:51:03.791: INFO/DEBUG(28):     bef065e8  df002777  12-20 10:51:03.791: INFO/DEBUG(28):     bef065ec  e3a070ad  12-20 10:51:03.791: INFO/DEBUG(28): #00 bef065f0  00000000  12-20 10:51:03.791: INFO/DEBUG(28):     bef065f4  ac06fc10  /system/lib/libsgl.so12-20 10:51:03.791: INFO/DEBUG(28):     bef065f8  bef06647  [stack]12-20 10:51:03.791: INFO/DEBUG(28):     bef065fc  00000001  12-20 10:51:03.801: INFO/DEBUG(28):     bef06600  00000070  12-20 10:51:03.801: INFO/DEBUG(28):     bef06604  afe0ea00  /system/lib/libc.so12-20 10:51:03.801: INFO/DEBUG(28):     bef06608  00299b00  [heap]12-20 10:51:03.801: INFO/DEBUG(28):     bef0660c  afe0ed94  /system/lib/libc.so12-20 10:51:03.801: INFO/DEBUG(28):     bef06610  00299b00  [heap]12-20 10:51:03.801: INFO/DEBUG(28):     bef06614  000001b4  12-20 10:51:03.801: INFO/DEBUG(28):     bef06618  000000dc  12-20 10:51:03.801: INFO/DEBUG(28):     bef0661c  00002bcc  12-20 10:51:03.801: INFO/DEBUG(28):     bef06620  bef06670  [stack]12-20 10:51:03.811: INFO/DEBUG(28):     bef06624  afe0b70f  /system/lib/libc.so12-20 10:51:03.811: INFO/DEBUG(28):     bef06628  afe39dd4  /system/lib/libc.so12-20 10:51:03.811: INFO/DEBUG(28):     bef0662c  00299b00  [heap]12-20 10:51:03.811: INFO/DEBUG(28):     bef06630  00299ae0  [heap]12-20 10:51:03.811: INFO/DEBUG(28):     bef06634  00299ac0  [heap]12-20 10:51:04.661: DEBUG/Zygote(30): Process 238 terminated by signal (11)12-20 10:51:04.671: INFO/ActivityManager(53): Process com. (pid 238) has died.12-20 10:51:04.691: INFO/WindowManager(53): WIN DEATH: Window{43899ae8 12-20 10:51:04.701: INFO/WindowManager(53): WINDOW DIED during motion dispatch: 12-20 10:51:04.761: WARN/UsageStats(53): Unexpected resume of com.android.launcher while already resumed in 12-20 10:51:04.791: WARN/WindowManager(53): Requested window android.os.BinderProxy@437913d8 does not exist12-20 10:51:04.791: WARN/WindowManager(53): java.lang.RuntimeException12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:7767)12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:7759)12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService.removeWindow(WindowManagerService.java:1359)12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService.dispatchPointer(WindowManagerService.java:4078)12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService.access$1200(WindowManagerService.java:127)12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService$InputDispatcherThread.process(WindowManagerService.java:5356)12-20 10:51:04.791: WARN/WindowManager(53):     at com.android.server.WindowManagerService$InputDispatcherThread.run(WindowManagerService.java:5264)12-20 10:51:04.832: WARN/InputManagerService(53): Got RemoteException sending setActive(false) notification to pid 238 uid 10023</code></pre>","426493","","426493","","2010-12-20 17:16:53","2011-02-12 19:23:14","Android: application crashes on Picture.createFromStream()","<android><image>","1","0","","",""
"4491370","1","4491406","","2010-12-20 16:02:46","1","3996","<pre><code>Log.d(getClass().getName(), ""BLA BLA BLA"");</code></pre><p>to log.</p><p>How can i show an int value? What is the equivalent of C's <code>%d</code> and so on?</p><p>Thanks</p>","396133","","","","","2010-12-20 18:22:35","Logging with syntax on Android","<android><logging>","4","0","1","",""
"4491380","1","","","2010-12-20 16:03:52","0","927","<p>I have already lost 2 days in this problem, please provide any help you can.I have an Android application which displays 2 Android Activity icons: ""Comp 1"" and ""Comp 2"".Both ""Comp 1"" and ""Comp 2"" shows TabActivities with tabs within.Problem:Right after deploying my application, I can enter into any of ""Comp 1"" or ""Comp 2"" TabActivity, but when I leave the activity and when I try to enter the other TabActivity, the tabs shown are the same from the previous one ""Comp 1"" or ""Comp 2"" it always depends on which I start first.Objective:For any of the ""Comp N"", open correctly the tabs assigned on the TabActivities(see code on this post).</p><p>Please, allow me to show my code. I will show AndroidManifest.xml, TabActivity for ""Comp 1"" and TabActivity for ""Comp 2"". They're a bit extensive, so I apologize in advance for any extra and unnecessary info they may contain. I just didn't want to take risk to forget to provide any important information on the first post.</p><p>AndroidManifest.xml (""Comp 1""=MMComponentTabAssembler, ""Comp 2""=TabAssembler)</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  android:versionCode=""1""  android:versionName=""1.0""   android:installLocation=""internalOnly""  package=""be.multitel.android.mmnd""&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="".activity.TabAssembler""              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="".activity.NetworkDispatcher1""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".activity.Device""              android:label=""@string/app_test_device_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".activity.SMS""              android:label=""@string/sms_app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".activity.NetworkDispatcherActivity""              android:label=""@string/test_network_dispatcher_app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;!-- Begin :: Code for standard MMComponentTabAssembler tab view.        Use this code to include new components activities that extend from MMSuperComponent.    --&gt;    &lt;activity android:name="".activity.MMComponentTabAssembler""              android:label=""Comp 1""              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="".activity.GPS""              android:label=""GPS""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".activity.GPSPreferences""              android:label=""GPSPrefs""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name="".activity.StandardSetupActivity""              android:label=""Setup""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.TAB"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;!-- End :: Code for standard MMComponentTabAssembler tab view. --&gt;    &lt;service android:exported=""true"" android:name="".service.NetworkDispatcherService"" android:process="":remote""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""NetworkDispatcherService""&gt;            &lt;/action&gt;        &lt;/intent-filter&gt;    &lt;/service&gt;    &lt;service android:exported=""true"" android:name="".service.NetHubService"" android:process="":remote""/&gt;    &lt;receiver android:name="".service.utils.NetworkListener""&gt;         &lt;intent-filter&gt;             &lt;action android:name=                ""android.net.conn.CONNECTIVITY_CHANGE"" /&gt;            &lt;action android:name=                ""android.provider.Telephony.SMS_RECEIVED"" /&gt;            &lt;action android:name=                ""be.multitel.android.mmnd.service.utils.SocketListener.ACK_RECEIVED"" /&gt;        &lt;/intent-filter&gt;     &lt;/receiver&gt;    &lt;receiver android:name="".service.utils.MMNetworkDispatcherReceiver"" &gt;         &lt;intent-filter&gt;             &lt;action android:name=                ""android.net.conn.CONNECTIVITY_CHANGE"" /&gt;            &lt;action android:name=                ""CONNECTIVITY_CHANGE"" /&gt;                &lt;action android:name=                ""android.provider.Telephony.SMS_RECEIVED"" /&gt;            &lt;action android:name=                ""be.multitel.android.mmnd.service.utils.SocketListener.ACK_RECEIVED"" /&gt;        &lt;/intent-filter&gt;     &lt;/receiver&gt;    &lt;receiver android:name="".service.utils.MMReceiver"" &gt;         &lt;intent-filter&gt;        &lt;action android:name=""ACTION_MM_CONNECT"" /&gt;        &lt;action android:name=""ACTION_MM_DISCONNECT"" /&gt;        &lt;action android:name=""ACTION_EVENT_CMD_DISPATCHER_ACCESREQ"" /&gt;        &lt;action android:name=""ACTION_EVENT_CMD_DISPATCHER_ACCESRELEASE"" /&gt;        &lt;action android:name=""ACTION_EVENT_CMD_DISPATCHER_ACCESINFOREQ"" /&gt;        &lt;action android:name=""ACTION_EVENT_CMD_DISPATCHER_BWINFOREQ"" /&gt;        &lt;action android:name=""ACTION_EVENT_CMD_DISPATCHER_LATENCYINFOREQ"" /&gt;        &lt;category android:name=""COMPONENT_CATEGORY_GPS""/&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.SEND_SMS"" /&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;</code></pre><p></p><p>""Comp 1"" TabActivity = MMComponentTabAssembler   </p><pre><code>public class MMComponentTabAssembler extends TabActivity {public static final String TAG = MMComponentTabAssembler.class.getName();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.standard_tabbed_pane);    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    //Multimodal component tab     intent = new Intent().setClass(this, GPS.class);    intent.addCategory(Const.COMPONENT_CATEGORY_GPS); //Used to produce Intents to the MMComponent    intent.addCategory(Const.ACTIVITY_CATEGORY_GPS); //Used to consume Intents on the BroadcastReceiver associated to the Activity    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""gps"").setIndicator(""GPS"",                      res.getDrawable(R.drawable.ic_tab_gps))                  .setContent(intent);    tabHost.addTab(spec);    //preferences tab    intent = new Intent().setClass(this, GPSPreferences.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""gpsPrefs"").setIndicator(""GPSPrefs"",                      res.getDrawable(R.drawable.ic_tab_gpsprefs))                  .setContent(intent);    tabHost.addTab(spec);    //standard setup tab    intent = new Intent().setClass(this, StandardSetupActivity.class);    intent.addCategory(Const.COMPONENT_CATEGORY_GPS); //Used to produce Intents to the MMComponent    intent.addCategory(Const.ACTIVITY_CATEGORY_GPS); //Used to consume Intents on the BroadcastReceiver associated to the Activity    spec = tabHost.newTabSpec(""standard_setup_tab"").setIndicator(""Setup"",                    res.getDrawable(R.drawable.ic_tab_standard_setup))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(0);}@Overrideprotected void onResume() {    super.onResume();    Log.d(TAG,""Activity group lifecicle :: onResume()."");}@Overrideprotected void onPause() {    super.onPause();    Log.d(TAG,""Activity group lifecicle :: onPause()."");}@Overrideprotected void onStop() {    super.onStop();    Log.d(TAG,""Activity group lifecicle :: onStop()."");}@Overrideprotected void onDestroy() {    super.onDestroy();    Log.d(TAG,""Activity group lifecicle :: onDestroy()."");}   </code></pre><p>}</p><p>""Comp 2"" TabActivity = TabAssembler</p><pre><code>public class TabAssembler extends TabActivity  {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main_tab);    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, NetworkDispatcher1.class);    // Initialize a TabSpec for each tab and add it to the TabHost    spec = tabHost.newTabSpec(""netword_dispatcher"").setIndicator(""NDispatcher"",                      res.getDrawable(R.drawable.ic_tab_mmnd))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, Device.class);    spec = tabHost.newTabSpec(""test_device"").setIndicator(""Test Device"",                    res.getDrawable(R.drawable.ic_tab_test_device))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, SMS.class);    spec = tabHost.newTabSpec(""test_sms"").setIndicator(""SMS"",                    res.getDrawable(R.drawable.ic_tab_sms))                  .setContent(intent);    tabHost.addTab(spec);    intent = new Intent().setClass(this, NetworkDispatcherActivity.class);    spec = tabHost.newTabSpec(""test_network_dispatcher"").setIndicator(""Test ND"",                    res.getDrawable(R.drawable.ic_tab_test_network_dispatcher))                  .setContent(intent);    tabHost.addTab(spec);    tabHost.setCurrentTab(3);}</code></pre><p>}</p>","548831","","","","","2011-03-14 04:42:14","Android: Multiple TabActivities problem","<android><android-layout><android-manifest><android-tabhost>","1","0","1","",""
"4491403","1","4502160","","2010-12-20 16:07:00","4","565","<p>I have an Android app that I would like to display high quality images with. However there are many different screen sizes and ratios. I know there are filters to show apps in Market only for devices with small/medium/large screens.</p><p>If I put images of both sizes in 1 app it will double the size of the app, right?</p><p>Is it a good practice to make multiple versions for different screen sizes?</p><p>I would like to make 1 app in 3 versions for such devices:</p><ul><li>medium screen mdpi </li><li>medium screen hdpi + large screen mdpi</li><li>large (tablets)</li></ul><p>If it's possible to do it how can I specify them in manifests? Or is it somewhere in market?</p>","475861","","","","","2011-12-21 10:36:21","Publishing multiple versions of one app on Google Market","<android><filter><screen><google-play>","4","0","1","",""
"4491494","1","4495899","","2010-12-20 16:15:45","0","604","<p>How do I get the ""max"" attribute during onCreateView()?If I can get attrs.getAttributeCount() to work that would solve my problem.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;PreferenceScreen        xmlns:android=""http://schemas.android.com/apk/res/android""        android:title=""@string/livewallpaper_settings""        android:key=""livewallpaper_settings""    &gt;        &lt;com.example.myapp.SeekBarPreference1            android:persistent=""true""            android:key=""keyItems""            android:title=""Items""            android:defaultValue=""50""            android:max=""200"" /&gt;        &lt;com.example.myapp.SeekBarPreference1            android:persistent=""true""            android:key=""keyItemsTwo""            android:title=""Items Two""            android:defaultValue=""5""            android:max=""10"" /&gt;    &lt;/PreferenceScreen&gt;  </code></pre><p>Here is the simplified class. XmlPullParser does not return anything to parse.</p><pre><code>    public final class SeekBarPreference1 extends Preference implements OnSeekBarChangeListener {        private static int _maxValue = 0;        private int _currentValue = 0;        private TextView _value;        private SharedPreferences _preferences;        public SeekBarPreference1(Context context, AttributeSet attrs) {            super(context, attrs);            _preferences = PreferenceManager.getDefaultSharedPreferences(context);            //            // These values are correct            //            Log.d(""PREFS"", "" "");            Log.d(""PREFS"", ""SeekBarPreference1"");            Log.d(""PREFS"", ""Key: "" + getKey());            Log.d(""PREFS"", ""AttrCount: "" + attrs.getAttributeCount());            Log.d(""PREFS"", ""####"");        }        @Override        protected View onCreateView(ViewGroup parent) {            XmlPullParser attrs = parent.getResources().getXml(R.xml.livewallpaper_settings);            Log.d(""PREFS"", "" "");            Log.d(""PREFS"", ""onCreateView"");            Log.d(""PREFS"", ""Key: "" + getKey()); // Correct key is output            Log.d(""PREFS"", ""AttrCount: "" + attrs.getAttributeCount()); // -1            Log.d(""PREFS"", ""####"");          }}</code></pre><p>Log output</p><pre><code>SeekBarPreference1Key: keyItemsAttrCount: 7####SeekBarPreference1Key: keyItemsTwoAttrCount: 7####onCreateViewKey: keyItemsAttrCount: -1####onCreateViewKey: keyItemsTwoAttrCount: -1####</code></pre><p>It seems to me that if I can get the correct key, title, summery, etc. (from onCreateView) there should be a simple way to get other attributes.?</p><p>If I try and store the attributes from SeekBarPreference1(), they are lost as soon as onCreateView() is called.</p><p>Summery: get the attributes from the current ""this"" onCreateView();</p>","548799","","","","","2010-12-21 02:52:15","Android - Preference onCreateView attrs.getAttributeCount()","<android>","1","0","","",""
"4491609","1","","","2010-12-20 16:27:08","2","4664","<p>I want to start learning Android developement. I have a windows 7 Home Premium Operating System. My problem is I am not able to setup the environment of developing android. Here is what I have done till now.</p><ol><li>I have installed Java (both 32 bit and 64 bit versions)</li><li>I have installed Android SDK (installer_r08-windows.exe)</li><li>I have not yet downloaded any tools or platforms or ADT.</li><li>I have downloaded 32 bit eclipse. (eclipse-SDK-3.5.1-win32.zip)</li><li>I am stuck at this eclipse setup. A strange thing I observed is that, it does not install. When I click on eclipse.exe, it starts running from there only. I am still not sure if my eclipse installation is proper?</li><li>So, I assumed that my eclipse is working fine. Then when I try installing new programs in eclipse, eg google plugin, it gives error.</li></ol><p>I want to know, where am I going wrong? What mistakes am I doing? Can anyone guide me with the complete step by step procedure to setup my android development environment on windows 7? </p><p>Thanks in advance.</p><ul><li>Jay</li></ul>","548890","","1180954","","2012-08-31 18:45:23","2012-08-31 18:47:37","Setting up Android Development Environment on Windows 7","<android><eclipse><windows-7><adt><android-sdk-2.3>","3","2","","",""
"4491720","1","","","2010-12-20 16:37:13","13","6549","<p>I am curious to know what made google choose to develop android's framework on java VM.</p><p>In the process of writing code for android for nearly 6 months now, I observed that running code on a VM in a resource limited platform is really slow. There is a lot of overhead involved. I know that java is portable etc etc, is it not possible at all to use native languages and get both performance and features offered by a VM ? For performance oriented applications one still ends up writing native code and wrap it with JNI,</p><p>So why did google choose this particular stack : </p><ol><li>Arm based core (understandable, ARM is the best for mobile devices)</li><li>Linux (Open source)</li><li>Java VM (My question)</li></ol><p>EDIT : I know java - JVM run's on par with C++ applications on my server, but not on android.With respect to android its not the case - As a matter of my experience, a C++ code wrapped with JNI runs far faster than java code (note I have even checked with exact same code from a static block in java) I will agree with your answer on any other platform.</p>","383677","","383677","","2010-12-20 17:06:55","2012-09-04 19:40:36","why android is built on a VM (Dalvik)","<android><design><dalvik>","4","7","5","2010-12-20 17:13:29",""
"4491764","1","5102875","","2010-12-20 16:42:01","0","1481","<p>I've installed the following development environment on my 10.6.5:</p><ul><li>Eclipse SDK 3.6.1 </li><li>Android SDK Tools r8</li><li>Android SDK Platform-tools r1</li><li>Android SDK 2.2</li><li>Android SDT 8.0.1</li></ul><p>Then when I create the <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">Hello World</a> I get the error:Conversion to Dalvik format failed with error 1</p><p>I have tried everything, since this error has appeared in the past for many reasons, but I still have the same problem.</p><p>Thanks in advance</p>","548714","","","","","2011-02-24 09:45:04","Hello World “Conversion to Dalvik format failed”","<android><format><dalvik>","2","3","0","",""
"4491796","1","4491913","","2010-12-20 16:44:57","0","160","<p>I have a project with many classes and activities. I would like to test some of those classes by creating another project and using them. Is this possible? I tried creating an Android test project in Eclipse, linking to the project I want to test, creating an activity and there using some of those classes. Unfortunately, I get NoClassDefFoundError. Could you please address me to the right direction on how to create this kind of test?Thanks!</p>","427544","","21234","","2010-12-20 16:47:32","2010-12-20 16:57:53","Creating a test project to test classes in another project in Android","<android><testing><android-sdk-2.2>","1","0","","",""
"4491880","1","","","2010-12-20 16:54:47","0","470","<p>I am working on a widget that is fetching and displaying some data.The refresh rate is custom.</p><p>What I would like to do, is only fetch data when the widget is displayed (when the launcher is on top).</p><p>Is there a way to check if the launcher is displayed?</p>","316877","","","","","2010-12-20 17:28:06","How can I check if the Launcher/Home screen is currently displayed","<android><android-widget>","1","1","","",""
"4491938","1","","","2010-12-20 17:01:17","0","244","<p>I'm using this method to fill a list of available main activities on a device. This works however is very very slow. I could cache this but, caching it would mean having an out of sync list.</p><pre><code>     final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);     mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);     final List&lt;ResolveInfo&gt; pkgAppsList = pm.queryIntentActivities(mainIntent, 0);     for (ResolveInfo ri : pkgAppsList) {      outNames.add(ri.loadLabel(pm));       outValues.add((new ComponentName(ri.activityInfo.packageName, ri.activityInfo.name)).flattenToString());     }</code></pre><p>Any idea to make it better (other that storing it somewhere for later use)?</p>","376579","","244296","","2010-12-20 17:02:56","2010-12-20 17:02:56","Better way to find all application installed (ACTION_MAIN)","<android><list><activity><performance><package>","0","2","","",""
"4492003","1","4492049","","2010-12-20 17:08:37","1","1804","<p>In using this code (adapted from <a href=""http://stackoverflow.com/questions/3984958/how-to-get-multiple-spinner-in-android-where-value-of-one-spinner-depends-on-valu/4491960#4491960"">here</a>) I get the following error:</p><blockquote>  <p>The constructor ArrayAdapter(new  AdapterView.OnItemSelectedListener(){},  int, String[]) is undefined</p></blockquote><p>Can anyone help correct this? Thanks</p><pre><code>private void setDynamicSpinnerBE() {    beSpinner = (Spinner) findViewById(R.id.spBE);    final String[] itemsSpinner2;    lensSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {        public void onItemSelected(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            Integer focalLength = (Integer) parent.getAdapter().getItem(                    position);            itemsSpinner2 = getBellowsExtension(focalLength, maxBellows,                    precision);            ArrayAdapter&lt;CharSequence&gt; beAdapter = new ArrayAdapter&lt;CharSequence&gt;(                    this, android.R.layout.simple_spinner_item,                    itemsSpinner2);            beAdapter                    .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);            beSpinner.setAdapter(beAdapter);        }        public void onNothingSelected(AdapterView&lt;?&gt; parent) {            beSpinner.setAdapter(null);        }    }    );    ...}</code></pre>","547931","","390177","","2012-02-04 21:23:30","2012-02-04 21:23:30","Dynamic update of Spinner2 based on choice in Spinner 1","<java><android><spinner><dynamic>","2","0","","",""
"4492162","1","4502017","","2010-12-20 17:29:08","1","7144","<p>I have a custom dialog class that extends Dialog. Inside this I have a Tab Layout with 2 tabs. In each tab I have a list view. Everything works but I can't get scroll bars to show up.</p><p>Here is my XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHostxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/TabHost01""android:layout_width=""300dp""android:layout_height=""300dp""&gt;    &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&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=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;ListView        android:id=""@+id/ListView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:scrollbars=""vertical""        android:scrollbarAlwaysDrawVerticalTrack=""true""/&gt;    &lt;ListView        android:id=""@+id/ListView02""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:scrollbars=""vertical""        android:scrollbarAlwaysDrawVerticalTrack=""true""/&gt;    &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>and here is part of my code that sets this up:</p><pre><code>    // get this window's layout parameters so we can change the positionWindowManager.LayoutParams params = getWindow().getAttributes();     // change the position. 0,0 is center    params.x = 0;    params.y = 250;    this.getWindow().setAttributes(params);     // no title on this dialogrequestWindowFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.myLayout);// instantiate our list views for each tabListView listView01 = (ListView)findViewById(R.id.ListView01);ListView listView02 = (ListView)findViewById(R.id.ListView02);// instantiate and set our custom list view adapterslistViewAdapter01 = new ListViewAdapter01(context);listView01.setAdapter(listViewAdapter01);listViewAdapter02 = new ListViewAdapter02(context);listView02.setAdapter(listViewAdapter02);// get our tabHost from the xmlTabHost tabs = (TabHost)findViewById(R.id.TabHost01);tabs.setup();// create tab 1TabHost.TabSpec tab1 = tabs.newTabSpec(""tab1"");tab1.setContent(R.id.listView01);tab1.setIndicator(""List 1"");tabs.addTab(tab1);// create tab 2TabHost.TabSpec tab2 = tabs.newTabSpec(""tab2"");tab2.setContent(R.id.listView02);tab2.setIndicator(""List 01"");tabs.addTab(tab2);</code></pre>","548949","","","","","2010-12-21 17:17:01","Android listview inside tab layout inside dialog can't get scroll bars to show up","<android><listview><dialog><tabview>","2","2","2","",""
"4492232","1","4492554","","2010-12-20 17:37:00","1","971","<p>I am trying to implementing pagination in Android.Currently I am displaying in ListView  , a list of 10 items where the data for the list items exist in the database.</p><p>Each list item contains an thumbnail Image Url , a text data</p><p>I have the following requirement.i> When the user scrolls  to the 10 th list item , I am calling a webservice method of the server to fetch the next set of records.</p><p>My question is how can I determine when the user scrolls to the 10 th list item , what kind of validation can I make.</p><p>Kindly provide me the sample source code.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-12-20 18:16:39","Kindly provide the source code to determine the last item in the ListView","<android>","1","2","1","",""
"4492261","1","6392840","","2010-12-20 17:40:32","5","1175","<p>I've read in different places that this is possible.  I do not need to debug, just compile.  Any walkthrus out there?  Thx.</p><p>Found links:<a href=""http://stackoverflow.com/questions/4056606/android-ndk-with-visual-studio"">Android NDK with Visual Studio</a> - ""we've got it partially working, we use Visual Studio to build, using the proper android headers and whatnot, then we call the NDK build scripts. we're currently working on automating the second half as a post-build step""</p><p><a href=""http://groups.google.com/group/android-ndk/browse_thread/thread/9f3a55366ba08f2a/cb539c80e5729032"" rel=""nofollow"">http://groups.google.com/group/android-ndk/browse_thread/thread/9f3a55366ba08f2a/cb539c80e5729032</a> - ""You have to dig out proper parameters for all the tools, but I assure you that this all works for me on command-line (well actually in various bat files called from MS Visual Studio).""</p>","339843","","3043","","2011-12-21 13:36:25","2012-06-22 14:39:22","What do I need to do to compile Android NDK (C++) aps in Visual Studio 2010?","<android><visual-studio>","2","3","3","",""
"4492304","1","4492325","","2010-12-20 17:44:55","0","862","<p>What is the best way to persist a users info in an android app?  I have a login screen that uses a web service to authenticate the user and return basic user info.</p><p>I don't care about saving the username/password, but I do need things like a couple of integer ID fields (patientID and personID) and a first and last name.</p><p>I don't want the user to have to login every time they load the app.  Someone suggested I use SQL lite to store the info, is this the best way or is there a more light weight solution?</p>","496189","","","","","2010-12-20 18:30:43","Persist login/Authentication info on Android?","<android><sqlite>","2","0","","",""
"4492319","1","","","2010-12-20 17:46:29","0","347","<p>I have a simple Android app - a dictionary. I am using a ListView to populate the dictionary words on the main glossary screen. If a word is touched a new intent launches a wordscreen that shows the word and the definition. The problem is that if I hit ""back"" to go from the wordscreen back to the glossary the ListView does not populate. </p><p>I am using onStop() to close the database cursor when moving from the glossary screen, and onRestart() to open the cursor and (I thought) to populate the ListView. It doesn't seem to be working. </p><p>One important thing, if after going back to the glossary screen from the word screen (and getting a black screen with no ListView) I change the orientation of the app the ListView populates. </p><p>I thought that pressing ""back"" would always cause onRestart() to execute. Why would pressing back NOT cause the ListView to populate, but changing the orientation does?</p><p>Thanks</p>","548956","","","","","2010-12-20 18:05:16","Android ListView doesn't (re) populate on ""back""","<android>","1","0","","",""
"4492386","1","","","2010-12-20 17:55:22","0","209","<p>I'm playing around with writing a web service that runs on Android that handles uploading photos.  I am only writing the server, and do not have any control over the client. </p><p>Inside of the message is a small SOAP message, and then the binary data.  I am trying to figure out if there's a library that can do the parsing of the two pieces.  Apache Commons FileUpload looked like the obvious choice, however, it seems to be heavily intertwined with servlet libraries, and I don't know if it's possible (or if it's a good idea) to put too much J2EE infrastructure on a phone. </p><p>Parsing it myself doesn't seem too bad.  I'm not too familiar with the raw HTTP layers/protocol, but it looks like the the boundary delimiter string is given in the content type header.  If I find and index past those, I should be able to find the two halves of the multi-part message that I need to deal with.  At least that's what I seem to think after looking at a wireshark trace of the client talking to the real server. </p><p>Any thoughts would be appreciated. </p><p>-Kevin </p>","271177","","","","","2010-12-20 19:35:48","Looking for ideas for Multipart Form Handling on Web Service","<java><android>","2","0","","",""
"4492439","1","","","2010-12-20 18:03:11","0","287","<p>Is there a way I can take an <a href=""http://developer.android.com/reference/org/apache/http/client/methods/HttpGet.html"" rel=""nofollow"">HttpGet</a> object and see the <em>exact</em> text that will be sent over the wire?</p><p>I'm using <a href=""http://developer.android.com/reference/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.html"" rel=""nofollow"">ThreadSafeClientConnManager</a> when I create my HttpClient.</p><p>HttpGet doesn't override <code>toString()</code> and the default headers aren't there when I call <code>HttpGet.getAllHeaders()</code>.</p>","680","","680","","2010-12-21 22:21:47","2010-12-21 22:21:47","getString of HttpRequest Being Sent on Android","<android><http>","1","1","1","",""
"4492550","1","4492899","","2010-12-20 18:16:27","0","539","<p>Is it possible to get authorized on twitter and change twitter status without asking users to enter PIN ? Or can i store access token to use it when user starts application next time ?</p>","476324","","","","","2010-12-20 19:03:00","Is it possible to get authorized on twitter and change twitter status without asking users to enter PIN?","<android><twitter><twitter4j><twitter-oauth>","1","1","","",""
"4492639","1","4494616","","2010-12-20 18:27:37","0","738","<p>What is the intent to handle the ""set alarm"" Voice Action?(For ""listen to"" it is android.media.action.MEDIA_PLAY_FROM_SEARCH)</p>","450404","","450404","","2010-12-20 19:54:59","2010-12-20 22:28:01","Android Voice Actions: set-alarm intent","<android><android-intent>","1","0","","",""
"4492944","1","4493009","","2010-12-20 19:09:53","0","1377","<p>Any quick way to extract base url from full url? for e.g., if i have <a href=""http://test.example.com/abcd/test.html"" rel=""nofollow"">http://test.example.com/abcd/test.html</a> - i want only <a href=""http://test.example.com"" rel=""nofollow"">http://test.example.com</a>. </p><p>I can always do string parsing - but wanted to know if there is something in Uri where I can get it directly.  </p>","207552","","","","","2010-12-20 21:39:48","Extract base url from full url","<android>","2","1","2","",""
"4492976","1","6291324","","2010-12-20 19:13:20","0","531","<p>How to start your activity on pressing a global hotkey on android?It is possible, see Button Shortcut app.</p>","450404","","450404","","2011-06-09 10:25:25","2011-06-09 10:26:50","android global hotkey","<android>","2","0","1","",""
"4493019","1","","","2010-12-20 19:18:11","0","329","<p>I need something special. </p><p><a href=""http://prefuse.org/gallery/treemap/"" rel=""nofollow"">http://prefuse.org/gallery/treemap/</a></p><p>i need this, for android, is there a way to do it? how?</p>","472537","","","","","2010-12-20 19:28:00","Android jTreeMap visual","<android><treemap>","1","0","","",""
"4493208","1","4493355","","2010-12-20 19:40:01","2","1841","<p>I am trying to use a Huawei Ascend (m860) (this particular model from Cricket Mobile) as a low-end Android test device. I've already turned USB Debugging on from the device. I plug it into my Mac, run ""./adb devices"" from terminal and there are no devices listed.</p><p>Has anyone successfully connected this device to a Mac for Android development?</p><p>My setup:</p><p>Mac OSX 10.6.5<br>Eclipse 3.5.2 with the Android ADT plugin 0.9.9<br>Android Debug Bridge version 1.0.26  </p><p>Thanks!</p>","549091","","","","","2010-12-20 19:57:11","huawei ascend (m860) not recognized by adb on mac","<android><eclipse><osx><adb>","1","0","","",""
"4493222","1","4493351","","2010-12-20 19:41:18","0","58","<p>Code:</p><pre><code>final ProgressDialog pd = ProgressDialog.show(Main.this,"""",""Loading. Please wait..."", true);pd.show();Thread t = new Thread()           {               public void run()               {                   result = GetData(""link"", nameValuePairs);                   pd.dismiss();                   if(result.contains(""Logged IN""))                   {                        user=etuser.getText().toString();                   }                   else                   {                       fail();                   }               }           };t.start();</code></pre><p>Fail Function:</p><pre><code>public void  fail (){    final TextView tverror = new TextView(this);    tverror.setText(""FAIL"");    linear_l.addView(tverror);}</code></pre><p>Error: It isn't possible to add a view  during the run in the thread.</p><p>Is there any workaround?</p>","547995","","1012641","","2013-05-21 06:19:42","2013-05-21 06:19:42","Notifiy the user in a Thread","<android>","1","0","","",""
"4493233","1","","","2010-12-20 19:41:50","0","964","<p>Is it possible on Android to intercept an outgoing text message and show a ""prompt"" to the user before it goes out?</p><p>For example, can I look at a message, do a spell check, then prompt the user to change the spelling of something before the message is actually sent?</p><p>Or, for another example, if I were to create a game around text messaging, and the format of the text needed to be changed a little before going to the receiver (like adding a comma).</p><p>Is this even possible?  If so, where do I start to learn how to do this?</p>","179518","","","","","2010-12-20 19:55:03","How to intercept an outgoing Text Message on Android and notify user","<android><sms>","1","0","","",""
"4493286","1","4493329","","2010-12-20 19:47:32","0","848","<p>Suppose I have 2 classes that extends Activity; ActivityA and ActivityB, and they are declared properly in the manifest XML.</p><p>Now, what I want to do is call ActivityB from ActivityA and access ActivityB's fields.</p><pre><code>Intent myIntent = new Intent(MyApplication.getInstance().getApplicationContext(), ActivityB.getClass());startActivityForResult(myIntent,0);</code></pre><p>This code does not return an object of ActivityB, I have tried instantiation manually such that:</p><pre><code>ActivityB actB=new ActivityB();</code></pre><p>That's ok, but how to pass that to an intent? </p><p>Is that possible?</p>","192936","","","","","2010-12-20 20:14:54","How to access Android activity class instance fields?","<android>","1","2","","",""
"4493311","1","","","2010-12-20 19:52:16","1","3231","<p>I am trying to find out how to implement a click handler for items in a ListView in Android.</p><p>I have a layout file that looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;ScrollView    xmlns:android=""http://schemas.android.com/apk/res/android""      android:id=""@+id/ScrollView03lr""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:scrollbars=""vertical""&gt;      &lt;LinearLayout           android:id=""@+id/Linear03lr""         android:layout_width=""fill_parent""           android:orientation=""vertical""           android:gravity=""center""         android:layout_height=""fill_parent""&gt;   &lt;!--Put form controls here--&gt;          &lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content"" android:layout_height=""400dp"" /&gt;         &lt;Button            android:id=""@+id/previousbutton""            android:gravity=""center_horizontal""            android:layout_width = ""fill_parent""            android:layout_height = ""fill_parent""            android:text=""Previous Menu""/&gt;    &lt;/LinearLayout&gt;  &lt;/ScrollView&gt; </code></pre><p>..and an activity/class that has the following code in the OnCreate() method:</p><pre><code> ListView lv1;    lv1=(ListView)findViewById(R.id.ListView01);    lv1.setTextFilterEnabled(true);         lv1.setOnItemClickListener(new OnItemClickListener() {        // @Override         public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {             Toast.makeText(ListRecords.this,""Clicked!"", Toast.LENGTH_LONG).show();         }         });</code></pre><p>When I run this code, when I click an item in the ListView, nothing happens.Can someone help me with this?</p>","490698","","244296","","2010-12-20 20:29:59","2010-12-20 21:16:01","Click handler for Android ListView","<android><listview>","1","0","","",""
"4493563","1","","","2010-12-20 20:22:28","0","2455","<p>i have scoured the net for this solution but am thus far unsuccessful. Hopefully someone can help me. I am a newb and don't know java programming. From tutorials over the web, i have created a ""webview"" app that loads local html files. This works fine. What i'm trying to do is add the options menu by clicking the ""menu"" button on the phone so i can quit(exit) the app. There are many tutorials out there for this but when i try to add the code my java file, my existing code in the file start coming up with errors &amp; then everything goes haywire. I am hoping someone can add the appropriate code to my existing code below or correct my code if it is wrong with the menu options included to quit the app. Thank you in advance.</p><p>Su</p><hr><p>`package com.xrefguide;</p><p>import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;import android.webkit.WebViewClient;</p><p>public class XRefGuide 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>    WebView web = (WebView) findViewById(R.id.webView);    web.getSettings().setJavaScriptEnabled(true);    web.loadUrl(""file:///android_asset/index.html"");    web.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);    web.getSettings().setPluginsEnabled(true);    web.getSettings().setSupportMultipleWindows(false);    web.getSettings().setSupportZoom(true);    web.setVerticalScrollBarEnabled(false);    web.setHorizontalScrollBarEnabled(false);    web.getSettings().setBuiltInZoomControls(true);    web.getSettings().setLoadWithOverviewMode(true);    web.getSettings().setUseWideViewPort(true);    //Our application's main page will be loaded    //web.loadUrl(""http://mapa.org.my"");    web.setWebViewClient(new WebViewClient() {        @Override public boolean shouldOverrideUrlLoading(WebView view, String url) {            return false;        }    });}</code></pre><h2>}`</h2>","549129","","","","","2010-12-20 21:25:43","Adding menu options to webview code","<android><webview>","1","0","","",""
"4493704","1","4493737","","2010-12-20 20:37:16","6","1868","<p>I want to display progressbar(spinner) to the right of editText when activity is doing some processing and hide upon completion, is there a simple way to do this?</p>","470682","","50049","","2012-06-04 08:00:56","2012-06-04 08:00:56","android progressbar inside edittext","<android><progress-bar><edittext>","1","0","1","",""
"4493723","1","4494339","","2010-12-20 20:39:23","0","1022","<p>How can i get the class below to create tabs that link to activities. its worrking the way it is but the tabs are not linked to any activity. I need the tabs to load different activities?</p><pre><code>import android.app.TabActivity;import android.content.Context;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.widget.TabHost;import android.widget.TabHost.TabSpec;import android.widget.TextView;import android.widget.TabHost.TabContentFactory;public class CustomTabActivity extends TabActivity {    TabHost mTabHost = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mTabHost = (TabHost) findViewById(android.R.id.tabhost);        // mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);        setupTab(new TextView(this), ""Tab 1"");        setupTab(new TextView(this), ""Tab 2"");        setupTab(new TextView(this), ""Tab 3"");    }    private void setupTab(final View view, final String tag) {        View tabview = createTabView(mTabHost.getContext(), tag);        TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview)                .setContent(new TabContentFactory() {                    public View createTabContent(String tag) {                        return view;                    }                });        mTabHost.addTab(setContent);    }    private static View createTabView(final Context context, final String text) {        View view = LayoutInflater.from(context)                .inflate(R.layout.tabs_bg, null);        TextView tv = (TextView) view.findViewById(R.id.tabsText);        tv.setText(text);        return view;    }}</code></pre>","545790","","244296","","2010-12-20 20:43:31","2010-12-20 21:56:07","Android Custom Tab linked to Activity","<android><tabs><activity>","1","2","","",""
"4493947","1","5052401","","2010-12-20 21:05:17","17","8448","<p>I've written a custom widget for a control that we use widely throughout our application.  The widget class derives from <code>ImageButton</code> and extends it in a couple of simple ways. I've defined a style which I can apply to the widget as it's used, but I'd prefer to set this up through a theme.  In <code>R.styleable</code> I see widget style attributes like <code>imageButtonStyle</code> and <code>textViewStyle</code>.  Is there any way to create something like that for the custom widget I wrote?</p>","512309","","967945","","2013-07-09 20:13:05","2013-07-09 20:13:05","How to: Define theme (style) item for custom widget","<android><android-theme>","1","0","27","",""
"4493996","1","","","2010-12-20 21:12:49","1","2621","<p>In November 2010 Facebook introduced Single-Sign-On for Android-Applications. Supposedly you can just login into your Facebook-App, and dont need to login again in your other applications, if you connect with Facebook-Login. However I experienced, that one of the Applications, either the Facebook-App, or my App fails with the login. </p><p>If the Facebook-App is installed, and I'm logged in, I cant log into my onw App, but instead get an error </p><pre><code>""invalid_key""</code></pre><p>If on the other hand, I first install my app, I'm logged into my App with Facebook-Login, and afterwards I install the Facebook App and try to logon their, the Facebook App fails and I cant login. Others seem to have the same issue: <a href=""https://github.com/facebook/facebook-android-sdk/issues/closed#issue/140"" rel=""nofollow"">https://github.com/facebook/facebook-android-sdk/issues/closed#issue/140</a></p><p>Is there anybody out there you ran into the same issue and solved it?</p>","351723","","","","","2011-11-03 14:36:07","Android, Facebook SDK and Single Sign On: Either my App fails with ""invalid_key"" or Facebook App fails","<android><single-sign-on><facebook>","4","0","1","",""
"4493997","1","4494093","","2010-12-20 21:13:03","0","543","<p>Basically I need to toast a message written in Chinese to user.However I don't know how to achieve such thing.Any solution that can help me?</p>","483253","","","","","2010-12-20 21:34:47","android toast a Chinese message to user","<android>","2","3","","",""
"4494059","1","4494145","","2010-12-20 21:19:34","0","3378","<p>I have been trying to use a .gif file from my resources, but I get no movement when it loads.  I am using it as a loading image while I am doing an asynchronous task.  I was previously using a progress dialog but now I would like to display the image myself and not use a dialog.    How can I get this image to display correctly?</p>","408079","","","","","2010-12-20 22:19:29","How display a loading image correctly on Android phone","<android><loading><gif><animated-gif><loading-image>","2","0","","",""
"4494067","1","","","2010-12-20 21:20:42","0","78","<p>Is there a way to only upload mp3 tones to the Android Market or do they have to be delivered via an APK? </p>","549185","","","","","2010-12-20 22:05:37","SMS and/or notification tones","<android><sms><notifications><google-play>","1","0","","",""
"4494241","1","4494413","","2010-12-20 21:42:04","1","528","<p>I am building an Android app in which user are required to choose a nick name. Now, two users cannot have same nick name. I have seen forms on .net where we can verify the availability of a particular username while user types or presses tab using Ajax calls. </p><p>My questions is - is anything like that available for Android. Can I query my server on the fly and verify the availability of a nick name.</p><p>Thanks a lot for your responses. If there are any tutorials, samples or Android doc references I need to look at please guide me to that.</p>","444514","","881229","","2014-03-18 20:05:50","2014-03-18 20:05:50","Android - Ajax style auto check of username availability","<android><ajax>","1","0","","",""
"4494483","1","4494586","","2010-12-20 22:12:15","3","1739","<p>I want to check if the user enabled background data on his/her device and display a message if it is disabled.</p><p>How can I check if it has been enabled?I tried </p><pre><code>import android.provider.Settings;//...Settings.System.getString(getContentResolver(), Settings.Secure.BACKGROUND_DATA);//andSettings.Secure.getString(getContentResolver(), Settings.Secure.BACKGROUND_DATA);</code></pre><p>But they are returning null.</p><p>Thank you,Achie.</p>","229266","","","","","2010-12-21 14:25:29","How to check if background data is enabled on the android?","<android>","1","0","2","",""
"4494660","1","4494731","","2010-12-20 22:33:36","1","560","<p>I am building the application that will load list of news from the website. Each news/headline has an image. I want to save/cash the images so user does not has to download them again.</p><p>Q: In your opinion, what would be a better/more sufficient way: Loading images and saving them on the device or use the CacheManager? At the moment I am using the first solution and everything works fine. However, the website has many categories and even more news per category therefore there are lot of images saved on the device. Is it normal in this type of applications to save the images on the device?</p><p>Thanks for your help,marqs</p>","400493","","","","","2010-12-20 22:45:13","android loading and saving images on the device","<android><image><webview>","2","0","","",""
"4494663","1","4494698","","2010-12-20 22:34:22","0","873","<p>i got this error when i start my app:</p><p>12-20 22:27:01.447: ERROR/Database(716): Failure 1 (near "":00"": syntax error) on 0x1a4338 when preparing 'CREATE TABLE permission ( fk_email1 varchar(100) NOT NULL, fk_email2 varchar(100) NOT NULL, validated tinyint(4) default 0, hour1 time default 08:00:00, hour2 time default 20:00:00, date1 date default NULL, date2 date default NULL, weekend tinyint(4) default 0, fk_type varchar(45) default NULL, PRIMARY KEY  (fk_email1,fk_email2))'.</p><p>here is the code where i am creating the database:</p><pre><code>private static final String PERMISSION_TABLE_CREATE = ""CREATE TABLE permission ("" ""fk_email1 varchar(100) NOT NULL, fk_email2 varchar(100) NOT NULL, """"validated tinyint(4) default 0, hour1 time default 08:00:00, """"hour2 time default 20:00:00, date1 date default NULL, """"date2 date default NULL, weekend tinyint(4) default 0, """"fk_type varchar(45) default NULL, PRIMARY KEY  (fk_email1,fk_email2))"";private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( """"email varchar(100) NOT NULL, password varchar(45) default NULL, """"fullName varchar(80) default NULL, """"mobilePhone varchar(14) default NULL, """"mobileOperatingSystem varchar(20) default NULL, PRIMARY KEY  (email))"";</code></pre><p>what i am doing bad?</p>","479886","","33006","","2010-12-20 22:40:19","2012-05-15 20:53:44","Problems with SQLite database, error when creating","<android><sqlite>","3","0","","",""
"4494720","1","4701171","","2010-12-20 22:43:43","8","20580","<p>I am not sure what I am doing wrong but onPostExecute never gets called.</p><ul><li>Created a base class called BaseActivity.java</li><li>From my original Activity I extended this class.</li><li>Placed PostToOpenFeint class inside BaseActivity</li><li><p>Called it from the UI thread from the main activity my doing: </p><pre><code>new PostToOpenFeint.execute();</code></pre></li></ul><p>The onPreExecute(), doInBackground(..) gets triggered, but for some reason the onPostExecute never gets called.</p><p>Thank you in Advance!</p><p>Dave</p><pre><code> private class PostToOpenFeint extends AsyncTask&lt;Void, Void, Void&gt; {  /*   * (non-Javadoc)   *    * @see android.os.AsyncTask#doInBackground(Params[])   */  @Override  protected Void doInBackground(Void... params) {   // does all the work here   return null;  }  /*   * (non-Javadoc)   *    * @see android.os.AsyncTask#onPostExecute(java.lang.Object)   */  @Override  protected void onPostExecute(Void result) {   // TODO Auto-generated method stub   super.onPostExecute(result);   Toast.makeText(MainScreen.this, ""Done syncing"", Toast.LENGTH_LONG).show();  }  /*   * (non-Javadoc)   *    * @see android.os.AsyncTask#onPreExecute()   */  @Override  protected void onPreExecute() {   // TODO Auto-generated method stub   super.onPreExecute();   Toast.makeText(MainScreen.this, ""About to sync all your scores"", Toast.LENGTH_LONG).show();  }</code></pre><hr><p>Looking into it more, this is what I was able to observe. For example if I place this call:                           </p><pre><code> new PostToOpenFeint.execute();</code></pre><p>right after onCreate of the Activity, then everything works fine. If I place this call say inside a button listener.</p><pre><code>settingsButton.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {   new PostToOpenFeint.execute();}});</code></pre><p>The onPostExecute() never gets called, not sure what I am doing wrong. The restriction I read was to call this from UI Thread and I am calling it from UI thread.</p>","395458","","395458","","2010-12-21 23:00:27","2013-04-01 19:47:02","AsyncTask onPostExecute never gets called","<android><android-asynctask>","6","5","2","",""
"4494791","1","4499033","","2010-12-20 22:53:23","1","1443","<p>For my Android application, I want to have a view which allows a user to click a plus button to add EditText fields, and next to the EditText fields, I want to have minus buttons that will remove them from the view. In essence, something that is very similar to adding multiple phone numbers/email addresses in the edit Contact interface on Android.</p><p>I imagine I will need to do this by inflating my main view with a separate one that contains the EditText and button I want to add each time. However, I have no idea how I will manage identifying each EditText and button with a unique ID, and thus, I have no idea how I would manage to grab the values of each EditText for saving to my database. Can someone advise me on what I need to do? Thank you.</p>","453354","","","","","2010-12-21 12:03:22","Android - how to inflate a view with multiple EditText fields and read their values?","<java><android><edittext><inflate>","2","0","1","",""
"4494792","1","4495041","","2010-12-20 22:53:29","0","573","<p>i need to do a function on MyDBAdapter to extract a all the users from the SQLite database, and then, return a <code>List&lt;Friend&gt;.</code></p><p>this is too munch hard for me, i am testing and trying to understand a lot of  google examples and stackoverflow posts but i can't do it</p><p>i tryed with this code but it doesn't works, C<code>ursorIndexOutOfBoundsException: Index -1 requested, with a size of 3</code></p><pre><code>public List&lt;Friend&gt; retrieveAllUsers()     {        List &lt;Friend&gt; friends=new ArrayList&lt;Friend&gt;();        Cursor result=fetchAllUsers();        for (int i=0; i&lt;result.getCount();i++)        {            //note.getString(note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));            friends.add(new Friend(result.getString(result.getColumnIndexOrThrow(""email"")), """","""","""",""""));        }        return friends;    }</code></pre><p>please can someone help me doing that function ?</p><p>i have a user (Friend) class, like this:</p><pre><code>public class Friend { private String email; //id de usuario    private String password;    private String fullName;    private String movilephone;    private String movileOperatingSystem;</code></pre><p>And also i have a SQLite database like this: </p><pre><code>public class MyDbAdapter {    private static final String TAG = ""NotesDbAdapter"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    private static final String DATABASE_NAME = ""gpslocdb"";    private static final String PERMISSION_TABLE_CREATE = ""CREATE TABLE permission ( fk_email1 varchar, fk_email2 varchar, validated tinyint, hour1 time default '08:00:00', hour2 time default '20:00:00', date1 date, date2 date, weekend tinyint default '0', fk_type varchar, PRIMARY KEY  (fk_email1,fk_email2))"";    private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY  (email))"";    private static final int DATABASE_VERSION = 2;    private final Context mCtx;    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(PERMISSION_TABLE_CREATE);            db.execSQL(USER_TABLE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            db.execSQL(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            onCreate(db);        }    }    /**     * Constructor - takes the context to allow the database to be     * opened/created     *      * @param ctx the Context within which to work     */    public MyDbAdapter(Context ctx) {        this.mCtx = ctx;    }    /**     * Open the database. If it cannot be opened, try to create a new     * instance of the database. If it cannot be created, throw an exception to     * signal the failure     *      * @return this (self reference, allowing this to be chained in an     *         initialization call)     * @throws SQLException if the database could be neither opened or created     */    public MyDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        mDbHelper.close();    }    public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""email"",email);        initialValues.put(""password"",password);        initialValues.put(""fullName"",fullName);        initialValues.put(""mobilePhone"",mobilePhone);        initialValues.put(""mobileOperatingSystem"",mobileOperatingSystem);        return mDb.insert(""user"", null, initialValues);    }    public Cursor fetchAllUsers() {        return mDb.query(""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}, null, null, null, null, null);    }    public Cursor fetchUser(String email) throws SQLException {        Cursor mCursor = mDb.query(true, ""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}            , ""email"" + ""="" + email, null, null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }}</code></pre>","479886","","479886","","2010-12-20 23:27:52","2010-12-20 23:41:58","How to extract the content of a cursor from a SQLite DB to a class?","<android><sqlite>","2","0","0","",""
"4494809","1","","","2010-12-20 22:54:40","2","659","<p>To capture video in an Android app, I'm using the <code>MediaStore.ACTION_VIDEO_CAPTURE</code> action, with <code>EXTRA_OUTPUT</code> to specify the location of the new video file. But how do I know what the MIME type is? Right now I just assume that it's “video/mp4”, but is there a way to get the video capture activity to tell me what the type is?</p>","25653","","","","","2012-07-09 21:12:48","What type of file does MediaStore.ACTION_VIDEO_CAPTURE give back?","<android><action><video-capture><android-intent>","1","0","","",""
"4494943","1","4495580","","2010-12-20 23:16:40","1","1174","<p>I have a custom view (which extends GLSurfaceView) I'm trying to use in my app. The xml layout that uses it appears to be being loaded correctly (attributes I set for the view are applied), but neither the view's constructor nor the onFinishInflate method are being called for the class.  I should also add that I'm new to the android platform so this is probably a stupid mistake.</p><p>Here is my main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>#&lt;!-- Status Bar --&gt;&lt;LinearLayout     android:orientation=""horizontal""    android:layout_width=""match_parent""     android:layout_height=""wrap_content""    android:layout_weight=""0""    android:background=""@drawable/status_bkg""&gt;    #&lt;!-- Location label --&gt;    &lt;TextView         android:text=""Location""         android:textColor=""#FFFFFF""        android:layout_weight=""1""         android:layout_width=""match_parent""        android:layout_height=""wrap_content"" /&gt;    #&lt;!-- Date/Time label --&gt;    &lt;TextView         android:text=""Date and Time""         android:textColor=""#FFFFFF""        android:layout_weight=""1""         android:layout_width=""match_parent""        android:layout_height=""wrap_content""        android:gravity=""right""  /&gt;&lt;/LinearLayout&gt;#&lt;!-- ChartView --&gt;&lt;View class=""com.xxx.yyy.ChartView"" android:id=""@+id/chartView""    android:layout_width=""match_parent""     android:layout_height=""match_parent""    android:background=""#00FF00""     android:layout_weight=""1""&gt;&lt;/View&gt;</code></pre><p></p><p>The ChartView is the custom GLSurfaceView.  This layout is loaded and the ChartView has a green background as specified. However, none of my setup (in code) happens for it.  I've tried placing it in the two constructors and in the onFinishInflate methods, but they inexplicably don't get called.  I've verified that the class name is correct (the xxx.yyy are just to hide the company in this post.</p><p>I've also tried a different form of the xml reference</p><pre><code>    &lt;com.xxx.yyy.ChartView android:id=""@+id/chartView""    android:layout_width=""match_parent""     android:layout_height=""match_parent""    android:background=""#00FF00""     android:layout_weight=""1""/&gt;</code></pre><p>But this dies when loading the Activity says that the constructor </p><p>ChartView(Context context, AttributeSet attrs)</p><p>doesn't exist (although it is certainly in my code).</p><p>Anyone got any tips on what could be going on?</p>","178430","","","","","2010-12-21 01:25:52","Neither constructor nor onFinishInflate called for custom view","<android>","1","1","","",""
"4494976","1","","","2010-12-20 23:21:49","2","1272","<p>I have a DatePicker in my activity. It works fine except when the user enters the date via the keypad and does not use the + or - buttons to change date.The date returned when the user edits via keyboard is always what is the DatePicker is  initialized with.When debug I notice the onDateChanged() callback is never called except when the date is change using the buttons.</p>","549287","","549287","","2010-12-21 16:17:06","2011-02-13 19:40:35","DatePicker not responding to user input from Keyboard in Android","<android><android-datepicker>","2","0","1","",""
"4495076","1","","","2010-12-20 23:44:49","0","187","<p>I want to make it so the user clicks a button, it opens up a dialog box, the user types in the name of an item, then it adds the item to a list. So far, I've gotten to where the dialog box opens up with an EditText, an OK and a Cancel button that dismisses the box. How do I do this? Here is my .java File:</p><pre><code>package com.shoppinglist;import android.app.ListActivity;import android.app.Dialog;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class ShoppingList extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button button1main = (Button) findViewById(R.id.Button01main);    button1main.setOnClickListener(new OnClickListener()  {     @Override      public void onClick(View v)  {       final Dialog dialog = new Dialog(ShoppingList.this);       dialog.setContentView(R.layout.maindialog);       dialog.setCancelable(true);       Button button = (Button) dialog.findViewById(R.id.cancel);       button.setOnClickListener(new OnClickListener()  {        @Override         public void onClick(View v)  {          dialog.dismiss();        }        });       dialog.show();       }     });    }}</code></pre><p>Thanks in advance!!!</p>","549304","","549304","","2010-12-23 00:14:30","2011-01-02 02:07:49","How do you get the user to add to a list?","<android><listview><button>","1","4","","",""
"4495122","1","","","2010-12-20 23:54:52","2","1200","<p>I am doing some preparation research for an Android phone app that would involve voice search or speech recognition while the user is simultaneously engaged in a phone call. I'm finding that when I am in the middle of a call and attempt to invoke voice search or a similar action that would take input from the microphone I get an ""audio error"" message. Does the phone app take exclusive control over the microphone input of the phone such that other apps cannot get access to audio input?</p>","549316","","","","","2011-01-10 22:35:45","sharing audio input on Android","<android><audio>","1","0","","",""
"4495220","1","4495254","","2010-12-21 00:15:28","3","7263","<p>I'm trying to make my case statement open up a different class depending on what button is pressed. I got this working fine for one button but am unsure how to proceed for two buttons.</p><p>Heres my code so far:</p><pre><code>public void onClick(View v) {    switch (v.getId()) {    case R.id.about_button:        Intent i = new Intent(this, About.class);        startActivity(i);        break;    case R.id.reminderList_button:        Intent i = new Intent (this, ReminderListActivity.class);        startActivity(i);        break;    }}</code></pre><p>This gives an error because I'm reusing the local variable (i) - if anyone could let me know how to do this properly it would be much appreciated.</p>","319940","","","","","2010-12-21 00:39:57","Android case statement help","<android><android-layout>","2","0","","",""
"4495258","1","4670035","","2010-12-21 00:23:05","4","2206","<p>I'm making an android 1.6 app that uses phone's camera.</p><p>In order to do this app resolution independent, I need to set a compatible aspect ratio for previewing camera on a SurfaceLayout. In 1.6 sdk there is no way to get supported sizes for the camera preview. It is possible to use a 4:3 or 3:2 aspect ratio and get no errors whith that?</p><p>On the other hand, I need a way to make a xml layout that represents this Surfacelayout in this (unknown) aspect ratio in every resolution. I assume that is not possible to change the SurfaceLayout size in runtime. Can I do it with ""dp"" units? The other way is making this layout programmatically?</p><p>There are some apps like Vignette or android camera application with some tricks to make something like that, like black bars (vignette) or fixed buttons bar, but I don't know how to do it in any kind of resolution.</p><p>Any ideas?</p><p>Thanks!</p>","549330","","","","","2011-01-12 14:43:20","How to make a resolution independent camera preview on android?","<android><layout><camera><resolution><aspect-ratio>","1","0","","",""
"4495261","1","","","2010-12-21 00:23:41","8","661","<p>I want to access a ""global"" variable in my MyApp(extends Application) from a broadcastreceiver (registered in the manifest) and e.g. multiple activities. Now I seem to have different instances of my MyApp: one for the BCR and one for the activities. Could sb help me with my problem?thanks alotJoerg</p>","549345","","","","","2012-09-03 14:17:53","Different Instance of Applicationcontext in Broadcastreceiver","<android><global-variables><broadcastreceiver>","2","4","1","",""
"4495508","1","4522268","","2010-12-21 01:06:56","0","228","<p>When I call setContentView with this view, it takes up the whole screen. I thought wrap_content and wrap_content would mean the view would be big enough to show the two strings only. I would like this to show just like a small dialog. Any ideas? How does an alert dialog use only the size that it needs? 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=""wrap_content""     android:layout_height=""wrap_content""     android:padding=""80dp""    &gt;&lt;TextView      android:id=""@+id/dialog_title""    android:textSize=""15sp""    android:gravity=""center_horizontal""    android:layout_width=""fill_parent""                         android:layout_height=""wrap_content""              android:text=""String 1""    /&gt;&lt;TextView     android:id=""@+id/dialog_text1""     android:textSize=""10sp""    android:gravity=""center_horizontal""         android:layout_width=""fill_parent""                         android:layout_height=""wrap_content""                   android:text=""String 2""    /&gt;&lt;/LinearLayout&gt;</code></pre>","479542","","244296","","2010-12-23 20:35:47","2010-12-23 20:35:47","View taking up whole screen when not desired","<android>","1","2","","",""
"4495511","1","4495745","","2010-12-21 01:07:03","18","9759","<p>When creating a custom component in android it is often asked how to create and pass through the attrs property to the constructor.</p><p>It is often suggested that when creating a component in java that you simply use the default constructor, i.e. </p><pre><code>new MyComponent(context);</code></pre><p>rather than attempting to create an attrs object to pass through to the overloaded constructor often seen in xml based custom components. I've tried to create an attrs object and it doesn't seem either easy or at all possible (without an exceedingly complicated process), and by all accounts isn't really required. </p><p>My question is then: What is the most efficient way of construction a custom component in java that passes or sets properties that would have otherwise been set by the attrs object when inflating a component using xml?</p>","468195","","244296","","2011-01-08 23:58:44","2012-11-27 09:48:14","How to pass custom component parameters in java and xml","<android><components><custom-attributes><uicomponents>","1","0","12","",""
"4495555","1","5239620","","2010-12-21 01:18:16","4","1545","<p>When developing in eclipse, the android.util.Config.DEBUG constant is always false even when I debug the project.</p><p>The javadoc for this constant says that ""If this is a debug build, this field will be true."" What am I doing wrong?</p>","481009","","","","","2011-03-08 23:27:45","android.util.Config.DEBUG always false even when developing and debugging in eclipse. Why?","<android><logging>","2","0","","",""
"4495606","1","4495844","","2010-12-21 01:32:38","2","906","<p>For a listView, when you register an OnItemClickListener, the method you specify looks like this:</p><p>public abstract void onItemClick (AdapterView parent, View view, int position, long id)</p><p>The id corresponds to the row that the user clicked on.  My question is simply why is it a long and not an int?  When would you use it as a long?  I've been casting it to an int when I use it, so it makes me think that maybe I'm using it wrong.</p>","302118","","","","","2010-12-21 05:17:21","Why does Android's onItemClick want a long for row Id?","<java><android><listview><listener>","2","1","2","",""
"4495613","1","4495695","","2010-12-21 01:34:25","5","4447","<p>I am creating an android game using opengl and a cocos2d port (http://code.google.com/p/cocos2d-android-1). I am targeting a wide range of devices and want to ensure that it performs well. I only test on a nexus one and am hoping to get some input from people with experience on slower devices.</p><p>Currently the game uses two 1024x1024 textures as well as two 256x256 textures. Is this within the limits of most devices? Anyone have any rule of thumb or experience with graphics memory limits in these cases? If gfx memory is exceeded does it page to normal memory?</p>","80617","","201863","","2011-10-15 22:21:29","2012-02-29 20:37:04","Android Graphics Memory Limits","<android><opengl-es><cocos2d-android>","2","7","4","",""
"4495616","1","4527065","","2010-12-21 01:34:35","4","1906","<p>I have programmed my game in C++. I have managed to compile everything using ndk, but I have notice a couple of snags.</p><p>How do I load textures into NDK OpenGL(since the code is already there)? I did use a BitmapFactory to load the image, then copy the pixels into a ByteBuffer which I allocated at a size of width * height * 4. I then sent the array of the ByteBuffer to my native code and pulled out a pointer using Get/ReleasePrimiativeArrayCritical. I don't think it works as it crashes when it renders. Also, I can't help but notice the Garbage Compiler is moaning about 5.37 MB of space being taking up when the image is only 16 KB.</p><p>The other thing is buffers, like framebuffers and renderbuffers. I notice that it isn't any use of framebuffers and renderbuffers. Does GLSurfaceView atuomatically do this? And is it okay to use my own buffers?</p>","398640","","398640","","2010-12-21 14:24:44","2010-12-24 15:33:10","Porting an iPhone game to Android - Texures and Buffers","<c++><android><opengl-es><android-ndk>","1","2","3","",""
"4495620","1","","","2010-12-21 01:36:27","2","1689","<p>I want to create layout like this: <a href=""https://github.com/muhku/calendar-ui"" rel=""nofollow"">dayview</a></p><p>dose anyone can tell me which layout should i used to make day view calendar like that. I'm going to using absolute layout to process with overlap widget but it's not recommended.</p>","541383","","13793","","2012-04-30 23:44:14","2012-04-30 23:44:14","how to create layout for dayview, weekview calendar?","<android><calendar>","1","1","2","",""
"4495663","1","","","2010-12-21 01:46:05","2","1020","<p>I'm trying to create a animation to link two position of a View. The position of the View is defined by the overridden method onLayout. I'm getting the position before and after the position update with the getLocationOnScreen method.</p><p>Here is my code simplified:</p><pre><code>int[] startPosition = new int[2];view.getLocationOnScreen(startPosition);// do some layout update that changed the view position on screenrequestLayout();invalidate();int[] endPosition = new int[2];view.getLocationOnScreen(endPosition);Animation anim = new TranslateAnimation(startPosition[0], endPosition[0], startPosition[1], endPosition[1]);anim.setDuration(100);view.startAnimation(anim);</code></pre><p>The problem is that the onLayout method isn't called after the layout update and the call to requestLayout... I found that calling requestLayout will only schedule a layout pass of the view tree. So my question is: how to make this layout calculation synchronously ? Or wait for its end ? I could use postDelayed or add a event system to the onLayout method, but I'd like to test cleaner methods first...I could also call the onLayout method myself, but I don't know exactly how to calculate its arguments.</p><p>Any idea is welcomed !</p>","522763","","","","","2010-12-21 01:46:05","Android: How to get a View position before and after an layout update?","<android>","0","2","","",""
"4495673","1","","","2010-12-21 01:48:40","5","2388","<p>everyone! I have compressed lots of pictures to a ""pictures.zip"" file. I want to load one of these pictures to a WebView like this: </p><pre><code>WebView wv = (WebView)findViewById(R.id.WebView01);wv.loadDataWithBaseURL(null,""&lt;img src=\""abc.jpg\""&gt;"", ""text/html"", ""UTF-8"", null);</code></pre><p>Here,""abc.jpg"" is a picture that has been compressed to pictures.zip file.</p><ol><li><p><strong>I just want to decompress the picture from the zip file and getthe picture's byte stream, and thenload the image to the WebView fromthe byte stream.</strong></p></li><li><p>I don't want to decompress thepicture from the zip file and thensave it to sdcard and then load it.</p></li><li><p>Moreover, I don't want to encode thepitcture's byte to a base64 and thenload the image to the WebVieweither, because these two ways willbe very slow.</p></li></ol>","549380","","549380","","2010-12-21 05:53:20","2012-02-23 07:04:49","How to load an image stored in a byte array to WebView?","<android><webview><bytearray>","2","4","2","",""
"4495676","1","","","2010-12-21 01:50:24","1","268","<p>I'm writing an application for Android-based tablets. While I have come very far in development, there is one bug I don't understand and can't get rid of. I have a GridView with a custom ArrayAdapter, which contains some downloadable items in it. Each item in this grid is a clickable relative layout, which looks something like this:</p><pre><code>&lt;RelativeLayout&gt;  &lt;FrameLayout /&gt;  &lt;TextView /&gt;  &lt;TextView /&gt;  &lt;ProgressBar /&gt;   &lt;/RelativeLayout&gt;</code></pre><p>When an item is clicked, the app will try to find it on sd-card and show it. If it fails, then it will start downloading it in it's own thread. File-downloading method is very standard, except for two things things - it has, as said, it's own thread and it updates progress-bar after downloading each data-chunk (which, at this moment, is 2048 bytes):</p><pre><code>while ((n = in.read(b,0,chunkSize)) &gt;= 0) {    out.write(b,0,n);    if (handler != null &amp;&amp; progressbar != null) {        /* Update progressbar:*/        currentBytes += n;        final int nbytes = currentBytes;        handler.post(new Runnable() {            public void run() {                progressbar.setProgress(nbytes);            }        });    }}</code></pre><p>This works perfectly well. Here's how it looks like in the real world (after clicking on 3rd icon; these items are just placeholders, but the downloaded files are real):</p><p>[I couldn't post an image (not enough rep), so here's a link]</p><h2><a href=""http://i52.tinypic.com/20zb8jq.png"" rel=""nofollow"">http://i52.tinypic.com/20zb8jq.png</a></h2><p>In the same time I can start a second download and it will still work perfectly. I can also add elements at the end and it will work too. There is a slight problem, however. Whenever I use a search button, which starts a new activity, and go back to this activity, same gridview will look like this:</p><p>[I couldn't post an image and only one hyperlink (not enough rep), so here's a link with a space]</p><h2>http:// i54.tinypic.com/16kqgxg.png</h2><p>It's still downloading the right element, it just shows the wrong progressbar. The magazine will still be shown after downloading completes. Another unwanted effect is that ALL items, even those downloading and with progress bars, are set to be clickable (I disable it before starting downloading). Here is the code (a bit shortened, but it doesn't matter) updating the adapter:</p><pre><code>List&lt;Magazine&gt; newList = cm.getMyMags(); // Returns a list of current magazinesList&lt;Magazine&gt; oldList = cachedAdapter.mags; // I use List.toArray() method in getView in Adapter.for (Magazine mag : newList) {    if (!oldList.contains(mag)) {        cachedAdapter.add(mag);    }}</code></pre><p>I know it's not the most efficient way to do this, but right now all I care about is making it work.<br>I tried to update the list itself and call notifyDataSetChanged(), but it gave exactly the same results.Does anyone know what might cause this problem?</p><p>Thank you for your time.</p>","164751","","","","","2010-12-21 01:50:24","Strange ArrayAdapter behaviour","<android><android-arrayadapter>","0","0","","",""
"4495770","1","","","2010-12-21 02:17:47","0","1761","<p>my webservice return a data in the format</p><p> ab  cdef i have to show to this return data in listview here is my welcome.xml in which i have to display data</p><p><strong>welcome.xml</strong></p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt; - &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:orientation=""vertical""&gt;  &lt;ImageView android:id=""@+id/welcome"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:src=""@drawable/main"" android:layout_gravity=""center_horizontal"" /&gt;   - - &lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_marginTop=""10dip"" android:id=""@+id/Relative01""&gt;  &lt;ListView android:id=""@+id/lvevent"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_below=""@+id/welcome"" android:background=""@drawable/wel_bg"" android:layout_marginBottom=""50dip"" /&gt;   &lt;/RelativeLayout&gt;- &lt;TableLayout android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:layout_below=""@+id/Relative01""&gt;- &lt;TableRow&gt;  &lt;Button android:id=""@+id/btn_index"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:background=""@drawable/cap_button"" android:paddingRight=""15dip"" android:layout_marginRight=""50dip"" /&gt;   &lt;Button android:id=""@+id/btn_event"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:background=""@drawable/button"" android:layout_toRightOf=""@+id/btn_index"" android:paddingLeft=""25dip"" android:layout_marginLeft=""30dip"" /&gt;   &lt;/TableRow&gt;  &lt;/TableLayout&gt;  &lt;/LinearLayout&gt;</code></pre><p>how can i show data in listview. </p><p>following code i am using for parser:</p><p>MYXMLHandler.java :</p><pre><code>package org.parsing;import org.xml.sax.Attributes;import org.xml.sax.SAXException;import org.xml.sax.helpers.DefaultHandler;public class MyXMLHandler extends DefaultHandler{ Boolean currentElement = false; String currentValue = null; public static SitesList sitesList = null; public static SitesList getSitesList() {  return sitesList; } public static void setSitesList(SitesList sitesList) {  MyXMLHandler.sitesList = sitesList; } /** Called when tag starts ( ex:- &lt;name&gt;AndroidPeople&lt;/name&gt;   * -- &lt;name&gt; )*/ @Override public void startElement(String uri, String localName, String qName,   Attributes attributes) throws SAXException {  currentElement = true;  if (localName.equals(""content""))  {   /** Start */    sitesList = new SitesList();  } /*else if (localName.equals(""website"")) {   *//** Get attribute value *//*   String attr = attributes.getValue(""category"");   sitesList.setCategory(attr);  }*/ } /** Called when tag closing ( ex:- &lt;name&gt;AndroidPeople&lt;/name&gt;   * -- &lt;/name&gt; )*/ @Override public void endElement(String uri, String localName, String qName)   throws SAXException {  currentElement = false;  /** set value */   if (localName.equalsIgnoreCase(""title""))   sitesList.setTitle(currentValue);  else if (localName.equalsIgnoreCase(""description""))   sitesList.setDescription(currentValue); } /** Called to get tag characters ( ex:- &lt;name&gt;AndroidPeople&lt;/name&gt;   * -- to get AndroidPeople Character ) */ public void characters(char[] ch, int start, int length)   throws SAXException {  if (currentElement) {   currentValue = new String(ch, start, length);   currentElement = false;  } }}</code></pre><p>SitesList.java:</p><pre><code>package org.parsing;import java.util.ArrayList;public class SitesList { /** Variables */ private ArrayList&lt;String&gt; title = new ArrayList&lt;String&gt;(); private ArrayList&lt;String&gt; description = new ArrayList&lt;String&gt;(); //private ArrayList&lt;String&gt; category = new ArrayList&lt;String&gt;(); /** In Setter method default it will return arraylist   *  change that to add  */ public ArrayList&lt;String&gt; getTitle() {  return title; } public void setTitle(String title) {  this.title.add(title); } public ArrayList&lt;String&gt; getDescription() {  return description; } public void setDescription(String description) {  this.description.add(description); } /*public ArrayList&lt;String&gt; getCategory() {  return category; } public void setCategory(String category) {  this.category.add(category); }*/}</code></pre><p>XMLParsingExample.java:</p><pre><code>package org.parsing;import java.net.URL;import javax.xml.parsers.SAXParser;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.ContentHandler;import org.xml.sax.InputSource;import org.xml.sax.XMLReader;import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import android.widget.TextView;public class XMLParsingExample extends Activity { /** Create Object For SiteList Class */ SitesList sitesList = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  /** 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 title[];  TextView description[];  //TextView category[];  try {   /** Handling XML */   SAXParserFactory spf = SAXParserFactory.newInstance();   SAXParser sp = spf.newSAXParser();   XMLReader xr = sp.getXMLReader();   /** Send URL to parse XML Tags */   URL sourceUrl = new URL(     ""http://208.109.97.179:1010/webservices/newsevents.php"");   /** Create handler to handle XML Tags ( extends DefaultHandler ) */   MyXMLHandler myXMLHandler = new MyXMLHandler();   xr.setContentHandler((ContentHandler) myXMLHandler);   xr.parse(new InputSource(sourceUrl.openStream()));  } catch (Exception e) {   System.out.println(""XML Pasing Excpetion = "" + e);  }  /** Get result from MyXMLHandler SitlesList Object */  sitesList = MyXMLHandler.sitesList;  /** Assign textview array lenght by arraylist size */  title = new TextView[sitesList.getTitle().size()];  description = new TextView[sitesList.getDescription().size()];  //category = new TextView[sitesList.getName().size()];  /** Set the result text in textview and add it to layout */  for (int i = 0; i &lt; sitesList.getTitle().size(); i++) {   title[i] = new TextView(this);   title[i].setText(""Title = ""+sitesList.getTitle().get(i));   description[i] = new TextView(this);   description[i].setText(""Website = ""+sitesList.getDescription().get(i));   //category[i] = new TextView(this);   //category[i].setText(""Website Category = ""+sitesList.getCategory().get(i));   layout.addView(title[i]);   layout.addView(description[i]);   //layout.addView(category[i]);  }  /** Set the layout view to display */  setContentView(layout); }}</code></pre><p>after checking my code tell me where i am wrong and tell the correct answer.</p>","512383","","142162","","2010-12-21 02:24:07","2010-12-21 03:05:14","how to show data in listview from web service in android","<java><android>","1","0","","",""
"4495845","1","5046553","","2010-12-21 02:39:04","25","7445","<p>I'm getting a completely useless page when I use the Single Sign on for Facebook's Android SDK. </p><blockquote>  <p>""You have already authorized happyapp.  Press ""Okay"" to continue.</p></blockquote><p>This page would destroy user experience. How the heck do I get rid of it. Lots of people  have been seeing this, but no solution is posted.</p><p>Even Facebook admits this is a problem, see: <a href=""http://forum.developers.facebook.net/viewtopic.php?id=84548"">http://forum.developers.facebook.net/viewtopic.php?id=84548</a></p><p>Does anyone know any work-around?</p>","420259","","420259","","2010-12-25 03:04:55","2012-07-04 15:51:24","How to avoid already-authorized in Android Facebook SDK","<android><facebook>","4","4","5","",""
"4496021","1","","","2010-12-21 03:30:27","1","790","<p>we all know how to save an Activity's state to SavedState via  onSaveInstanceState before it is killed.  but when the application has some global data will be used by all the activities. so I do not have a good method to save the global data. when the application be killed on the backgound.</p>","549438","","","","","2010-12-21 04:55:52","how to save android application's global data to SavedSate","<android>","1","0","","",""
"4496090","1","4498229","","2010-12-21 03:44:08","1","499","<p>I have a layout similiar to this:</p><pre><code>&lt;RelativeLayout ...&gt;     &lt;EditText android:id=""@+id/editbox""             android:layout_width=""wrap_content"" .../&gt;     &lt;Button android:layout_right=""@id/editbox""             android:layout_width=""wrap_content""            android:text=""Button"" /&gt; &lt;/RelativeLayout&gt;</code></pre><p>The button is at the right of the edit text. And the edit text is 'wrap_content'. When i type texts into the edit view, the view's width increase and will expand to my button. I want the two views (button and edit text) have their own area. How to configure this?</p>","459062","","19750","","2010-12-21 03:49:44","2010-12-21 10:29:23","how can i make the View do NOT expand over its sibling View","<android><layout>","2","0","","",""
"4496131","1","","","2010-12-21 03:53:41","1","184","<p>Is it possible to make a app on Android such that whoever downloads this app receives a message from me weekly? I want to be the only person who can write on this message board and no one else. If this is possible, where should I start looking for tutorials about doing this sort of stuff?</p>","549455","","23897","","2010-12-21 03:57:34","2010-12-21 04:02:51","Can I send periodic messages to my Android app users?","<android><message>","1","1","1","",""
"4496461","1","","","2010-12-21 05:11:25","0","137","<p>I am developing an application.I have one xml file in which i have a image.I want to place edittext in the image..Can anybody tell me how to use an edittext in the image...</p>","475349","","","","","2010-12-21 05:11:25","regarding placing edittext in an image in android","<android>","0","5","","",""
"4496476","1","4496493","","2010-12-21 05:14:46","1","352","<p>I have a ListView and I want the first two entries in it to be displayed differently than the rest. Nothing fancy, I want them all to just be text views. But the first two entries need to have different sizes and weights than the rest. I tried modifying the ArrayAdapter class like so:</p><pre><code>private class BusStopAdapter&lt;T&gt; extends ArrayAdapter&lt;T&gt;{  public BusStopAdapter(      Context context, int textViewResourceId,    List&lt;T&gt; objects)  {    super(context, textViewResourceId, objects);  }  public View getView(int position, View convertView,     ViewGroup parent)  {    TextView toReturn =       (TextView)super.getView(position, convertView, parent);    if(position == 0){     toReturn.setTextSize(12);     toReturn.setText(""Previous Bus: "" + toReturn.getText());     toReturn.setPadding(0,0,0,0);    }    else if(position == 1){      toReturn.setTextSize(20);      toReturn.setPadding(        toReturn.getPaddingLeft(),        0,        toReturn.getPaddingRight(),        0      );      toReturn.setText(""Next Bus: "" + toReturn.getText());      toReturn.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.TOP);    }    return toReturn;  }}</code></pre><p>But this inadvertantly causes some of the other textviews to take on these special attributes. I think it's because cause textviews get ""recycled"" in the AbsListAdapter class.</p>","527288","","","","","2010-12-21 05:18:32","Style first 2 TextViews in Android ListView differently","<android><listview><textview>","1","0","1","",""
"4496576","1","4496623","","2010-12-21 05:44:22","0","6273","<p>I am using a ""WVGA800"" for my app. I try to run it on different resolution screens. It it is not perfectly scratching in that resolution .I read and implement issues form this link.<a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a>But still not result. Please let me know if any one hase a perfect solution. Main issue are that I am fixing hight &amp; width of Image, textsize etc. When these are displayedto screen of ""WVGA800"". But when I test them on ""HVGA"", ""QVGA"" then problem arise.I want to avoid the ""if else"" conditions by getting the screen resolution at Runtime. If any one hase any solution for this...let me know. Thanks in advance. I am also wondring when there will be new devices with new screen resolutions? </p>","486139","","457982","","2010-12-21 07:04:02","2013-03-26 13:01:26","How to set my .apk file to run on different screen resolution in android?","<android><android-emulator><screen><android-layout><resolution>","4","0","","",""
"4496583","1","","","2010-12-21 05:46:24","1","623","<p>I have developed a simple AlarmClock application and running it on the emulator, its is working properly but when I try to run it on the device its not working properly. Like I can set the alarm but it never starts. There is some information that might be helpful for you guys in order to solve my problem. I have a setup (emulator) of Android 1.6, but the device has got Android 2.2. Its not that the device is totally rejecting the app because I am able to set the Alarm but the alarm is never started. </p><p>The application uses some activities and a service. The main <code>Activity Class</code> uses a <code>PendingIntent</code> and an <code>AlarmManager</code> to set the Alarm and it calls a <code>Service Class</code> when the alarm start. The <code>Service Class</code> then calls an <code>Activity Class</code> show the snooze and alarm off options, the 'Activity Class' also uses <code>TexttoSpeech</code> API to speak out some greeting and Alarm text. I have double checked that the services and activities are registered in the AndroidManifest.xml. My hunch says that the service is being blocked by something. People your help and suggestions would highly be appreciated.</p>","385145","","213269","","2011-03-22 08:31:28","2011-03-22 08:31:28","Application running on emulator but not working properly on the Device","<service><avd><android>","0","8","1","",""
"4496608","1","","","2010-12-21 05:52:33","0","507","<p>I have to port my application to be working in Android 2.1 which was made originally for Android2.2</p><p>Now I have problem in XML parsing as XPath is not supported in Android 2.1So now I am using an SAX parser. </p><p>In XMLParsing method in the older code we use XPAth to complile the key like \Employee\Designation\Value\""<br>eg:Key = \Employee\Designation\Value\""<br>XML file</p><p>Personnel><br>Address><br>/Address>Employee type=""permanent""><br>Name> Seagull /Name><br>Id> 3674 /Id><br>Age> 34 /Age>  </p><p>Designation><br>Value>34 /Value><br>/Designation><br>/Employee><br> -Employee type=""contract""><br>Name>Robin /Name<br>Id>3675 /Id><br>Age>25 /Age>  </p><p>Designation>Value>34 /Value><br>/Designation></p><h2>/Employee></h2><p>Employee type=""permanent""><br>Name>Crow /Name><br>Id>3676 /Id><br>Age>28 /Age>  </p><p>Designation><br>Value>38 /Value><br>/Designation><br>/Employee><br>/Personnel>`  </p><p>o/p comes to be 34 and 38`enter code here and then it returns mw corresponding values as many as they are in the xml file.Now I need to use SAXParser so </p><p>how can I implement this? Is there any way using the SAXParserFactory ,schema?</p><p>Thanks for your response.</p>","521380","","521380","","2010-12-21 06:12:39","2010-12-29 13:02:40","Alternative for XPath for Android 2.1","<android><parsing>","0","3","","",""
"4496627","1","4612555","","2010-12-21 05:57:43","4","2235","<p>I'm using Twitter4j and the Android Facebook SDK to fetch status messages. With Twitter4J I get real-time notifications whenever a new status has been added to the stream via <code>StatusListener</code> (Twitter4J). In the Facebook SDK I cannot find a similar way, I can only fetch entire streams over and over again in a fixed time interval using <code>RequestListener</code> (Facebook SDK) as far as I see it. </p><p>Is there any way to get notified of new statuses in realtime with the Facebook SDK in a similar way as with Twitter4J?</p><p>(Found a similar but unanswered question here: <a href=""http://stackoverflow.com/questions/4231514/facebook-real-time-updated-application-wall"">Facebook real-time updated application wall</a>)</p>","241475","","","","","2011-01-06 12:50:16","How to get real-time status notification with Facebook SDK via listener","<android><listener><facebook>","1","2","3","",""
"4496656","1","","","2010-12-21 06:04:25","2","735","<p>I know android uses their own loading animations through that are included with the android.jar...however I have not been able to successfully get them to work with an ImageView correctly.  For instance, the following code gives me an error in my xml file that says the image is not public...is there anyway to get this to work correctly or is it even possible?</p><pre><code>        &lt;ImageView android:layout_height=""wrap_content"" android:id=""@+id/loadingImg""        android:layout_width=""wrap_content"" android:paddingTop=""6px""        android:paddingLeft=""6px"" android:src=""@android:drawable/spinner_white_16""&gt;    &lt;/ImageView&gt;</code></pre><p>I know its possible to slice a loading gif up and use <code>animation-list</code> however it would be convenient to just use android's images.</p>","408079","","","","","2010-12-21 06:04:25","Is it possible to use the default android loading animations on an ImageView?","<android><image><loading><imageview>","0","1","1","",""
"4496673","1","4497726","","2010-12-21 06:08:31","4","6937","<p>My Problem is that when I hit the pdf link in the webview, the browser opens for a short moment (I guess to download the linked file), the pdf file starts to download and the app returns back to the webview. Is there a way to stop the browser window opening to start the download?</p><p>I have used WebViewClient to shouldOverrideUrlLoading so that clicked urls are kept in the webview:</p><pre><code>private class LinkWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;    }}</code></pre><p>And I have a download listener so I can download files  (for my needs these are pdf's):</p><pre><code>webView.setDownloadListener(new DownloadListener() {        public void onDownloadStart(String url, String userAgent,                String contentDisposition, String mimetype,                long contentLength) {            Intent intent = new Intent(Intent.ACTION_VIEW);            intent.setData(Uri.parse(url));            startActivity(intent);        }    });</code></pre>","496625","","496625","","2010-12-21 08:34:49","2010-12-21 09:14:33","WebView download opens browser window for a short moment before returning to WebView","<android><download><android-intent><webview>","1","0","1","",""
"4496676","1","4496726","","2010-12-21 06:09:04","1","836","<p>To call main activity I saw componentName class in android.</p><pre><code>intent = new Intent(new ComponentName(packageNam,classname);</code></pre><p>if same is used in case of child activity, I got error ,<code>""is activity delcared in andorid manifest?""</code> like error.</p><p>how to call app1 child activity in app2 by using intent ?In app1 the activity is declared like this in manifest</p><pre><code>&lt;activity android:name="".activity.MessageCompose"" android:label=""@string/app_name"" android:enabled=""false""&gt;- &lt;intent-filter&gt;  &lt;action android:name=""android.intent.action.VIEW"" /&gt;   &lt;action android:name=""android.intent.action.SENDTO"" /&gt;   &lt;data android:scheme=""mailto"" /&gt;   &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;   &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;   &lt;/intent-filter&gt;- &lt;intent-filter android:label=""@string/app_name""&gt;  &lt;action android:name=""android.intent.action.SEND"" /&gt;   &lt;data android:mimeType=""*/*"" /&gt;   &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;   &lt;/intent-filter&gt;- &lt;intent-filter android:label=""@string/app_name""&gt;  &lt;action android:name=""android.intent.action.SEND_MULTIPLE"" /&gt;   &lt;data android:mimeType=""*/*"" /&gt;   &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;</code></pre>","486216","","486216","","2010-12-21 06:49:03","2010-12-21 06:49:03","how to call subactivity of another application android?","<android>","2","0","","",""
"4496700","1","","","2010-12-21 06:12:24","1","1141","<pre><code>CookieManager   cookieManager = CookieManager.getInstance();     String  cookie = cookieManager.getCookie(url);cookieManager.removeSessionCookie(); cookieManager.setAcceptCookie(true);   cookieManager.setCookie( url, cookiestring);</code></pre><p>removing cookie works,how do i set the cookie back onto webview and access logged in page again</p><p>thanks in advance</p>","549543","","1461682","","2013-11-27 11:25:37","2013-11-27 11:25:37","On android first I am capturing cookie from webview, then removing the session cookie , then again setting the cookie","<android><cookies><webview>","1","0","","",""
"4496731","1","4496997","","2010-12-21 06:17:53","0","531","<p>Hello Guys i m using following code to open Android Add Contact Page ,</p><pre><code>Intent intent1 = new Intent(Intent.ACTION_INSERT);        intent1.setType(Contacts.CONTENT_ITEM_TYPE);        intent1.setData(ContactsContract.Contacts.CONTENT_URI);        startActivityForResult(intent1,300);</code></pre><p>But as a result code it sends -1 inside onActivityResult functionI want to have the ContactId of the newly added Person , How can we get this?</p>","395661","","","","","2010-12-21 07:14:18","How can we know a new contact is Added to Android?","<android>","2","0","","",""
"4496791","1","","","2010-12-21 06:29:55","0","2120","<p>I have one website with JQueryMobile which works fine for iPhone but with Android HTC looks really weird when zooming. Same thing happens in any of the demo pages of JQueryMobile site, almost half of the screen becomes blank breaking completely the site.</p><p>Is there any way of solving this or at least disable pinch zooming for Android HTC Browsers?</p>","549553","","","","","2011-02-15 17:31:16","JQueryMobile HTC Android pinch zoom","<javascript><jquery><android>","3","0","1","",""
"4496805","1","4497441","","2010-12-21 06:33:25","0","396","<p>I hava a simple program about video recording .I use the surfaceView to show the preview screen.and I also want to put some buttons on the screen.</p><p>I put all the component mentioned above into a XML file which is ""ipcam.xml"" </p><p>I use MediaRecorder , SurfaceView , SurfaceHolder to complete this programbecause the preview screen does not orientate correctly when I rotate my phone.so I use ""setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);""but , the button in the program is always in LANDSCAPE direction . it will not auto change direction when I rotate my phone , but the preview is ok!!</p><p>so is there anyway to solve this problem.</p><p>Thank you all very much in advance.</p><p>you can see this picture , I put my phone in vertical directionthe preview screen seems OK  but the button is in horizontal direction , i don't want it.</p><p><a href=""https://newslab.csie.ntu.edu.tw/~poc7667/123.png"" rel=""nofollow"">https://newslab.csie.ntu.edu.tw/~poc7667/123.png</a></p>","549556","","549556","","2010-12-21 09:18:13","2010-12-21 09:18:13","How could I make the SurfaceView and Button have a different orientation in a Activity","<android>","2","0","","",""
"4496858","1","4496929","","2010-12-21 06:45:52","2","6606","<p>I had an abnormal shutdown of my mac and when it came back up, Eclipse would no longer compile my project correctly.</p>","157804","","","","","2010-12-21 07:00:30","Android eclipse ERROR: Unknown option '--auto-add-overlay'","<android><eclipse><compiler><sdk>","1","0","1","",""
"4496861","1","","","2010-12-21 06:47:01","0","533","<p>I'm new to Android development, Eclipse and Java (done mostly .Net and IVR programming up till now), so when I tried to compile and run a sample app I found for TTS on the Droid, I wasn't surprised that I got a runtime error right away.  The error is:</p><p><em><strong>dalvikvm Failed resolving com/sample/TTSapp/AndroidTTSapp; interface 4 'android/speech/tts/TextToSpeech$OnInitListner;'</em></strong></p><p>I suppose the OnInitListner method must be in one of the classes that was installed when I installed the Android SDK (release 1.6 R1 I believe), but I'm not sure how to import the associated class module into the current program.  I can't find a speech/tts/TextToSpeech directory anywhere on my system. Do I need to download this directory from somewhere? Following is the Java source code for the demo TTS program I'm trying to run:</p><hr><p>package com.sample.TTSApp;</p><p>import android.app.Activity;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.util.Log;import android.view.View;import android.widget.Button;import com.sample.TTSApp.R;import java.util.Locale;import java.util.Random;public class AndroidTTSapp extends Activity implementsTextToSpeech.OnInitListener     {    private static final String TAG = ""TextToSpeechDemo"";<br>    private TextToSpeech mTts;    private Button mAgainButton;    @Override    public void onCreate(Bundle savedInstanceState)       { super.onCreate(savedInstanceState);         setContentView(R.layout.main);       // Initialize text-to-speech. This is an asynchronous operation.<br>       // The OnInitListener (second argument) is called after initialization completes.       // Instantiate TextToSpeech.OnInitListener<br>       mTts = new TextToSpeech(this, this);       mAgainButton = (Button) findViewById(R.id.again_button);</p><pre><code>   mAgainButton.setOnClickListener(new View.OnClickListener()         {  public void onClick(View v)    {    sayHello();       }      });  }  @Override public void onDestroy()     {        // Don't forget to shutdown!     if (mTts != null)        {        mTts.stop();        mTts.shutdown();       }    super.onDestroy();</code></pre><p>}  // Implements TextToSpeech.OnInitListener.</p><pre><code>  public void onInit(int status)  {  // status can be either TextToSpeech.SUCCESS or TextToSpeech.ERROR.  if (status == TextToSpeech.SUCCESS)      {             int result = mTts.setLanguage(Locale.US);      if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED)          {           // Language data is missing or the language is not supported.           Log.e(TAG, ""Language is not available."");           }  else     {         // Check the documentation for other possible result codes. For example, the language may be available for the locale   // but not for the specified country and variant.               // The TTS engine has been successfully initialized. Allow the user to press the button for the app to speak again.          mAgainButton.setEnabled(true);     // Greet the user      sayHello();      }             </code></pre><p>}      else          {         // Initialization failed.            Log.e(TAG, ""Could not initialize TextToSpeech."");      }     };</p><pre><code> private static final Random RANDOM = new Random(); private static final String[] HELLOS =  {   ""Hello World"",  ""This is Text to speech demo by Zahid Shaikh""    }; private void sayHello()  { // Select a random hello. int i =0;  int helloLength = HELLOS.length; String hello = HELLOS[i]; i++; if(i == helloLength) i =0; mTts.speak(hello,TextToSpeech.QUEUE_FLUSH,null); } </code></pre><p>}</p><p>Thanks in advance for any assitance anyone can give a beginner like myself.</p><p>Don Tilley</p>","549496","","","","","2010-12-21 08:09:31","Failure in resolving TextToSpeech class for Android Development","<android><eclipse>","1","0","","",""
"4496875","1","","","2010-12-21 06:49:20","0","3051","<p>I can draw a pie chart using this:</p><p><a href=""http://blog.gafmediastudio.com/2010/04/01/draw-a-pie-chart-with-android/comment-page-1/#comment-1340"" rel=""nofollow"">http://blog.gafmediastudio.com/2010/04/01/draw-a-pie-chart-with-android/comment-page-1/#comment-1340</a></p><p>But now I want to show pie chart legend in pie chart view. Can anybody help?</p>","515810","","23897","","2010-12-21 06:51:30","2013-08-02 13:51:56","Android Pie Chart Legend","<android><legend><pie-chart>","4","0","","",""
"4496909","1","5167695","","2010-12-21 06:56:07","0","1017","<p>I am trying to make a game. I try to use GridView but wonder how can I drag Item onTouchEvent().  I found an example <a href=""http://www.droidnova.com/playing-with-graphics-in-android-part-ii,160.html"" rel=""nofollow"">http://www.droidnova.com/playing-with-graphics-in-android-part-ii,160.html</a></p><p>It is a great example. I cropped my image in 12 small image bitmap. display them on screen randomly on specific position.By overriding the onTouchEvent() I got my requirement. Now I want to animate my image as the ""swap"" other image by animating. I have both images X,Y location. I am wondring if it can by done by some Animation class.So that I should not put effort for doing it manually. I know it is not a hard job. But I Animation class can do it more smoothly.So I have a ArrayOfImages(Bitmap) and I want to swap 2Images with animation. I am using a thread that update ""Canvas"" in background. Please help me..I more thing. How can I add Scroll view with surface holder?? Is it possible? Because I think when I try to drag my image , It my not drag and active scrollbar for this response? </p>","486139","","","","","2011-03-02 12:49:02","How to animate Bitmap on Surface view onDraw()?","<android><android-layout>","1","0","","",""
"4496943","1","4497013","","2010-12-21 07:03:36","0","271","<p>So Im getting the location fix from the phone and the problem comes up if it never finds the location or takes wayy too long.  below is the sample code from the loading screen</p><p>How could i set up a timer to stop the thread(load screen) once a certain amount of time has passed?</p><pre><code>lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,</code></pre><p>1000, 10f, this);</p><p>Handler handler = new Handler();  Runnable showWaitDialog = new Runnable() {   int wait = 0;   @Override   public void run() {    while (loc == null) {</p><pre><code>}// After receiving first GPS Fix dismiss the Progress Dialogdialog.dismiss();</code></pre><p>}  };</p><p>// Create a Dialog to let the User know that we're waiting for a GPS Fix  dialog = ProgressDialog.show(Weather.this, ""Please wait..."",    ""Retrieving GPS data ..."", true);</p><p>Thread t = new Thread(showWaitDialog);  t.start();</p>","549572","","","","","2010-12-21 07:16:12","Stopping thread that doesnt throw Exception Android","<android><multithreading><location>","1","0","","",""
"4496954","1","","","2010-12-21 07:05:01","1","105","<p>Is it possible to share a Java library (in the form of a jar file) between Android and MIDP projects? If that is the case, which Java version should I compile with? The library does not use any Android or MIDP specific stuff.</p>","549577","","","","","2010-12-21 07:07:03","Lib for Android and MIDP?","<java><android><midp>","1","0","","",""
"4497048","1","","","2010-12-21 07:22:30","0","5991","<p>i have three button which is arranged in table row .I gave background for the three button but it wraps the button .  </p>","538626","","","","","2012-07-25 12:15:17","how to give background color for button in android","<android><button><colors>","2","1","","",""
"4497051","1","","","2010-12-21 07:22:45","2","8007","<p>I am trying to figure out why my service is leaking from my application.</p><p>The official error I am getting is that the Service is not registered any longer.</p><p>Here's what works:I create a service which creates a listener, when the listener is triggered the service sets of an intent to start another activity. The new activity begins and does its thing.</p><p>The problem:When I get back to a main screen which gives me the option to turn off the service, I get the error which I stated previously which causes an IllegalArgumentException (when I try to unbind the service which is not registered).</p><p>Any help would be greatly appreciated. Here is the code for my service. It is all I've included because this seems to be where the problem is, but if you need any more let me know.</p><p>Thanks in advance, here is the code.</p><pre><code>import java.lang.ref.WeakReference;import java.util.List;import android.app.Service;import android.content.Context;import android.content.Intent;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;import android.os.Binder;import android.os.IBinder;import android.util.Log;import android.widget.Toast;public class AccelService extends Service{public static boolean listening = false;public boolean callMade = false;private static Sensor sensor;private static SensorManager ASensorManager;private SensorEventListener EventListener =     new SensorEventListener() {    private float x = 0;    private float y = 0;    private float z = 0;    private double max = 0;    private double force = 0;    public void onAccuracyChanged(Sensor sensor, int accuracy) {}    public void onSensorChanged(SensorEvent event)     {        x = event.values[0];        y = event.values[1];        z = event.values[2];        force = Math.sqrt(x*x+y*y+z*z);        Log.i(""LocalService"", ""Event happened: "" + force);        if (force &gt; Main.dropValue)        {            onDrop(force);        }    } };public void startListener(){    ASensorManager = (SensorManager) this.getSystemService(Context.SENSOR_SERVICE);    List&lt;Sensor&gt; sensors = ASensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);    if (sensors.size() &gt; 0)     {        sensor = sensors.get(0);        listening = ASensorManager.registerListener(accelEventListener, sensor, SensorManager.SENSOR_DELAY_GAME);    }}   public class AccelBinder&lt;S&gt; extends Binder {    private WeakReference&lt;S&gt; mService;    public AccelBinder (S service)    {        mService = new WeakReference&lt;S&gt;(service);    }    public S getService()    {        return mService.get();    }}public IBinder mBinder;@Overridepublic void onCreate(){    startListener();    mBinder = new AccelBinder&lt;AccelService&gt;(this);}public boolean isListening(){    return listening;}/*@Overridepublic void onStart(Intent intent, int startId){    Log.i(""LocalService"", ""Received start id "" + startId + "": "" + intent);}*/@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {    Log.i(""LocalService"", ""Received start id "" + startId + "": "" + intent);    return AccelService.START_STICKY;}@Overridepublic void onDestroy() {    if (listening)        stopListening();    mBinder = null;    super.onDestroy();}public void onDrop(double force){    if (!callMade)    {        Toast.makeText(this, ""Phone dropped: "" + force, 5000).show();        Intent i = new Intent(this,Next.class);        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        callMade = true;        //stopListening();        //onDestroy();        //SafetyNet.ctxt.unbindService(SafetyNet.AccelWatch);        this.startActivity(i);    }}public void stopListening(){           listening = false;    try {        if (ASensorManager != null &amp;&amp; accelEventListener != null)         {            ASensorManager.unregisterListener(accelEventListener);        }    } catch (Exception e) {}        }@Overridepublic IBinder onBind(Intent intent) {    return mBinder;}}</code></pre>","545825","","545825","","2010-12-21 07:37:43","2011-11-17 14:24:20","Android service connection leaked after starting new activity","<android><android-service>","1","0","2","",""
"4497076","1","","","2010-12-21 07:27:38","11","14749","<p>I have a few projects that were previously tested to be working in 1 PC.</p><p>I've since moved to another Windows XP PC, and I've setup the development tools on this XP system. I've downloaded and installed the following in order:<br>1. Eclipse Classic 3.6.1<br>2. JDK v6(jdk-6u23-windows-i586.exe)<br>3. Android SDK Tools rev8(installer_r08-windows.exe)<br>4. SDK Platform v2.3/2.2, Google APIs, Android API8, rev2, Google USB driver, rev4<br>5. ADT 8.0.1</p><p>I created a new empty project just to make sure things are working, and I seem to be able to get that new project to run on the emulator just fine. However, when I imported an existing project into the workspace, I get a bunch of errors, such as:""The import java.util cannot be resolved""""The import android cannot be resolved""</p><p>When I look at Project Properties->Java Build Path, it shows ""Unable to get system library for the project"" under ""Libraries"" and ""Order and Export"". What's wrong?</p><p>I've also tried copying and pasting the .java files and main.xml files from the imported project to the new project, and it runs correctly...but somehow the imported project doesn't.</p><p>Thanks.</p>","549605","","549605","","2010-12-21 07:52:52","2012-10-19 22:41:37","Unable to run imported project","<android><eclipse>","2","4","13","",""
"4497187","1","4497230","","2010-12-21 07:47:05","9","9506","<p>hi can you tell me how to disable a tab in the UI of android code.. (eclair code)</p>","507466","","","","","2013-03-21 13:06:24","how to disable a tab in android screen?","<android><gui><tabs>","1","1","2","",""
"4497234","1","4497275","","2010-12-21 07:56:01","2","5939","<p>is it possible to detect a speed of a car using GPS or accelerometer in android phone ?</p><p>can anyone give me the road map to implement this ?</p>","405383","","","","","2012-06-19 16:46:15","Detect a speed in android","<android><gps><accelerometer>","1","0","2","",""
"4497326","1","4501994","","2010-12-21 08:14:21","7","423","<p>I need your advice on the best way to implement a scrollable playing field in a simple game. The field consists of multiple rows, with 9 cells in each row. The rows can be dynamically added and removed during the course of the game. Each cell has a digit in it, and optionally several overlayed images, like selection, selector over, crossed out, etc. (see the pic below). The user should be able to click on individual cells of a row to select/deselect/cross the touched cells. At any point in the game there can be from 0 to 3000 cells (0 to about 333 rows). The field should scroll up and down smoothly.</p><p><img src=""http://i.stack.imgur.com/M9whp.png"" alt=""alt text""></p><p>I was thinking about having a ListView with its each row being a row on the field. That way i could add/remove rows dynamically during the game. However, how exactly should i implement a row: have one bitmap representing a row, and then when the user touches it -- get the coordinates of the touch area, and find out what cell was affected, and then act upon that. Is it possible to get the touch coordinates of a row in ListView? If not, should I place 9 dummy image placeholders in each row, and then act on user touching those? What about performance?</p><p>Or should I have one huge bitmap / canvas representing the entire field, place it inside a ScrollView and then calculate all the coordinates and update it as the user interacts with it? Is it going to be faster or slower than the ListView?</p><p>Any other solutions?  </p><p>I prefer it to be a ""regular"" app type game, not a loop-based game, as I don't think I really need to redraw 30 times a second.</p><p>I am pretty new to Android. Thank you for your suggestions.</p>","58038","","58038","","2010-12-21 08:47:12","2010-12-21 17:15:09","Design decisions / advice for a simple game on Android","<android>","2","0","1","",""
"4497390","1","","","2010-12-21 08:22:44","1","543","<p>I just created my own zooming image.The image has an onClick-Listener that starts a ScaleAnimation.</p><p>When I set fillAfter true the image will be small, but the size of the view didn't change. Therefor the area, which is clickable, is bigger than the image. I got a webview under the image which is never scrollable.</p><pre><code>imageHeight = view.getHeight();ratio = (float)smallImageWidth / view.getHeight();scaleAnimation = new ScaleAnimation(1, ratio, 1, ratio);scaleAnimation.setAnimationListener(this);view.startAnimation(scaleAnimation);</code></pre><p>My solution is that I resize the image in animationDidEnd but that results in a flicker.</p><pre><code>params.height = (int) (holder.imageView.getHeight() * values[Matrix.MSCALE_Y]);params.width = (int) (holder.imageView.getWidth() * values[Matrix.MSCALE_X]);</code></pre><p>Did anybody has a solution for this problem.</p><p>Thanks,C3000 </p>","311807","","","","","2010-12-21 08:22:44","ScaleAnimation scales not the size of the view","<android>","0","0","","",""
"4497510","1","4497655","","2010-12-21 08:42:01","1","2651","<p>Hi i want to display a list view in my application. Each row should contains a text and an image. i have used ArrayAdapter to display this, but how to insert an image after the text.Please help ?</p><pre><code>String lvr[]={""Android"",""iPhone"",""BlackBerry"",""AndroidPeople""};super.onCreate(savedInstanceState);setContentView(R.layout.main);list1 = (ListView) findViewById(R.id.cg_listview1);list1.setAdapter(new ArrayAdapter&lt;String&gt;(this,R.layout.alerts , lvr));</code></pre><p>Here alerts is my layout contains only textView.</p>","487604","","24054","","2010-12-21 08:51:41","2011-12-27 18:55:58","ArrayAdapter Help?","<android>","3","0","1","",""
"4497528","1","","","2010-12-21 08:44:01","1","904","<p>I am creating an app depend on parent child relationship, in which when child got a call from a particular no, it should changed in a conference call with parent automatically.Is it possible? </p><p>I read about a class <code>com.android.internal.telephony.gsm.GSMPhone</code><br>from which we can do this functionality. But I am not getting this class directly. So please help me to do this. I got the call from incoming call receiver.</p>","450601","","1748142","","2012-10-15 20:27:55","2013-04-11 10:01:45","how to start conference call programatically","<android>","1","2","2","",""
"4497551","1","","","2010-12-21 08:46:59","0","696","<p>Hi     I am trying to download apk file from https and http ,I am not able to proceed.What wrong i may be doing.When trying on https I have added .htaccess file on apache server containing the AddType for android.When tried on http it didnt worked.</p><p>Any help is appreciated.Thanks in advance.</p>","95877","","","","","2010-12-21 08:46:59","apk download issue","<java><android>","0","5","","",""
"4497642","1","4497692","","2010-12-21 09:01:06","0","923","<p>hey, I've developped a car dock application.I can add shortcuts in my activity but how can I add a system widget ?</p>","431652","","473070","","2010-12-21 09:21:24","2010-12-21 09:21:24","Add widget to activity","<android><widget>","1","0","","",""
"4497729","1","4497923","","2010-12-21 09:15:57","0","492","<p>HI, </p><p>I want to stretch my image to the layout width, how can i do this using xml layouts ?</p><pre><code>&lt;LinearLayout android:layout_width=""700dp""        android:layout_height=""310dp"" android:orientation=""vertical""&gt;        &lt;TextView android:id=""@+id/widget37"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:text=""Welcome Ramesh Kumar,""
            android:paddingTop=""5dp"" android:textSize=""10dp"" android:textColor=""#02284D""            android:gravity=""left""&gt;        &lt;/TextView&gt;        &lt;TextView android:id=""@+id/widget37"" android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" android:text=""Employee Id: 152490""            android:textSize=""10dp"" android:textColor=""#02284D"" android:gravity=""left""&gt;        &lt;/TextView&gt;        &lt;RelativeLayout android:layout_width=""fill_parent""            android:layout_height=""150dp"" android:layout_x=""10dp""&gt;            &lt;ImageView android:id=""@+id/bannert30""                android:layout_width=""fill_parent"" android:layout_height=""fill_parent""                android:src=""@drawable/front_screen"" android:scaleType=""fitEnd""                android:layout_alignParentLeft=""true""&gt;            &lt;/ImageView&gt;        &lt;/RelativeLayout&gt;</code></pre><p></p><p>This is my code please help ?</p>","487604","","","","","2010-12-21 09:45:53","How to strech the image to the width of the layout?","<android>","1","0","","",""
"4497757","1","","","2010-12-21 09:21:29","1","1281","<p>I need to call TTS service within subclass of BroadcastReceiver. When I am implement that class from OnInitListener, it gave run-time error. </p><p>Is there any other-way to implement TTS within BroadcastReceiver?</p><p>Thank You,</p><p>Sorry Code:</p><pre><code>public class TextApp extends BroadcastReceiver implements OnInitListener {private TextToSpeech tts;private String message = ""Hello"";@Overridepublic void onReceive(Context context, Intent intent) {    tts = new TextToSpeech(context, this);    message = ""Hello TTS"";}@Overridepublic void onInit(int status) {    if (status == TextToSpeech.SUCCESS)    {        tts.speak(message, TextToSpeech.QUEUE_FLUSH, null);    }}}</code></pre>","377438","","377438","","2010-12-21 09:57:19","2013-12-17 04:42:34","Android call TTS in BroadcastReceiver","<android><text-to-speech>","1","5","","",""
"4497773","1","","","2010-12-21 09:23:54","1","1203","<p>I am currently working on an Android App which has different service dimensions, such as "" service order"", ""route planning"", ""photo gallery"" and a central login. so far i implemented each ""screen"" (and by screen i mean actually the layout of a screen) as a seperate class, which loads a specific layout and handles all listeners and core functionalities such as calling webservices in a thread, receiving answers etc.I am not quite sure if this is the best way to implemnt mulitiple layout-screens.</p><p>The Android dev guideline proposes to use single activities for each ""screen layout"". However I doubt that this is the most effective way of doing things. Since i need information for each ""layout"" which are retrieved by the central login (here: a  user object). Since an activity (as far as i understand) is a seperate thread, the passing and retrieving of information seems not very practical.</p><p>I would like to get your oppinions/feedback on that and thanks for any hint or tip.</p><p>So far my structure looks like :</p><ul><li>Activity<ul><li>loads login layout (res/layout/login.xml with setlContentView)</li><li>depending on buttonclick other resources are loaded and initialized (means listeners are added etc.)</li></ul></li></ul><p>Greets Peter</p>","549709","","345717","","2010-12-21 10:06:22","2010-12-21 11:14:23","How to implement multiple screens within an App","<android><screens>","2","0","1","",""
"4497801","1","4497918","","2010-12-21 09:27:35","0","49","<p>I want to play the audio file in my application but the condition is that I want to play the selected sound file in background that means when the Timer CountDown(I have created one separate View for the Timer CountDown) gets over the audio file should play with the Same Timer CountDown View as it is.</p><p>The Timer CountDown Layout View should be maintained and the audio file should be played.</p><p>Can anyone please help me here because I am able to play the selected file finely, but All I want to do is just to play it with the Timer CountDown View maintained.</p>","422859","","1288","","2011-07-12 12:49:32","2011-07-12 12:49:32","keeping the one view on the front and doing another activity in Android","<android><view><timer><background>","1","0","","",""
"4497813","1","","","2010-12-21 09:28:58","1","695","<p>i want to sent data from one applications to another android application, i am new to this android so please help me...</p>","544356","","","","","2012-08-15 03:58:07","How to communicate two android applications?","<android>","4","0","","",""
"4497831","1","4497878","","2010-12-21 09:32:27","1","4603","<p>Pls help me to solve my issue.. In most of my application the Ui design is not compatible for all Android devices.. ie..all the widgets are not aligning in proper order in all phones.. i want to develop an application which should fit all phone size and resolution ( large phones, normal ones and in small ones) ..pls resolve this issue...</p><p>Thanks in advance...</p>","244540","","","","","2010-12-21 09:40:39","How to make an application compatible in all Android phones?","<android>","2","0","","",""
"4497940","1","4506325","","2010-12-21 09:47:15","1","521","<p>I want to do some image processing work like face detection or something during the camera is  under recording video mode .</p><p>now I can recording video and save file and transfer it to my server.but if I want to detect human face during recording,(I don't need any algorithm , I'll take it)how can I do this? use what kind of library ?I think I should use some method to get each frame of the recording video. but how ?</p><p>now, I use  ""MediaRecorder"" to capture the video .SurfaceView , SurfaceHolder  : to show the preview screen</p><p>is anyone can give me some suggestions ? thank you very much in advance ^^</p>","549556","","549556","","2010-12-22 03:33:21","2013-08-25 06:10:19","How could I do face detect during recording video mode","<java><android>","2","0","2","",""
"4497989","1","4498993","","2010-12-21 09:53:46","-3","421","<p>""x"" button is available or not in android,if no instead of that what button is used?</p>","538626","","","","","2010-12-21 11:57:40","if there is any close button is available in android?","<android><button>","1","7","","2010-12-22 00:37:19",""
"4498075","1","4498139","","2010-12-21 10:05:11","6","11297","<p>is there any way to turn on gps service through code?</p>","304961","","345717","","2010-12-21 10:11:14","2012-12-21 11:36:45","start Android gps service","<android>","3","0","8","",""
"4498140","1","","","2010-12-21 10:12:48","0","844","<p>Can any one tell me how to design virtual keyboard in android.</p>","549771","","","","","2010-12-21 10:54:43","Design key board in android","<android><keyboard>","2","0","","",""
"4498211","1","","","2010-12-21 10:20:18","0","771","<p>I am new to android game development but I have searched all forumns and cannot find how to simply create a circle or a circle.png image to travel vertically down the page at random intervals.</p><p>I have a game i am designing where I want random bullets to rain from top to the bottom of the potrait screen (That will then allow a hittest to occur on impact when the bullet hits a particular object)</p><p>1) I cannot make a simple image travel vertically down the screen and then repeat at random intervals2) I cannot even draw a simple circle on screen and animate it as in number1</p><p>Please help</p>","549780","","","","","2010-12-21 18:14:34","How to make a circle or bullet.png move vertical at random times down the screen","<android><movement>","1","0","0","",""
"4498302","1","","","2010-12-21 10:29:26","1","2766","<p>android still not fully support Arabic language even in last version 2.3 and maybe not in 3.0 also</p><p>any way i am programmer if i want to make it Arabic support how to start to make it fully support Arabic ?</p><p>because i found some the companies like Samsung and HTC add fully Arabic support to there devices this mean every body if he has a good knowledge with the system can add support.</p><p>can some body guide me how to start ?</p><p>Thank you</p>","549776","","","","","2013-05-31 10:04:57","Arabic languge in android","<android><arabic>","4","1","1","",""
"4498307","1","4498347","","2010-12-21 10:29:39","1","678","<p>hii want to restrict the special characters (!,@,#,$ etc.) from entering in to Edit Text field in android. how to do this please any body help..thnx.</p>","489762","","","","","2010-12-21 10:35:16","edit text in android","<android>","2","0","","",""
"4498315","1","5017279","","2010-12-21 10:30:34","6","4747","<p>I have a RingtonePreference that is used to select a ringtone that is broadcasted to a receiver used in an Alarm application.<br>I would like to display the title (the titles displayed in the list you see when you choose the ringtone) of the selected ringtone in the summary of the RingtonePrefernce.Somehow get the ID3 tag?Some ringtones would be mp3 but not all so this might not be a good idea? </p><p>What I do now is:</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());strRingtonePreference = prefs.getString(""RingtonePref"", ""DEFAULT_RINGTONE_URI"");</code></pre><p>This will make strRingtonePreference look like ""content://media/internal/audio/media/55"" which is not very informative to the user.</p><p>How can I do this?</p>","546429","","","","","2011-02-16 15:04:11","Get the Ringtone title from RingtonePreference","<android><id3><ringtone><preferenceactivity>","1","0","2","",""
"4498317","1","4498363","","2010-12-21 10:30:38","0","397","<p>I'm calling a web service, it is returning result in XML format. How do I convert returning XML into XSL and display that in web browser?</p>","1746300","","1900417","user357812","2013-02-01 21:14:37","2013-02-01 21:14:37","transform xml to xsl","<java><android><xml><xslt>","3","2","1","2013-02-01 23:43:18",""
"4498325","1","4498580","","2010-12-21 10:31:28","0","191","<p>I'm using Sqlite with android to develop and app which can be customizable (for the dev) in the future. I have created a database with the data which is then to be used to create the database for the application. So if any changes need to be made in the future or I write an app for somebody else in the future then all I have to do is change this original database. The idea behind this is the dev's database will set up all the UI and everything to do with the app.</p><p>I am stuck on what to do next I have the database I need in the app as the dev fully populated. My idea was to create another DBHelper class and within that reference the original DBHelper class and query within the new DB Class. So this is the second DBHelper class that i'm trying to create a database from a previous database:</p><pre><code>public class appDbHelper extends SQLiteOpenHelper {    private static final String DATABASE_NAME = ""library.db""; //database name       Cursor all, tables, options, ui_type;    SQLiteDatabase database;    public appDbHelper(Context context) {        super(context, DATABASE_NAME, null, 1);        DBHandler databaseHelper = new DBHandler(context);        database = databaseHelper.getReadableDatabase();        all = database.rawQuery(""SELECT * FROM config"", null);        tables = database.rawQuery(""SELECT * FROM table_names"", null);        options = database.rawQuery(""SELECT * FROM options"", null);        ui_type = database.rawQuery(""SELECT * FROM ui_type"", null);    }    @Override    public void onCreate(SQLiteDatabase db) {        for(int i=0; i&lt;tables.getCount(); i++){            tables.moveToPosition(i+1);            String sql = """";            for(int j = 0; i &lt; all.getCount(); j++){                if (all.moveToFirst()) {                    do{                        sql = "", "" + all.getString(2) + "" "" + all.getString(5).toUpperCase();                    }                    while (all.moveToNext());                }            }             Log.v(""DatabaseSQL"", sql);            database.execSQL( ""CREATE TABLE "" + tables.getString(1) + ""(_id INTEGER PRIMARY KEY AUTOINCREMENT""+sql+"");"");        }    }</code></pre><p>But I have a feeling this is not the way to go about what I need to do. Any help will be greatly appreciated.  </p>","400406","","","","","2010-12-21 11:04:45","Database to create a database","<android><database><sqlite>","1","2","","",""
"4498372","1","","","2010-12-21 10:37:18","0","599","<p>i know how to store the value from edittext to database.i have doubt in store the selected value from spinner to the database.i need the details </p>","","mukesh","21234","","2010-12-21 10:38:32","2010-12-21 10:38:32","how to store the selected value from spinner to the database","<android><database>","0","3","1","",""
"4498386","1","4500593","","2010-12-21 10:39:13","1","770","<p>Allow me to start with a little rant: While Background Data is enabled on my Galaxy S (Froyo) the battery completely drains in just a few hours! I really cant figure out why when both my exchange and gmail accounts are set to push. In any case, this leads to the need to turn BG Data off to conserve my battery and turn it on mainly for browsing the marketplace.I dont understand why the Market app cant simply turn the thing on when I open the app and not bother me about it and I really dont get why everytime I turn BG Data off I get a dialog telling me it will save me battery, I know that! thats why im turning if off!!! eurghhhh...</p><p>With that out of the way, I wanted to write a little widget that will allow me to turn Background Data on and off whenever I want without going through the menus and seeing that annoying dialog.Then I found out that this setting is one of the ""secured settings"" which apps cant change.</p><p>What I wanted to ask, is whether there is any way to change a secure setting in Android through code? Has anyone found a way around this? Or do we just have to live with it?</p><p>Thanks!</p>","107976","","","","","2010-12-21 15:01:14","changing background data state in Android","<android><security><settings><widget>","1","3","","",""
"4498566","1","","","2010-12-21 11:02:23","0","294","<p>I am busy editing the aptoide code from github into something that will be used for users to suggest apps and be able to browse and download suggested apps.</p><p>The only problem is that aptoide does not display any explaination of what the app is. </p><p>So I would like to know firstly, is it possible to code a if single-click event and a double-click event?</p><p>And secondly, how would I go about coding this? I would like the single-click to show the info about the app and the double click to download the app. So you'd click the suggested app, it'll show the info and then you click again to download.</p><p>I am using Eclipse with the ADT plugin.</p><p>I have tried to be as thorough as possible.</p><p>I am not very good with eclipse and android just yet, so you might have to spoon feed me here.</p>","549821","","","","","2010-12-21 11:13:08","How to display a text popup on single click and download on double click?","<android>","1","0","","",""
"4498583","1","","","2010-12-21 11:05:16","1","631","<p>I am working on Android Application using HTML5. I am using HTML5 Web SQL database for local data storage. I want this database to grow dynamically as it requires to be like that. I am using Phonegap as development framework to build this android application.</p>","145676","","145676","","2010-12-21 18:13:21","2010-12-21 18:13:21","How can i set up dynamic database size using HTML5 Web SQL Database?","<android><html5><phonegap><local-storage><offlineapps>","0","5","","",""
"4498664","1","4499816","","2010-12-21 11:19:32","5","6884","<p>I am making a IM client for android and I am working with databases for storing the contacts and other info's... In my app I have an activity and one service. I need to open three databases in the same time both on the service and on the activity.</p><p>I use three database because I want the databases to be managed more easily without having problems with the synchronization of writing in them. (as far as I know I need to write in the database synchronously because it may crush).</p><p>To manage the databases from the service and from the activity in the same time, I thought that a singleton or a static class of DatabaseHelper could help me...</p><p>So I have started to make a test by making two databasehelper global objects in the activity, each one opens a diferent database, after running the project i've noticed that the last opened database remains opened in both objects :((, why is this happening?</p><p>Can somebody sugest me how can i make this work?Thank you!</p><p>L.E.: after more tests, I made a Static object of databasehelper, open a service from which I take the database object from activity and in the same time i made two for statements, one in activity and one in service that run from 0 to 3000 and adds some values into the same database and then it reads the database.</p><p>After this run i noticed that the database is still in feet and running without errors. The strange thing is that the service for is running only after the activity for finishes the job. Why is that?Thank you!   </p>","449310","","449310","","2010-12-21 13:23:04","2010-12-21 13:36:38","Android multiple databases open","<sql><android><database><sqlite>","1","0","8","",""
"4498711","1","4555286","","2010-12-21 11:25:11","0","245","<p>how to make httpclient portable on different handset such as android and j2me</p>","528900","","","","","2010-12-29 15:19:47","how to make httpclient portable on different handset such as android and j2me","<android><java-me><httpclient>","1","0","","",""
"4498806","1","","","2010-12-21 11:35:16","3","739","<p>I created a simple preference class that shows an AutoCompleteTextView control and it displays properly but when i focus on the AutoCompleteTextView and start typing it brings up the keyboard but then immediately loses focus on the control. </p><p>Any idea why this loses focus? </p><p>Here's what i did to create the view. the inflated layout is just a basic linear layout with a title textview in it.</p><p>I could change it to a dialog preference instead I guess but it'd be smoother if it could be part of the base view.</p><pre><code>@Overrideprotected View onCreateView(ViewGroup parent) {    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);    LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.base_preference, null);    if (mHint != null) {        TextView hintView = (TextView) layout.findViewById(R.id.PreferenceHintTextView);        hintView.setText(mHint);    }    TextView titleView = (TextView) layout.findViewById(R.id.PreferenceTitleTextView);    titleView.setText(getTitle());    AutoCompleteTextView inputView = new AutoCompleteTextView(getContext());    inputView.setGravity(Gravity.FILL_HORIZONTAL);    ArrayAdapter&lt;CharSequence&gt; adapter = new ArrayAdapter&lt;CharSequence&gt;(getContext(),            R.layout.auto_complete_text_list_item,            getEntries());    inputView.setAdapter(adapter);    inputView.setThreshold(1);    inputView.setOnItemSelectedListener(this);    layout.addView(inputView);    return layout;}</code></pre><p>The list item is:</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""    android:textColor=""#000""&gt;&lt;/TextView&gt;</code></pre><p>could've probably been the standard list item and come out identical.</p>","362076","","362076","","2011-02-27 07:19:31","2013-09-21 09:12:34","Custom android preference type loses focus when typing","<android>","2","3","1","",""
"4498810","1","4499101","","2010-12-21 11:35:38","3","5420","<p>how i can do this? i have an object array id like to convert it to int array</p>","472537","","","","","2010-12-21 12:19:40","java convert object array to int array","<java><android>","2","1","0","",""
"4498818","1","","","2010-12-21 11:36:32","0","340","<p><strike> Basically I am making an app where there is a Ball On the screen and the size of the ball is determined by this code</p><p><code>private static final float sBallDiameter = 0.011f;</code></p><p>Is there any way i could create a menu system for the user , For example Like a pop up menu shown here </p><p><a href=""http://i.stack.imgur.com/WsHJX.png"" rel=""nofollow"">http://i.stack.imgur.com/WsHJX.png</a></p><p><br></p><p>That would change the size of the ball , For example where on the menu above it says Map , Traffic , Street View etc. - I could use Small, Medium, Large </p><p>Small, changing the <code>sBallDiameter</code> to something like 0.009fand large changing it to something like 0.018f </p><p>I hope you get what i mean , but if someone could assist me on creating this menu type thing it would be great ! </strike> </p><pre><code>             **UPDATE :**</code></pre><p>Here is the current Menu</p><pre><code>private static final int Small= 1;     public boolean onCreateOptionsMenu(Menu menu) {        ((Activity) menu).onCreateOptionsMenu(menu);        menu.add(0, Small, 0, ""Small"");       return true;    }     public boolean onOptionsItemSelected(MenuItem item) {            switch (item.getItemId()) {                case Small:                   // here i want it to change the size down to something like 0.009f                    return true;            }            return false;     }    public   float sBallDiameter = 0.013f;</code></pre><p>Basically - What i want to do is make it so when the case ""Small"" is selected - it decreases the size of ""sBallDiameter""</p><ul><li>I hope that clears things up a bit more -</li></ul>","549846","","549846","","2010-12-21 14:26:51","2010-12-21 14:37:51","Change a Public Float Value within a Menu [Android]","<java><javascript><android><menu>","2","2","1","",""
"4498851","1","4500557","","2010-12-21 11:41:38","0","179","<p><strong>I HAVE REEDITED THE QUESTION</strong></p><p>I am getting the apps installed in the Android phone with the code below. I put the info of the app in an instance of PInfo (one of my customized class).</p><p>Now I want to get one of them and open it passing a parameter, I have tried the following:</p><pre><code>Uri uri =Uri.parse(""THEURL"");Intent intent = getPackageManager().getLaunchIntentForPackage(((PInfo)apps.get(0)).apppackage);intent.setData(uri);startActivity(intent);</code></pre><p>This opens the app but <strong>how to pass the parameter?</strong> (The code above is not working) For example, a string.</p>","31791","","31791","","2010-12-21 12:46:40","2010-12-21 14:57:46","Android: how to start the app intalled in the phone using the packagename and pass it a parameter?","<android><activity>","2","0","1","",""
"4498863","1","4498945","","2010-12-21 11:42:22","0","163","<p>I navigate to the subsequent activities in my project and from one activity i want to come at the home screen...Please suggest the exact code for it.</p><p>Thanks</p>","517234","","35245","","2010-12-21 11:54:55","2010-12-21 11:54:55","Resuming Home Screen","<android><activity><android-intent>","2","0","","",""
"4498939","1","4713773","","2010-12-21 11:50:35","1","3501","<p>I want to develop speedometer in Android which will display the speed of the user. For that I have one image which has speed readings like 5, 10, 15 and so on. Now, I want to move the arrow on that. If the speed is 5 then that arrow should move from 0 to 5. Can someone help me out as how that can be done?</p>","261566","","","","","2014-01-20 11:17:45","Developing speedometer in Android?","<android><performance>","3","3","0","2014-01-21 02:31:56",""
"4499054","1","4500808","","2010-12-21 12:05:50","9","319","<p>For some reason my FPS jumps up considerably when I move my mouse around on the screen (on the emulator) while holding the left mouse button. Normally my game is very laggy, but if I touch the screen (and as long as I am moving the mouse around while touching) it goes perfectly smooth.</p><p>I have tried sleeping for 20ms in the onTouchEvent, but it doesn't appear to make any difference.</p><p>Here is the code I use in my onTouchEvent:</p><pre><code> // events when touching the screen    public boolean onTouchEvent(MotionEvent event)     {        int eventaction = event.getAction();         touchX=event.getX();        touchY=event.getY();        switch (eventaction)         {          case MotionEvent.ACTION_DOWN:          {          touch=true;         }         break;          case MotionEvent.ACTION_MOVE:         {         }         break;          case MotionEvent.ACTION_UP:          {          touch=false;         }              break;         }     /*try      {      AscentThread.sleep(20);     }      catch (InterruptedException e)      {      // TODO Auto-generated catch block      e.printStackTrace();     }*/        return true;     }</code></pre><p>In the logcat log, FPS is the current fps (average of the last 20 frames), touch is whether or not the screen is being touched (from onTouchEvent).</p><p>What on earth is going on? Has anyone else had this odd behaviour before?</p><p>Logcat log:</p><pre><code>12-21 19:43:26.154: INFO/myActivity(786): FPS: 31.686569159606414 Touch: false12-21 19:43:27.624: INFO/myActivity(786): FPS: 19.46310293212206 Touch: false12-21 19:43:29.104: INFO/myActivity(786): FPS: 18.801202175690467 Touch: false12-21 19:43:30.514: INFO/myActivity(786): FPS: 21.118295877408478 Touch: false12-21 19:43:31.985: INFO/myActivity(786): FPS: 19.117397812958878 Touch: false12-21 19:43:33.534: INFO/myActivity(786): FPS: 15.572571858239263 Touch: false12-21 19:43:34.934: INFO/myActivity(786): FPS: 20.584119901503506 Touch: false12-21 19:43:36.404: INFO/myActivity(786): FPS: 18.888025905454207 Touch: false12-21 19:43:37.814: INFO/myActivity(786): FPS: 22.35722329083629 Touch: false12-21 19:43:39.353: INFO/myActivity(786): FPS: 15.73604859775362 Touch: false12-21 19:43:40.763: INFO/myActivity(786): FPS: 20.912449882754633 Touch: false12-21 19:43:42.233: INFO/myActivity(786): FPS: 18.785278388997718 Touch: false12-21 19:43:43.634: INFO/myActivity(786): FPS: 20.1357397209596 Touch: false12-21 19:43:45.043: INFO/myActivity(786): FPS: 21.961138432007957 Touch: false12-21 19:43:46.453: INFO/myActivity(786): FPS: 22.167196852834273 Touch: false12-21 19:43:47.854: INFO/myActivity(786): FPS: 22.207318228024274 Touch: false12-21 19:43:49.264: INFO/myActivity(786): FPS: 22.36980559230175 Touch: false12-21 19:43:50.604: INFO/myActivity(786): FPS: 23.587638823252547 Touch: false12-21 19:43:52.073: INFO/myActivity(786): FPS: 19.233902040593076 Touch: false12-21 19:43:53.624: INFO/myActivity(786): FPS: 15.542190150440987 Touch: false12-21 19:43:55.034: INFO/myActivity(786): FPS: 20.82290063974675 Touch: false12-21 19:43:56.436: INFO/myActivity(786): FPS: 21.975282007207717 Touch: false12-21 19:43:57.914: INFO/myActivity(786): FPS: 18.786927284103687 Touch: false12-21 19:43:59.393: INFO/myActivity(786): FPS: 18.96879004217992 Touch: false12-21 19:44:00.625: INFO/myActivity(786): FPS: 28.367566618064878 Touch: false12-21 19:44:02.113: INFO/myActivity(786): FPS: 19.04441528684418 Touch: false12-21 19:44:03.585: INFO/myActivity(786): FPS: 18.807837511809065 Touch: false12-21 19:44:04.993: INFO/myActivity(786): FPS: 21.134330284993418 Touch: false12-21 19:44:06.275: INFO/myActivity(786): FPS: 27.209688764079907 Touch: false12-21 19:44:07.753: INFO/myActivity(786): FPS: 19.055894653261653 Touch: false12-21 19:44:09.163: INFO/myActivity(786): FPS: 22.05422794901088 Touch: false12-21 19:44:10.644: INFO/myActivity(786): FPS: 18.6956805300596 Touch: false12-21 19:44:12.124: INFO/myActivity(786): FPS: 17.434180581311054 Touch: false12-21 19:44:13.594: INFO/myActivity(786): FPS: 18.71932038510891 Touch: false12-21 19:44:14.504: INFO/myActivity(786): FPS: 40.94571503868066 Touch: true12-21 19:44:14.924: INFO/myActivity(786): FPS: 57.061200121138576 Touch: true12-21 19:44:15.364: INFO/myActivity(786): FPS: 62.54377946377936 Touch: true12-21 19:44:15.764: INFO/myActivity(786): FPS: 64.05005071818726 Touch: true12-21 19:44:16.384: INFO/myActivity(786): FPS: 50.912951172948155 Touch: true12-21 19:44:16.874: INFO/myActivity(786): FPS: 55.31242053078078 Touch: true12-21 19:44:17.364: INFO/myActivity(786): FPS: 59.31625410615102 Touch: true12-21 19:44:18.413: INFO/myActivity(786): FPS: 36.63504170925923 Touch: false12-21 19:44:19.885: INFO/myActivity(786): FPS: 18.099130467755923 Touch: false12-21 19:44:21.363: INFO/myActivity(786): FPS: 18.458978222946566 Touch: false12-21 19:44:22.683: INFO/myActivity(786): FPS: 25.582179409330823 Touch: true12-21 19:44:23.044: INFO/myActivity(786): FPS: 60.99865521942455 Touch: true12-21 19:44:23.403: INFO/myActivity(786): FPS: 74.17873975470984 Touch: true12-21 19:44:23.763: INFO/myActivity(786): FPS: 64.25663040460714 Touch: true12-21 19:44:24.113: INFO/myActivity(786): FPS: 62.47483457826921 Touch: true12-21 19:44:24.473: INFO/myActivity(786): FPS: 65.27969529547072 Touch: true12-21 19:44:24.825: INFO/myActivity(786): FPS: 67.84743115273311 Touch: true12-21 19:44:25.173: INFO/myActivity(786): FPS: 73.50854551357706 Touch: true12-21 19:44:25.523: INFO/myActivity(786): FPS: 70.46432534585368 Touch: true12-21 19:44:25.873: INFO/myActivity(786): FPS: 69.04076953445896 Touch: true</code></pre>","549859","","44729","","2010-12-21 17:50:22","2012-02-07 17:15:17","Why does my performance increase when touching the screen?","<java><android><opengl-es>","2","3","","",""
"4499071","1","4506017","","2010-12-21 12:09:17","0","858","<p>For some reason I can only call native functions from my main activity and not any custom views that I've created. Here is an example file (I followed a tutorial, but renamed the classes <a href=""http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/"" rel=""nofollow"">http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/</a>)</p><p>See the usage of the native function ""getNewString"".  </p><pre><code>package com.example.native;import android.app.Activity;import android.app.AlertDialog;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Canvas;import android.os.Bundle;import android.view.View;public class NativeTestActivity extends Activity{       static    {        System.loadLibrary(""nativeTest"");    }    private native String getNewString();    @Override public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);                this.setContentView(new BitmapView(this));        String hello = getNewString(); // This line works fine        new AlertDialog.Builder(this).setMessage(hello).show();    }}class BitmapView extends View{    static    {        System.loadLibrary(""nativeTest"");    }    private native String getNewString();    public BitmapView(Context context)    {        super(context);        String hello = getNewString(); // This line throws the UnsatisfiedLinkError        new AlertDialog.Builder(this.getContext()).setMessage(hello).show();    }}</code></pre><p>How can I call native functions in my custom views?</p><p>I've built the application as an Android 2.2 app. I'm running the application on my HTC Desire. I have the latest SDK (9) and latest NDK (r5).</p>","986","","","","","2010-12-22 03:49:18","Native functions throw UnsatisfiedLinkError in custom view, despite working in main activity","<java><c++><android><android-ndk><android-ndk-r5>","1","2","","",""
"4499201","1","4499293","","2010-12-21 12:25:14","16","26635","<p>im getting that exception when i do an insert on my SQLite database</p><p>the code that gives me the exception: <code>mDbHelper.createUser(""pablo"",""a"",""a"",""a"",""a"");</code></p><p>the code from mDbHelper (MyDbAdapter):</p><pre><code>private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY  (email))"";...public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""email"",email);        initialValues.put(""password"",password);        initialValues.put(""fullName"",fullName);        initialValues.put(""mobilePhone"",mobilePhone);        initialValues.put(""mobileOperatingSystem"",mobileOperatingSystem);        return mDb.insert(""user"", null, initialValues);    }</code></pre><p>the exception is created on the last line: <code>return mDb.insert(""user"", null, initialValues);</code></p>","479886","","","","","2010-12-21 12:34:49","SQLiteConstraintException: error code 19: constraint failed","<android><sqlite>","1","0","1","",""
"4499208","1","4499429","","2010-12-21 12:25:52","3","19091","<p>I have a list and i write a custom adapter for this. And I want to set some text color for this (e.g. Orange color code #F06D2F). I am presenting the code snippet for my <code>getView()</code> method.</p><pre><code>TextView text = new TextView(this.context);// text.setPadding(25, 5, 0, 0);text.setBackgroundResource(R.drawable.back_horizontal);// text.setClickable(false);// text.setFocusable(false);text.setEllipsize(TruncateAt.END);text.setSingleLine(true);// text.setTextColor(R.color.yellow);text.setTextColor(R.color.Orange);text.setGravity(Gravity.CENTER_VERTICAL);helvetica_normal = Typeface.createFromAsset(context.getAssets(), ""fonts/helvetica.ttf"");text.setTypeface(helvetica_normal);// text.setTextColor(R.color.yellow);text.setText(objects[position]);LayoutParams layoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);manager.addView(text, layoutParams);</code></pre><p>The problem is that i can't see the color set to orange. What went wrong?</p><p><strong>Note:</strong> The context is passed in constructor as well as objects (the string array)</p><p>Thanks for your help</p>","246942","","882453","","2011-12-26 15:33:17","2013-09-21 06:13:03","Android setting text view color from java code","<android><android-layout>","5","4","1","",""
"4499215","1","7472109","","2010-12-21 12:26:39","0","150","<p>I have a <code>mapview</code>, with <code>itemizedoverlay</code>, like on Android developers example. But now I have a problem. When the user presses 1 or 2 cm out of the 32x32 image of the item on the map, the dialog of the item opens. I don't want that. I want to reduce the ""press"" area of the item to the 32x32 proportions of the image of the item on the map</p><p>How can I do that?</p>","479886","","1167234","","2013-04-29 19:25:39","2013-04-29 19:25:39","It is possible to specify/reduce the onTap area of the items on a mapview?","<android><android-mapview>","2","0","","",""
"4499227","1","4563505","","2010-12-21 12:27:51","0","770","<p>I have added a SeekBar control to the preference by java code. It's got added and shown up in the preference. I also added a EditTextPreference and a checkbox to the preference. Now I dragged up the seekbar to some value. After this if I select checkbox the seekbar gets reset to initial value ( I meant to say the selected seekbar value not staying ...it is going back...).Do you please guide me what went wrong?</p>","540798","","21234","","2010-12-21 12:29:18","2010-12-30 14:44:47","SeekBar value gets Reset in preference automatically if I choose any other control in the preference","<android><seekbar>","2","2","1","",""
"4499241","1","","","2010-12-21 12:29:23","1","2137","<p>I'm using in my application OSMDroid. Everything works nice, but not everything is clear.</p><p>OpenStreetMapViewItemizedOverlay or (OpenStreetMapViewItemizedOverlayWithFocus) will be used.</p><p>If the user clicks on an item from this overlay, a small pop-up occurs with item's titleand description.</p><p>Does anybody know, how to implement click-listener if the user clickson that pop-up?</p><p>I haven't found any methods for that and I'll be very thankfull forany suggestion or link.</p>","408780","","213269","","2011-12-02 14:27:02","2011-12-14 11:14:22","OSMDroid and OpenStreetMapViewItemizedOverlay","<android><openstreetmap><osmdroid>","2","0","","",""
"4499420","1","4499476","","2010-12-21 12:50:59","2","12101","<p>i want that each time i start my app my SQLite database get's cleaned</p><p>for this, i need to make a method on my class MyDBAdapter.java</p><p>code examples are welcome, i have no idea how to do it</p><p>this is the dbadapter/helper i'm using:</p><pre><code>public class MyDbAdapter {    private static final String TAG = ""NotesDbAdapter"";    private DatabaseHelper mDbHelper;    private SQLiteDatabase mDb;    private static final String DATABASE_NAME = ""gpslocdb"";    private static final String PERMISSION_TABLE_CREATE = ""CREATE TABLE permission ( fk_email1 varchar, fk_email2 varchar, validated tinyint, hour1 time default '08:00:00', hour2 time default '20:00:00', date1 date, date2 date, weekend tinyint default '0', fk_type varchar, PRIMARY KEY  (fk_email1,fk_email2))"";    private static final String USER_TABLE_CREATE = ""CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY  (email))"";    private static final int DATABASE_VERSION = 2;    private final Context mCtx;    private static class DatabaseHelper extends SQLiteOpenHelper {        DatabaseHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(PERMISSION_TABLE_CREATE);            db.execSQL(USER_TABLE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            db.execSQL(""DROP TABLE IF EXISTS user"");            db.execSQL(""DROP TABLE IF EXISTS permission"");            onCreate(db);        }    }    /**     * Constructor - takes the context to allow the database to be     * opened/created     *      * @param ctx the Context within which to work     */    public MyDbAdapter(Context ctx) {        this.mCtx = ctx;    }    /**     * Open the database. If it cannot be opened, try to create a new     * instance of the database. If it cannot be created, throw an exception to     * signal the failure     *      * @return this (self reference, allowing this to be chained in an     *         initialization call)     * @throws SQLException if the database could be neither opened or created     */    public MyDbAdapter open() throws SQLException {        mDbHelper = new DatabaseHelper(mCtx);        mDb = mDbHelper.getWritableDatabase();        return this;    }    public void close() {        mDbHelper.close();    }    public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem)     {        ContentValues initialValues = new ContentValues();        initialValues.put(""email"",email);        initialValues.put(""password"",password);        initialValues.put(""fullName"",fullName);        initialValues.put(""mobilePhone"",mobilePhone);        initialValues.put(""mobileOperatingSystem"",mobileOperatingSystem);        return mDb.insert(""user"", null, initialValues);    }    public Cursor fetchAllUsers() {        return mDb.query(""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}, null, null, null, null, null);    }    public Cursor fetchUser(String email) throws SQLException {        Cursor mCursor = mDb.query(true, ""user"", new String[] {""email"", ""password"", ""fullName"", ""mobilePhone"", ""mobileOperatingSystem""}            , ""email"" + ""="" + email, null, null, null, null, null);        if (mCursor != null) {            mCursor.moveToFirst();        }        return mCursor;    }    public List&lt;Friend&gt; retrieveAllUsers()     {        List &lt;Friend&gt; friends=new ArrayList&lt;Friend&gt;();        Cursor result=fetchAllUsers();        if( result.moveToFirst() ){            do{                //note.getString(note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));                friends.add(new Friend(result.getString(result.getColumnIndexOrThrow(""email"")), """","""","""",""""));            }while( result.moveToNext() );        }        return friends;    }}</code></pre>","479886","","479886","","2010-12-21 17:09:10","2011-11-14 20:34:17","How can i clear a SQLite database each time i start my app","<android><sqlite>","3","3","2","",""
"4499427","1","","","2010-12-21 12:52:05","1","998","<p>Is it possible to flip images in gallery when i shift from left to right , or give an effect similar to iPhone. The simple scrolling images look very dull.</p>","335429","","","","","2010-12-21 13:01:13","Animate gallery view in android?","<android>","0","1","","2012-05-20 23:36:23",""
"4499433","1","4499768","","2010-12-21 12:52:20","5","11462","<p>I have defined a xml layout with the DatePicker widget as follows:</p><pre><code>     &lt;DatePicker         android:id=""@+id/SelectDate""        android:layout_marginTop=""10dp""          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:gravity=""center|center_horizontal|center_vertical""&gt;    &lt;/DatePicker&gt;</code></pre><p>and it is being displayed in <code>mm/dd/yyyy</code> format, as below:</p><p><img src=""http://i.stack.imgur.com/GExav.png"" alt=""alt text""></p><p>but <strong><code>how can I display the DatePicker widget in (dd/mm/yyyy) format,</code></strong> as below?</p><p><img src=""http://i.stack.imgur.com/gQ3EP.png"" alt=""alt text""></p>","379693","","469983","","2012-11-09 13:17:55","2013-10-24 19:47:20","DatePicker Widget Format","<android>","6","0","2","",""
"4499474","1","","","2010-12-21 12:58:14","0","1616","<p>I have and android emulator and microphone connected to my pc. I want to capture pcm pulses from microphone (i.e. record voice) and then send to udp socket. please anybody help me in source code at least for voice recording.</p>","549929","","","","","2012-01-23 15:53:00","audio recording in android","<android>","2","0","","",""
"4499659","1","4499770","","2010-12-21 13:20:16","1","455","<p>Is there a simple way to add an add to the top of an app by code, without using XML layouts? I can't find anything in the documentation.</p>","420617","","","","","2010-12-21 13:31:23","Android AdMob - Ad without XML","<android><admob>","1","0","","",""
"4499661","1","","","2010-12-21 13:20:27","2","1366","<p>In my application I want to be able to play streaming video (by way of RTSP protocol).I found open RTSP stream: <code>rtsp://red7blue.de/Primetime</code> and tried to play it. But my application is being terminated by signal SIGILL while trying to play video. I'm using libffmpeg.so and cause ofthe SIGILL signal is located in the code of this library.Look at what I got in logs:</p><pre><code>D/dalvikvm(  217): Trying to load lib /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68D/dalvikvm(  217): Added shared lib /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68D/dalvikvm(  217): No JNI_OnLoad found in /data/data/my.apps.package/lib/libffmpeg.so 0x43757d68D/dalvikvm(  217): Trying to load lib /data/data/my.apps.package/lib/libplayer-4.so 0x43757d68D/dalvikvm(  217): Added shared lib /data/data/my.apps.package/lib/libplayer-4.so 0x43757d68D/PlayerActivity(  217): FILE TO OPEN: rtsp://red7blue.de/PrimetimeD/dalvikvm(  217): +++ not scanning '/system/lib/libwebcore.so' for 'open' (wrong CL)D/dalvikvm(  217): +++ not scanning '/system/lib/libexif.so' for 'open' (wrong CL)D/dalvikvm(  217): +++ not scanning '/system/lib/libFFTEm.so' for 'open' (wrong CL)I/DEBUG   (   27): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   (   27): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'I/DEBUG   (   27): pid: 217, tid: 217  &gt;&gt;&gt; my.apps.package &lt;&lt;&lt;I/DEBUG   (   27): signal 4 (SIGILL), fault addr 81337fb0I/DEBUG   (   27):  r0 00000000  r1 00000000  r2 00000001  r3 00000001I/DEBUG   (   27):  r4 00000001  r5 00000000  r6 00000000  r7 00000000I/DEBUG   (   27):  r8 7fffffff  r9 00000000  10 00000000  fp 20000000I/DEBUG   (   27):  ip 00000000  sp bee438a0  lr 81337f68  pc 81337fb0  cpsr 80000010I/DEBUG   (   27):          #00  pc 00337fb0  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #01  pc 00338564  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #02  pc 003368b8  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #03  pc 00079f74  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #04  pc 0007a040  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #05  pc 002c5780  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #06  pc 002d6bc4  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #07  pc 002c67d0  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #08  pc 003110a0  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #09  pc 00317ac4  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #10  pc 003197bc  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #11  pc 00316d04  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #12  pc 00319448  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #13  pc 002c67d0  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #14  pc 002c6fe0  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):          #15  pc 00004a28  /data/data/my.apps.package/lib/libplayer-4.soI/DEBUG   (   27):          #16  pc 00007d08  /data/data/my.apps.package/lib/libplayer-4.soI/DEBUG   (   27):          #17  pc 0000e434  /system/lib/libdvm.soI/DEBUG   (   27):          #18  pc 00040b0e  /system/lib/libdvm.soI/DEBUG   (   27):          #19  pc 000432b6  /system/lib/libdvm.soI/DEBUG   (   27):          #20  pc 00013198  /system/lib/libdvm.soI/DEBUG   (   27):          #21  pc 00017be4  /system/lib/libdvm.soI/DEBUG   (   27):          #22  pc 0001762c  /system/lib/libdvm.soI/DEBUG   (   27):          #23  pc 000529a8  /system/lib/libdvm.soI/DEBUG   (   27):          #24  pc 00059eda  /system/lib/libdvm.soI/DEBUG   (   27):          #25  pc 00013198  /system/lib/libdvm.soI/DEBUG   (   27):          #26  pc 00017be4  /system/lib/libdvm.soI/DEBUG   (   27):          #27  pc 0001762c  /system/lib/libdvm.soI/DEBUG   (   27):          #28  pc 0005282c  /system/lib/libdvm.soI/DEBUG   (   27):          #29  pc 0003f790  /system/lib/libdvm.soI/DEBUG   (   27):          #30  pc 00031caa  /system/lib/libdvm.soI/DEBUG   (   27):          #31  pc 0002a804  /system/lib/libandroid_runtime.soI/DEBUG   (   27): stack:I/DEBUG   (   27):     bee43860  00000000  I/DEBUG   (   27):     bee43864  00000000  I/DEBUG   (   27):     bee43868  20000000  I/DEBUG   (   27):     bee4386c  8135cb94  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43870  20000000  I/DEBUG   (   27):     bee43874  00000000  I/DEBUG   (   27):     bee43878  00000000  I/DEBUG   (   27):     bee4387c  20000000  I/DEBUG   (   27):     bee43880  00000000  I/DEBUG   (   27):     bee43884  00000000  I/DEBUG   (   27):     bee43888  00000000  I/DEBUG   (   27):     bee4388c  8135ca5c  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43890  bee43898  [stack]I/DEBUG   (   27):     bee43894  81337f68  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43898  df002777  I/DEBUG   (   27):     bee4389c  e3a070ad  I/DEBUG   (   27): #00 bee438a0  00000000  I/DEBUG   (   27):     bee438a4  00000000  I/DEBUG   (   27):     bee438a8  00000000  I/DEBUG   (   27):     bee438ac  00000000  I/DEBUG   (   27):     bee438b0  3ff00000  I/DEBUG   (   27):     bee438b4  afc1d8f4  /system/lib/libm.soI/DEBUG   (   27):     bee438b8  afc1d868  /system/lib/libm.soI/DEBUG   (   27):     bee438bc  001f750c  [heap]I/DEBUG   (   27):     bee438c0  8146ab20  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee438c4  0000001c  I/DEBUG   (   27):     bee438c8  8b9e9309  I/DEBUG   (   27):     bee438cc  8b9e9309  I/DEBUG   (   27):     bee438d0  3fa56e5f  I/DEBUG   (   27):     bee438d4  afc0e3bc  /system/lib/libm.soI/DEBUG   (   27):     bee438d8  2d87a4ea  I/DEBUG   (   27):     bee438dc  00000000  I/DEBUG   (   27):     bee438e0  00000000  I/DEBUG   (   27):     bee438e4  bee43928  [stack]I/DEBUG   (   27):     bee438e8  bee4392c  [stack]I/DEBUG   (   27):     bee438ec  ffffffbe  I/DEBUG   (   27):     bee438f0  00000000  I/DEBUG   (   27):     bee438f4  bee43928  [stack]I/DEBUG   (   27):     bee438f8  bee4392c  [stack]I/DEBUG   (   27):     bee438fc  bee43968  [stack]I/DEBUG   (   27):     bee43900  00000000  I/DEBUG   (   27):     bee43904  7fffffff  I/DEBUG   (   27):     bee43908  00000000  I/DEBUG   (   27):     bee4390c  00000000  I/DEBUG   (   27):     bee43910  20000000  I/DEBUG   (   27):     bee43914  81338568  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27): #01 bee43918  00000001  I/DEBUG   (   27):     bee4391c  00000000  I/DEBUG   (   27):     bee43920  7fffffff  I/DEBUG   (   27):     bee43924  00000000  I/DEBUG   (   27):     bee43928  8145fe10  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee4392c  81336698  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43930  00000001  I/DEBUG   (   27):     bee43934  8146ab50  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43938  001f74f0  [heap]I/DEBUG   (   27):     bee4393c  00000000  I/DEBUG   (   27):     bee43940  00000000  I/DEBUG   (   27):     bee43944  bee43968  [stack]I/DEBUG   (   27):     bee43948  7fffffff  I/DEBUG   (   27):     bee4394c  8145fe34  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43950  8145fe10  /data/data/my.apps.package/lib/libffmpeg.soI/DEBUG   (   27):     bee43954  813368bc  /data/data/my.apps.package/lib/libffmpeg.soD/Zygote  (   29): Process 217 terminated by signal (4)I/ActivityManager(   65): Process my.apps.package (pid 217) has died.I/WindowManager(   65): WIN DEATH: Window{43846460 my.apps.package/my.apps.package.MainActivity paused=false}</code></pre><p>As I guess one of the causes of SIGILL signal may be the try to perform privileged instruction. RTSP is a network protocol. It's meaning that ffmpeg.so tries to access media stream using network. Maybe some special permissions should be specified for that? In my app I have the only explicit permission - <code>android.permission.INTERNET</code> Should I specify something else?</p>","544820","","544820","","2010-12-22 16:06:38","2011-07-12 12:40:36","SIGILL signal is sent to my Android app","<android><ffmpeg><rtsp>","2","0","0","",""
"4499803","1","4881366","","2010-12-21 13:35:08","3","3666","<p>Has anyone been successful in using 64-bit Eclipse for Android 2.3 dev on 64-bit Windows 7?</p><p>Please answer positively <strong>only if</strong>, when you invoke the emulator via Eclipse's Run (Ctrl+F11), your app-to-be-debugged's APK is installed <strong>automatically</strong> onto the Android emulator <strong><em>and</em></strong> you are running this same exact configuration:</p><ol><li>Windows 7 Ultimate 64-bit.</li><li>JDK 64-bit (jdk-6u23-windows-x64.exe installed.)</li><li>JDK 32-bit (jdk-6u23-windows-i586.exe installed.)</li><li>Eclipse Classic 3.6 <strong>64-bit</strong> (eclipse-SDK-3.6.1-win32-x86_64.zip)</li><li>Android <strong>2.3</strong> SDK Starter Package</li></ol><p>If you are able to <em>fully</em> use 64-bit Eclipse for Android 2.3 dev on 64-bit Windows 7, please describe the steps you performed to make this happen.</p><p>As of now, the following steps did <strong>NOT</strong> work for me:</p><ol><li>install the 64-bit JDK</li><li>install the 32-bit JDK</li><li>unzip android-sdk_r08-windows.zip toC:\android-sdk-windows</li><li>append C:\android-sdk-windows\toolsto %PATH% in System env vars.</li><li>Run C:\android-sdk-windows\tools>android.bat</li><li>Install ADT Plugin via Eclipse</li><li>Create ""Android 2.3 - API Level 9"" virtual device via Eclipse</li><li>Window > Preferences > Java > Installed JREs: [Search...]</li></ol>","418055","","","","","2012-10-03 18:26:37","Has anyone been successful in using 64-bit Eclipse for Android 2.3 dev on 64-bit Windows 7?","<android><eclipse><windows-7><64bit><jdk>","6","6","","",""
"4499900","1","4513722","","2010-12-21 13:47:31","2","809","<p>I'm using following code to fill a custom ListPreference dialog. Since the fill procedure takes a lot of time i want to show a progress dialog during the fill procedure.</p><p>My problem is that filler.execute() does not block onPrepareDialogBuilder and functions goes till the end before values are filled causing an exception... Any idea?</p><pre><code>@Overrideprotected void onPrepareDialogBuilder(Builder builder) {            // Load data    if (this.getEntries()==null) {        FillerTask filler = new FillerTask();        filler.execute();    }       Log.d(TAG, ""Filler finished"");    super.onPrepareDialogBuilder(builder);}</code></pre><p>Here is Filltertask code, basically he looks for every activity with a MAIN Intent filling a list:</p><pre><code>private class FillerTask extends AsyncTask&lt;Void, Void, String[][]&gt; {    private ProgressDialog dialog;    @Override    protected void onPreExecute() {        Log.d(TAG, ""Dismiss dialog"");        dialog = ProgressDialog.show(MyListPreference.this.getContext(), """", ""Doing stuff..."", true);    }    @Override    protected String[][] doInBackground(Void... params) {        return fill();    }    public String[][] fill() {    Log.d(TAG, ""Fill started"");        CREATE LISTS...        // Done        Log.d(TAG, ""Fill done"");        String[][] result = new String[][] {entryNames, entryValues};        return result;    }    @Override    protected void onPostExecute(String[][] result) {        Log.d(TAG, ""Post execute"");        MyListPreference.this.setEntries(result[0]);        MyListPreference.this.setEntryValues(result[1]);        dialog.dismiss();    } }  </code></pre>","376579","","","","","2012-03-21 08:26:01","AsyncTask not locking main thread?","<android><multithreading><preferences><android-asynctask><listpreference>","3","0","","",""
"4499915","1","4931062","","2010-12-21 13:48:48","0","2220","<p>Is it possible to stop wifi scan started with wifiMgr.startScan() ? I browse some posts and read about using thread to give intervals between each result delivery. But if I want to completely stop the process, how can I achieve it?</p>","404437","","","","","2012-05-23 02:17:12","how to stop wifi scan on android?","<android><wifi><scan>","2","2","1","",""
"4499928","1","4500248","","2010-12-21 13:50:00","2","611","<p>how can i load a file into mediaplayer while showing a splash screen in the foregroung ,i mean after splash sceen i want to display video on the screen directly without wait </p>","413770","","","","","2012-07-02 12:01:18","android mediaplayer bacgroung loading","<android>","1","0","","",""
"4500003","1","4500052","","2010-12-21 13:58:52","0","803","<p>I create the Pie Chart and Bar Chart by using Canvas.In that chart if i click or touch any of the bar i need to show the value of the Bar.How to do this ??</p>","548435","","","","","2010-12-21 14:03:18","Click Event in Canvas?","<android>","1","0","1","",""
"4500013","1","","","2010-12-21 13:59:27","3","1031","<p>I've written an application that handles incoming SMS. Everything works great and also marking the processed SMS works. The only thing that doesn't seem to care is the tray notification. It still sits there in the tray and claims there is an unread message (just like the standard SMS app with its little green ""1"" does). I checked that the message actually is marked as read using the method used in the smspopup sample application, which seems to have the same problem. If I just say ""close"" on the received message, the tray icon is not updated. Do I miss something here? Do I have to send something like a notification to the tray that it should check again?</p>","550006","","","","","2011-01-03 12:00:06","Unread SMS tray notification stays after marking SMS as read","<android><sms>","1","1","","",""
"4500119","1","","","2010-12-21 14:09:50","-7","1488","<p><a href=""http://pastebin.com/Cz8gbxs8"" rel=""nofollow"">http://pastebin.com/Cz8gbxs8</a></p><p>is there a way to convert this php code, to a java code?</p><p>Thanks, anyway</p>","472537","","","","","2010-12-21 14:21:12","Convert php code to Java/android","<java><php><android>","3","2","","2010-12-21 14:48:21",""
"4500297","1","4500326","","2010-12-21 14:26:59","2","3050","<p>I would like to know what exact advantage is gained in doing Android XML Parsing using DOM Parser and SAX Parser?<br>Is it like DOm parser is advantageous than SAX Parser or vice-versa?  </p><p>Please clarify.</p><p>Thanks,<br>Sen</p>","449378","","","","","2010-12-21 14:40:46","Difference in doing Android XML Parsing using DOM Parser and SAX Parser","<android><saxparser><domparser>","1","0","3","",""
"4500317","1","","","2010-12-21 14:29:34","0","862","<p>I am trying to implement <code>Webview</code> with scroll view to detect gesture detector from swipe left to right and right to left how to do? can anybody give example</p>","426344","","244296","","2010-12-21 17:10:11","2010-12-21 17:10:11","Gesture detector with scroll view in android","<android>","1","0","","",""
"4500337","1","4500454","","2010-12-21 14:31:36","3","347","<p>The following situation will surely be familiar to any Android developer using Eclipse and ADT.</p><p>I'm tired of this endless cycle of switching Build Automatically on and off, running Clean, building and running. I'm constantly doing all of these operations when I'm fine tuning UI (i.e., editing XML files and needing to see the results live), and any time I save, an Eclipse window telling me I have these pending operations shows up. When that happens, I turn off Build Automatically. I do my alterations and then run. Sometimes Eclipse decides the changes in the XML file weren't enough, and it won't reinstall the app in the emulator or device, so I force a build and install.</p><p>All of this is just wasted time. I've already done an AppleScript to build &amp; run my app into all the emulators and devices I have connected at once, described in <a href=""http://stackoverflow.com/questions/3968926/in-eclipse-any-way-to-start-application-in-more-than-one-emulator-at-the-same-ti"">this SO question</a>, but my workflow could be much improved if I found a way to save and build silently and fast. </p><p>Does anyone have any tips or alternatives?</p>","169786","","","","","2010-12-21 16:03:12","Alternatives to compiling in Eclipse?","<android><eclipse>","2","0","2","",""
"4500354","1","","","2010-12-21 14:35:40","2","2209","<p>In my application I have overridden the <code>onKeyDown()</code> and <code>onKeyUp()</code> functions in order to capture volume keys events. I use such events in order to control my application volume. I use the music stream to play my sounds. When detecting an event like this I also show a custom toast (similar to the one shown by Android). The problems I'm facing with this take are: </p><ol><li>Android always plays a sound on volume keys events </li><li>That sound is played always at the same intensity.</li></ol><p>What I'd like is to control the intensity at which the default sound is played (also the stream on which is played) in the following way: a louder sound for a higher volume and a lower sound for a low volume, if this is possible.Or a way to disable playing that default sound and play my custom sound at the intensity I just set.</p>","304866","","491044","","2012-01-30 10:42:05","2012-01-30 10:42:05","Control volume keys","<android><android-audiomanager>","2","0","1","",""
"4500399","1","4519994","","2010-12-21 14:40:48","1","1125","<p>I got a row xml for my ListView with chronometer</p><hr><pre><code>&lt;LinearLayout android:layout_width=""fill_parent""android:id=""@+id/layout_orders_list_row_ll_Timer"" android:focusable=""false""   android:layout_height=""wrap_content"" android:gravity=""center_horizontal|right""android:layout_gravity=""center""&gt;&lt;Chronometer android:text=""@+id/Chronometer01""    android:layout_height=""wrap_content"" android:layout_width=""wrap_content""    android:id=""@+id/layout_orders_list_row_chr_Timer""    android:focusable=""false"" android:focusableInTouchMode=""false""    android:layout_gravity=""center"" android:enabled=""true""&gt;&lt;/Chronometer&gt;&lt;Button android:background=""@drawable/check"" android:layout_height=""wrap_content""     android:id=""@+id/layout_orders_list_row_bt_Done""     android:layout_width=""wrap_content"" android:focusable=""false""                   android:onClick=""OnRowButtonClick""&gt;&lt;/Button&gt;</code></pre><p></p><hr><p>and I want to start my chronometer for each row.I'm getting data from database and fill the adapter.After that I'm connecting to each chronometer and trying to calculate it.But it doesn't work.</p><pre><code>    SimpleAdapter simpleAdapter = new SimpleAdapter(this, fillMaps,            R.layout.orders_list_row, from, to);    listView.setAdapter(simpleAdapter);       for (int i = 0; i &lt; simpleAdapter.getCount(); i++) {        LinearLayout vwParentRow = (LinearLayout) simpleAdapter.getView(i,                null, null);        LinearLayout ChildTop = (LinearLayout) vwParentRow.getChildAt(0);        LinearLayout ChildTop2 = (LinearLayout) ChildTop.getChildAt(1);        final Chronometer chrono = (Chronometer) ChildTop2.getChildAt(0);        chrono.setText(""00:00:00"");        chrono.setBase(SystemClock.elapsedRealtime());        chrono.start();        chrono.setOnChronometerTickListener(new OnChronometerTickListener() {            public void onChronometerTick(Chronometer arg0) {                // TODO Auto-generated method stub                    long minutes = ((elapsedTime - chrono.getBase()) / 1000) / 60;                    long seconds = ((elapsedTime - chrono.getBase()) / 1000) % 60;                    currentTime = minutes + "":"" + seconds;                    arg0.setText(currentTime);                    elapsedTime = elapsedTime + 1000;            }        });    }    listView.invalidate();</code></pre><hr><p><strong>What I'm doing wrong? Maybe there is <em>other solution</em> how to start chronometer in each row?</strong></p>","215381","","215381","","2010-12-21 22:35:32","2013-11-07 14:04:52","Android: Chronometer in ListView Row?","<java><android><listview><chronometer>","1","0","1","",""
"4500442","1","4501279","","2010-12-21 14:45:00","1","790","<p>I am using <code>ACTION_DATE_CHANGED</code> in my Broadcast Receiver,and <code>android.intent.action.DATE_CHANGED</code>in <code>&lt;receiver&gt;...&lt;/receiver&gt;</code> in my manifest file.I got result,when will user set device's date  manually using application->Date &amp; Time setting->set date.But I don't want it,I want to receive,when device will change date automatically ie depending upon device's  time.is it possible?</p><p>Thanks All</p>","500595","","","","","2010-12-21 16:07:29","how to receive broadcastrecevier, when device's date automaticaly change?","<android>","1","0","","",""
"4500594","1","4502064","","2010-12-21 15:01:15","2","2523","<p>Can anybody help me set the graphical layout option in eclipse to the dimensions of the Galaxy tab (1024 x 600). I have the emulator set up perfectly its just designing the layout of everything using the .xml and the graphical layout version.</p><p>I find it helps me visualize it better when what I design is what I see in the emulator. At the moment my only solution is trial and error.</p>","400406","","","","","2010-12-24 08:45:45","Samsung Galaxy Tab layout in graphical layout xml","<android><eclipse><galaxy>","2","2","1","",""
"4500637","1","4501059","","2010-12-21 15:05:20","2","1103","<p>I want an AlertDialog to show a list of countries selected from database with a cursor, it selects id and country name, I have the following code but I don't know how to get the selected item:</p><pre><code>AlertDialog.Builder ab=new AlertDialog.Builder(this);ab.setTitle(R.string.msg_title_Pais_Resid);Locale locale = Locale.getDefault();final Cursor items  = DaoProvider.getListaPaisesCursor(this, (locale.getLanguage()).toUpperCase());    ab.setCursor(items,new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            //Here: get the selected item object (or id)        }    }, Internacionalizacion.colInternacionalizacionTraduccion)</code></pre><p>Thanks</p>","366253","","","","","2010-12-21 15:47:23","Using AlertBuilder with cursors","<android><cursor><alertdialog>","1","0","","",""
"4500894","1","4502061","","2010-12-21 15:30:26","1","427","<p>I have two threads that need to send TCP messages using the same already stablished connection. I have an object lets say tcpSender that I would like to use from booth threads. How can I design my software in order I would not have concurrency problems and lost messages? </p><p>Thanks! </p>","217527","","","","","2010-12-21 17:47:03","send TCP messages from two different threads","<android><design-patterns><tcp>","3","0","","",""
"4500948","1","","","2010-12-21 15:34:48","1","132","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/4489138/force-close-the-application"">force close the application </a><br>  <a href=""http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon"">Quitting an application - is that frowned upon?</a>  </p></blockquote><p>Hi,I have a lot of Activities and i want to exit the application - to close all activities and the services at once. i tried to  use this Process.killProcess( Process.myPid()) but that doesn't work , any tips?</p>","508197","","","","","2010-12-21 15:47:22","can't Exit from my apk","<android>","1","1","","2010-12-21 16:56:35",""
"4501051","1","4501132","","2010-12-21 15:46:59","1","2276","<p>What are mobile phones supporting Java Android?</p><p>Is there any Nokia phone supporting this technology?</p><p>What should the mobile contain (a framework, a plugin.. etc) if we want to deploy a Java Android Application?</p>","550937","","127880","","2013-02-17 18:10:42","2013-02-17 18:10:42","Mobile phones supporting Java Android?","<java><android><nokia>","3","0","","",""
"4501163","1","9801779","","2010-12-21 15:56:55","2","982","<p>Are there any industrial handheld terminals (e.g. from honeywell or datalogic) which are shipped with Android?</p><p>It seems to me, that all of them are Windows CE/Mobile only, which sucks (beginning at the browser).</p><p>We've created a webbased-App for the DataLogic Memor, but the industrial browser on it doesn't even come close to a Webkit-Browser.</p>","456160","","131433","","2012-04-19 00:47:49","2012-12-05 15:05:24","Industrial Handheld Terminals with Android?","<android><webkit><windows-mobile>","3","0","0","2012-12-06 05:21:56",""
"4501297","1","","","2010-12-21 16:09:13","0","460","<p>i have searched all over the place and havent been able to find the answer.here is the code :</p><pre><code>package hardy.scl;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;import android.widget.Toast;public class zody extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final Button b = (Button)this.findViewById(R.id.Button01);       final ImageView iv=(ImageView)this.findViewById(R.id.ImageView01);        final EditText et = (EditText)this.findViewById(R.id.EditText01);        final EditText et2 = (EditText)this.findViewById(R.id.EditText02);        b.setOnClickListener(new OnClickListener() {             public void onClick(View v) {int dd = Integer.parseInt(et.getText().toString());int mm = Integer.parseInt(et2.getText().toString());          if (dd&gt;=21&amp;&amp;mm==1||dd&lt;=19&amp;&amp;mm==2){                    iv.setImageResource(R.drawable.aq);          }            else if (dd&gt;=20&amp;&amp;mm==2||dd&lt;=20&amp;&amp;mm==3) {                iv.setImageResource(R.drawable.pi);            }            else if (dd&gt;=21&amp;&amp;mm==3||dd&lt;=20&amp;&amp;mm==4) {                iv.setImageResource(R.drawable.aries);            }            else if (dd&gt;=21&amp;&amp;mm==4||dd&lt;=21&amp;&amp;mm==5) {                iv.setImageResource(R.drawable.tau);            }            else if (dd&gt;=22&amp;&amp;mm==5||dd&lt;=21&amp;&amp;mm==6) {                iv.setImageResource(R.drawable.gem);            }            else if (dd&gt;=22&amp;&amp;mm==6||dd&lt;=22&amp;&amp;mm==7) {                iv.setImageResource(R.drawable.can);            }            else if (dd&gt;=23&amp;&amp;mm==7||dd&lt;=21&amp;&amp;mm==8) {               iv.setImageResource(R.drawable.leo);            }            else if (dd&gt;=22&amp;&amp;mm==8||dd&lt;=23&amp;&amp;mm==9) {                iv.setImageResource(R.drawable.virg);            }            else if (dd&gt;=24&amp;&amp;mm==9||dd&lt;=23&amp;&amp;mm==10) {                iv.setImageResource(R.drawable.lib);            }            else if (dd&gt;=24&amp;&amp;mm==10||dd&lt;=22&amp;&amp;mm==11) {                iv.setImageResource(R.drawable.sco);            }            else if (dd&gt;=23&amp;&amp;mm==11||dd&lt;=22&amp;&amp;mm==12) {                iv.setImageResource(R.drawable.sag);            }            else if (dd&gt;=23&amp;&amp;mm==12||dd&lt;=20&amp;&amp;mm==1) {                iv.setImageResource(R.drawable.cap);            }            if ((et.getText().length()&lt;1)|| (et2.getText().length()&lt;1)|| (et.getText().length()&lt;1)&amp;&amp; (et2.getText().length()&lt;1)){                Toast.makeText(getApplicationContext(), ""Oh! invisible D.O.B..nice!"", Toast.LENGTH_LONG).show();}            else{                Toast.makeText(getApplicationContext(), ""ERRrr! Wrong D.O.B :/"", Toast.LENGTH_LONG).show(); }            }});}}</code></pre><p>what is it that im doin wrong that is causing the app to force close whenever i click the button if both or any of the edittexts are empty?</p>","550181","","180538","","2010-12-21 16:13:39","2011-08-20 22:49:16","android app force closing due to empty EditText","<android>","3","2","","",""
"4501335","1","","","2010-12-21 16:12:46","0","1516","<p>I want to do something when the user clicks on the LinearLayout group.</p>","508377","","811","","2010-12-21 20:30:35","2010-12-21 20:30:35","Can I add a clicklistener to LinearLayout in Android?","<android><event-handling><android-linearlayout>","1","4","","",""
"4501354","1","4502083","","2010-12-21 16:14:40","0","269","<p>I'm new to Android development and have some question regarding overlays in googlemaps API.</p><p>What I'm trying to achieve is a class that adds one and only one marker at the position where you tap, I want this overlay to be active only when a button ""add marker"" is pressed. I've solved this problem in two different ways and I'm not completely satisfied with either one of them. </p><p>My solutions is as follows:</p><p>first attempt:A bool that turns true when ""add button"" is pressed, then you are able to put a marker on the map and the boolean value turns false.</p><p>This feels quite ugly and the overlay is always active and listens to every tap on the display, maybe this is't that dumb as I believe.</p><p>second attempt:Temporary creates the overlay that creates the marker and then immediately removes it self.</p><p>This solution I just can't find efficient... Creating new overlay before creating a new marker.</p><p>Is there any way to just activate the overlay when ""add button"" is pressed? Maybe there is some other way to do this?</p><p>Thanks in advanced//christofferp</p>","550139","","","","","2010-12-21 17:23:55","Android: google maps deactivate overlays","<android><google-maps><google-maps-markers><itemizedoverlay><overlays>","1","0","","",""
"4501549","1","","","2010-12-21 16:33:35","4","1123","<p>Is possible to make the app use different drawables after choosing a theme in Android?</p><p><strong>An explanatory example:</strong></p><p>i have a layout which background uses a reference to: ""@drawable/backgroundsolid"", that is image backgroundsolid.png in <strong>res/drawable-mdpi</strong>.</p><p>I want that, if the user choose ""Glass"" theme, the reference stays to ""@drawable/backgroundsolid"" but the resources folder is changed to <strong>res/drawable-glass</strong>, which contains a different backgroundsolid.png image.</p><p>Is it possible to set this programmatically? Thanks a lot!</p>","527317","","","","","2012-02-08 12:56:08","Android: Use different drawables after choosing a different theme, keeping the same references","<android><layout><themes>","1","0","2","",""
"4501788","1","4501982","","2010-12-21 16:54:07","1","210","<p>im making an android application which requires a user to register using a form , the form must take in a username , email and a  users chosen image. The image can be obtained either by using the camera or by browsing a directory. My question is what would be the best way to implement this on a form . For the email and username I am using a the EditText class , I was planning on using a spinner for the choice of image selection but I am unsure how I would return the image to the form. I know I can start activity for result but I want to visually display the chosen image in the form , either using a path or a thumbnail or something ? </p><p>any ideas on the best way to go about this ? </p>","506892","","","","","2010-12-21 17:14:08","Return image to form and display chosen image","<android><image><forms>","1","0","0","",""
"4501840","1","4502232","","2010-12-21 16:59:03","2","7115","<p>Simple question, perhaps frustratingly-complex-but-hopefully-simple answer?</p><p>What is the ""Best Practice"" for getting the actual height of an element that has its size set to FILL_PARENT?</p>","285417","","244296","","2010-12-21 17:06:55","2010-12-21 17:40:39","Get Actual Height of View","<android><size><android-layout>","1","2","3","",""
"4502000","1","","","2010-12-21 17:15:40","0","1451","<p>I have an android application (in dev), which    while starting reads a data file from the external server (say www.google.com/data.js). It checks with my SQL lite database and if the versions doesn;t match, then it updates the SQLITE. The problem now is, in the emulator, the data.js file gets cached up. Only when i uninstall the application it actually loads the new data. How do i avoid caching the JS file?</p>","490601","","","","","2011-06-13 08:39:15","Android using PhoneGap Cache the data file","<android><phonegap><cache-control>","2","0","","",""
"4502209","1","4504340","","2010-12-21 17:38:04","0","234","<p>Here is my XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                xmlns:app=""http://schemas.android.com/apk/res/com.tahakki.buttonpuzzlelite""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   &gt;                        &lt;org.anddev.andengine.opengl.view.RenderSurfaceView android:id=""@+id/flip_render""                                android:layout_width=""fill_parent""                                android:layout_height=""fill_parent""                                android:layout_margin=""0px""                                android:layout_centerInParent=""true""                                                           /&gt;        &lt;RelativeLayout            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignTop=""@+id/flip_render""            android:layout_alignLeft=""@+id/flip_render""        &gt;&lt;!-- Ad here --&gt;&lt;com.admob.android.ads.AdView           android:layout_width=""fill_parent""            android:layout_height=""wrap_content""           app:backgroundColor=""#000000""           app:primaryTextColor=""#FFFFFF""           app:secondaryTextColor=""#CCCCCC""    /&gt;        &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Eclipse tells me that app:backgroundColor, app:primaryTextColor and app:secondaryTextColor cannot be found. I have the appropriate admob JAR in my build path. What's wrong?</p>","420617","","","","","2010-12-21 21:59:15","Eclipse AdMob not finding attributes","<android><admob>","1","1","","2012-08-17 11:50:13",""
"4502329","1","4502380","","2010-12-21 17:51:54","4","2263","<p>I am developing which uploads a picture taken from Android phone to Picassa. AFter having browsed few sites, I found there are two ways to go about it.1) Using SurfaceView and Camera Callbacks2) startActivityforResult(CAMERA)</p><p>Which method should I use?</p>","548903","","","","","2010-12-21 17:58:54","Using Android Camera","<android>","2","0","1","",""
"4502340","1","4673477","","2010-12-21 17:53:16","7","6188","<p>In the stock Gingerbread release, overscrolling is indicated with an orange ""flash"". However, the release notes and some of the API docs seem to indicate that there is support for iPhone-style overshoot overscroll behavior. For example, see<a href=""http://developer.android.com/reference/android/widget/ListView.html#setOverscrollHeader%28android.graphics.drawable.Drawable%29"">here</a>. However, it's not clear how to make these work. Simply setting drawables with these methods does not change the behavior. Does anybody know of a way to do this?</p>","369833","","","","","2011-01-12 20:07:00","How to get iPhone-style overscrolling in Android 2.3 (Gingerbread)?","<android><gui>","2","0","4","",""
"4502425","1","4502867","","2010-12-21 18:05:55","2","922","<p>I am evaluating smartphone operating systems and hardware platforms (and in a roundabout way, mobile carriers) to see which one would be the most suitable for delivering custom business software. Our applications will only be used by internal employees. Here are some features and bullet points that influence the selection:</p><ul><li><p>Our apps will need access to about 1 GB of proprietary data. We could use an embedded SQL database, but for speed, our preference is to have access to some kind of file system, or possibly SD card storage.</p></li><li><p>This data is mostly read-only on the mobile side. But we do need to update it regularly from corporate data sources. This could happen over the wire, or by docking to a workstation, or by taking an SD card out, and updating the data it on a PC.</p></li><li><p>Our applications will be graphical visualizations of the proprietary data. The data is used in a ag/biotech/research environment. </p></li><li><p>Code execution speed is critical.</p></li><li><p>The 1GB of data will be shared across multiple applications that we create.</p></li><li><p>Devices will be used worldwide, but by a relatively small number of users (~1000).</p></li><li><p>Users work both indoors and outdoors doing agricultural research. While indoors, they have good network connectivity. While outdoors, connectivity is poor. They also travel a fair bit throughout the year.</p></li><li><p>Our development staff has lots of experience with C# and .net (mostly windows forms) and some exposure to C++ and java. We have done some mobile development with .net, some palm OS stuff years ago, and a few developers have tinkered with learning iPhone development.</p></li><li><p>Being cross platform and not tied to a specific wireless provider or software platform would be desirable. But vendor lock-in seems to be the name of the game these days.</p></li><li><p>We will deploy applications ourselves, and have no need for app stores and the like.</p></li></ul><p>I know that is a lot to digest. So what is my question? I would like opinions on which devices and platforms are the most suitable for what we are doing. I would also like developers who have developed internal business software for these platforms to chime in and share what they have learned.</p>","163679","","","","","2010-12-22 09:18:59","Android vs iPhone vs Windows Phone vs Others as a platform for internal business software","<iphone><android><windows-phone-7><symbian>","4","3","1","",""
"4502445","1","4542181","","2010-12-21 18:08:58","12","10348","<p>I get this weird error everytime I debug in eclipse.  It just seemed to appear one day and I was wondering if anyone else was running int the same problem.  It does not affect my app in anyway visibly and does not cause a crash but it is an annoyance while debugging.  Here is the full error:</p><pre><code>    // Compiled from DexFile.java (version 1.5 : 49.0, super bit)public final class dalvik.system.DexFile {  // Method descriptor #8 (Ljava/io/File;)V  // Stack: 3, Locals: 2  public DexFile(java.io.File file) throws java.io.IOException;     0  aload_0 [this]     1  invokespecial java.lang.Object() [1]     4  new java.lang.RuntimeException [2]     7  dup     8  ldc &lt;String ""Stub!""&gt; [3]    10  invokespecial java.lang.RuntimeException(java.lang.String) [4]    13  athrow      Line numbers:        [pc: 0, line: 4]      Local variable table:        [pc: 0, pc: 14] local: this index: 0 type: dalvik.system.DexFile        [pc: 0, pc: 14] local: file index: 1 type: java.io.File  // Method descriptor #18 (Ljava/lang/String;)V  // Stack: 3, Locals: 2  public DexFile(java.lang.String fileName) throws java.io.IOException;     0  aload_0 [this]     1  invokespecial java.lang.Object() [1]     4  new java.lang.RuntimeException [2]     7  dup     8  ldc &lt;String ""Stub!""&gt; [3]    10  invokespecial java.lang.RuntimeException(java.lang.String) [4]    13  athrow      Line numbers:        [pc: 0, line: 5]      Local variable table:        [pc: 0, pc: 14] local: this index: 0 type: dalvik.system.DexFile        [pc: 0, pc: 14] local: fileName index: 1 type: java.lang.String  // Method descriptor #22 (Ljava/lang/String;Ljava/lang/String;I)Ldalvik/system/DexFile;  // Stack: 3, Locals: 3  public static dalvik.system.DexFile loadDex(java.lang.String sourcePathName, java.lang.String outputPathName, int flags) throws java.io.IOException;     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 6]      Local variable table:        [pc: 0, pc: 10] local: sourcePathName index: 0 type: java.lang.String        [pc: 0, pc: 10] local: outputPathName index: 1 type: java.lang.String        [pc: 0, pc: 10] local: flags index: 2 type: int  // Method descriptor #28 ()Ljava/lang/String;  // Stack: 3, Locals: 1  public java.lang.String getName();     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 7]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile  // Method descriptor #30 ()V  // Stack: 3, Locals: 1  public void close() throws java.io.IOException;     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 8]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile  // Method descriptor #32 (Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class;  // Stack: 3, Locals: 3  public java.lang.Class loadClass(java.lang.String name, java.lang.ClassLoader loader);     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 9]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile        [pc: 0, pc: 10] local: name index: 1 type: java.lang.String        [pc: 0, pc: 10] local: loader index: 2 type: java.lang.ClassLoader  // Method descriptor #37 ()Ljava/util/Enumeration;  // Signature: ()Ljava/util/Enumeration&lt;Ljava/lang/String;&gt;;  // Stack: 3, Locals: 1  public java.util.Enumeration entries();     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 10]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile  // Method descriptor #30 ()V  // Stack: 3, Locals: 1  protected void finalize() throws java.io.IOException;     0  new java.lang.RuntimeException [2]     3  dup     4  ldc &lt;String ""Stub!""&gt; [3]     6  invokespecial java.lang.RuntimeException(java.lang.String) [4]     9  athrow      Line numbers:        [pc: 0, line: 11]      Local variable table:        [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile  // Method descriptor #42 (Ljava/lang/String;)Z  public static native boolean isDexOptNeeded(java.lang.String arg0) throws java.io.FileNotFoundException, java.io.IOException;}</code></pre><p>Thanks</p>","408079","","408079","","2010-12-21 18:52:40","2012-07-10 09:30:12","DexFile.class error in eclipse","<java><android><eclipse>","2","0","3","",""
"4502528","1","","","2010-12-21 18:17:43","0","639","<p>I've got a little problem developing an Android app. I've got a client (running Android), using android-xmlrpc, that calls some methods on the server (standard Java app), using Apache XML-RPC. Everything runs fine and smoothly, with one exception. When I try to call a method that has a Long type parameter, the server throws out this exception : </p><pre><code>21.12.2010 18:54:35 org.apache.xmlrpc.server.XmlRpcErrorLogger logSEVERE: Failed to parse XML-RPC request: Unknown type: i8org.apache.xmlrpc.XmlRpcException: Failed to parse XML-RPC request: Unknown type: i8at org.apache.xmlrpc.server.XmlRpcStreamServer.getRequest(XmlRpcStreamServer.java:71)at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:199)at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)Caused by: org.xml.sax.SAXParseException: Unknown type: i8at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.startElement(RecursiveTypeParserImpl.java:122)at org.apache.xmlrpc.parser.XmlRpcRequestParser.startElement(XmlRpcRequestParser.java:122)at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(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.AbstractSAXParser.parse(Unknown Source)at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)at org.apache.xmlrpc.server.XmlRpcStreamServer.getRequest(XmlRpcStreamServer.java:65)... 3 more</code></pre><p>Everything should be in order, the EnabledForExtensions flag on the Apache side, as mentioned <a href=""http://ws.apache.org/xmlrpc/types.html"" rel=""nofollow"">here</a> , is set like this :</p><pre><code>serverConfig.setEnabledForExtensions(true);</code></pre><p>Does anyone have any idea what I am doing wrong? Any help much appreciated!</p>","550339","","","","","2012-11-03 20:44:12","Apache XML-RPC seems unable to parse long type passed to it by android-xmlrpc","<java><android><apache><xml-rpc><long-integer>","1","0","","",""
"4502542","1","4503354","","2010-12-21 18:19:02","0","321","<p>i am creating an app that is like a mini social network app, with users, that can be friends of other users. Each user haves email, fullName, etc... but now i want to implement and give to the user the possibility to select a image from the images directory of the phone and make it his profile image.</p><p>That image have to be sent to the remote server and all the other users will see that image when open the description of that friend.</p><p>On my app i am using JSON and PHP to connect from my app to the remote database, then i supose that i have to transform the image into a String and add a row on the remote database representing the String of the image.</p><p>I have no idea of how to do this, and i can't find any easy help on google or here, all i am finding is too hard for me or is not what i am searching for.</p><p>Code examples are welcome</p>","479886","","","","","2010-12-21 19:59:00","How can i implement the possibility of select an image on my app and send it to a remote database (JSON+PHP)?","<php><android><database><json>","1","0","1","",""
"4502560","1","4502897","","2010-12-21 18:21:09","2","2354","<p>I'm currently trying to build the PocketSphinx library for Android using the NDK on Windows with Cygwin. I have the PocketSphinxAndroidDemo project code. I also have the pocketsphinx and shpinxbase projects as sub folders of the E:/Development/CMUSphinx folder.</p><p>I'm trying to build using ndk-build from the project folder. The Android.mk file in the /jni/ folder of the project looks like this -</p><pre><code># Build the native component of the PocketSphinx library for Android.# You MUST change this to the absolute path of the directory containing# sphinxbase and pocketsphinx source code.SPHINX_PATH := E:/Development/CMUSphinx# Copy this Android.mk along with pocketsphinx_wrap.c and the contents of the 'edu' folder# built by swig to the jni/ directory of your Android project.BASE_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android $(SPHINX_PATH)/sphinxbase/includeLOCAL_CFLAGS += -DHAVE_CONFIG_HLOCAL_CFLAGS += -DANDROID_NDKLOCAL_PATH := $(SPHINX_PATH)/sphinxbase/src/libsphinxbase/utilLOCAL_MODULE := sphinxutilLOCAL_SRC_FILES := \ bio.c \ bitvec.c \ case.c \ ckd_alloc.c \ cmd_ln.c \ dtoa.c \ err.c \ errno.c \ f2c_lite.c \ filename.c \ genrand.c \ glist.c \ hash_table.c \ heap.c \ huff_code.c \ info.c \ listelem_alloc.c \ logmath.c.arm \ matrix.c \ mmio.c \ pio.c \ profile.c \ sbthread.c \ strfuncs.c \ utf8.cinclude $(BUILD_STATIC_LIBRARY)include $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android $(SPHINX_PATH)/sphinxbase/includeLOCAL_CFLAGS += -DHAVE_CONFIG_HLOCAL_CFLAGS += -DANDROID_NDKLOCAL_PATH := $(SPHINX_PATH)/sphinxbase/src/libsphinxbase/feLOCAL_MODULE := sphinxfeLOCAL_ARM_MODE := armLOCAL_SRC_FILES := \ fe_interface.c \ fe_sigproc.c \ fe_warp_affine.c \ fe_warp.c \ fe_warp_inverse_linear.c \ fe_warp_piecewise_linear.c \ fixlog.cinclude $(BUILD_STATIC_LIBRARY)include $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android $(SPHINX_PATH)/sphinxbase/includeLOCAL_CFLAGS += -DHAVE_CONFIG_HLOCAL_CFLAGS += -DANDROID_NDKLOCAL_PATH := $(SPHINX_PATH)/sphinxbase/src/libsphinxbase/featLOCAL_MODULE := sphinxfeatLOCAL_SRC_FILES := \ agc.c \ cmn.c \ cmn_prior.c \ feat.c \ lda.cinclude $(BUILD_STATIC_LIBRARY)include $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android $(SPHINX_PATH)/sphinxbase/includeLOCAL_CFLAGS += -DHAVE_CONFIG_HLOCAL_CFLAGS += -DANDROID_NDKLOCAL_PATH := $(SPHINX_PATH)/sphinxbase/src/libsphinxbase/lmLOCAL_MODULE := sphinxlmLOCAL_SRC_FILES := \ fsg_model.c \ jsgf.c \ jsgf_parser.c \ jsgf_scanner.c \ lm3g_model.c \ ngram_model_arpa.c \ ngram_model_dmp.c \ ngram_model_set.c \ ngram_model.cinclude $(BUILD_STATIC_LIBRARY)include $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android $(SPHINX_PATH)/sphinxbase/include \     $(SPHINX_PATH)/pocketsphinx/includeLOCAL_CFLAGS += -DHAVE_CONFIG_HLOCAL_CFLAGS += -DANDROID_NDKLOCAL_PATH := $(SPHINX_PATH)/pocketsphinx/src/libpocketsphinxLOCAL_MODULE := pocketsphinxLOCAL_SRC_FILES := \ acmod.c     \ bin_mdef.c    \ blkarray_list.c   \ dict.c     \ dict2pid.c    \ fsg_history.c   \ fsg_lextree.c   \ fsg_search.c   \ hmm.c.arm     \ mdef.c     \ ms_gauden.c.arm    \ ms_mgau.c.arm    \ ms_senone.c.arm    \ ngram_search.c   \ ngram_search_fwdtree.c \ ngram_search_fwdflat.c \ phone_loop_search.c  \ pocketsphinx.c \ ps_lattice.c   \ ps_mllr.c    \ ptm_mgau.c.arm    \ s2_semi_mgau.c.arm   \ tmat.c     \ vector.cinclude $(BUILD_STATIC_LIBRARY)# Create the dynamic library wrapperinclude $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android $(SPHINX_PATH)/sphinxbase/include \     $(SPHINX_PATH)/pocketsphinx/includeLOCAL_CFLAGS += -DHAVE_CONFIG_HLOCAL_CFLAGS += -DANDROID_NDKLOCAL_PATH := $(BASE_PATH)LOCAL_MODULE := pocketsphinx_jniLOCAL_SRC_FILES := pocketsphinx_wrap.cPRIVATE_WHOLE_STATIC_LIBRARIES := \ $(call static-library-path,sphinxutil) \ $(call static-library-path,sphinxfe) \ $(call static-library-path,sphinxfeat) \ $(call static-library-path,sphinxlm) \ $(call static-library-path,pocketsphinx)LOCAL_STATIC_LIBRARIES := sphinxutil sphinxfe sphinxfeat sphinxlm pocketsphinxinclude $(BUILD_SHARED_LIBRARY)</code></pre><p>When I run the ndk-build command I get the following error:</p><pre><code>build-binary.mk:197: *** target pattern contains no '%'. Stop.</code></pre><p>I can build all the ndk samples just fine. Any clue what's causing this error? Many thanks in advance!</p>","451485","","","","","2013-05-26 16:47:42","Issue trying to build PocketSphinx for Android using the NDK on Windows with Cygwin","<android><android-ndk><android-ndk-r5>","4","1","","",""
"4502580","1","4503138","","2010-12-21 18:23:29","0","1088","<p>I have a small but annoying probleme with animations on views in Android.</p><p>What is involved:I have a FrameLayout in another FrameLayout contained in a 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;        &lt;ListView                android:id=""@android:id/list""                android:layout_height=""fill_parent""                android:layout_width=""fill_parent""&gt;&lt;/ListView&gt;        &lt;FrameLayout                android:id=""@+id/TopBanner""                xmlns:android=""http://schemas.android.com/apk/res/android""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;                &lt;ImageView                        android:id=""@+id/ImageView01""                        android:layout_width=""fill_parent""                        android:background=""@drawable/topmenu""                        android:layout_height=""150dip""&gt;&lt;/ImageView&gt;                &lt;Gallery                        android:id=""@+id/Gallery01""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""&gt;&lt;/Gallery&gt;        &lt;/FrameLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>I also wrote an animation XML:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set        android:interpolator=""@android:anim/bounce_interpolator""        xmlns:android=""http://schemas.android.com/apk/res/android""        fillEnabled=""true""        android:fillBefore=""true""        android:fillAfter=""true""&gt;        &lt;translate                android:duration=""500""                android:fromYDelta=""0""                android:toYDelta=""-80%"" /&gt;&lt;/set&gt;</code></pre><p>What I want is to <strong>translate on click</strong> my inner frameLayout (topbanner) out of the activity view, except 20% of it, in order to make it re-appear when I click on it. A kind of top menu. </p><p>I managed to apply my animation, but even if <strong>my layout is translated</strong>, <strong>I can touch it as if it was still there</strong>. Any suggestion? Here is my java code:</p><pre><code>@Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        UserSettings = getSharedPreferences(""net.blabla_preferences"", MODE_WORLD_WRITEABLE);        tab = getIntent().getExtras().getInt(""net.blabla.FigureTab"");        setContentView(R.layout.layout_figure_list);        final Animation animation = AnimationUtils.loadAnimation(this, R.anim.animation_topbanner);        topbanner = (FrameLayout) findViewById(R.id.TopBanner);        topbanner.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                v.startAnimation(animation);            }        });        load();    }</code></pre>","537694","","","","","2011-08-11 08:50:33","View still there but not visible after being moved out by animation","<android><animation>","1","1","","",""
"4502605","1","4502650","","2010-12-21 18:26:24","68","31162","<p>I'm dynamically creating buttons.  I styled them using XML first, and I'm trying to take the XML below and make it programattic.</p><pre><code>&lt;Buttonandroid:id=""@+id/buttonIdDoesntMatter""android:layout_height=""wrap_content""android:layout_width=""fill_parent""android:text=""buttonName""android:drawableLeft=""@drawable/imageWillChange""android:onClick=""listener""android:layout_width=""fill_parent""&gt;&lt;/Button&gt;</code></pre><p>This is what I have so far.  I can do everything but the drawable.</p><pre><code>linear = (LinearLayout) findViewById(R.id.LinearView);Button button = new Button(this);button.setText(""Button"");button.setOnClickListener(listener);button.setLayoutParams(    new LayoutParams(        android.view.ViewGroup.LayoutParams.FILL_PARENT,                 android.view.ViewGroup.LayoutParams.WRAP_CONTENT    ));      linear.addView(button);</code></pre>","375566","","375566","","2010-12-21 18:31:33","2013-11-13 09:50:30","How to programatically set drawableLeft on Android button?","<java><android><android-layout><android-sdk-2.2>","2","0","17","",""
"4502787","1","","","2010-12-21 18:47:24","1","635","<p>I am adding new contacts as follows:-</p><pre><code>ContentValues values = new ContentValues();       String accountType = ""test@gmail.com"";    values.put(RawContacts.ACCOUNT_TYPE, accountType );       String accountName = ""com.google"";    values.put(RawContacts.ACCOUNT_NAME, accountName );       Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values);       long rawContactId = ContentUris.parseId(rawContactUri);       //Add contact number       values.clear();       values.put(Data.RAW_CONTACT_ID, rawContactId);       values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);       values.put(Phone.NUMBER, ""123456789"");       getContentResolver().insert(Data.CONTENT_URI, values);       //Type of phone number       values.clear();       values.put(Data.RAW_CONTACT_ID, rawContactId);       values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);       values.put(Phone.TYPE, Phone.TYPE_WORK);       getContentResolver().insert(Data.CONTENT_URI, values);       //Add contact name       values.clear();       values.put(Data.RAW_CONTACT_ID, rawContactId);       values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);       values.put(Data.DISPLAY_NAME, ""First Second"");       getContentResolver().insert(Data.CONTENT_URI, values);</code></pre><p>Query runs successfully. But the added contacts are not visible in Android Emulator Contacts. Please help. Am I missing anything here.</p>","179012","","21234","","2010-12-21 19:38:57","2010-12-21 19:38:57","Newly added contacts not visible in Android Emulator contacts","<android><android-sdk-2.1>","0","2","0","",""
"4502795","1","9324637","","2010-12-21 18:48:36","2","4457","<p>I am using Gesture Listner to acheive Swipe screen navigation. But it is not so comfortable that I need to swipe multiple time to navigate to next or previous screen.  What are the proper values for Velocity, Off path and Min Distance.</p><p>Please find below is my code:</p><pre><code>private static final int SWIPE_MIN_DISTANCE = 50;private static final int SWIPE_MAX_OFF_PATH = 300;private static final int SWIPE_THRESHOLD_VELOCITY = 200;class MyGestureDetector extends SimpleOnGestureListener {    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        try {            if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)                return false;            // right to left swipe            if(e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                viewFlipper.setInAnimation(slideLeftIn);                viewFlipper.setOutAnimation(slideLeftOut);                viewFlipper.showNext();                    configDisplay();            }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                viewFlipper.setInAnimation(slideRightIn);                viewFlipper.setOutAnimation(slideRightOut);                viewFlipper.showPrevious();                configDisplay();            }        } catch (Exception e) {            // nothing        }        return false;    }}</code></pre>","28557","","657487","","2013-07-25 12:22:40","2013-07-25 12:22:40","Android: How to make Swipe screen Navigation comfortable","<android><android-layout><swipe><gesture-recognition><gesturedetector>","2","1","","",""
"4502810","1","4502890","","2010-12-21 18:49:54","0","600","<p>Using Google's ""Hello TabWidget"" tutorial found <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">here </a> I was able to build a tabWidget layout, but I'm having a seriously difficult time trying to stick a listview within one of the tabs.</p><p>I've also read through a couple threads here about this issue, but they all pertain to assigning the ListView to the specific id ""list"", which I have done, but I still get a null pointer exception.</p><p>I have spent wayyyyyyy to much time on this elementary objective, so I've asked God for help, but I think he's busy right now.  Anyone on a lunch break?  </p><p><strong>the activity in which the ListView is called</strong></p><pre><code>import android.app.Activity;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.widget.AdapterView.OnItemClickListener;public class SettingsActivity extends Activity  {private ListView lv;public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.settings);    String[] settingsList = getResources().getStringArray(R.array.settingsStringArray);    lv = (ListView) findViewById(R.id.list);    lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.id.TextView01, settingsList));    lv.setOnItemClickListener        (new OnItemClickListener()             {                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><strong>xml file from res/layout called within setContentView(R.layout.settings)</strong></p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;&lt;ListView     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/list""&gt;&lt;/ListView&gt;&lt;TextView      android:id=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks, everyone.</p>","239932","","","","","2011-05-17 12:36:41","Android listView within tabwidget activity gives exception","<android><listview><tabwidget>","1","0","","",""
"4502868","1","4503092","","2010-12-21 18:56:59","0","243","<p>For example, I have a couple of String arrays and I've already set a list adapter:</p><pre><code>String[] initial = new String[] {        ""Geometry"",        ""Algebra"",        ""Differentation Calculus"",        ""Integral Calculus"",        ""Trigonometry"",        ""Algebra II"",        ""Triangle"",        ""Rectange""};String [] triangle = new String[] {        ""Area"",        ""Perimeter""};String[] rectangle = new String[] {        ""Area"",        ""Perimeter""};@Overridepublic 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, initial);    setListAdapter(adapter);}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    ...}</code></pre><p>What should I have in my <code>onListItemClick(ListView, View, int, long)</code> method that allows me to load a different set of list items WITHOUT having to create a new activity.</p>","200477","","","","","2010-12-21 19:24:46","Transition into a new set of ListView items?","<java><android><listview>","1","3","1","",""
"4502913","1","4503106","","2010-12-21 19:00:55","0","110","<p>Sometimes I see the description of some classes in Android API aren't quite comprehensive (or I can't read it properly). For example<a href=""http://developer.android.com/reference/android/os/Vibrator.html"" rel=""nofollow"">http://developer.android.com/reference/android/os/Vibrator.html</a></p><p>There are no any information about public constructor over there, no information on how should I create an instance of this class. I searched and found that I have to use <code>getSystemService(Context.VIBRATOR_SERVICE)</code> method to instantiate it. How would I ever know that I need to use this method? Why this isn't included in API description?</p><p>So my question - where should I look for this kind of information (instead of googling the answers). </p>","397991","","397991","","2010-12-21 19:07:49","2010-12-21 19:26:44","No public constructors in API","<android><api>","1","2","","",""
"4502989","1","4503115","","2010-12-21 19:10:49","0","333","<p>I have a layout that looks like the following like below.My problems is that on small screens, the button at the bottom of the view gets pushed of out view for the user. I thought i could easily remedy this by wraping the whole layout in a ScrollView, but I´ve since learned that this is not a feasible solution since there is a ListView in my layout.</p><p>So, any suggestions on how to change this layout? My main issue is really that I have an adapter connected to the ListView, and I´m not sure if I can redo the layout and use the adapter. Thoughts anyone?</p><p>RegardsDaniel</p><p>BTW, here´s 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""    style=""@style/defaultBackground""     &gt;    &lt;LinearLayout         android:layout_height=""wrap_content""         android:layout_width=""fill_parent""         android:orientation=""horizontal""        android:paddingBottom=""10dip""        &gt;        &lt;TextView             android:id=""@+id/roundInfo""             android:layout_width=""wrap_content""             android:layout_height=""20dip"" android:textColor=""#000""             /&gt;        &lt;TextView             android:id=""@+id/balance""             android:layout_width=""fill_parent""             android:layout_height=""20dip""             android:gravity=""right""             android:textColor=""#000""             /&gt;    &lt;/LinearLayout&gt;    &lt;ListView         android:id=""@android:id/list""        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""         android:textSize=""10sp""         android:layout_height=""fill_parent""         android:layout_weight=""1""        android:listSelector=""@drawable/custom_row""        android:background=""@drawable/custom_listview""        android:dividerHeight=""0dip""        android:cacheColorHint=""#FFFFFF""        android:fadingEdge=""none""        android:divider=""#FFFFFF""         /&gt;    &lt;TextView         android:id=""@+id/gameCost""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:text=""@string/gameCost_not_finished""        android:textColor=""#000""  \        android:paddingTop=""10dip""        /&gt;    &lt;Button         android:id=""@+id/update_button""         android:text=""@string/placebet_button""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        style=""@style/whiteText""         android:background=""@drawable/custom_button""         /&gt;&lt;/LinearLayout&gt;</code></pre>","591935","","321697","","2010-12-21 19:18:47","2010-12-21 19:28:03","Need input on how to improve layout for small screens","<android><android-layout>","1","0","","",""
"4502996","1","4503065","","2010-12-21 19:12:45","2","1115","<p>Which is faster to load in android, a file from external storage or a file from internal storage? I am guessing that in many phones like in Motorola Droid the SD Card(flash memory) used for internal and external storage are identical.</p>","349161","","","","","2012-05-23 11:12:09","Which is faster to load in android, a file from external storage or a file from internal storage?","<android><android-sdcard>","4","0","","",""
"4503039","1","9661832","","2010-12-21 19:19:04","15","6662","<p>I have an Activity with a list of items and when you click on an item, I want playback controls for that item to slide up from the bottom of the screen and become visible.  I've defined an animation set for the slide in and the slide out and they work.  I've setup my animationListener in my activity and started my slide in animation onClick of an item.  My problem is, the first time I run the app, when I click on an item, the onClick callback is executed, but the animation doesn't happen.  Second time I click, the slide in animation happens, but not the slide out.  Third and subsequent times, it works as expected.  Here are my animation sets.</p><p>vm_slide_in.xml</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""            android:fillAfter=""true""&gt;    &lt;translate        android:fromYDelta=""800""        android:toYDelta=""0""        android:duration=""600"" /&gt;&lt;/set&gt;</code></pre><p>vm_slide_out.xml</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""            android:fillAfter=""true""&gt;    &lt;translate        android:fromYDelta=""0""        android:toYDelta=""800""        android:duration=""600"" /&gt;&lt;/set&gt;</code></pre><p>Here is my activity layout</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    style=""@style/AppBG""&gt;    &lt;RelativeLayout         style=""@style/LogoBar""         android:id=""@+id/logo_bar""              android:layout_alignParentTop=""true""&gt;        &lt;include layout=""@layout/logobar""&gt;&lt;/include&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout         style=""@style/TitleBar""         android:id=""@+id/title_bar""             android:layout_below=""@+id/logo_bar""&gt;        &lt;include layout=""@layout/titlebar""&gt;&lt;/include&gt;""        &lt;Button style=""@style/TitleBarButton""            android:id=""@+id/vm_speaker_btn""            android:text=""@string/vm_speaker_btn_label""             android:layout_alignParentLeft=""true""            android:layout_margin=""4dp""&gt;        &lt;/Button&gt;        &lt;Button style=""@style/TitleBarButton""            android:id=""@+id/vm_edit_btn""            android:text=""@string/vm_edit_btn_label""             android:layout_alignParentRight=""true""            android:layout_margin=""4dp""&gt;        &lt;/Button&gt;    &lt;/RelativeLayout&gt;    &lt;ListView        android:id=""@+id/@android:id/list""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@+id/title_bar""/&gt;    &lt;RelativeLayout        android:id=""@+id/vm_control_panel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_above=""@+id/footer""        android:visibility=""gone""&gt;        &lt;include layout=""@layout/vm_control""/&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout        android:id=""@+id/footer""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""&gt;        &lt;include layout=""@layout/taskbar""/&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Here is the layout for the included control</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;RelativeLayout         android:id=""@+id/vm_control""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@color/dark_grey""&gt;        &lt;TextView            android:id=""@+id/vm_ctl_branding""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignParentTop=""true""            android:layout_centerHorizontal=""true""            android:layout_marginTop=""5dp""            android:text=""@string/branding""            android:textColor=""@color/white""&gt;        &lt;/TextView&gt;        &lt;TextView style=""@style/TimeMark""            android:id=""@+id/vm_timestamp""            android:layout_toLeftOf=""@+id/vm_progress""            android:layout_below=""@+id/vm_ctl_branding""            android:layout_marginRight=""3dp""            android:text=""0:00""&gt;        &lt;/TextView&gt;        &lt;SeekBar            android:id=""@+id/vm_progress""            android:layout_width=""200dp""            android:layout_height=""wrap_content""            android:layout_below=""@+id/vm_ctl_branding""            android:layout_centerHorizontal=""true""&gt;        &lt;/SeekBar&gt;        &lt;TextView style=""@style/TimeMark""            android:id=""@+id/vm_timeleft""            android:layout_toRightOf=""@+id/vm_progress""            android:layout_below=""@+id/vm_ctl_branding""            android:layout_marginLeft=""3dp""            android:text=""-0:00""&gt;        &lt;/TextView&gt;        &lt;LinearLayout            android:id=""@+id/vm_action_button_layout""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_alignLeft=""@+id/vm_timestamp""            android:layout_alignRight=""@+id/vm_timeleft""            android:orientation=""horizontal""            android:layout_below=""@+id/vm_progress""&gt;            &lt;TextView style=""@style/Vm_Action_Button""                android:background=""@drawable/vm_action_btn_call""                android:id=""@+id/vm_callback_btn""                android:layout_marginRight=""5dp""                android:text=""@string/vm_action_btn_callback""&gt;            &lt;/TextView&gt;            &lt;TextView style=""@style/Vm_Action_Button""                android:background=""@drawable/vm_action_btn_delete""                android:id=""@+id/vm_delete_btn""                android:layout_marginLeft=""5dp""                android:text=""@string/vm_action_btn_delete""&gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;    &lt;/RelativeLayout&gt;&lt;/merge&gt;</code></pre><p>From my onCreate method...</p><pre><code>// Handle list item selectionsListView lv = getListView();lv.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {        final Voicemail vmItem = (Voicemail) vmla.getItem(position);        Toast.makeText(ctx, ""Name: "" + vmItem.getCallerName() + "" Position: "" + position, Toast.LENGTH_SHORT)                .show();        vVm_controls.startAnimation(mSlideIn);    }});</code></pre><p>And my animation callbacks...</p><pre><code>@Overridepublic void onAnimationStart(Animation animation) {    vm_controls_in = !vm_controls_in;    if (vm_controls_in) {        vVm_controls.setVisibility(View.GONE);    } else {        vVm_controls.setVisibility(View.VISIBLE);        // vVm_controls.bringToFront();    }}@Overridepublic void onAnimationEnd(Animation animation) {    if (!vm_controls_in) {        try {            Thread.sleep(1000);            vVm_controls.startAnimation(mSlideOut);        } catch (InterruptedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}@Overridepublic void onAnimationRepeat(Animation animation) {    // TODO Auto-generated method stub}</code></pre>","326430","","52626","","2011-03-28 20:30:03","2012-03-12 04:41:16","Layout animation not working on first run","<android><android-animation>","2","0","3","",""
"4503230","1","","","2010-12-21 19:41:30","2","1060","<p>Is it possible to use OpenMAX DL library in android? AFAIK android 2.2 uses OpenCore that probably doesn't implement this part of OpenMAX standard. Few months ago VisualOn joined OHA and their VOME fully implements OpenMAX. Does anyone know if VOME is now part of android 2.3?If so is there any example how to use it? I am especially interested in using optimized FFT function.</p>","550422","","","","","2010-12-21 19:41:30","OpenMAX DL (development layer) support in android","<android><opencore>","0","0","","",""
"4503277","1","","","2010-12-21 19:47:49","2","3736","<p>I have some code that will launch a different application using intents but what can I do to close or kill the other app?</p><p>Here is the launch code (works great):</p><pre><code>Intent i = new Intent();  i.setAction(Intent.ACTION_MAIN);  i.addCategory(Intent.CATEGORY_LAUNCHER);  i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  i.setComponent(     new ComponentName(resolveInfo.activityInfo.applicationInfo.packageName,        resolveInfo.activityInfo.name));</code></pre><p>I tried to kill the background processes but no luck:</p><pre><code>ActivityManager activityManager = (ActivityManager) context.getSystemService(context.ACTIVITY_SERVICE);  activityManager.killBackgroundProcesses(""com.pandora.android"");</code></pre><p>I also tried this to kill it:</p><pre><code>context.stopService(new Intent(context, Class.forName(""com.bla.bla"")));</code></pre><h3>Update:</h3><p>I want to kill other applications because I launch other applications and users have requested this additional feature (auto kill is a natural extension of auto launch). Please answer the question of how to accomplish this in code. I know about Advanced Task Mgr so it is possible but how?</p>","550518","","1288","","2011-03-25 16:44:48","2011-09-07 02:25:16","Android-Close Other Apps","<java><android>","5","8","0","",""
"4503292","1","4599224","","2010-12-21 19:50:09","0","212","<p>How can i add two or more addresses using contacts contract? I have three postal addresses to add but i don't see any secondary_address like one for phone/Email. Can anybody assist me with this?Thanks!!</p>","484691","","","","","2011-01-04 22:42:41","Adding two or more addresses using contactsContract in android","<android><contactscontract>","1","0","2","",""
"4503380","1","4503715","","2010-12-21 20:02:11","1","3540","<p>The spinning ProgressBar doesn't ""show up"" on a white background because the spinner is colored white.  Does Android include any ProgressBar styles to contrast with a white background?  Or will I need to skin my own?</p>","406790","","","","","2010-12-22 00:07:00","ProgressBar on white background","<android><progress-bar>","1","0","1","",""
"4503437","1","4503990","","2010-12-21 20:09:50","12","8304","<p>When I create a <a href=""http://developer.android.com/reference/org/apache/http/impl/client/DefaultHttpClient.html"">DefaultHttpClient</a> object and try to hit a webpage, the request isn't routed through the proxy I specified in Settings.</p><p>Looking through the API docs, I don't see anywhere where I can specify a proxy though Android does have a <a href=""http://developer.android.com/reference/org/apache/http/impl/client/DefaultHttpClient.html"">Proxy</a> class that allows me to read the system's proxy settings.</p><p>Is there a way I can use the proxy settings in an HttpClient?</p>","680","","","","","2013-02-01 13:18:36","Android HttpClient Doesn't Use System Proxy Settings","<android><proxy><httpclient>","3","3","9","",""
"4503458","1","4503932","","2010-12-21 20:12:36","2","14403","<p>The example is pretty straightforward: i want to let the user know about what the app is doing by just showing a text (canvas.drawText()). Then, my first message appears, but not the other ones. I mean, i have a ""setText"" method but it doesn't updates.</p><pre><code>onCreate(Bundle bundle) {    super.onCreate(bundle);    setContentView(splash); // splash is the view class    loadResources();    splash.setText(""this"");    boundWebService();    splash.setText(""that""):    etc();    splash.setText(""so on"");}</code></pre><p>The view's text drawing works by doing just a drawText in onDraw();, so setText changes the text but doesn't show it.</p><p>Someone recommended me replacing the view with a SurfaceView, but it would be alot of trouble for just a couple of updates, SO... how the heck can i update the view dinamically at runtime?</p><p>It should be quite simple, just showing a text for say 2 seconds and then the main thread doing his stuff and then updating the text...</p><p>Thanks!</p><p>Update:</p><p>I tried implementing handler.onPost(), but is the same story all over again. Let me put you the code:</p><pre><code>public class ThreadViewTestActivity extends Activity {Thread t;Splash splash;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    splash = new Splash(this);    t = new Thread(splash);    t.start();    splash.setTextow(""OA"");    try { Thread.sleep(4000); } catch (InterruptedException e) { }    splash.setTextow(""LALA"");}       }</code></pre><p>And:</p><pre><code>public class Splash implements Runnable {Activity activity;final Handler myHandler = new Handler();public Splash(Activity activity) {    this.activity=activity;}   @Overridepublic void run() {    // TODO Auto-generated method stub}public synchronized void setTextow(final String textow) {    // Wrap DownloadTask into another Runnable to track the statistics    myHandler.post(new Runnable() {        @Override        public void run() {            TextView t = (TextView)activity.findViewById(R.id.testo);            t.setText(textow);            t.invalidate();         }                       });}}</code></pre><p>Although splash is in other thread, i put a sleep on the main thread, i use the handler to manage UI and everything, it doesn't changes a thing, it only shows the last update.</p>","495904","","495904","","2011-02-18 17:17:23","2011-02-18 17:17:23","Update View at runtime in Android","<java><android><gui><view><handler>","3","0","","",""
"4503552","1","4523054","","2010-12-21 20:23:33","1","271","<p>I have made a class that extends View and this is the onDraw method. The program creates a maze and to get an appropriate reading of the height and width, I appeared to need to call them in the onDraw method (otherwise it would just return 0 for both). This may be what is screwing everything up. However, it gets the correct height based on the spacing of the visible squares in the section of the view that is painted. </p><p>The section of the view that appears to be unpainted is about the size of the context menu and does not match up with spares. I have looked for other people having this problem and it appears nobody else is having this problem and as best I can tell, I am not doing anything particularly different from them.  If there is any other insight I can provide, please let me know.</p><p>I can't post pictures yet because I'm new at this whole stack overflow thing =(Thus I tried to explain the phenomenon as best as I could.</p><p>Thanks!</p><pre><code>@Override public void onDraw(Canvas canvas) {  if(firstRun){  width = getMeasuredWidth();  height = getMeasuredHeight();  MazeMake();  invalidate(); }else  for (int i = 0; i &lt; c; i++)   for (int j = 0; j &lt; r; j++) {    grid[i][j].paintSq(canvas);   } }@Override protected void onMeasure(int wMeasureSpec, int hMeasureSpec) {  int measuredHeight = measure(hMeasureSpec);  int measuredWidth = measure(wMeasureSpec);  setMeasuredDimension(measuredHeight, measuredWidth); }private int measure(int measureSpec) { int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); if (specMode == MeasureSpec.UNSPECIFIED)   return 500; else {   return specSize; }}</code></pre>","1953819","","1953819","","2010-12-22 17:13:49","2012-07-10 19:14:43","ANDROID: My custom view is not getting entirely painted","<android><android-custom-view>","2","0","","",""
"4503561","1","4504110","","2010-12-21 20:24:57","9","6121","<p>Is it possible to implement a PhoneStateListener(or any other mechanism) to detect when either the 3G or Wifi network connection is restored ?</p><p>I see both LISTEN_DATA_CONNECTION_STATE and LISTEN_DATA_ACTIVITY say (cellular) in the API's summary. Does it mean 3G only ?</p><p>Thanks</p>","253944","","","","","2013-11-13 14:48:58","Detect 3G or Wifi Network restoration","<android><networking><3g><android-wifi>","2","0","5","",""
"4503582","1","4505701","","2010-12-21 20:26:45","3","5394","<p>I've been learning android development and been trying to get the app on my samsung galaxy tablet but have been having some problems. I have the device connected to my computer and i can access it thought the substandard samsung app and through explorer but when i try to send the app to the device using eclipse it just defaults to the emulator.</p><p>My pc is running windows 7, i have the android and galaxy tab packages installed on eclipse and i also have the device set up with type of galaxy tab. </p><p>When i plug in my HTC Desire it works perfectly fine and i can view apps on the device, it just seems to be the galaxy tablet.</p><p>Anyone else had this problem or know of any solutions? </p><p>Thanks a lot, been frustrating me for ages now.</p>","403311","","71421","","2011-07-07 07:56:31","2013-10-31 03:34:18","Android development with Samsung Galaxy tablet","<android>","1","5","1","",""
"4503649","1","4504073","","2010-12-21 20:35:08","0","254","<p>I'm trying to create a 1x2 TableLayout with MapView in one of the cells.</p><p>I'm using the following layout template:</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=""0,1""          android:padding=""5dp""&gt;    &lt;TableRow&gt;        &lt;Button android:text=""123"" /&gt;        &lt;com.google.android.maps.MapView            android:id=""@+id/mapContainer""            android:apiKey=""054E5p80TEOX6y_rf3lKv4rZBPOWv1N2FnYGkjw""            android:clickable=""true""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>As a result i've got a table stretched to full width and full height with a little button at the left and a huge map at the right. But i expecting what both button and map will be 50% width. And if i put another button instead of map it works just fine - buttons are drawn with same the width.</p><p>Is it a MapView issue or am i doing something wrong?</p>","296433","","","","","2010-12-21 21:28:31","MapView breaks TableLayout?","<android><android-layout>","1","0","","",""
"4503740","1","4663646","","2010-12-21 20:45:15","2","19341","<p>I a trying to connect my Nexus One with Android version 2.2.1 with my pc and use a terminal program such as windows terminal or hyper terminal to communicate.  To do this I believe I need to set up an outgoing serial com port.  I have paired the devices.  When I go on my PC to Bluetooth -> settings -> ""add com port"" the android device does not display.  </p><p>What am I missing? </p><p>Does android 2.2.1 support spp?   The documentation says it does. </p><p>Do I need to root the android to add spp?  </p><p>Has anyone succeeded in this?  </p><p>My final goal is to write an android app that communicates with an old school bluetooth device that requires com ports?  Getting the android to communicate with the pc is an interim step.  </p><p>I have tried everything I can think of in my android app to connect to my pc and android device but have not been successful.  My android app is essentially the same as <a href=""http://www.mail-archive.com/android-beginners@googlegroups.com/msg20753.html"" rel=""nofollow"">Serial over Bluetooth submitted by xCaffeniated</a> but with fewer comments.  Any suggestions?  </p>","321747","","706363","","2013-09-11 19:23:16","2013-09-11 19:23:16","Android 2.2. How to set up serial port(com,rfcomm) port?","<android><serial-port><rfcomm>","3","0","3","",""
"4503753","1","4503997","","2010-12-21 20:46:53","2","2306","<p>I gathered plenty of samples and tutorials on the matter but once I implement my own version or even just copy the code straight off, I cannot get any values to show up in my log.I think I am missing one important part but I cannot seem to figure it out.</p><pre><code>public class Accelerometer extends Activity {SensorManager sensorManager;Sensor accelerometer;private SensorEventListener sensorEventListener = new SensorEventListener() {    public void onAccuracyChanged(Sensor sensor, int accuracy) {    }    public void onSensorChanged(SensorEvent event) {        float x = event.values[0];        float y = event.values[1];        float z = event.values[2];        update(x, y, z);    }};/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    sensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);    accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);}public void update(float x, float y, float z) {    Log.v(""semajhan"", ""x: "" + x + "" y: "" + y + "" z: "" + z);}protected void onResume() {    super.onResume();    sensorManager.registerListener(sensorEventListener, accelerometer, SensorManager.SENSOR_DELAY_NORMAL);}protected void onPause() {    super.onPause();    sensorManager.unregisterListener(sensorEventListener);}</code></pre><p>}</p><p>My problem seems to be that I do not know how to really access the accelerometer.Once I can get these values, I can move forward but I need to understand this first.</p>","507007","","507007","","2010-12-21 21:37:51","2010-12-22 08:38:36","Android accelerometer","<java><android><accelerometer>","2","1","1","",""
"4503807","1","","","2010-12-21 20:53:20","0","580","<p>i'm using sharedPreferences to store username and password .. but i need to make log off, how can i remove the data od username and password ?</p>","508377","","","","","2010-12-21 21:08:58","how to empty the sharedpreferences storage in android?","<android>","1","0","1","",""
"4503817","1","4503875","","2010-12-21 20:55:30","0","661","<p>I have been programming for Windows for years and just now beginning to learn Android... Lots of new terminology so I naturally compare new terms (or notions) to ones I am familiar with.</p><p>In Android's ""Application Fundamentals"", the first of 4 application components is named an <strong>activity</strong> and is described as ""a <em>visual</em> user interface for <em>one</em> focused endeavor the user can undertake... Moving from one activity to another is accomplished by having the <em>current activity start the next one</em>.""</p><p>This sounds to me alot like the behavior of a Windows dialog box.</p><p>Is it?</p><p>What is your view on this?</p>","418055","","","","","2010-12-21 21:03:27","Android's Activity == Windows' Modal Dialog Box?","<android><windows><activity><modal-dialog>","1","4","","",""
"4503845","1","","","2010-12-21 20:59:19","0","124","<p>how make content database in android to view as list?? this my code :</p><pre><code>public void showData() {    try {        txt_diary.append(""\n"");        String[] field = { ""recID"", ""date"", ""isi"" };        Cursor c = myDb.query(""diary"", field, null, null, null, null,                ""recID"");        int theTotal = c.getCount();        Toast.makeText(getApplicationContext(), ""Total diary :"" + theTotal,                1).show();        int fieldID = c.getColumnIndex(""recID"");        int fieldDATE = c.getColumnIndex(""date"");        int fieldISI = c.getColumnIndex(""isi"");        while (c.moveToNext()) {            field[0] = Integer.toString((c.getInt(fieldID)));            field[1] = c.getString(fieldDATE);            field[2] = c.getString(fieldISI);            txt_diary.append(field[0] + "" "" + field[1] + "" "" + field[2]                    + ""\n"");        }    } catch (Exception e) {        Toast.makeText(getApplicationContext(), e.getMessage(),                Toast.LENGTH_SHORT).show();    }}</code></pre>","550488","","135152","","2011-05-25 03:03:46","2011-05-25 03:03:46","Make List of Content Database","<android><sqlite>","1","0","","",""
"4504024","1","","","2010-12-21 21:23:15","4","1378","<p>Here's the problem: When I have an activity running in the background, and I switch locales, and I switch back to the application, everything updates... EXCEPT checkboxes and radio buttons that have an ""android:id"" attribute set.</p><p>If the checkboxes and radio buttons don't have the ""android:id"" attribute, then they update OK. Other fields don't have this problem, whether they have an ""android:id"" attribute or not.</p><p>What is the best way to make sure everything in my running activity is updated whenever the locale is changed?</p><p>Steps to reproduce:</p><p>1) Create a ""Hello, Android"" project in Eclipse.2) In the main layout, define two checkboxes:</p><pre><code>&lt;CheckBox android:text=""@string/checkbox"" android:id=""@+id/CheckBox01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;CheckBox android:text=""@string/checkbox"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;</code></pre><p>3) Create two strings.xml: one under ""values"" and one under ""values-es"".</p><p>4) Create the following string under ""values"":</p><pre><code>&lt;string name=""checkbox""&gt;English&lt;/string&gt;</code></pre><p>5) Create the following string under ""values-es""</p><pre><code>&lt;string name=""checkbox""&gt;español&lt;/string&gt;</code></pre><p>6) Set device to “English”</p><p>7) Run the application on the emulator or any device (tested on HTC G1).</p><p>8) Observe. Both checkboxes say “English”.</p><p>9) Press “Home” to return to the menu and leave the application running in the background.</p><p>10) Go to the settings. Switch the language to “español""</p><p>11) Press and hold “Home”. Return to the application.</p><p>Expected result:</p><p>Both checkboxes say “español”</p><p>Actual result:</p><p>First checkbox says “English”</p><p>Second checkbox says “español”</p><p>It appears that the checkbox with an “android:id” attribute is not updating as it should. The checkbox without the “android:id” attribute is working as expected.</p>","550520","","","","","2013-04-30 08:32:26","Android Localization problem: Not all items in the layout update properly when switching locales","<android><layout><localization>","4","1","","",""
"4504027","1","4505877","","2010-12-21 21:23:36","2","2292","<p>I was wondering if it is possible to draw only a portion of a bitmap after it is loaded into memory without creating a new Bitmap. I see Drawable has a setBounds method but im not sure if it only draws the area set or just resizes the entire image. Thank you.</p>","385051","","","","","2010-12-22 03:16:24","draw only a portion of a Drawable/Bitmap","<android><bitmap><drawable><surfaceview>","1","0","1","",""
"4504088","1","","","2010-12-21 21:29:43","3","1160","<p>I have a bunch of <strong>flv video</strong> files stored on a <strong>media server</strong>, and I am trying to get them to launch in the flash player. Have been looking around but haven't found much help. I have downloaded the flv file into temporary storage, and try passing it using an <code>intent</code>. This is what my code looks like (from what I have seen on the net):</p><pre><code>try{  URL urlLink = new URL(""http://206.188.19.131/p4p101.flv"");  // Serve the file  InputStream in = urlLink.openStream();  FileOutputStream fos = new FileOutputStream(""/sdcard/tempFlash.flv"");  byte[] buf = new byte[4 * 1024]; // 4K buffer  int bytesRead;  while ((bytesRead = in.read(buf)) != -1) {    fos.write(buf, 0, bytesRead);  }  fos.close();  in.close();}catch(Exception e){}try{  Intent intent = new Intent();  intent.setAction(android.content.Intent.ACTION_VIEW);  File file = new File(""/sdcard/tempFlash.flv"");  intent.setDataAndType(Uri.fromFile(file), ""flash/*"");  startActivity(intent);}catch (ActivityNotFoundException e) {  Toast toast = Toast.makeText(this, ""No apps to launch activity"", 1000);  toast.show();}</code></pre>","512821","","6509","","2011-07-07 10:22:39","2013-08-23 16:12:12","How do I fire an intent to start a flv or swf to Flash Player 10.1?","<java><android><flash><flv>","2","3","2","",""
"4504091","1","","","2010-12-21 21:29:59","0","1344","<p>How can I kill other applications? I can launch other applications using intents but can't find a way to kill them.</p><p>This launches the application:</p><pre><code>Intent i = new Intent();    i.setAction(Intent.ACTION_MAIN);    i.addCategory(Intent.CATEGORY_LAUNCHER);    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    i.setComponent(        new ComponentName(""com.bla.bla..."",             ""com.bla.bla.Main""));    context.startActivity(i);</code></pre><p>I've tried to use the activity manager's kill</p><pre><code>killBackgroundProcesses(String packageName)</code></pre><p>but that does nothing.</p><p>I've also tried </p><pre><code> appContext.stopService(intent)</code></pre><p>but that did nothing</p>","550518","","47550","","2010-12-21 21:33:55","2010-12-22 01:57:05","How to kill other apps?","<android><kill-process>","0","0","0","",""
"4504189","1","4504845","","2010-12-21 21:41:55","8","24274","<p>I'm using an AsyncTask to download Images for my Listview, because I dont want the download of the Images to block my UI-Thread. While the images are being loaded, I want to show an animated progress circle in the spot, where the image will be.</p><p>But I cant find an Image of the progress circle. What is the Ressource-Id? Or is there any other way? Does someone has a link to this image?</p>","351723","","","","","2013-12-17 17:44:18","Android: Show progress circle like Google does in their apps","<android><progress>","4","0","2","",""
"4504280","1","4504481","","2010-12-21 21:51:27","6","24669","<p>I have a question relating to the use of an Initialization Vector in AES encryption.  I am referencing the following articles / posts to build encryption into my program:  </p><p>[1]  <a href=""http://stackoverflow.com/questions/992019/java-256bit-aes-encryption"">Java 256bit AES Encryption</a><br>[2]  <a href=""http://gmailassistant.sourceforge.net/src/org/freeshell/zs/common/Encryptor.java.html"">http://gmailassistant.sourceforge.net/src/org/freeshell/zs/common/Encryptor.java.html</a></p><p>I was originally following erickson's solution from the first link but, from what I can tell, PBKDF2WithHmacSHA1 is not supported on my implementation.  So, I turned to the second link to get an idea for my own iterative SHA-256 hash creation.  </p><p>My question comes in how the IV is created.  One implementation ([1]) uses methods from the Cypher class to derive the IV where are the other ([2]) uses the second 16 bytes of the hash as the IV.  Quite simply, why the difference and which is better from a security standpoint?  I am kinda confused to the derivation and use of IVs as well (I understand what they are used for, just not the subtler differences), so any clarification is also very welcome.</p><p>I noticed that the second link uses AES-128 rather than AES-256 which would suggest to me that I would have to go up to SHA-512 is I wanted to use this method.  This seems like it would be an unfortunate requirement as the user's password would have to be 16 characters longer to ensure a remotely secure hash and this app is destined for a cell phone.</p><p>Source is available on request, though it is still incomplete.</p><p>Thank you in advance.</p>","481075","","","","","2010-12-21 23:13:37","Encryption with AES-256 and the Initialization Vector","<java><android><encryption><aes>","5","1","7","",""
"4504291","1","4504692","","2010-12-21 21:53:13","12","4346","<p>Unzipping files on android seems to be dreadfully slow. At first I thought this was just the emulator but it appears to be the same on the phone. I've tried different compression levels, and eventually dropped down to storage mode but it still takes ages. </p><p>Anyway, there must be a reason! Does anyone else have this problem? My unzip method looks like this:</p><pre><code>public void unzip(){try{        FileInputStream fin = new FileInputStream(zipFile);        ZipInputStream zin = new ZipInputStream(fin);        File rootfolder = new File(directory);        rootfolder.mkdirs();        ZipEntry ze = null;        while ((ze = zin.getNextEntry())!=null){            if(ze.isDirectory()){                dirChecker(ze.getName());            }            else{                FileOutputStream fout = new FileOutputStream(directory+ze.getName());            for(int c = zin.read();c!=-1;c=zin.read()){                fout.write(c);            }                //Debug.out(""Closing streams"");                zin.closeEntry();                fout.close();        }    }    zin.close();}catch(Exception e){            //Debug.out(""Error trying to unzip file "" + zipFile);}    }</code></pre>","278229","","64967","","2012-04-23 19:43:03","2014-02-11 05:59:09","How to speed up unzipping time in Java / Android?","<java><android><android-emulator><unzip><zipinputstream>","3","1","8","",""
"4504400","1","5770343","","2010-12-21 22:05:40","4","1267","<p>I know how to clear SharedPreferences to run my unit tests in a defined state like this: <code>PreferenceManager.getDefaultSharedPreferences(getActivity()).edit().clear().commit()</code></p><p>However, I'd like to be able to save and restore the settings I prefer as a user of my own application after I run my unit tests.</p><p>Is there an easy way to do this without manually saving and restoring each preference item individually?</p><p>Thanks,Jeff</p>","403455","","","","","2011-04-24 11:55:55","Android: How can I Save, Clear, then Restore SharedPreferences for Unit Testing?","<android><unit-testing><preferences><android-preferences>","1","0","","",""
"4504576","1","4504986","","2010-12-21 22:32:52","2","4448","<p>I know that android source code is kept here: <a href=""http://android.git.kernel.org/"" rel=""nofollow"">http://android.git.kernel.org/</a>, but I can't see any way to browse an old version of the code. How would I view, say, dalvik/libcore/concurrent/src/main/java/java/util/concurrent/LinkedBlockingQueue.java in Froyo?</p>","415533","","","","","2010-12-24 04:34:43","How to browse Android source on http://android.git.kernel.org/ at a particular version?","<android><source>","1","0","1","",""
"4504619","1","5006245","","2010-12-21 22:39:11","3","2509","<p>How can I set up the animation when the user selects an element in a listview?</p><p>I am making my own listview adapter to set even rows with a pink background and odd rows with a purple background. The only problem is that I am not sure how to set the animation for the user clicking (""touching"") an element.</p><p>I thought of implementing OnTouchListener and changing the background to green when selected BUT I have buttons inside the rows that might no longer work due to OnTouchListener being implemented. Is this true?</p><p>Code:</p><pre><code>public class MyAdapter extends BaseAdapter {    public View getView(int position, View convertView, ViewGroup parent) {        // position is the element's id to use        // convertView is either null -&gt; create a new view for this element!        //                or not null -&gt; re-use this given view for element!        // parent is the listview all the elements are in            if (convertView == null) {            convertView = mInflater.inflate(R.layout.your_layout, null);            // here you must do whatever is needed to populate the elements of your            // list element layout            ...        } else {            // re-use the given convert view            // here you must set all the elements to the required values        }        // your drawable here for this element         convertView.setBackground(...);        // maybe here's more to do with the view        return convertView;    }}</code></pre>","252462","","2218452","","2013-05-24 05:49:48","2013-05-24 05:49:48","Android ListView Select Animation","<android><android-listview><android-animation><listview-adapter>","1","0","1","",""
"4504820","1","4504921","","2010-12-21 23:09:45","3","3453","<p>I saw a piece of code online. I am wondering why we need to use runnable to set text of TextView? Thanks!</p><pre><code>    while (true) {    // listen for incoming clients    Socket client = serverSocket.accept();    handler.post(new Runnable() {        @Override        public void run() {            serverStatus.setText(""Connected."");        }    });</code></pre><p><a href=""http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/"" rel=""nofollow"">http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/</a></p>","547589","","","","","2010-12-21 23:27:36","A question about Android runnable","<android><runnable>","2","0","3","",""
"4504906","1","4505907","","2010-12-21 23:22:58","3","4040","<p>I would like to create a application that would respond to receiving SMS messages and display a dialog. How can I register the receiver in the manifest without defining within an activity?</p><p>I tried to keep the receiver/intent-filter tags in the manifest out of the activity tag but the emulator will not install the apk since there is no launch activity. Keeping the BroadcastReceiver as the main activity results in an ""Unable to instantiate activity"" error in the Logcat.</p><p>Any help?</p><p>Thanks,Sunny</p><p><strong>Receiver class</strong></p><pre><code>public class SMSReceiver extends BroadcastReceiver { // onCreat is invoked when an sms message is received. // Message is attached to Intent via Bundle, stored in an Object // array in the PDU format. public void onReceive(Context context, Intent intent) {  // get the SMS message passed in from Bundle  Bundle bundle = intent.getExtras();            String bodyText = """";                String from = """";    if (bundle != null) {        //Retrieve sms message within Object array        Object[] pdus = (Object[]) bundle.get(""pdus"");        SmsMessage[] msgs = new SmsMessage[pdus.length];                    for (int i=0; i &lt; msgs.length; i++)         msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);        for (SmsMessage message: msgs) {         bodyText = message.getMessageBody();         from = ""Message from "" + message.getOriginatingAddress() + "": "";        }        // Display message in pop up        Toast.makeText(context, from + bodyText, Toast.LENGTH_SHORT).show();    }                   }}</code></pre><p><strong>Manifest</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=""home.splttingatms.SMSReceiver"" android:versionCode=""1"" android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".SMSReceiver""                  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="".SMSReceiver""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;   &lt;/intent-filter&gt;  &lt;/receiver&gt; &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","550608","","","","","2010-12-22 03:24:41","How to create BroadcastReceiver without Activity","<android><sms><broadcastreceiver>","1","1","1","",""
"4504916","1","","","2010-12-21 23:25:58","1","457","<p>I would like to put an image on a <code>Button</code> with some text, like:</p><pre><code>--------------[image] [text]--------------</code></pre><p>We can do this with <code>Button</code>, and specify the left <code>Drawable</code>, but it uses the <code>""intrinsic""</code> size of the drawable. If I understand correctly, this won't work across different density devices. If my image is <code>32x32</code> pixels, it will look really small on <code>hdpi</code> devices. Is there any way to specify the width and height of the drawable, in <code>dp</code>, so that it will take the same amount of space on different devices?</p>","291701","","493939","","2012-04-09 10:24:03","2012-04-09 10:24:03","How to specify the image's size for the left-image of a button?","<android><android-button>","1","0","","",""
"4504920","1","","","2010-12-21 23:27:21","1","1343","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4370899/android-draw9patch-throws-noclassdeffounderror"">Android draw9patch throws NoClassDefFoundError</a>  </p></blockquote><p>draw9path is a tool to edit 9-patch file. It worked well.However, after the recent SDK update, I can not run draw9patch again, the error message is:Any help would be really appreciated.</p><p>Exception in thread ""AWT-EventQueue-0"" java.lang.NoClassDefFoundError: org/jdesktop/swingworker/SwingWorker at 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:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingworker.SwingWorker 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 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</p>","550613","","","","","2011-01-24 15:02:21","Issue with draw9patch","<android>","1","3","","2011-12-01 01:29:07",""
"4504926","1","","","2010-12-21 23:30:06","0","1066","<p>Currently within an activity in my application I can call another activity and pass a variable to it in the following manner:</p><pre><code>Intent myIntent = new Intent(parentView.getContext(), ShowStations.class);myIntent.putExtra(""stationName"", stations[position].StationName);startActivity(myIntent);</code></pre><p>This works fine, but now I want to be able to do the same from my Widget.  Currently this code works fine for launching a specific activity from my widget:</p><pre><code>Intent WidgetIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName(""grell.com"", ""grell.com.FavStations""));    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, WidgetIntent, 0);    updateViews.setOnClickPendingIntent(R.id.widget_main, pendingIntent);</code></pre><p>So now I am wondering how can I launch the same activity as shown in the first example but also pass through the 'stationName' variable.</p><p>Any help would be greatly appreciated.</p><p>Cheers</p>","506503","","","","","2010-12-22 04:48:05","Pass variable/intent to an activity when launched from a Widget","<android><activity><android-widget>","1","0","","",""
"4504992","1","4505236","","2010-12-21 23:41:13","0","5058","<p>I've been able to successfully link two spinners to a database using a SimpleCursorAdapter. But, I need to make the second spinner selection dependant on the first spinner selection.</p><p>Here is how I linked the data:</p><pre><code>    public class epa_estimates_button extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.epa_estimates);    final Cursor cYear;    final Cursor cMake;    final Spinner mMakeSpinner;    final Spinner mModelSpinner;    cYear = (Cursor) DataBaseHelper.getEPADataYear();    this.startManagingCursor(cYear);    SimpleCursorAdapter scaYear = new SimpleCursorAdapter(this, R.layout.spinner_layout,cYear,new String[] {DataBaseHelper.EPA_COLUMN_ONE},new int[]{R.id.text1});    scaYear.setDropDownViewResource(R.layout.spinner_dropdown);    mYearSpinner = (Spinner) findViewById(R.id.yearSpinner);    mYearSpinner.setAdapter(scaYear);    cMake = (Cursor) DataBaseHelper.getEPADataMake();    this.startManagingCursor(cMake);    SimpleCursorAdapter scaMake = new SimpleCursorAdapter(this, R.layout.spinner_layout,cMake,new String[] {DataBaseHelper.EPA_COLUMN_TWO},new int[]{R.id.text1});    scaMake.setDropDownViewResource(R.layout.spinner_dropdown);    mMakeSpinner = (Spinner) findViewById(R.id.makeSpinner);    mMakeSpinner.setAdapter(scaMake);}}</code></pre><p>Here is my DataBaseHelper</p><pre><code>    public class DataBaseHelper extends SQLiteOpenHelper {private static String DB_PATH = ""/data/data/org.application.ocdmpg/databases/"";private static String DB_NAME = ""ocd_mpg.mp3"";private final int DB_VERSION = 1;private static SQLiteDatabase myDataBase; private final Context myContext;private static final String EPA_TABLE_NAME = ""epa_data"";private static final String EPA_COLUMN_ID = ""_id"";public DataBaseHelper(Context context) {    super(context, DB_NAME, null, 1);    this.myContext = context;}    public static Cursor getEPADataYear() {    return myDataBase.query(EPA_TABLE_NAME, //table name            new String[] {EPA_COLUMN_ID, EPA_COLUMN_ONE}, //list of columns to return            null, //filter declaring which rows to return; formatted as SQL WHERE clause            null,            EPA_COLUMN_ONE, //filter declaring how to group rows; formatted as SQL GROUP BY clause            null, //filter declaring which row groups to include in cursor; formatted as SQL HAVING clause            null); //how to order rows; formatted as SQL ORDER BY clause}public static Cursor getEPADataMake() {    return myDataBase.query(EPA_TABLE_NAME, new String[] {            EPA_COLUMN_ID,            EPA_COLUMN_TWO,            },             null,             null,             EPA_COLUMN_TWO,             null,             null);}}</code></pre><p>I've found code for setOnItemSelectedListener and tried to add my code for linking the data to the spinner but the startManagingCursor method and SimpleCursorAdapter constructors give me an error as undefined. Should I use an ArrayAdapter to populate my spinners? Or is there a way to correct the code below?</p><pre><code>        mYearSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {            // your code here            cMake = (Cursor) DataBaseHelper.getEPADataMake();            this.startManagingCursor(cMake);            SimpleCursorAdapter scaMake = new SimpleCursorAdapter(this, R.layout.spinner_layout,cMake,new String[] {DataBaseHelper.EPA_COLUMN_TWO},new int[]{R.id.text1});            scaMake.setDropDownViewResource(R.layout.spinner_dropdown);            mMakeSpinner = (Spinner) findViewById(R.id.makeSpinner);            mMakeSpinner.setAdapter(scaMake);        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; parentView) {            // your code here        }        });</code></pre>","550628","","550628","","2010-12-22 23:15:08","2010-12-22 23:54:15","Dynamic Spinner Using SQLite Database","<android><database><spinner>","1","0","0","",""
"4505009","1","4505287","","2010-12-21 23:44:09","0","411","<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;    &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://eventur.sis.pitt.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","","","","","2010-12-22 03:49:03","android app working on simulator but not on phone","<android><listview>","2","1","","",""
"4505264","1","","","2010-12-22 00:40:37","1","724","<p>I'm trying to post a video file to our server and monitor it's progress.  I followed the steps outlined in <a href=""http://stackoverflow.com/questions/3213899/cant-grab-progress-on-http-post-file-upload-android"">Can't grab progress on http POST file upload (Android)</a> and that worked great, but with larger files my program will hang while writing to the output socket and subsequently cause my phone to lock the WiFi so I can't turn it on/off and then cause it to crash (after a short period).    </p><p>So I attempted to write my own HTTPClient and it works, but also with intermittent success, still falling victim to the random crashes of the method outlined above.  It seems this only occurs on files > 5MB, but I've had it die around 1.3MB and I've even had it successfully transfer a 13MB file.  The fact that it's so random and sporadic is infuriating but I'm convinced there's some reason it's happening.</p><p>Here's my connection code:</p><pre><code>socket.connect(new InetSocketAddress(host, port));socket.setSendBufferSize(1024 * 65);int bytesSent = 0;PrintStream out = new PrintStream(socket.getOutputStream());out.print(headersBuffer);out.print(bodyBuffer);bytesSent += headersBuffer.length() + headersBuffer.length();byte[] bytes = new byte[1024 * 65];int size;while ((size = fileStream.read(bytes)) &gt; 0) {    mListener.transferred(bytesSent);    Log.i(TAG, ""bytes sent: "" + bytesSent);    bytesSent += size;    out.write(bytes, 0, size);       // Random freezes (/blocking?) on this line    out.flush();}Log.i(TAG, ""Made it!"");out.print(lastBoundary);out.flush();</code></pre><p>I've used the debugger to see where it's getting to in the stack when the write just seems to block and it's the OSNetworkSystem.writeSocketImpl() function.  That function just never returns...</p><p>So my next thought was - if the socket will just sit there, perhaps I can interrupt it and force it to close so at least the phone doesn't crash and the user can retry...  I read up on force closing sockets in Android here (since it seems there are some problems): <a href=""http://code.google.com/p/android/issues/detail?can=2&amp;q=7933&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&amp;id=7933"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?can=2&amp;q=7933&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&amp;id=7933</a></p><p>Basically what I did was create a Listener thread that looks at how many bytes have been transferred every 500ms and if there hasn't been a change, attempt to force close the socket by means of </p><pre><code>socket.shutdownOutput();socket.close();</code></pre><p>However the socket returns that it is closed and everything proceeds to fail as outlined above.</p><p>Here's the general sequence of events in Logcat:</p><pre><code>12-21 14:25:26.802  2234  2340 V UploadService: Bytes transferred: 5959800 of: 1319182312-21 14:25:26.802  2234  2340 V UploadService: Bytes transferred: 5963896 of: 1319182312-21 14:25:26.802  2234  2340 V UploadService: Bytes transferred: 5967992 of: 1319182312-21 14:26:00.693  1262  1270 D WifiService: acquireWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@45b48958}12-21 14:26:11.083  1262  1289 D WifiHW  : 'DRIVER LINKSPEED' command timed out.12-21 14:26:21.130  1262  1500 D WifiHW  : 'AP_SCAN 2' command timed out.12-21 14:26:31.177  1262  1500 D WifiHW  : 'SCAN' command timed out.</code></pre><p>And after a few minutes the really bad stuff starts happening and the phone crashes!</p><p>Please help!  Thank you.</p><p>EDIT: Works great over 3G - I'm going to try at home and see if its some sort of router issue.  However - how can I catch this problem and prevent the phone from crashing?</p>","443839","","443839","","2010-12-22 01:14:41","2010-12-22 01:14:41","Android HTTP Multipart POST - Locks WiFi and leads to phone crash","<android><sockets><file-upload><wifi><httpclient>","0","9","1","",""
"4505296","1","","","2010-12-22 00:48:12","0","776","<p>I have a Gallery view, In this view I set up an options menu</p><pre><code>    public boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, EMAIL_MENU_ID, 0, ""Email"");    menu.add(0, SHARE_MENU_ID, 0, ""Share"");    menu.add(0, RATE_MENU_ID, 0, ""Rate"");    menu.add(0, BUY_MENU_ID, 0, ""Buy"");    return true;}</code></pre><p>I have the following method to get the option item selected.</p><pre><code>    public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {     case EMAIL_MENU_ID:         sendMail(index);     case SHARE_MENU_ID:         postToWeb(index);     case RATE_MENU_ID:         postRating(index);     case BUY_MENU_ID:         buy(index);     }    return super.onOptionsItemSelected(item);}</code></pre><p>How could i find the item of the Gallery view that's currently in focus?</p>","550668","","550668","","2010-12-22 01:00:26","2010-12-22 17:59:30","How to find the position clicked from onOptionsItemSelected","<android>","1","1","","",""
"4505297","1","","","2010-12-22 00:48:33","-3","624","<p>I want to send an sms message (either text or data), and that the receiver side will open the web browser according to the specific url i have sent him.</p><p>I need to clarify that I dont want the receiver side to have some kind of an app on his side, that listens to the broadcast of an incoming sms.My intention is that an Intent of the web browser will be open according to my sent url, without an app that listens to it, and without the user presses the url shortcut, that he got in the text msg.</p><p>the idea is that the intent of the browser will be open automaticly as soon as I receive (or open) the sms msg.</p><p>If this is even possible, I will apriciate every answer that will lead me to the right direction. </p><p>thank you all.</p>","550670","","","","","2010-12-22 01:24:47","sending sms message in android that will open the web browser at the receiver. (in android)","<android><sms><broadcast><android-intent><android-pendingintent>","2","1","","",""
"4505311","1","4510032","","2010-12-22 00:51:06","0","474","<p>When I first installed Ubuntu 10.10 64-bit, I was able to see a physical Android device (connected via USB) in the Android Device Chooser (launched from Eclipse). But, after upgrading my kernel from <code>2.6.35-22-generic</code> to <code>2.6.35-24-generic</code>, no devices are listed any more, and I am unable to see any results when running <code>adb devices</code> like so:</p><pre><code>$ ./adb devicesList of devices attached $ </code></pre><p>I have tried booting in the previous kernel version, but I get some <code>udev</code> error, so I was hoping I could get it working with the newer kernel version.</p><p>I figured SO was the best place for this question, as it seems more developer related.</p>","47775","","","","","2011-04-28 08:58:19","After upgrading to 2.6.35-24 kernel, why does adb no longer list devices?","<android>","3","0","","",""
"4505333","1","","","2010-12-22 00:56:40","0","789","<p>Is there any solution to call SOAP services, which are secured with HTTP authentication?</p><p>I am working with this wsdl file: <a href=""https://www.smoneybox.com/service/service.wsdl"" rel=""nofollow"">https://www.smoneybox.com/service/service.wsdl</a></p><p>I've tried to add headerOut to SoapSerializationEnvelope object, but without success. Can you please help me?</p><p>Michal</p>","550674","","367698","","2011-08-21 23:13:59","2011-08-21 23:13:59","HTTP authentication and SOAP request","<java><android><soap><wsdl>","1","0","","",""
"4505449","1","4505820","","2010-12-22 01:22:19","1","1526","<p>I am following the SampleSyncAdapter and upon startup, it appears that my SyncAdapter is not configured correctly.  It reports an error trying to load its meta-data.  How can I isolate the problem?  You can see the other accounts in the system that register correctly.</p><p>Logcat:</p><pre><code>12-21 17:10:50.667 W/PackageManager(  121): Unable to load service info ResolveInfo{4605dcd0 com.myapp.syncadapter.MySyncAdapter p=0 o=0 m=0x108000}12-21 17:10:50.667 W/PackageManager(  121): org.xmlpull.v1.XmlPullParserException: No android.content.SyncAdapter meta-data12-21 17:10:50.667 W/PackageManager(  121):     at android.content.pm.RegisteredServicesCache.parseServiceInfo(RegisteredServicesCache.java:391)12-21 17:10:50.667 W/PackageManager(  121):     at android.content.pm.RegisteredServicesCache.generateServicesMap(RegisteredServicesCache.java:260)12-21 17:10:50.667 W/PackageManager(  121):     at android.content.pm.RegisteredServicesCache$1.onReceive(RegisteredServicesCache.java:110)12-21 17:10:50.667 W/PackageManager(  121):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)12-21 17:10:50.667 W/PackageManager(  121):     at android.os.Handler.handleCallback(Handler.java:587)12-21 17:10:50.667 W/PackageManager(  121):     at android.os.Handler.dispatchMessage(Handler.java:92)12-21 17:10:50.667 W/PackageManager(  121):     at android.os.Looper.loop(Looper.java:123)12-21 17:10:50.667 W/PackageManager(  121):     at com.android.server.ServerThread.run(SystemServer.java:570)12-21 17:10:50.747 D/Sources (  294): Creating external source for type=com.skype.contacts.sync, packageName=com.skype.raider12-21 17:10:50.747 D/Sources (  294): Creating external source for type=com.twitter.android.auth.login, packageName=com.twitter.android12-21 17:10:50.747 D/Sources (  294): Creating external source for type=com.example.android.samplesync, packageName=com.example.android.samplesync12-21 17:10:50.747 W/PackageManager(  121): Unable to load service info ResolveInfo{460504b0 com.myapp.syncadapter.MySyncAdapter p=0 o=0 m=0x108000}12-21 17:10:50.747 W/PackageManager(  121): org.xmlpull.v1.XmlPullParserException: No android.content.SyncAdapter meta-data12-21 17:10:50.747 W/PackageManager(  121):     at android.content.pm.RegisteredServicesCache.parseServiceInfo(RegisteredServicesCache.java:391)12-21 17:10:50.747 W/PackageManager(  121):     at android.content.pm.RegisteredServicesCache.generateServicesMap(RegisteredServicesCache.java:260)12-21 17:10:50.747 W/PackageManager(  121):     at android.content.pm.RegisteredServicesCache$1.onReceive(RegisteredServicesCache.java:110)12-21 17:10:50.747 W/PackageManager(  121):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)12-21 17:10:50.747 W/PackageManager(  121):     at android.os.Handler.handleCallback(Handler.java:587)12-21 17:10:50.747 W/PackageManager(  121):     at android.os.Handler.dispatchMessage(Handler.java:92)12-21 17:10:50.747 W/PackageManager(  121):     at android.os.Looper.loop(Looper.java:123)12-21 17:10:50.747 W/PackageManager(  121):     at com.android.server.ServerThread.run(SystemServer.java:570)</code></pre><p>Also note, I have tried to force mis-configuration to see if I could change the error in a way that would point out my flaw.  Unfortunately, most of the misconfigurations are caught by the (pre)compiler.</p><p>I managed to find this logcat entry after an uninstall/install which corresponds to my meta-data node inside the AndroidManifest.xml for the Sync Adapter's service entry.  It may be a very important clue that I am investigating.</p><pre><code>12-21 18:46:36.026 D/AndroidRuntime(28641): &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-21 18:46:36.026 D/AndroidRuntime(28641): CheckJNI is OFF12-21 18:46:36.106 D/AndroidRuntime(28641): --- registering native functions ---12-21 18:46:36.836 D/PackageParser(  121): Scanning package: /data/app/vmdl13904.tmp12-21 18:46:36.856 W/PackageParser(  121): Unknown element under &lt;intent-filter&gt;: meta-data at /data/app/vmdl13904.tmp Binary XML file line #25412-21 18:46:36.856 W/PackageParser(  121): Unknown element under &lt;intent-filter&gt;: meta-data at /data/app/vmdl13904.tmp Binary XML file line #25712-21 18:46:37.166 D/PackageManager(  121): Scanning package com.myapp</code></pre>","157804","","1908677","","2013-02-08 16:30:43","2013-02-08 16:30:43","Why No android.content.SyncAdapter meta-data registering sync-adapter?","<android><metadata><android-syncadapter><registering>","1","0","","",""
"4505557","1","","","2010-12-22 01:53:06","0","2895","<p>I show an AlertDialog on the first start-up using code I copied and don't fully understand, but it works great as a EULA. I want to show the longwinded legal text in a smaller font. Text is loaded from a file in the RES/ASSETS directory. </p><p>I'm guessing the standard AlertDialog has a built-in TextView? If that's the case then I need to get access to that then change the TextSize property of the TextView? Thanks for any suggestions. </p>","512588","","","","","2011-03-03 05:14:08","AlertDialog text properties","<android>","3","0","","",""
"4505575","1","4567012","","2010-12-22 01:56:17","1","249","<p>I was trying to transfer a mp3 file to mediaplayer through socket. Here is the article I followed:<a href=""http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/"" rel=""nofollow"">http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/</a></p><p>I also add code for mediaplayer</p><pre><code>SERVERADDRESS = ""http://"" + SERVERIP + "":""+Integer.toString(SERVERPORT);public class MediaPlayerThread implements Runnable {    public void run() {        mediaPlayer = new MediaPlayer();        try {        mediaPlayer.setDataSource(SERVERADDRESS);        mediaPlayer.prepare();        mediaPlayer.start();        } catch (Exception e) {        Log.e(""socketExample"",""Error! "" + Log.getStackTraceString(e));        }    }}</code></pre><p>I can see the connection is established, but I cannot get anything out of BufferedReader. Does this mean MediaPlayer doesn't send HTTP request? Thanks!</p>","547589","","547589","","2010-12-22 02:04:34","2010-12-30 23:15:58","MediaPlayer doesn't send HTTP request?","<android><http><sockets><media-player>","1","0","1","",""
"4505629","1","","","2010-12-22 02:15:02","0","423","<p>I want to make app for android and iphone ""writing once"" and run in both.</p><p>Despite hardware, OS and native interface differences between this two platforms there is a special technology to make this easy, or I need to think in web apps with only html5, for example?</p><p>I read a bit material related with rhodes, titanium app and a others frameworks, but I don't know if is better to spend time studying the sdks and native tools or to invest in only solution. It's worthwhile?</p>","220175","","","","","2010-12-22 12:38:42","Best Solution, framework or technology to make apps for android and iphone","<iphone><android><frameworks><mobile>","3","0","1","",""
"4505633","1","4519106","","2010-12-22 02:15:16","6","1847","<p>I'm trying to build PocketSphinx for Android using the PocketSphinxAndroidDemo project. I've given up om my quest to build it using Cygwin and Windows and installed an Ubuntu VM. I'm making progress but I seem to be stuck and I can't seem to figure it out. It has to be something simple that I'm missing. The ndk-build gives the following output (clipped):</p><pre><code>Compile thumb  : pocketsphinx_jni &lt;= pocketsphinx_wrap.c/home/user/development/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:760:26: error: pocketsphinx.h: No such file or directory/home/user/development/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:761:28: error: sphinxbase/err.h: No such file or directory</code></pre><p>The header files are (obviously) not in the same folder as the JNI files. The LOCAL_C_INCLUDES flag has been set in Android.mk file to include the needed headers -</p><pre><code>include $(CLEAR_VARS)LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android \            $(SPHINX_PATH)/sphinxbase/include/sphinxbase \            $(SPHINX_PATH)/sphinxbase/include \            $(SPHINX_PATH)/pocketsphinx/include</code></pre><p>I should note that my SPHINX_PATH variable looks like this, and it's correct -</p><pre><code>SPHINX_PATH := ~/development</code></pre><p>If I copy the header files over into the /jni/ folder I get farther but then the compiler starts yelling at me for header files missing in other locations. Surely I'm missing something simple. Isn't there somewhere I can set a ""Look in these locations for header files before blowing up"" flag?</p><p>I'm not a C/C++ or a Linux guy so I'm kind of in the dark here. Any help would be greatly appreciated. Thanks!</p>","451485","","451485","","2010-12-22 02:21:54","2012-04-12 17:30:52","Problems trying to build PocketSphinx for Android using NDK","<android><android-ndk><android-ndk-r5>","2","1","4","",""
"4505645","1","4505927","","2010-12-22 02:20:49","-1","873","<p>I get 12-21 21:19:09.384: ERROR/AndroidRuntime(4063): java.lang.OutOfMemoryError</p><p>Thanks! </p><pre><code>@Overridepublic void initScene() {    //openOptionsMenu();    //plane = new Box(1.5f,1.5f,1.5f);    scene.addChild(plane);    // Create a Bitmap. Here we're generating it from an embedded resource,    // but the Bitmap could be created in any manner (eg, dynamically).    Bitmap b = Utils.makeBitmapFromResourceId(this, R.drawable.clouds_alpha2b);    // Upload the Bitmap via TextureManager and assign it a     Shared.textureManager().addTextureId(b, ""battleback"", false);    // Unless you have a specific reason for doing so, recycle the Bitmap,    // as it is no longer necessary.    b.recycle();    // Create a TextureVo using the textureId that was previously added     // to the TextureManager (""uglysquares"").    TextureVo texture = new TextureVo(""battleback"");    // Add it to the TexturesList held by the Object3d,     // and it will be duly rendered.    plane.textures().add(texture);    plane.position().y = -.5f;    plane.position().z = 0;    plane.position().x = 0;    plane.rotation().y -= 60;    skyBox.rotation().y -= 60;    skyBox.addTexture(SkyBox.Face.All, R.drawable.clouds_alpha2b, ""mytexture"");    scene.addChild(skyBox);    IParser parser = Parser.createParser(Parser.Type.MD2,            getResources(), ""com.thinknew.androidbattle:raw/blade"", true);    parser.parse();    revenant = parser.getParsedAnimationObject();    //revenant.position().x = -1;    revenant.scale().x = revenant.scale().y = revenant.scale().z = .025f;    revenant.rotation().z = -60;    revenant.rotation().x = -90;    revenant.position().x = -1;    revenant.position().z = -1;    revenant.setFps(20);    revenant.animationEnabled();    revenant.play(""stand"", true);    scene.addChild(revenant);    parser = Parser.createParser(Parser.Type.MD2,             getResources(), ""com.thinknew.androidbattle:raw/blade"", true);    parser.parse();    fatso = parser.getParsedAnimationObject();    fatso.scale().x = fatso.scale().y = fatso.scale().z = .025f;    fatso.rotation().z = -250;    fatso.rotation().x = -90;    fatso.position().x = 1;    fatso.position().z = 1;    fatso.setFps(20);    fatso.animationEnabled();    fatso.play(""stand"", true);    scene.addChild(fatso);    Light light = new Light();    scene.lights().add(light);    scene.camera().position.y = 2;    scene.camera().position.x = -2;    scene.camera().position.z = 5;    scene.camera().target = new Number3d(0, 1, 0);}12-21 21:45:18.668: ERROR/libs3c2drender(1917): int S3c2DRender::DoG2D(unsigned int, s3c_img*, s3c_rect*, unsigned int, s3c_img*, s3c_rect*, int, int)::S3C_G2D_ROTATOR_18176 fail12-21 21:45:50.763: ERROR/PowerManagerService(1917): CurLock p:3 mPS:112-21 21:45:50.763: ERROR/PowerManagerService(1917): type=SCREEN_DIM_WAKE_LOCK           'StayOnWhilePluggedIn Screen Dim' active (minState=1)12-21 21:45:50.763: ERROR/PowerManagerService(1917): type=PARTIAL_WAKE_LOCK              'StayOnWhilePluggedIn Partial' active (minState=0)12-21 21:47:08.768: ERROR/libs3c2drender(1917): int S3c2DRender::DoG2D(unsigned int, s3c_img*, s3c_rect*, unsigned int, s3c_img*, s3c_rect*, int, int)::S3C_G2D_ROTATOR_18176 fail12-21 21:47:58.468: ERROR/dalvikvm-heap(4414): Out of memory on a 27232-byte allocation.</code></pre>","510848","","44729","","2010-12-22 03:28:31","2011-03-01 01:58:58","Does Anyone know what is causing this GLThread Out of Memory Error?","<android><opengl-es>","1","10","1","",""
"4505845","1","","","2010-12-22 03:09:59","22","10163","<p>I'm writing some custom preference dialogs in Android by extending the <code>DialogPreference</code> class. However, I'm getting a bit concerned at the amount of boiler plate code that is needed for this as there appears to be a lot of behaviour to test. </p><p>For instance, this example of a number preference dialog is fairly typical:<a href=""http://svn.jimblackler.net/jimblackler/trunk/workspace/NewsWidget/src/net/jimblackler/newswidget/NumberPreference.java"">http://svn.jimblackler.net/jimblackler/trunk/workspace/NewsWidget/src/net/jimblackler/newswidget/NumberPreference.java</a></p><p>In particular, the <code>onSave()</code>/<code>RestoreInstanceState()</code> methods and ""class SavedState"" parts, which are needed so that the current changes to the dialog are retained on orientation changes are quite verbose and complex. </p><p>Does anyone have any tips for writing DialogPreference classes in a more concise way?</p>","483701","","1210260","","2012-03-24 01:15:35","2012-03-24 01:15:35","Concise way of writing new DialogPreference classes?","<java><android><mobile>","1","0","25","",""
"4506024","1","4506037","","2010-12-22 03:50:57","1","2198","<p>I've setup a new Repo for Android source code, and after executing the repo sync, there are no files in the repo directory. Did I miss something?</p><p>I used:</p><pre><code>repo init -u git://android.git.kernel.org/platform/manifest.git</code></pre><blockquote>  <p>repo initialized in /home/tarandeep/code/Android</p></blockquote><pre><code>repo sync</code></pre><p>...It downloaded GBs of data (I can confirm via network monitor) and then nothing appeared in the Android directory.</p>","389161","","","","","2012-03-29 16:50:04","After Repo sync, there are no files in the directory","<android><repository>","2","1","","",""
"4506053","1","","","2010-12-22 04:00:35","1","633","<p>I have a ListActivity which will display three widgets for each row.  One of them is a checkbox.</p><pre><code>public class GroceryItems extends ListActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.grocery_items_list); setUpData();}</code></pre><p>In my setUpData() I'm using a SimpleAdapter (this is all a test case).</p><pre><code>private void setUpData(){// generate the mapsString[] from = new String[] {""checked"", ""item_name"",""quantity""};int[] toDisplay = new int[] {R.id.checkbox1, R.id.text1, R.id.text2};List&lt;HashMap&lt;String, Object&gt;&gt; fillMaps = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();for(int i = 0; i &lt; 20; i++){HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();if(i==3){map.put(""checked"", false);}else{map.put(""checked"", true);}  map.put(""item_name"", items[i]);  map.put(""quantity"",""3"");  fillMaps.add(map);}ListView lv= getListView();    SimpleAdapter adapter = new SimpleAdapter(this, fillMaps, R.layout.common_rowitem, from, toDisplay);    lv.setAdapter(adapter);    CheckBox cb = (CheckBox) lv.findViewById(R.id.checkbox1);    cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {        public void onCheckedChanged(CompoundButton cb, boolean isChecked) {                        if(cb.isChecked()) {                                    // action            }            else {                // action            }        }               }); }</code></pre><p>On findViewById I always get a null returned and can't add the listener.  I have also tried to use a view binder</p><pre><code>   adapter.setViewBinder(new SimpleAdapter.ViewBinder() {   public boolean setViewValue(View view, Object data, String textRepresentation) {if (view.getId()==R.id.checkbox1){  CheckBox cb = (CheckBox) view;  if (data != null){   cb.setChecked((Boolean)data);   return true;  }} return false; }    });</code></pre><p>This also fails to install the handler.</p><p>Here are the two layout views</p><p>grocery_items_list.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;ListView android:id=""@+id/android:list""      android:layout_width=""wrap_content""     android:layout_height=""wrap_content""/&gt;</code></pre><p></p><p>common_rowitem.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>          </p><p></p><p>Any suggestions or help is appreciated.</p>","534611","","655443","","2011-05-11 09:19:25","2011-05-11 09:19:25","How to get proper view in ListActivity to set OnCheckedChangeListener for CheckBox widget in Android","<android><checkbox><listactivity>","0","2","","",""
"4506097","1","4898388","","2010-12-22 04:13:03","1","1645","<p>i am creating a custom ui component for android ,its working fine, but how to add android:keepScreenOn to this custom UI component ,so that i could set android:keepScreenOn=""true"" for the custom component</p>","413770","","413770","","2010-12-22 04:18:41","2011-02-04 13:17:23","Android android:keepScreenOn","<android>","1","1","","",""
"4506153","1","4506185","","2010-12-22 04:25:30","0","2066","<p>I have a Tab Interface with two separate activities, lets call them ActA and ActB. Both of these activities can launch a custom Dialog, and I would like to have a button within this dialog call a method of ActBs, (ActB is a ListView of a database, and the method in question is to fill the list, basically refresh).How could I have the dialog box activity reference ActB to call its method? Thanks!</p><p>EDIT: I'll give some more details. I worked this program off of Google's Notepad tutorial which teaches about SQLite DBs. I took that and split it into two activities, one for creating the entries, and then saving them (ActA); and another for viewing the entries (ActB). Now, more recently, I put those activities in tabs rather than accessing them through the phone's menu key. Unfortunately, this appears to have stopped the ListActivity from calling its ""fillData()"" method.</p>","468498","","468498","","2010-12-22 05:23:18","2012-07-25 18:54:59","Call method of an activity from dialog","<android><methods><dialog><activity><tabs>","3","0","","",""
"4506294","1","4506490","","2010-12-22 04:59:29","3","1710","<p>I have an application that I now want to split part of off into a library project so I can re-use it in several other places.  Among the stuff in there being re-used is a custom view, which uses code from this answer (http://stackoverflow.com/questions/1258275/vertical-rotated-label-in-android) with some adaptations I made to it.  Anyway, the styleable resources don't work properly.  The attr.xml looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;     &lt;declare-styleable name=""VerticalTextView""&gt;        &lt;attr name=""text"" format=""string"" /&gt;        &lt;attr name=""textColor"" format=""color"" /&gt;        &lt;attr name=""textSize"" format=""dimension"" /&gt;        &lt;attr name=""rotateLeft"" format=""boolean"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>and it's referenced in a layout file in the library project.  I get the following error in Eclipse when trying to compile the main project:</p><p>[2010-12-20 23:29:38 - MyApp] C:\Library\res\layout\main.xml:124: error: No resource identifier found for attribute 'text' in package 'com.mydomain.mylibrary'</p><p>I'm puzzled.  I've tried everything I can think of to get this to work, and I just haven't found the magic combination.  How do I make styleable resources work inside of a library project?</p>","104918","","","","","2012-09-26 08:11:20","Android: Library projects and styleable resources","<android><eclipse>","2","2","2","",""
"4506401","1","4507731","","2010-12-22 05:21:09","0","3761","<p>I want to delete the selected record form my SQLite Database in my android application. But I can't do it and getting the exception while program runs.</p><p>Here is what I am trying to delete the Particular Selected Record.</p><pre><code> public void deleteRecord(String datarecord)   {       this.db.delete(TABLE_NAME, ""name=""+datarecord , null);   }</code></pre><p>And this is what I am doing on the click event from where I perform the delete operation of the selected Record.</p><pre><code>dh.deleteRecord(FavMusicList[position]);</code></pre><p>dh is the object of my DataHelper Class where I have created the deleteRecord function. </p><p>I am getting the SQLite Exception for the Syntax Error. So I guess I am surely making mistake with the Syntax to delete the Particular Selected Record but couldn't know what exactly I have to correct.</p><p>Can anybody please help me in this?</p><p>Thanks,david</p><p>My Stack Trace:</p><pre><code>12-22 14:39:37.892: ERROR/AndroidRuntime(676): FATAL EXCEPTION: main12-22 14:39:37.892: ERROR/AndroidRuntime(676): android.database.sqlite.SQLiteException: near ""very"": syntax error: , while compiling: DELETE FROM table1 WHERE name=Iâm very drunk12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:64)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:80)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteStatement.&lt;init&gt;(SQLiteStatement.java:36)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1145)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1589)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at com.android.soundmachine.DataHelper.deleteRecord(DataHelper.java:42)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at com.android.soundmachine.FavoritesListing$SoundMacHineAdapter$1$1.onClick(FavoritesListing.java:192)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.os.Handler.dispatchMessage(Handler.java:99)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.os.Looper.loop(Looper.java:123)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at java.lang.reflect.Method.invokeNative(Native Method)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at java.lang.reflect.Method.invoke(Method.java:521)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-22 14:39:37.892: ERROR/AndroidRuntime(676):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","422859","","948041","","2011-12-13 11:32:29","2012-07-04 09:03:11","Query for deleting a particular record form the SQLite Database in android","<android><database><sqlite><records>","2","4","","",""
"4506486","1","","","2010-12-22 05:39:50","1","1667","<p>my Codes: </p><hr><pre><code>package net.tq5.bubbleexplosion;import android.app.Activity;import android.content.Context;import android.graphics.drawable.AnimationDrawable;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.view.View.OnTouchListener;import android.widget.FrameLayout;import android.widget.ImageView;public class BubbleExplosionActivity extends Activity { public static final String TAG = ""BubbleExplosionActivity""; /** Called when the activity is first created. */ private FrameLayout parent; private ExplosionView customView; private AnimationDrawable exal; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  // set no title;  requestWindowFeature(Window.FEATURE_NO_TITLE);  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    WindowManager.LayoutParams.FLAG_FULLSCREEN);  // Create a FrameLayout and set the background;  parent = new FrameLayout(this);  parent.setBackgroundResource(R.drawable.bg);  customView = new ExplosionView(this);  customView.setVisibility(View.INVISIBLE);  customView.setBackgroundResource(R.anim.explosion);  exal = (AnimationDrawable) customView.getBackground();  parent.addView(customView);  parent.setOnTouchListener(new LayoutListener());  setContentView(parent); } class ExplosionView extends ImageView {  public ExplosionView(Context context) {   super(context);  }  // handle the location of the Explosion;  public void setLocation(int left, int top) {   this.setFrame(left, top, left + 40, top + 40);  } } class LayoutListener implements OnTouchListener {  @Override  public boolean onTouch(View view, MotionEvent event) {   // first you stop the animation   // you can always restart it;   customView.setVisibility(View.INVISIBLE);   if (exal.isRunning())    return false;//    exal.stop();   float x = event.getX();   float y = event.getY();   Log.i(TAG, ""on Touch"");   customView.setLocation((int) x - 20, (int) y - 20);   customView.setVisibility(View.VISIBLE);   exal.start();   return false;  } }}</code></pre><hr><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=""true""&gt;     &lt;item android:drawable=""@drawable/bubble0"" android:duration=""500"" /&gt;    &lt;item android:drawable=""@drawable/explode1"" android:duration=""500"" /&gt;    &lt;item android:drawable=""@drawable/explode2"" android:duration=""500"" /&gt;    &lt;item android:drawable=""@drawable/explode3"" android:duration=""500"" /&gt;    &lt;item android:drawable=""@drawable/explode4"" android:duration=""500"" /&gt;    &lt;item android:drawable=""@drawable/explode5"" android:duration=""500"" /&gt;&lt;/animation-list&gt;</code></pre><hr><p>The image bubble0 always show two times; It seems that the animation has been fired two times, but I event tried this to make sure the start() method only be triggered once, but the animation will still be performed twice: </p><hr><pre><code>public class BubbleExplosionActivity extends Activity { public static final String TAG = ""BubbleExplosionActivity""; /** Called when the activity is first created. */ private FrameLayout parent; private ExplosionView customView; private AnimationDrawable exal; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  // set no title;  requestWindowFeature(Window.FEATURE_NO_TITLE);  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    WindowManager.LayoutParams.FLAG_FULLSCREEN);  // Create a FrameLayout and set the background;  parent = new FrameLayout(this);  parent.setBackgroundResource(R.drawable.bg);  customView = new ExplosionView(this);  customView.setVisibility(View.INVISIBLE);  customView.setBackgroundResource(R.anim.explosion);  exal = (AnimationDrawable) customView.getBackground();  parent.addView(customView);  parent.setOnTouchListener(new LayoutListener());  setContentView(parent);  (new Handler()).postDelayed(new Runnable() {   @Override   public void run() {    customView.setLocation((int) 100 - 20, (int) 100 - 20);    customView.setVisibility(View.VISIBLE);    exal.start();   }  }, 3000); }}</code></pre><hr><p>Help!</p>","401559","","","","","2011-06-02 00:17:37","Android AnimationDrawable, why always shot two times?","<android><animation><drawable>","1","0","1","",""
"4506505","1","4514590","","2010-12-22 05:43:15","0","809","<p>I'm currently trying to debug my Android App. I've built out the first screen and it's using a Tab Host. I had made a few minor modifications to TabHost to add a few extra methods (full source to follow) to work with some other parts of my App.</p><p>However, when I try to run the following I get a null pointer exception on Inflate and it doesn't really tell me anything about why. I downloaded the full Android source for my SDK and added it in eclipse to step through the inflation process and find if I could get any more info about the error that way.</p><p>I found exactly what line was causing the error (source included below) but when stepping through the debugger something strange happened. The logic is an if/else case where if == true it should return a New Parser() object, I ran that code and it successfully stepped through the constructor of Parser, yet after returning from that, the next instruction stepped right out of the statement group to the line below returning null.</p><p>The constructor appears to have run properly (it's located in XmlBlock.java in case you're wondering) yet it still steps to the next line and returns null and I have no idea why this is. I've searched for solutions but so far the only similar problem was encountered by someone using a TabActivity which is not suitable for my Application. I need Tabs and their views to be generated by objects I've defined within my project (similar to IOS style View Controllers) and not separate processes via using Intents to launch new Activities.</p><p>Can someone please have a look at my source and tell me what I'm doing wrong here because no one else can seem to tell me what the problem is? Here's another direct link to the source involved: <a href=""http://pastebin.com/9VRE2UGW"" rel=""nofollow"">http://pastebin.com/9VRE2UGW</a></p>","550828","","","","","2010-12-22 23:16:55","Null Pointer Exception when inflating from XML (Not using TabActivity)","<android><android-widget><nullpointerexception><android-tabhost>","2","2","","",""
"4506571","1","4516765","","2010-12-22 05:55:09","11","3806","<p><strong>How to get the facebook id or url of a contacts that's been synced to the native contacts app via Facebook sync adapter?</strong></p><p>I went through different urls, but didn't see any info regarding facebook.</p><p>I tried</p><pre><code>ContactsContract.Data.CONTENT_URIContactsContract.CommonDataKinds.Email.CONTENT_URIContactsContract.CommonDataKinds.Phone.CONTENT_URIContactsContract.Contacts.CONTENT_URI</code></pre><p>as URIs already in the code below:</p><pre><code>    Uri uri = ContactsContract.Data.CONTENT_URI;    Cursor c = getContentResolver().query(uri, null, null, null, null);    while (c.moveToNext()) {        for (int i=0; i&lt;c.getColumnCount(); i++) {            Log.d(TAG, c.getColumnName(i) + "": "" +  c.getString(i));        }        Log.d(TAG, ""=================================="");    }</code></pre><p>I do get a column value like</p><pre><code>contact_status_res_package: com.facebook.katana</code></pre><p>in this dump, and I also get the contacts status (contact_status column), but nowhere do I see the facebook url or id of this contact.</p>","241475","","","","","2011-01-03 16:56:07","How to get a contact's facebook id or url from native contacts / content resolver?","<android><android-contacts><android-contentprovider><facebook>","1","1","3","",""
"4506576","1","","","2010-12-22 05:55:39","1","4297","<p>I want to play a YouTube video in webview in android, which should not open in a new window. It should only play in webview on android.</p>","550843","","703019","","2012-03-08 14:51:18","2013-02-01 09:15:18","How to Play Youtube video in webview in android?","<android>","2","2","1","",""
"4506612","1","","","2010-12-22 06:04:59","12","39335","<p>I am trying to write a file to SDCard with below Code (permission android.permission.WRITE_EXTERNAL_STORAGE already set in manifest.xml). Upon execution *nmea_file.createNewFile();* throws exception with ""Permission Denied"". Any guesses why would this be happening?</p><pre><code>        if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))           {             Log.d(TAG, ""Sdcard was not mounted !!"" );           }        else          {            File nmea_file;             File root = Environment.getExternalStorageDirectory();            FileWriter nmea_writer = null;            try {                nmea_file = new File(root,""NMEA.txt"");                if(!nmea_file.exists()) {                        Log.w(TAG, ""File Doesn't Exists!"");                        nmea_file.createNewFile();                    }                nmea_writer = new FileWriter(nmea_file);                nmea_writer.append(nmea);                nmea_writer.flush();            }            catch (IOException e)             {                Log.w(TAG, ""Unable to write"", e);            }             finally             {                if (nmea_writer != null)                 {                    try                     {                        nmea_writer.close();                    }                     catch (IOException e)                     {                        Log.w(TAG, ""Exception closing file"", e);                    }                }            }          }</code></pre>","329604","","","","","2013-10-18 07:30:41","Android SD card writing, Permission Denied!","<android><android-sdcard>","5","2","2","",""
"4506700","1","4533603","","2010-12-22 06:25:05","1","241","<p>I wanted to add a custom ImageButton on top of my SurfaceView so it essentially scrolls with the View. The canvas scrolls and zooms with a matrix. How could I go about doing this? Thanks.</p>","385051","","86860","","2010-12-23 20:46:26","2010-12-26 11:06:36","How can I add a Button to a custom scrolling and zooming SurfaceView?","<android><surfaceview><custom-view>","1","0","","",""
"4506708","1","11383481","","2010-12-22 06:26:11","10","10941","<pre><code>public static int RGB(float[] hsv) {    return Color.HSVToColor(hsv);}</code></pre><p>this function add an int, froma  color. how can i convert that int to a hexa string: #efefef</p>","472537","","","","","2013-01-15 16:35:34","Android convert color int to hexa String","<android><colors>","2","0","1","",""
"4506725","1","4506845","","2010-12-22 06:30:55","1","251","<p>The UI thread of my app locks up at indeterminate and un-reproduceable times. Can anyone suggest a tool or a mindset that I should use to debug this problem? I can't really predict when it happens, so it doesn't seem to be a problem with the code itself.</p><p>Any help?</p>","118241","","","","","2010-12-22 06:54:08","Android App Unresponsive","<android><debugging>","2","0","","",""
"4506728","1","4508722","","2010-12-22 06:31:21","0","603","<p>android is supporting <code>javax.xml.xpath.XPath</code> in api level 8 ie 2.2<br>But i am writing some application for 2.0.1  in that there is a need for XPath parser. I downloaded jar file from aml-apis.jar<br>But when i added the jar file to my application i got the following build error </p><pre><code>trouble processing ""javax/xml/XMLConstants.class"": [2010-12-21 15:49:59 - Client] Attempt to include a core class (java.* or javax.*) in something other than a core library. It is likely that you have attempted to include in an application the core library (or a part thereof) from a desktop virtual machine. This will most assuredly not work. At a minimum, it jeopardizes the compatibility of your app with future versions of the platform. It is also often of questionable legality.   If you really intend to build a core library -- which is only appropriate 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.   If you go ahead and use ""--core-library"" but are in fact building an application, then be forewarned that your application will still fail to build or run, at some point. Please be prepared for angry customers who find, for example, that your application ceases to function once they upgrade their operating system. You will be to blame for this problem. If you are legitimately using some code that happens to be in a core package, then the easiest safe alternative you have is to repackage that code. That is, move the classes in question into your own package namespace. This means that they will never be in conflict with core system classes. If you find that you cannot do this, then that is an indication that the path you are on will ultimately lead to pain, suffering, grief, and lamentation.     [2010-12-21 15:49:59 - Client] 1 error; aborting     [2010-12-21 15:49:59 - Client] Conversion to Dalvik format failed with error     1 </code></pre><p>Please help me!Thanks</p>","521380","","81717","","2012-02-15 23:53:23","2012-02-15 23:53:23","xpath support in android 2.0.1","<android>","1","0","","",""
"4506742","1","","","2010-12-22 06:32:40","2","1694","<pre><code>can anybody have any idea how to integrate Bonjour in Android Application.</code></pre><p>any help will be appreciative.thanks a lot.</p>","397901","","","","","2011-02-11 05:47:32","how to integrate Bonjour in Android Application","<android><bonjour>","0","1","","",""
"4506764","1","","","2010-12-22 06:38:01","0","398","<p>As per my requirement I need to add tow rectangles in a existing xml layout through java code. I can create the rectangle shapes using ondraw method, but using intents in fresh layout. I need to display that shapes in existing layout. If any one faces this experience, please help me to create shapes in a xml. Any responce would be appreciated.</p><p>Thanks in advance</p>","524937","","524937","","2010-12-29 10:45:55","2010-12-29 10:54:07","how to add shapes using java code to a xml layout?","<android>","1","0","","",""
"4506868","1","4512087","","2010-12-22 06:57:18","1","512","<p>Which Mobile Devices Support Databases ?</p><p>Iphone, Android, Symbian, J2ME, Palm, BlackBerry ?</p>","155196","","236247","","2011-06-28 16:08:15","2011-06-28 16:08:15","Which Mobile Devices Support Databases like SQLite?","<iphone><android><sqlite><symbian>","2","0","","",""
"4506874","1","","","2010-12-22 06:58:02","2","4852","<p>I am new to Ubuntu. I cannot run <code>adb</code> in my terminal. When I try to run <code>adb</code> in the terminal I get the following error: </p><pre><code>No command 'adb' found</code></pre><p>At the same time I can run my Android application in the emulator.  What can be the problem?</p>","482604","","812149","","2012-02-05 16:59:16","2014-03-13 11:56:33","Cannot run adb from terminal in Ubuntu","<android><ubuntu><adb>","5","2","","",""
"4506906","1","4507129","","2010-12-22 07:04:19","2","863","<p>I want to import .doc files from sdcard into my application and also in database of my application but when i am importing file text is not displaying correctly. It is showing symbols characters. How to change format from .doc to .txt</p>","493193","","493193","","2010-12-22 07:32:28","2010-12-22 07:43:08","how to import .doc files from sd card into application database?","<android>","2","0","","",""
"4506949","1","4509928","","2010-12-22 07:11:53","0","158","<p>I wanted to know how to start with a new device addition to android.Say, I have a new hardware, a barcode scanner and want to add this to my android phone. How do I do this? i mean how do the OEMs go about this? Do they have some kind of tie-up with Google for this proprietary addition?</p><p>My understanding/approach is as below:1. Take the firmware of the new hardware.2. Interface it with android (here is my doubt,how do I do this?)3. Write an android application to use the device, say add the costs of all objects scanned by the new h/w. The firmware sends me the barcode. I, in my android app, collect all the codes, match their prices and add them up.Is this app written in java?</p><p>RegardsAad</p>","523460","","","","","2010-12-22 15:22:23","Firmware support in android","<android><firmware>","1","0","","",""
"4506971","1","","","2010-12-22 07:16:33","0","350","<p>I have microphone instead of phone. So it will throws SD card is removed error. What can i do? How can i change the path? and is it possible in windows? please help me as soon as possible.my code is on <a href=""http://www.benmccann.com/blog/android-audio-recording-tutorial/comment-page-2/#comment-34668"" rel=""nofollow"">http://www.benmccann.com/blog/android-audio-recording-tutorial/comment-page-2/#comment-34668</a></p>","544345","","64421","","2013-04-07 05:50:58","2013-04-07 05:50:58","voice recording in android","<android>","1","0","","",""
"4507001","1","","","2010-12-22 07:22:12","0","3511","<p>I want to change the background of the spinner in ProgressBar from white to blue.Can anybody help me....</p>","522834","","","","","2010-12-22 08:01:09","Android ProgressBar","<android><progress-bar>","1","2","","",""
"4507018","1","4507034","","2010-12-22 07:24:39","2","825","<p>What does msm means in android source?</p><p>there you go. simplest question ever. but no google result for it.</p>","183132","","","","","2010-12-22 07:26:36","What does msm means in android source?","<android><documentation><acronym>","1","0","1","",""
"4507079","1","","","2010-12-22 07:32:05","6","7149","<p>guys I got a problem with my listview. It runs so slow when scrolling can anybody help me. My listview is custom layout using relative with 3 textview and 1 imageview each row with all content is retrieve from the web. I use a custom adapter and a view holder.</p><p>below is my codes on how I use the adapter. </p><pre><code>public class MessageList extends ListActivity {    @Override    public void onCreate(Bundle icicle) {     super.onCreate(icicle);        setContentView(R.layout.listarticle);        loadFeed(link);        setListAdapter(new IconAdapter(this));    } /* This method load xml file and parse it into message object*/ private void loadFeed(String link){     try{      BaseFeedParser parser = new BaseFeedParser(link);      messages = parser.parse();      titles = new ArrayList&lt;String&gt;(messages.size());      image = new ArrayList&lt;String&gt;(messages.size());      date_post = new ArrayList&lt;String&gt;(messages.size());      descs = new ArrayList&lt;String&gt;(messages.size());      for (Message msg : messages){       titles.add(msg.getTitle());       image.add(msg.getImageLink().toString());       date_post.add(msg.getDate());       descs.add(msg.getDescription());      }       } catch (Throwable t){      Log.e(""AndroidNews"",t.getMessage(),t);     }    } /*this is my custom baseadapter */ class IconAdapter extends BaseAdapter{  private LayoutInflater mInflater;  public IconAdapter(Context cxt){   mInflater = LayoutInflater.from(cxt);  }  public class ViewHolder{   private TextView title;   private TextView date;   private TextView desc;   private ImageView thumb;  }  public View getView(int positiion, View convertView, ViewGroup parent){   ViewHolder holder;   if (convertView==null){    convertView = mInflater.inflate(R.layout.row, null);    holder = new ViewHolder();    holder.title = (TextView) convertView.findViewById(R.id.title);    holder.date = (TextView) convertView.findViewById(R.id.date);    holder.desc = (TextView) convertView.findViewById(R.id.deskripsi);    holder.thumb = (ImageView) convertView.findViewById(R.id.thumbnail);    convertView.setTag(holder);   }else{    holder = (ViewHolder) convertView.getTag();   }   holder.title.setText(titles.get(positiion));   holder.date.setText(date_post.get(positiion));   holder.desc.setText(descs.get(positiion).substring(0, 55)+""..."");   Drawable draw = LoadImageFromWebOperation(image.get(positiion));   holder.thumb.setImageDrawable(draw);   return convertView;  }  /* this method take image from url that retrieve from xml*/  public Drawable LoadImageFromWebOperation(String url){   try{    InputStream is = (InputStream) new URL(url).getContent();    Drawable d = Drawable.createFromStream(is, ""src name"");    return d;   }catch (Exception e){    Log.d(""image"", url, e);    return null;   }  }  @Override  public int getCount() {   return messages.size();  }  @Override  public Object getItem(int position) {   return messages.get(position);  }  @Override  public long getItemId(int position) {   return position;  } }</code></pre>","550921","","550921","","2010-12-22 07:56:52","2014-01-27 10:44:44","android custom listview very slow when scrolling","<android><scrolling><performance><android-listview>","4","8","1","",""
"4507201","1","4507279","","2010-12-22 07:56:25","8","8855","<p>As I am new to web service can you please tell the answer of my question.My question is</p><blockquote>  <p>I want to implement a web service which sends pdf files to client as the client calls this web service.</p></blockquote><p>Please someone help me with nice piece of code or explanation.</p><p>Now can some one please solve my error.</p><blockquote>  <p>12-23 09:42:48.429: DEBUG/installd(32): DexInv: --- BEGIN '/data/app/vmdl33143.tmp' ---  12-23 09:42:51.708: DEBUG/dalvikvm(328): DexOpt: 'Lorg/xmlpull/v1/XmlPullParser;' has an earlier definition; blocking out<br>  12-23 09:42:51.730: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/io/KXmlParser;' has an earlier definition; blocking out<br>  12-23 09:42:51.749: DEBUG/dalvikvm(328): DexOpt: 'Lorg/xmlpull/v1/XmlSerializer;' has an earlier definition; blocking out<br>  12-23 09:42:51.759: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/io/KXmlSerializer;' has an earlier definition; blocking out<br>  12-23 09:42:51.779: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/kdom/Node;' has an earlier definition; blocking out<br>  12-23 09:42:51.779: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/kdom/Document;' has an earlier definition; blocking out<br>  12-23 09:42:51.819: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/kdom/Element;' has an earlier definition; blocking out<br>  12-23 09:42:51.830: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/wap/Wbxml;' has an earlier definition; blocking out<br>  12-23 09:42:51.840: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/wap/WbxmlParser;' has an earlier definition; blocking out<br>  12-23 09:42:51.900: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/wap/WbxmlSerializer;' has an earlier definition; blocking out<br>  12-23 09:42:51.910: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/wap/syncml/SyncML;' has an earlier definition; blocking out<br>  12-23 09:42:51.910: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/wap/wml/Wml;' has an earlier definition; blocking out<br>  12-23 09:42:51.929: DEBUG/dalvikvm(328): DexOpt: 'Lorg/kxml2/wap/wv/WV;' has an earlier definition; blocking out<br>  12-23 09:42:51.929: DEBUG/dalvikvm(328): DexOpt: 'Lorg/xmlpull/v1/XmlPullParserException;' has an earlier definition; blocking out<br>  12-23 09:42:51.949: DEBUG/dalvikvm(328): DexOpt: 'Lorg/xmlpull/v1/XmlPullParserFactory;' has an earlier definition; blocking out<br>  12-23 09:42:53.299: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.319: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.329: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.350: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.350: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.370: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.499: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.560: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/xmlpull/v1/XmlPullParser;'<br>  12-23 09:42:53.570: INFO/dalvikvm(328): DexOpt: not resolving ambiguous class 'Lorg/kxml2/io/KXmlSerializer;'<br>  12-23 09:42:53.659: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParser;': multiple definitions<br>  12-23 09:42:53.668: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/io/KXmlParser;': multiple definitions<br>  12-23 09:42:53.668: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlSerializer;': multiple definitions<br>  12-23 09:42:53.668: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/io/KXmlSerializer;': multiple definitions<br>  12-23 09:42:53.680: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/kdom/Node;': multiple definitions<br>  12-23 09:42:53.690: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/kdom/Document;': multiple definitions<br>  12-23 09:42:53.709: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/kdom/Element;': multiple definitions<br>  12-23 09:42:53.709: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/wap/Wbxml;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/wap/WbxmlParser;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/wap/WbxmlSerializer;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/wap/syncml/SyncML;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/wap/wml/Wml;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/kxml2/wap/wv/WV;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParserException;': multiple definitions<br>  12-23 09:42:53.719: DEBUG/dalvikvm(328): DexOpt: not verifying 'Lorg/xmlpull/v1/XmlPullParserFactory;': multiple definitions<br>  12-23 09:42:53.829: DEBUG/dalvikvm(328): DexOpt: load 867ms, verify 1752ms, opt 108ms<br>  12-23 09:42:54.029: DEBUG/installd(32): DexInv: --- END '/data/app/vmdl33143.tmp'(success) ---</p></blockquote><p>This the Error in DDMS of android emulator.</p><p>Now my web service &amp; code looks likes this.</p><p>Code:-</p><pre><code>package com.uks.webservice;import java.io.FileNotFoundException;  import java.io.IOException;  import java.rmi.Remote;  public interface SendPDF extends Remote {    public String[] sendPDF() throws FileNotFoundException, IOException,            Exception;}</code></pre><p>Main Class from web service is created:-</p><pre><code>package com.uks.webservice;import java.io.File;   import java.io.FileNotFoundException;  import java.io.IOException;  import java.io.InputStream;  import javax.activation.DataHandler;  import javax.activation.FileDataSource;  import sun.misc.BASE64Encoder;  public class SendPDFImpl implements SendPDF {@Overridepublic String[] sendPDF() {    String[] pdfFile = new String[2];    BASE64Encoder encoder = new BASE64Encoder();    File file = new File(            ""C:/eclipse/workspace/AIPWebService/src/test.pdf"");    DataHandler dh = new DataHandler(new FileDataSource(file));    String readLine = null;    byte[] data = new byte[(int) file.length()];    int offset = 0;    int numRead = 0;    InputStream stream = null;    try {        System.out.println(""Web Service Called Successfully"");        stream = dh.getInputStream();        // BufferedReader bufferedReader = new BufferedReader(        // new InputStreamReader(stream));        while (offset &lt; data.length                &amp;&amp; (numRead = stream.read(data, offset, data.length                        - offset)) &gt;= 0) {            offset += numRead;        }        readLine = encoder.encode(data);        // while ((readLine = bufferedReader.readLine()) != null) {        System.out.println(""'Reading File............................"");        System.out.println(""\n"");        System.out.println(""Data Reading Successful"");        pdfFile[0] = file.getName();        pdfFile[1] = readLine;        stream.close();    } catch (FileNotFoundException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    } catch (Exception e) {        e.printStackTrace();    }    return pdfFile;}}</code></pre><p>Web Service:- </p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;wsdl:definitions targetNamespace=""http://webservice.uks.com""    xmlns:apachesoap=""http://xml.apache.org/xml-soap"" xmlns:impl=""http://webservice.uks.com""    xmlns:intf=""http://webservice.uks.com"" xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/""    xmlns:wsdlsoap=""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""&gt;    &lt;!--        WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006        (06:55:48 PDT)    --&gt;    &lt;wsdl:types&gt;        &lt;schema elementFormDefault=""qualified"" targetNamespace=""http://webservice.uks.com""            xmlns=""http://www.w3.org/2001/XMLSchema""&gt;            &lt;element name=""sendPDF""&gt;                &lt;complexType /&gt;            &lt;/element&gt;            &lt;element name=""sendPDFResponse""&gt;                &lt;complexType&gt;                    &lt;sequence&gt;                        &lt;element maxOccurs=""unbounded"" name=""sendPDFReturn"" type=""xsd:String"" /&gt;                    &lt;/sequence&gt;                &lt;/complexType&gt;            &lt;/element&gt;        &lt;/schema&gt;    &lt;/wsdl:types&gt;    &lt;wsdl:message name=""sendPDFRequest""&gt;        &lt;wsdl:part element=""impl:sendPDF"" name=""parameters"" /&gt;    &lt;/wsdl:message&gt;    &lt;wsdl:message name=""sendPDFResponse""&gt;        &lt;wsdl:part element=""impl:sendPDFResponse"" name=""parameters"" /&gt;    &lt;/wsdl:message&gt;    &lt;wsdl:portType name=""SendPDFImpl""&gt;        &lt;wsdl:operation name=""sendPDF""&gt;            &lt;wsdl:input message=""impl:sendPDFRequest"" name=""sendPDFRequest"" /&gt;            &lt;wsdl:output message=""impl:sendPDFResponse"" name=""sendPDFResponse"" /&gt;        &lt;/wsdl:operation&gt;    &lt;/wsdl:portType&gt;    &lt;wsdl:binding name=""SendPDFImplSoapBinding"" type=""impl:SendPDFImpl""&gt;        &lt;wsdlsoap:binding style=""document""            transport=""http://schemas.xmlsoap.org/soap/http"" /&gt;        &lt;wsdl:operation name=""sendPDF""&gt;            &lt;wsdlsoap:operation soapAction="""" /&gt;            &lt;wsdl:input name=""sendPDFRequest""&gt;                &lt;wsdlsoap:body use=""literal"" /&gt;            &lt;/wsdl:input&gt;            &lt;wsdl:output name=""sendPDFResponse""&gt;                &lt;wsdlsoap:body use=""literal"" /&gt;            &lt;/wsdl:output&gt;        &lt;/wsdl:operation&gt;    &lt;/wsdl:binding&gt;    &lt;wsdl:service name=""SendPDFImplService""&gt;        &lt;wsdl:port binding=""impl:SendPDFImplSoapBinding"" name=""SendPDFImpl""&gt;            &lt;wsdlsoap:address                location=""http://localhost:8080/AIPWebService/services/SendPDFImpl"" /&gt;        &lt;/wsdl:port&gt;    &lt;/wsdl:service&gt;&lt;/wsdl:definitions&gt;</code></pre><p>And Now My Android Code.</p><pre><code>package com.uks.android.webservice;import android.app.Activity;  import android.os.Bundle;  import android.widget.TextView;  import org.ksoap2.SoapEnvelope;  import org.ksoap2.serialization.SoapObject;  import org.ksoap2.serialization.SoapSerializationEnvelope;  import org.ksoap2.transport.AndroidHttpTransport;  public class PDFActivity extends Activity {      private final String METHOD_NAME = ""sendPDF"";      private final String NAMESPACE = ""http://webservice.uks.com/"";      private final String SOAP_ACTION = NAMESPACE + METHOD_NAME;      private final String URL = ""http://192.168.1.123:8080/AIPWebService/services/SendPDFImpl"";      /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView textViewOne = (TextView) findViewById(R.id.textViewOne);        TextView textViewTwo = (TextView) findViewById(R.id.textViewTwo);        try {            SoapObject soapObject = new SoapObject(NAMESPACE, METHOD_NAME);            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(                    SoapEnvelope.VER11);            envelope.setOutputSoapObject(soapObject);            textViewOne.setText(""Web Service Started"");            AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);            httpTransport.call(SOAP_ACTION, envelope);            SoapObject result = (SoapObject) envelope.getResponse();            textViewTwo.setText(result.toString());            // Object result = envelope.getResponse();            // FileOutputStream outputStream = openFileOutput(name, mode)        } catch (Exception e) {            e.printStackTrace();        }    }}</code></pre><p>Please help me.</p><p>Thanks in advance.  </p>","536148","","284538","","2011-04-29 12:57:05","2013-04-16 18:57:00","Sending a pdf file to client from server through web service","<java><android><web-services><java-ee>","2","0","4","",""
"4507216","1","","","2010-12-22 07:58:15","0","76","<p>I am new to android.I want to have good knowledge in android.Can anyone tell how should i proceed??</p>","475349","","","","","2010-12-22 08:08:03","regarding getting the good knowledge of android","<android>","1","2","","",""
"4507240","1","4508553","","2010-12-22 08:01:27","0","201","<p>I run my applcation in Motorola,HTC devices and each group of devices my application dialog box,Text box appearance is different.Why this will happend?Is device to device any specific theme applied on my application?Iam n't used any custom theme for my application.</p><p>how to persist my application look and feel in all devices.I know little bit, by using our own theme we can persist.but, I don't have time to develope my own theme.I want to take the source of one device default theme and utilise that one in my application.So that I think i can see the application same in all devices.how to get the theme from one device,if my above sentence correct?</p>","486216","","486216","","2010-12-22 11:02:11","2010-12-22 11:11:25","each android device had it's own default theme for applications?","<android>","1","0","","",""
"4507243","1","17179570","","2010-12-22 08:02:20","2","2801","<p>I have made a webpage that stores cookies to remember what ID a user has put in a scheme viewer. It works in desktop versions of IE, Firefox and Chrome. But when I try to visit it with Android or iPhone it doesn't work.</p><p>What I would like to know is how you see stored cookies or how you debug JavaScript/HTML/CSS. If I look at errors in desktop Firefox I get no errors for JavaScript and CSS.</p>","497116","","220060","","2012-08-06 15:25:35","2014-03-04 18:14:45","See stored cookies or debug in browser","<javascript><android><debugging><cookies>","3","0","","",""
"4507248","1","4507289","","2010-12-22 08:03:16","17","8993","<p>i have a listview that displays a set of rows, each row is clickable.now, i wish to group similar type of rows under one header something like as shown in the figure (mocked up). could some please advise or provide an approach for this.<img src=""http://i.stack.imgur.com/PzCGT.png"" alt=""mockup image""></p>","377337","","","","","2010-12-22 08:10:01","group similar rows in listview based on their content","<android><listview><android-listview>","1","3","1","",""
"4507299","1","","","2010-12-22 08:13:10","6","5394","<p>I just discovered PhoneGap and was wondering if there's a way to access the SMS inbox from Javascript with it. Or if there's another easy way to do it in an app created from a HTML/CSS/JS solution.</p><p>There's no info about SMS access in the phonegap docs, but maybe the inbox is avaliable as a url or a folder?</p><p>I would like to stick with phonegap so that the app would work on many devices, but an android only solution is satisfactory too.</p>","173077","","703019","","2012-03-03 22:07:01","2014-04-14 10:16:37","How to access sms inbox from javascript on android (phonegap)","<javascript><android><sms><phonegap>","2","2","3","",""
"4507419","1","4507691","","2010-12-22 08:32:15","1","223","<p>is there a way to discover which category my screen belong? I want to know via api if my screen is a small/normal/large or extra large screen... Look at the documentation I ve retrived the pixel density and the width/height of the screen.. </p><p>thanks in advance..</p>","501696","","","","","2010-12-22 09:40:23","android screen categories","<android><screen><screen-resolution>","1","0","","",""
"4507431","1","4507966","","2010-12-22 08:34:52","4","1130","<p>I have a question about publishing to the marketplace. </p><p>Company, X, provides similar services for companies A &amp; B, and both A &amp; B want an app in the market place. Company X wants to write just one app and differentiate between them using the appropriate logo's, configuration settings, language strings at compile time.  However, when it comes to publishing, the apps have the same app package name (using shared code base). The app will be maintained and </p><p>So, given that I want to keep a single code base, what is the best practice here?</p>","156477","","1470567","","2012-07-17 21:33:31","2012-07-18 18:35:08","Android - whitelabel app","<android><google-play><publishing><white-labelling>","4","0","3","",""
"4507486","1","15848846","","2010-12-22 08:43:31","0","561","<p>how to create circle in android using drawarc method. orhow to split a circle in 6 parts. each part contain different color. </p>","886023","","","","","2013-04-06 08:55:58","display circle in android using drawarc method","<android>","1","2","","",""
"4507516","1","","","2010-12-22 08:49:11","2","428","<p>I would like to know , what are the sequence of steps that happen oncethe user clicks on the ""installApp""??</p><p>I need to disable the installation of apps(when user tries to installthe app by clicking on install), based on certain conditions, how cani do it??Any suggestions will help.Thank you.</p>","550974","","","","","2012-05-21 11:01:42","What is the structure of the Android PackageManagerService?","<android>","1","0","","",""
"4507615","1","4507710","","2010-12-22 09:05:04","1","827","<p>I have a ByteBuffer called buffer.  I want to generate a new buffer that contains all of it's bytes that go from buffer.position() to the end of buffer <em>followed by</em> all of the bytes from position 0 to buffer.position()-1.</p><p>Essentially, I want to shift the bytes at the current position to the beginning of the buffer while bringing the current beginning to the end.</p><p>To illustrate, if this is my ByteBuffer (where <code>P</code> is the current position and the numbers <code>0-9</code> indicate byte positions):</p><pre><code> |0123456789|     P</code></pre><p>... then I would want to form a new ByteBuffer that looks like this:</p><pre><code> |3456789012|  P</code></pre><p>Here's what I'm trying so far (and is not working):</p><pre><code> ByteBuffer tmpByteBuffer = buffer.slice(); tmpByteBuffer.limit(buffer.capacity());</code></pre><p>And here is the error (this is from LogCat on Android - although I don't think the issue is Android-specific):</p><pre><code> 12-22 03:49:44.303: ERROR/AndroidRuntime(10399): Uncaught handler: thread Thread-11 exiting due to uncaught exception 12-22 03:49:44.313: ERROR/AndroidRuntime(10399): java.lang.IllegalArgumentException 12-22 03:49:44.313: ERROR/AndroidRuntime(10399):     at java.nio.Buffer.limit(Buffer.java:239) 12-22 03:49:44.313: ERROR/AndroidRuntime(10399):     at com.chaimp.audiolistener.AudioListener.captureSamples(AudioListener.java:175) 12-22 03:49:44.313: ERROR/AndroidRuntime(10399):     at com.chaimp.precisiontuner.PrecisionTuner$1.run(PrecisionTuner.java:28) 12-22 03:49:44.313: ERROR/AndroidRuntime(10399):     at java.lang.Thread.run(Thread.java:1096)</code></pre><p>Can anybody tell me what I'm doing wrong?</p><p>And, is there a better way to do this?</p><p>Thank you for any help with this.</p>","107083","","","","","2010-12-22 09:19:04","New ByteBuffer with Shifted Bytes (Java)?","<java><android><bytebuffer>","1","1","1","",""
"4507716","1","","","2010-12-22 09:19:41","1","1507","<p>When disable the rtsp authentication, videoview works well. But for security issues, authentication can not be disabled. So is there a way to play a rtsp stream with authentication?</p>","525413","","","","","2012-07-03 12:06:32","how to play a rtsp stream with authentication using videoview?","<android><rtsp><videoview>","2","6","0","",""
"4507718","1","4507844","","2010-12-22 09:19:44","14","17684","<p>I am using the TabHost in my application, I am using four Tabs in my application and I want to use the different Images in the TabHost when the Particular Tab is been Selected and not selected. I need to use to different Images for a particular tab each. </p><p>When I Select any Tab the Image is little bright and when I switch to another Tab that bright Image becomes grey shaded. </p><p>I have implemented the TabHost but I don know how to change the Images in the TabHost.</p><p>Can anybody help me in this.</p><p>Thanks,david</p>","422859","","399459","","2013-07-31 11:46:07","2013-11-11 15:49:09","How to change the Tabs Images in the TabHost","<android><android-tabhost><android-image>","8","1","10","",""
"4507730","1","4507752","","2010-12-22 09:21:26","0","386","<p>I'm trying to make bulk of sms/mms now for testing my android message program. </p><p>(I need almost 5000 sms/mms messages, it's so big :-) )</p><p>So I made an app that access to sms/mms databas file directly, but it works so slowly </p><p>because it works on phone or emulator, limited hardware</p><p>so I want to ask you that how to make bulk of sms and mms messages for about 4~5 thousands.</p><p>can I make them easier through other way? </p><p>Thank you!</p>","369929","","","","","2012-08-20 09:18:00","Is there anyway to make bulk of SMS/MMS?","<android><sms><message><mms>","1","0","","",""
"4507756","1","4508726","","2010-12-22 09:26:03","0","455","<p>I am trying to setup local CI environment - an Android project, built with Maven and now I want to put it on Hudson. But, there is a problem.</p><p>When I execute ""mvn clean install"" in command line everything goes just fine. On the other hand, Hudson build fails saying ""Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]"". For some reason, certificate that is used to sign my test project is not the same as the one used for signing of my app, which is strange because I haven't changed anything regarding this - default, android debug key store is used.</p><p>Anyone? Any idea why is this happening?</p>","551014","","","","","2010-12-22 11:30:42","Android and Hudson problem - INCONSISTENT_CERTIFICATES","<android><hudson><maven>","2","0","","",""
"4507802","1","4508621","","2010-12-22 09:31:12","1","1183","<p>Here is what I am doing:</p><p>In onActivityResult, I get the data in an Intent.</p><pre><code> Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE""); startActivityForResult(intent, TAKE_PICTURE);</code></pre><p>This code gets the image ID:</p><pre><code>data.getData().getLastPathSegment();</code></pre><p>Now i want to use this image ID to get byte[] imageData so I can upload the image on a server.</p><p>How do I go about it?</p>","548903","","424","","2011-06-30 16:23:27","2011-07-01 14:24:37","Android : Getting byte[] from Image ID","<android><android-camera><android-camera-intent>","2","0","","",""
"4508019","1","","","2010-12-22 10:01:00","0","1359","<p>i am able to show all images from sdcard into grid but how to show only specified image from sdcard into grid in android.Can anybody help please?</p>","543144","","","","","2011-12-12 09:52:13","How to get specified images from sdcard in android?","<android><image><sd-card>","1","1","","",""
"4508029","1","4567665","","2010-12-22 10:02:16","2","666","<p>I have some encrypted storage (SQLite) and would like to implement my own ContentProvider. Precondition is:</p><ul><li>Access should be granted/possible only whenworks/started my application - in allother cases access has to be deniedreturning to user/application someintelligent message/return code</li></ul><p>So the question is: is it possible? If yes, please give me some hints how to start.</p>","472270","","","","","2010-12-31 02:21:25","Custom ContentProvider for encrypted storage","<android><android-contentprovider>","3","2","","",""
"4508243","1","4510877","","2010-12-22 10:30:50","3","382","<p>I have an activity which is declared in my manifest with <code>android:noHistory=""true""</code>, and 90% of the time, this is the desired functionality.  This particular activity doesn't need to be saved in the application's history, and the application's UI flow is greatly complicated when it is in the history and needs to be manually removed by calling <code>finish()</code> every time the activity would otherwise be added to the stack.</p><p>The problem is, that this activity has the ability for the user to send an email, which is of course accomplished by creating an Intent with the <code>ACTION_SEND</code> property.  When the user presses the ""back"" button from this activity, the next one to be shown in the stack is actually the one underneath my activity.  Is there any way that I can force Android to add my activity in the history stack before presenting the <code>ACTION_SEND</code> intent?</p>","14302","","21234","","2010-12-22 15:26:43","2010-12-22 15:47:41","Forcing an activity to be added to the history stack","<android><activity>","1","0","","",""
"4508314","1","","","2010-12-22 10:40:25","1","1500","<p>What does 'howard.jpg' do in the sql statement below  &amp; how do I insert the image into my android app?</p><pre><code>CREATE TABLE IF NOT EXISTS employee (     _id INTEGER PRIMARY KEY AUTOINCREMENT,     firstName VARCHAR(50),     lastName VARCHAR(50),     title VARCHAR(50),     department VARCHAR(50),     managerId INTEGER,     city VARCHAR(50),     officePhone VARCHAR(30),     cellPhone VARCHAR(30),      email VARCHAR(30),     picture VARCHAR(200))     INSERT INTO employee VALUES(1,'Ryan','Howard','Vice President, North East', 'Management', NULL, 'Scranton','570-999-8888','570-999-8887','ryan@dundermifflin.com','howard.jpg')</code></pre>","528057","","104117","","2010-12-22 10:51:06","2011-06-23 07:55:18","Image insertion from SQL info","<android><sqlite>","3","0","1","",""
"4508373","1","","","2010-12-22 10:46:33","0","2303","<p>I'm trying to write email search application in android , I want to search like</p><pre><code>select * from message where subject like '%email%' or fromlist like'%email%'or displayname like '%email%' or tolist like '%email%' or cclist like '%email%'or bcclist like '%email%' or replytolist like '%email%';</code></pre><p>How to write a where clause in query method in android???</p>","551081","","473070","","2010-12-22 10:53:58","2010-12-22 10:58:00","Android Where Clause","<android><sqlite>","2","1","","",""
"4508439","1","4509093","","2010-12-22 10:55:01","1","4013","<p>I read some nice articles about how to connect to a remote MySQL database via Android.<br>Found some really interesting links <a href=""http://www.helloandroid.com/tutorials/connecting-mysql-database"" rel=""nofollow"">here</a> and <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/fb782da5fd515e03"" rel=""nofollow"">here</a>.<br>So the common way for getting data seems to be using some kind of webservice (interface, in this case a php script) which queries the db and renders the result in JSON (or XML) format. Then its possible to parse this output with the android JSON_Object implementation. So far so good.<br>Receiving data from the database and showing it up in a android listview was done in about minutes.  </p><p>But what is the best practice for writing (inserting) data into tables?<br>Should a webservice be used here too? (or rather direct mysql conn)<br>What is the best method to push data to a webservice? (for ex. to insert a new entity in a database) and which format should be used?<br>In this case I do not use any html forms or anything to post the parameters. So how to post these parameters to the php script?  (from within the android app!)Of course this operation should be secure as well. Implementing a data manipulation machanism is bit more risky (in order to keep the db persistant)</p><p>I think, that many apps use some kind of DB, to synchronize data (ex: highscores).So there should be a best practise for that. </p>","483499","","483499","","2010-12-22 21:46:53","2011-04-22 07:00:06","Android remote MySQL operations using a web service with php","<php><mysql><android><database><json>","2","0","1","",""
"4508516","1","","","2010-12-22 11:05:48","0","475","<p>I currently using a layout named ""ax"", Now I have to switch to full screen view and for some time with some button on it which is there in linear layout , on click of one of the view I want to come back to normal view (""ax""), How can I do that ?if i do <code> setContentView(ax); </code> then it redraws the view , which is not permitted.</p>","526359","","","","","2010-12-22 12:15:40","How to change the view at runtime","<android>","1","1","","",""
"4508649","1","","","2010-12-22 11:22:08","2","496","<p>Is it possible to install/debug applications using adb on a device that is connected to a remote machine.(IP address of the remote machine is known)?</p>","110024","","","","","2010-12-22 11:42:43","Debugging android app on a device remotely","<android>","1","1","","",""
"4508759","1","","","2010-12-22 11:36:35","1","32","<p>In my android application,i am parsing a text file of about 1500Kb and saving into database.But if i am trying to run this in andrioid emulator i am receiving Negative Array exception.The same application runs fine in device.</p><p>Could anyone please let me know if i can solve this issue anyhow ?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-09-05 11:17:12","NegativeArray exception in android","<android>","1","1","","",""
"4508792","1","","","2010-12-22 11:40:50","0","733","<p>I want to implement a flash type layout, with repeat changes of images in my application.i have a banner , should be change to banner2 in 5 seconds of time. is this possible todo?can anyone guide me ?</p>","487604","","","","","2011-06-15 12:09:52","How to change images repeatedly for a specific time","<android>","1","2","","",""
"4508803","1","","","2010-12-22 11:41:40","0","1525","<p>I am currently looking for a third party library to process XSL stylesheets in Android. I know Android 2.2 has added the <code>javax.xml.transform.TransformerFactory</code>, but unfortunately we need to be able to support older versions of Android.</p><p>Are there any third-party libraries available that I can use to transform XML with XSL?</p><p>I've had a look at Xalan, Saxon and XT, but from my understanding these just provide implementations of <code>javax.xml.transform.TransformerFactory</code> and still require the core abstract classes. </p>","416214","","","user357812","2010-12-22 13:22:53","2012-02-27 15:32:14","XSLT support in Android 2.1 (and older)?","<java><android><xslt>","3","0","","",""
"4508809","1","4508856","","2010-12-22 11:41:55","0","927","<p>How do I stretch across 2 columns in the Table Layout. I have 2 rows with a label and edit text on 1 row and I want to have a single button stretch across the whole second row.</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_height=""fill_parent""     android:layout_width=""fill_parent""    android:background=""#000000""    android:stretchColumns=""1""&gt;    &lt;TableRow&gt;        &lt;TextView            android:text = ""Name: ""        /&gt;        &lt;EditText            android:id = ""@+id/txtAddName""            android:gravity = ""right""            android:layout_width = ""fill_parent""        /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text = ""Phone: ""        /&gt;        &lt;EditText            android:id = ""@+id/txtAddPhone""            android:gravity = ""right""            android:layout_width = ""fill_parent""        /&gt;            &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;Button            android:id = ""@+id/btnAdd""            android:text = ""Add Entrie""            android:layout_width = ""fill_parent""        /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;Button            android:id = ""@+id/btnShow""            android:text = ""Show all Entries""            android:layout_width = ""fill_parent""        /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;Button            android:id = ""@+id/btnDelete""            android:text = ""Delete all Entries""            android:layout_width = ""fill_parent""        /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","471196","","","","","2010-12-22 11:50:47","Stretching across 2 rows in Table Layout","<android><xml><android-layout>","1","0","","",""
"4508887","1","4508930","","2010-12-22 11:51:29","0","1102","<p>What I want to do:I want to draw image from xml and then animate it from xml.this image should move with constant speed anywhere on our screen.</p><p>Now the problem is:I can draw and animate image from xml but i can not move this image with constant speed.</p><p>I am using two xml files: One for animate and other for moving.XML for animation:                        android:duration=""200""/></p><h2></h2><p>XML file for move:</p><pre><code>&lt;translate    android:interpolator=""@android:anim/linear_interpolator""    android:fromXDelta=""2%""    android:toXDelta=""400%""    android:fromYDelta=""2%""    android:toYDelta=""800%""/&gt;</code></pre><p></p><p>Activity.java file code in onCreate() method:</p><pre><code>  ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image);  Animation hyperspaceJump = AnimationUtils.loadAnimation(this,   R.anim.hyperspace_jump);        rocketImage.setBackgroundResource(R.drawable.rocket_thrust);  AnimationDrawable rocketAnimation = (AnimationDrawable) rocketImage.getBackground();  rocketAnimation.start();  rocketImage.startAnimation(hyperspaceJump);</code></pre>","534957","","","","","2010-12-22 11:57:01","Draw and move animation from xml in android","<android>","1","0","","",""
"4508937","1","","","2010-12-22 11:57:34","1","375","<p>I have a Activty containing a custom ListView filled by Baseadapter.The Data displayed by this ListView changes all the time, so I need to refresh the List. </p><p>I do this by periodially calling notifyDataSetChanged() on my ListViewAdapter in a Thread and setting thread_paused to true if the activity is paused. Ugly as hell.</p><pre><code>public void StartListener(){  new Thread(new Runnable() {      public void run() {          while(!thread_paused){              try {                 Thread.sleep(5000);              } catch (InterruptedException e) {                  e.printStackTrace();              }              runOnUiThread(new Runnable() {                 public void run() {                    ListViewA.notifyDataSetChanged();                    Log.v(""refresh"", ""refreshed view"");             }        });      }     }   }).start();}@Overridepublic void onPause(){  super.onPause();  thread_paused=true;}</code></pre><p>I know there has to be a a better way to do this, maybe some kind of listener on the datasource ?</p><p>Any suggestions ?</p>","551145","","551145","","2010-12-22 12:05:06","2010-12-23 15:37:54","Better Way to refresh ListView?","<android><multithreading><listview>","2","0","1","",""
"4508979","1","4509011","","2010-12-22 12:03:54","27","71273","<p>I am new to android, I have a code in which I have placed buttons in list view.My list is as..</p><pre><code>Number | Name | ID (visibility = gone) | Level | button1 | button2</code></pre><p>Function is different in button 1 and button 2 case. I have applied listeners on buttons but when I try to get the ID from list it always shows me the last id. </p><p>How to know which button was clicked, name and id of related field.</p><p>I have placed buttons and listener on buttons in <code>getView(...)</code> function. </p>","185022","","1395941","","2012-12-26 19:02:13","2012-12-26 19:02:13","android listview get selected item","<android><listview><onclick><selecteditem>","1","0","9","",""
"4509029","1","4510968","","2010-12-22 12:12:24","1","3242","<p>I have created an android app, that registering to google c2dm service. And It's getting a registration_id token from c2dm services successfully. </p><p>I already signed Android Cloud to Device Messaging form and I received confirmation email from c2dm service.</p><p>Everything seems ok in client side, it's getting registration_id in simulator environment. So, it's ok. </p><p>But, On server side, It's authenticating google service, it's receiving Auth code then it's invoking to c2dm send url with below code. </p><pre><code>  public void SendMessage(string registrationId, string data)    {        ServicePointManager.ServerCertificateValidationCallback += delegate(                                            object sender,                                            X509Certificate certificate,                                            X509Chain chain,                                            SslPolicyErrors sslPolicyErrors)        {            return true;        };        string collapseKey = Guid.NewGuid().ToString(""n"");                  string url = ""https://android.apis.google.com/c2dm/send"";        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);        request.Method = ""POST"";        request.Headers.Add(""Authorization"", ""GoogleLogin auth=DQAAAKYAAACE_0NqG8Sj5lBf4YSPXs_ltQbTzPsAL5u1Q1KGF..."");        string px = ""registration_id="" + registrationId + ""&amp;collapse_key="" + collapseKey + ""&amp;data.payload="" + data;        string encoded = HttpUtility.UrlEncode(px);        ASCIIEncoding encoding = new ASCIIEncoding();        byte[] buffer = encoding.GetBytes(encoded);        Stream newStream = request.GetRequestStream();        newStream.Write(buffer, 0, buffer.Length);        newStream.Close();         HttpWebResponse response = (HttpWebResponse)request.GetResponse();         if(response.StatusCode == HttpStatusCode.OK)         {             Stream resStream = response.GetResponseStream();             StreamReader sr = new StreamReader(resStream);             Console.Write(sr.ReadToEnd());             sr.Close();             resStream.Close();         }         Console.WriteLine();         Console.ReadLine();    }</code></pre><p>It's still receiving <code>Error=InvalidRegistration</code> response from c2dm service. </p><p>What I'm doing wrong ? </p>","88032","","","","","2012-11-26 10:38:46","Android C2DM Invalidregistration","<c#><asp.net><android><push-notification><android-c2dm>","2","2","1","",""
"4509061","1","","","2010-12-22 12:16:34","2","3348","<p>What is the procedure to debug the android eclipse in sony experia </p>","461972","","","","","2011-09-17 03:32:29","debugging android application on sony xperia device","<android>","1","0","","",""
"4509097","1","4509140","","2010-12-22 12:21:05","0","136","<p>I am creating a pop up window in click event,inside that pop up window there are text view and Button... If i create a Id in XML and set the text by TextView txt=(TextView)findViewById(R.id.text) </p><p>txt.setText(""Message"");</p><p>I ma getting Null pointer Exception same for Button..</p><p>Pls </p>","555221","","","","","2011-02-27 03:55:29","Android Text View","<android>","1","1","","2011-06-21 20:02:23",""
"4509147","1","4509288","","2010-12-22 12:27:19","0","284","<p>I am getting some odd stuttering issues with my game even though my FPS never seems to drop below 30. About every 5 seconds my game stutters. I was originally getting stuttering every 1-2 seconds due to my garbage collection issues, but I have sorted those and will often go 15-20 seconds without a garbage collection.</p><p>Despite this, my game still stutters periodically even when there is no GC listed in logcat anywhere near the stutter. Even when I take out most of my code and simply make my ""physics"" code the below code I get this weird slowdown issue. I feel that I am missing something or overlooking something.</p><p>Shouldn't that ""elapsed"" code that I put in stop any variance in the speed of the main character related to changes in FPS?</p><p>Any input/theories would be awesome.</p><p>Physics:</p><pre><code>private void updatePhysics(){    //get current time    long now = System.currentTimeMillis();    //added this to see if I could speed it up, it made no difference    Thread myThread = Thread.currentThread();    myThread.setPriority(Thread.MAX_PRIORITY);    //work out elapsed time since last frame in seconds    double elapsed = (now - mLastTime2) / 1000.0;    mLastTime2 = now;    //measures FPS and displays in logcat once every 30 frames    fps+=1/elapsed;    fpscount+=1;    if (fpscount==30)    {        fps=fps/fpscount;        Log.i(""myActivity"",""FPS: ""+fps+"" Touch: ""+touch);        fpscount=0;    }    //this should make the main character (theoretically) move upwards at a steady pace    mY-=100*elapsed;    //increase amount I translate the draw to = main characters Y     //location if the main character goes upwards    if (mY&lt;=viewY)    {        viewY=mY;    }}</code></pre>","549859","","44729","","2010-12-22 16:05:46","2010-12-22 17:29:58","Weird stuttering issues not related to GC","<java><android><opengl-es>","2","2","","",""
"4509166","1","","","2010-12-22 12:30:20","0","843","<p>I want BroadcastReceiver to receive incoming call, so I used </p><pre><code>&lt;receiver&gt;--android.intent.action.ANSWER --&lt;/receiver&gt; </code></pre><p>in manifest file and my receiver class contains this code </p><p><code>if(intent.getAction().equals(Intent.ACTION_ANSWER)){}</code> </p><p>but my receiver class doesn't receive any incoming call and does not response to me. How to solve this problem?</p><p>Thanks All</p>","500595","","222159","","2010-12-22 14:05:29","2010-12-22 14:05:29","How to solve this problem when an incoming call arrives?","<android><broadcastreceiver>","1","0","1","",""
"4509177","1","","","2010-12-22 12:32:46","1","1386","<p>I developed one project using titanium framework. Now i want to import that project from eclipse for run as a normal android project. I had successfully import that project with some error from eclipse.</p><p><strong>(in manifest file have this error Class ti.modules.titanium.ui.TiTabActivity does not exist ,Class ti.modules.titanium.media.TiVideoActivity does not exist</strong>, I removed this activity from manifest and error gone)**</p><p>But when I run the project it throws following exception.</p><pre><code>    12-21 17:53:50.282: ERROR/AndroidRuntime(464): Uncaught handler: thread main exiting due to uncaught exception        12-21 17:53:50.292: ERROR/AndroidRuntime(464): Caused by: java.lang.ClassCastException: org.mozilla.javascript.UniqueTag    12-21 17:53:50.292: ERROR/AndroidRuntime(464):     at org.appcelerator.titanium.kroll.KrollBridge.&lt;init&gt;(KrollBridge.java:35)    12-21 17:53:50.292: ERROR/AndroidRuntime(464):     at org.appcelerator.titanium.TiContext.createTiContext(TiContext.java:724)    12-21 17:53:50.292: ERROR/AndroidRuntime(464):     at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:64)    12-21 17:53:50.292: ERROR/AndroidRuntime(464):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)    12-21 17:53:50.292: ERROR/AndroidRuntime(464):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)</code></pre><p>The splash screen only display after that, application will be terminated. I need this for testing the application in a release mode.From titanium I can only test the application in debug mode.</p><p>Please anyone help me to solve this problem.</p><p>Thanks</p>","450596","","","","","2011-06-04 05:06:09","How to import titanium project from eclipse for run as a normal android project?","<android><titanium>","2","2","1","",""
"4509199","1","4509448","","2010-12-22 12:35:14","0","398","<p>I have a ViewFlipper that contains multiple chat windows at any given time.  When I click a user A on my contact list and open a chat with that user A, the ViewFlipper is brought into the foreground and I'm able to start a chat with user A.  If I want to then open another, concurrent chat with user B, I must press the back button on the android device, be brought back to the contact list and click on another user.</p><p>When this happens, as soon as I click on User B, the previous chat from User A is deleted since the onCreate() method was called in the ViewFlipper Activity.</p><p>How can I avoid this problem?  I would like to click on User B and have it <em>added</em> to the ViewFlipper instead of the ViewFlipper resetting itself.</p><p>Do I have to put the ViewFlipper as a Service? Is there something I can do in the onPause, onResume, or maybe reprogram the onBackPressed method?</p><p>The contact screen is implemented as follows:</p><p><strong>list.xml</strong></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;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/no_friend"" android:gravity=""center_vertical|center_horizontal"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>contact_list.xml</strong></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/icon"" android:layout_width=""48dip""    android:layout_height=""48dip"" /&gt;&lt;TextView android:id=""@+id/text"" android:layout_gravity=""center_vertical""    android:layout_width=""0dip"" android:layout_weight=""1.0""    android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>contact.java</strong></p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        if (convertView == null) {            View v =             convertView = mInflater.inflate(R.layout.contact_list,null);            holder = new ViewHolder();            holder.text = (TextView) convertView.findViewById(R.id.text);            holder.icon = (ImageView) convertView.findViewById(R.id.icon);            convertView.setTag(holder);        } else {            holder = (ViewHolder) convertView.getTag();        }        holder.text.setText(friends[position].userName);        if (friends[position].status == STATUS.NEW_MSG)            holder.icon.setImageBitmap(mNewMsgIcon);        if (friends[position].status == STATUS.OPEN)            holder.icon.setImageBitmap(mOpenChat);        return convertView;    }</code></pre><p>Where mInflater is </p><pre><code>mInflater = LayoutInflater.from(context);</code></pre><p>The ListAdapter is defined within contact.java (it would take up the entire screen if I put it here)</p>","544884","","544884","","2010-12-22 16:09:39","2010-12-22 16:09:39","How to handle multiple concurrent chat windows in Android?","<android><view><activity><viewflipper>","1","0","","",""
"4509327","1","4509403","","2010-12-22 12:50:25","0","4294","<p>I am creating a pop up window in click event, inside that pop up window there are text view and Button...</p><p>If I create an Id in XML and set the text by</p><pre><code>TextView txt=(TextView)findViewById(R.id.text)txt.setText(""Message"");</code></pre><p>I get a Null pointer Exception. The same happens for a Button..</p><p>Here is my code</p><pre><code>package com.examples;import java.util.ArrayList;import java.util.Calendar;import java.util.GregorianCalendar;import java.util.List;import java.util.Locale;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.graphics.Color;import android.os.Bundle;import android.text.format.DateFormat;import android.util.Log;import android.view.Gravity;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.View.OnClickListener;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.Button;import android.widget.GridView;import android.widget.ImageView;import android.widget.PopupWindow;import android.widget.TextView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;public class Main extends Activity implements OnClickListener    {    private final String[] months = { ""January"", ""February"", ""March"", ""April"", ""May"", ""June"", ""July"", ""August"", ""September"", ""October"", ""November"", ""December"" };        private static final String tag = ""Main"";        private Button selectedDayMonthYearButton;        private Button currentMonth;        private ImageView prevMonth;        private ImageView nextMonth;        private GridView calendarView;        private GridCellAdapter adapter;        private Calendar _calendar;        private int month, year;        private final DateFormat dateFormatter = new DateFormat();        private static final String dateTemplate = ""MMMM yyyy"";        private PopupWindow pw;        TextView txt1;        static ViewHolder holder;        private void getRequestParameters()            {                Intent intent = getIntent();                if (intent != null)                    {                        Bundle extras = intent.getExtras();                        if (extras != null)                            {                                 if (extras != null)                                    {                                        Log.d(tag, ""+++++-----------------&gt;"" + extras.getString(""params""));                                    }                            }                    }            }        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState)            {                super.onCreate(savedInstanceState);                setContentView(R.layout.simple_calendar_view);                _calendar = Calendar.getInstance(Locale.getDefault());                month = _calendar.get(Calendar.MONTH);                Log.v(""Months"", """"+month);                year = _calendar.get(Calendar.YEAR);                Log.v(""YEAR"", """"+year);                selectedDayMonthYearButton = (Button) this.findViewById(R.id.selectedDayMonthYear);                selectedDayMonthYearButton.setText(""Selected: "");                prevMonth = (ImageView) this.findViewById(R.id.prevMonth);                prevMonth.setOnClickListener(this);                currentMonth = (Button) this.findViewById(R.id.currentMonth);                currentMonth.setText(dateFormatter.format(dateTemplate, _calendar.getTime()));                nextMonth = (ImageView) this.findViewById(R.id.nextMonth);                nextMonth.setOnClickListener(this);                calendarView = (GridView) this.findViewById(R.id.calendar);                // Initialised                adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);                adapter.notifyDataSetChanged();                calendarView.setAdapter(adapter);        }        @Override        public void onClick(View v)            {                if (v == prevMonth)                    {                        if (month &lt;= 1)                            {                                month = 11;                                year--;                            } else                            {                                month--;                            }                        adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);                        _calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));                        currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + ""-"" +_calendar.get(Calendar.YEAR));                        //currentMonth.setText(_calendar.getTime().toString());                        adapter.notifyDataSetChanged();                        calendarView.setAdapter(adapter);                    }                if (v == nextMonth)                    {                        if (month &gt;= 11)                            {                                month = 0;                                year++;                            } else                            {                                month++;                            }                        adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);                        _calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));                        currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + ""-"" +_calendar.get(Calendar.YEAR));                        //currentMonth.setText(_calendar.getTime().toString());                        adapter.notifyDataSetChanged();                        calendarView.setAdapter(adapter);                    }            }        // Inner Class        public class GridCellAdapter extends BaseAdapter implements OnClickListener            {                private static final String tag = ""GridCellAdapter"";                private final Context _context;                private final List&lt;String&gt; list;                private final String[] weekdays = new String[] { ""Sun"", ""Mon"", ""Tue"", ""Wed"", ""Thu"", ""Fri"", ""Sat"" };                private final int[] daysOfMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };                private final int month, year;                int daysInMonth, prevMonthDays;                private final int currentDayOfMonth;                private Button gridcell;                // Days in Current Month                public GridCellAdapter(Context context, int textViewResourceId, int month, int year)                    {                        super();                        this._context = context;                        this.list = new ArrayList&lt;String&gt;();                        this.month = month;                        this.year = year;                        Log.d(tag, ""Month: "" + month + "" "" + ""Year: "" + year);                        Calendar calendar = Calendar.getInstance();                        currentDayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);                        printMonth(month, year);                    }                public String getItem(int position)                    {                        return list.get(position);                    }                @Override                public int getCount()                    {                        return list.size();                    }                private void printMonth(int mm, int yy)                    {                        // The number of days to leave blank at                        // the start of this month.                        int trailingSpaces = 0;                        int leadSpaces = 0;                        int daysInPrevMonth = 0;                        int prevMonth = 0;                        int prevYear = 0;                        int nextMonth = 0;                        int nextYear = 0;                        GregorianCalendar cal = new GregorianCalendar(yy, mm, currentDayOfMonth);                        // Days in Current Month                        daysInMonth = daysOfMonth[mm];                        int currentMonth = mm;                        if (currentMonth == 11)                            {                                prevMonth = 10;                                daysInPrevMonth = daysOfMonth[prevMonth];                                nextMonth = 0;                                prevYear = yy;                                nextYear = yy + 1;                            } else if (currentMonth == 0)                            {                                prevMonth = 11;                                prevYear = yy - 1;                                nextYear = yy;                                daysInPrevMonth = daysOfMonth[prevMonth];                                nextMonth = 1;                            } else                            {                                prevMonth = currentMonth - 1;                                nextMonth = currentMonth + 1;                                nextYear = yy;                                prevYear = yy;                                daysInPrevMonth = daysOfMonth[prevMonth];                            }                        // Compute how much to leave before before the first day of the                        // month.                        // getDay() returns 0 for Sunday.                        trailingSpaces = cal.get(Calendar.DAY_OF_WEEK) - 1;                        if (cal.isLeapYear(cal.get(Calendar.YEAR)) &amp;&amp; mm == 1)                            {                                ++daysInMonth;                            }                        // Trailing Month days                        for (int i = 0; i &lt; trailingSpaces; i++)                            {                                list.add(String.valueOf((daysInPrevMonth - trailingSpaces + 1) + i) + ""-GREY"" + ""-"" + months[prevMonth] + ""-"" + prevYear);                            }                        // Current Month Days                        for (int i = 1; i &lt;= daysInMonth; i++)                            {                                list.add(String.valueOf(i) + ""-WHITE"" + ""-"" + months[mm] + ""-"" + yy);                            }                        // Leading Month days                        for (int i = 0; i &lt; list.size() % 7; i++)                            {                                Log.d(tag, ""NEXT MONTH:= "" + months[nextMonth]);                                list.add(String.valueOf(i + 1) + ""-GREY"" + ""-"" + months[nextMonth] + ""-"" + nextYear);                            }                    }                @Override                public long getItemId(int position)                    {                        return position;                    }                @Override                public View getView(int position, View convertView, ViewGroup parent)                    {                        Log.d(tag, ""getView ..."");                        View row = convertView;                        if (row == null)                            {                                // ROW INFLATION                                Log.d(tag, ""Starting XML Row Inflation ... "");                                LayoutInflater inflater = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                                row = inflater.inflate(R.layout.day_gridcell, parent, false);                                Log.d(tag, ""Successfully completed XML Row Inflation!"");                            }                        // Get a reference to the Day gridcell                        gridcell = (Button) row.findViewById(R.id.day_gridcell);                        gridcell.setOnClickListener(this);                        // ACCOUNT FOR SPACING                        Log.d(tag, ""Current Day: "" + currentDayOfMonth);                        String[] day_color = list.get(position).split(""-"");                        gridcell.setText(day_color[0]);                        gridcell.setTag(day_color[0] + ""-"" + day_color[2] + ""-"" + day_color[3]);                        if (day_color[1].equals(""GREY""))                            {                                gridcell.setTextColor(Color.LTGRAY);                            }                        if (day_color[1].equals(""WHITE""))                            {                                gridcell.setTextColor(Color.WHITE);                            }                        if (position == currentDayOfMonth)                            {                                gridcell.setTextColor(Color.BLUE);                            }                        return row;                    }                @Override                public void onClick(View view)                    {                    LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                     // inflate our view from the corresponding XML file                     final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));                    String date_month_year = (String) view.getTag();                     pw = new PopupWindow(layout, 200,75, true);                     holder = new ViewHolder();                        holder.text1 = (TextView) view.findViewById(R.id.pop_txt);                        //holder.text1.setText(""HIIIIIII"");                     pw.dismiss();                     pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);                        Toast.makeText(getApplicationContext(), date_month_year, Toast.LENGTH_SHORT).show();                        selectedDayMonthYearButton.setText(""Selected: "" + date_month_year);                        Log.v(""Button ID"",""""+R.id.bttn2);                        //layout.setVisibility(View.INVISIBLE);//                      findViewById(R.id.bttn2).setOnClickListener(//                              new OnClickListener() {////                                    ////                                    //LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);////                                     // inflate our view from the corresponding XML file////                                   //  final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));////                                    ////////                                    @Override//                                  public void onClick(View arg0) {////                                        // TODO Auto-generated method stub//////                                       pw = new PopupWindow(layout, 200,75, true);//////                                              //////                                       pw.dismiss();//////                                       pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);////                                        //                                  }//                              });                    }            }        static class ViewHolder {            TextView text1;        }        //list.setOnItemClickListener(new OnItemClickListener(){    }</code></pre>","555221","","1011995","","2013-04-29 19:12:18","2013-04-29 19:12:18","Android Text View","<android><text><view>","2","0","","2011-06-21 20:00:50",""
"4509436","1","","","2010-12-22 13:01:50","1","726","<p>My Application needs to pick up location information at regular intervals. I use <code>AlarmManager</code> to do it and it works fine. The problem is that when the phone goes to the standby/sleep mode the GPS location listener gets removed. After some time when my <code>AlarmReceiver</code> gets fired it looks for the latest location update which it does not get because GPS has been turned off due to the standby mode.</p><p>Is there a way how I can wake up the location listener when my <code>AlarmReceiver</code> gets fired or any other alternative?</p>","327491","","1267021","","2012-09-11 23:49:40","2012-09-11 23:49:40","GPS not updating when phone is in sleep mode","<android><gps><sleep><android-alarms>","1","1","1","",""
"4509445","1","","","2010-12-22 13:03:08","1","312","<p>I would like to change the target API (in order to make it posible to install my app on the sdcard). I know how to change the API (Right click on project --> properties...) and I am able to compile and export with <code>android:installLocation=""auto</code>"" and install on my phone works fine. But when trying to update an already installed version the installation fails. </p><p>Do I need to change something else or is it even possible to change the target API on a published application?</p>","551212","","222159","","2010-12-22 13:05:48","2010-12-22 13:06:20","Change target API on published application","<android>","1","1","","",""
"4509460","1","","","2010-12-22 13:05:34","2","222","<p>Is possible to apply styling to Android inbuilt layouts such as R.layout.simple_list_item_multiple_choice?</p>","176666","","","","","2011-07-07 23:28:18","Are inbuilt layouts in Android Styleable?","<java><android>","1","1","","",""
"4509511","1","4509717","","2010-12-22 13:12:05","0","150","<p>Hi guys if i try to set a text in the TextView that is present in the PopUp window i am getting NULL POINTER EXCEPTION if i set like this holder.text1.setText(""HIIIIIII"");But in the same way i am getting the ID of the Text View in LogCat..</p><pre><code>@Override            public void onClick(View view)                {                LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                 // inflate our view from the corresponding XML file                 final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));                String date_month_year = (String) view.getTag();                 pw = new PopupWindow(layout, 200,75, true);                 holder = new ViewHolder();                    holder.text1 = (TextView) view.findViewById(R.id.pop_txt);                    //holder.text1.setText(""HIIIIIII"");                 pw.dismiss();                 pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);                    Toast.makeText(getApplicationContext(), date_month_year, Toast.LENGTH_SHORT).show();                    selectedDayMonthYearButton.setText(""Selected: "" + date_month_year);                    Log.v(""Button ID"",""""+R.id.bttn2);                }</code></pre>","555221","","","","","2010-12-22 13:40:39","Android Text View","<android><text><view>","2","1","","2011-06-21 20:02:18",""
"4509542","1","","","2010-12-22 13:15:40","0","254","<p>I wanna show imageview already included in layout xml when user reach the end of the listview with scroll , i switch to Visible.GONE while loading the activity with onCreate method and than try to show the imageview when user reach the end of the scroll on the listview. How can i implement this ?</p>","155332","","155332","","2010-12-22 13:27:22","2012-05-03 11:42:30","Show imageview when reach the end of the listview with scroll","<java><android><listview><scrolling>","1","2","","",""
"4509703","1","","","2010-12-22 13:38:02","0","2156","<p>How do i get image thumbnail from the given file path? Here what i am doing</p><pre><code>    Intent cameraIntent = new Intent(""android.media.action.IMAGE_CAPTURE"");    startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);</code></pre><p>On ""onActivityResult"", i get the image in Intent data.</p><p>I want to extract thumbnail info from this image. How do i extract it, so that i can show that thumbnail as preview</p>","548903","","548903","","2010-12-22 16:18:52","2013-06-16 21:07:25","Android : Getting Thumbnail Info from an Image","<android><image-manipulation>","4","0","","",""
"4509721","1","","","2010-12-22 13:40:57","1","630","<p>I have developed one android app which uses web service to get data. it means it requires an internet connection. My Problem is when the internet is not available during web service call or before web service call it should throw some alerts.</p><p>I have implemented one code:</p><pre><code> public static boolean isOnline(Context context) {        try {        ConnectivityManager cm = (ConnectivityManager) context        .getSystemService(Context.CONNECTIVITY_SERVICE);        if (cm.getActiveNetworkInfo().isConnectedOrConnecting()) {        URL url = new URL(""https://widget.istockanalyst.com/WebServiceIStock.asmx"");        HttpURLConnection urlc = (HttpURLConnection) url        .openConnection();        urlc.setRequestProperty(""User-Agent"", ""My Android Demo"");        urlc.setRequestProperty(""Connection"", ""close"");        urlc.setConnectTimeout(1000); // mTimeout is in seconds        urlc.connect();        if (urlc.getResponseCode() == 200)        {            System.out.println(""*********True****************"");        return true;        }         else         {            System.out.println(""*********False****************"");           return false;        }        }        } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();        }        return false;        }</code></pre><p>and after that m calling this method on my splash screen. and on emulator it is responding. but when  i perform device testing after desabling the wifi it is showing an error and app crashes.</p><p>Pls help me.</p>","383597","","","","","2010-12-22 17:54:19","Android internet connectivity issue","<android>","1","2","","",""
"4509745","1","4509787","","2010-12-22 13:43:55","6","13777","<p>I'm trying to use Android Maps, following the instructions in <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"">Hello MapView</a>.</p><p>I've added <code>&lt;uses-library android:name=""com.google.android.maps"" /&gt;</code> in the Manifest, and I'm building against the 'Google APIs' target, which claims to be API version 7. </p><p>So I don't think I'm doing anything obviously wrong, but the project refuses to build with this error: </p><pre><code>[2010-12-22 13:34:32 - FMS]Installing FMS.apk...[2010-12-22 13:35:01 - FMS]Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY[2010-12-22 13:35:01 - FMS]Please check logcat output for more details.[2010-12-22 13:35:01 - FMS]Launch canceled!</code></pre><p>logcat is telling me the following (not very enlightening):</p><pre><code>D/PackageParser(   55): Scanning package: /data/app/vmdl67147.tmpI/PackageParser(   55): com.android.fms: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATEE/PackageManager(   55): Package com.android.fms requires unavailable shared library com.google.android.maps; failing!W/PackageManager(   55): Package couldn't be installed in /data/app/com.android.fms.apkD/AndroidRuntime(  206): Shutting down VM</code></pre><p>It is possible I haven't set up the Maps API key correctly - when I <a href=""http://code.google.com/android/add-ons/google-apis/mapkey.html#getfingerprint"">got it using <code>keytools</code></a>, I didn't specify an <code>alias_name</code>, though this didn't seem to cause an error. </p><p>Can anyone help?</p>","267831","","","","","2012-01-31 16:15:12","Android Maps: Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY","<android><google-maps>","2","0","","",""
"4509851","1","4509989","","2010-12-22 13:55:30","10","20860","<p>Is it possible to host a web server within an Android phone itself? Similar to Apache. I want to access the web server from the mobile browser itself. </p><p>Couldn't find any reference online. Is this possible?</p><p>Thanks In Advance, Perumal</p>","426201","","","","","2013-07-24 16:56:58","Web Server for Android","<android>","6","3","12","",""
"4509877","1","","","2010-12-22 13:58:39","1","6079","<p>I am trying to save an image (jpg or png) from the res/raw or assets folder to the SD card location (/sdcard/DCIM/).</p><p>I have been following a tutorial which can save an image from a URL to the SD card Root, but i have looked everywhere to be able to save from res/raw or asset folder instead, and to a differnet location onthe sd card /sdcard/DCIM/</p><p>Here is the code, can anyone show me how to do the above from this?</p><pre><code>public class home extends Activity {    private File file;     private String imgNumber;     private Button btnDownload;     /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);        btnDownload=(Button)findViewById(R.id.btnDownload);      btnDownload.setOnClickListener(new OnClickListener() {     public void onClick(View v) {       btnDownload.setText(""Download is in Progress."");      String savedFilePath=Download(""http://www.domain.com/android1.png"");      Toast.makeText(getApplicationContext(), ""File is Saved in  ""+savedFilePath, 1000).show();      if(savedFilePath!=null)      {        btnDownload.setText(""Download Completed."");      }     }    });    }     public String Download(String Url)    {    String filepath=null;    try {    //set the download URL, a url that points to a file on the internet    //this is the file to be downloaded    URL url = new URL(Url);    //create the new connection    HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();    //set up some things on the connection    urlConnection.setRequestMethod(""GET"");    urlConnection.setDoOutput(true);    //and connect!    urlConnection.connect();    //set the path where we want to save the file    //in this case, going to save it on the root directory of the    //sd card.    File SDCardRoot = Environment.getExternalStorageDirectory();    //create a new file, specifying the path, and the filename    //which we want to save the file as.    String filename= ""download_""+System.currentTimeMillis()+"".png"";   // you can download to any type of file ex:.jpeg (image) ,.txt(text file),.mp3 (audio file)    Log.i(""Local filename:"",""""+filename);    file = new File(SDCardRoot,filename);    if(file.createNewFile())    {    file.createNewFile();    }    //this will be used to write the downloaded data into the file we created    FileOutputStream fileOutput = new FileOutputStream(file);    //this will be used in reading the data from the internet    InputStream inputStream = urlConnection.getInputStream();    //this is the total size of the file    int totalSize = urlConnection.getContentLength();    //variable to store total downloaded bytes    int downloadedSize = 0;    //create a buffer...    byte[] buffer = new byte[1024];    int bufferLength = 0; //used to store a temporary size of the buffer    //now, read through the input buffer and write the contents to the file    while ( (bufferLength = inputStream.read(buffer)) &gt; 0 ) {    //add the data in the buffer to the file in the file output stream (the file on the sd card    fileOutput.write(buffer, 0, bufferLength);    //add up the size so we know how much is downloaded    downloadedSize += bufferLength;    //this is where you would do something to report the prgress, like this maybe    Log.i(""Progress:"",""downloadedSize:""+downloadedSize+""totalSize:""+ totalSize) ;    btnDownload.setText(""download Status:""+downloadedSize+"" / ""+totalSize);    }    //close the output stream when done    fileOutput.close();    if(downloadedSize==totalSize) filepath=file.getPath();    //catch some possible errors...    } catch (MalformedURLException e) {    e.printStackTrace();    } catch (IOException e) {    filepath=null;    btnDownload.setText(""Internet Connection Failed.\n""+e.getMessage());    e.printStackTrace();    }    Log.i(""filepath:"","" ""+filepath) ;     return filepath;    }}</code></pre>","551268","","1288","","2011-06-16 04:08:17","2011-06-16 04:08:17","Android Dev Help: Saving an image from Res/raw or Asset folder to the Sd card","<android>","2","0","","",""
"4509878","1","4509980","","2010-12-22 13:58:43","-3","887","<p>HiI just bought xperia x10 and upgraded it to android 2.1 but I am struggling with themes. I have downloaded couple of them from the market but I do not know how to install them. How do I change themes for andorid 2.1?</p>","533568","","1039361","","2012-04-18 13:45:10","2013-11-19 05:40:29","How to change android 2.1 themes","<android><themes>","2","3","","",""
"4509912","1","4516150","","2010-12-22 14:02:16","7","11864","<p>I would like to know if it is possible to use BitmapFactory.decodeFile method to decode a image from http location?  </p><p>For eg. </p><pre><code>ImageView imageview = new ImageView(context);Bitmap bmp = BitmapFactory.decodeFile(""http://&lt;my IP&gt;/test/abc.jpg"");  imageview.setImageBitmap(bmp);</code></pre><p>But bmp is always returning null.  </p><p>Is there any other way to achieve this scenario, where i have a set of images in my server PC, and i am loading the images to my gallery application via an xml?  </p><p>Thanks,<br>Sen</p>","449378","","","","","2013-04-22 04:02:38","Is it possible to use BitmapFactory.decodeFile method to decode a image from http location?","<android><http><bitmap>","4","4","8","",""
"4510100","1","4510127","","2010-12-22 14:20:44","6","1864","<p>I've been working on this project for my company and my boss said: ""we want to target as many devices as possible so make it work for 1.6"" which seriously tied my hands at some times.</p><p>What I'm wandering now is: is it worth supporting 1.6 in general?</p><p>With the release of 2.3 and the fact that most recent phones have been updated to 2.X, what place is left for 1.6 devices. </p>","440336","","","","","2010-12-22 15:38:24","Android: Which versions of android should I support?","<android>","4","0","1","2014-01-03 13:01:17",""
"4510233","1","4732087","","2010-12-21 09:29:54","2","765","<p>Need to read/write to a tty SDIO device in an user space program in using JNI in Android.Is it possible to open the device (/dev/ttySDIO0) using fopen and read/write as a normal file?</p><p>From the terminal apps it is possible to do cat/echo to it. However I am looking for a approach which can be used in a program.</p><p>I don't see the .read operation defined in the SDIO UART driver.</p><p>Thank you. </p><p>EDIT: I am using Android Dev Phone 1 which has Android 1.6 (Linux Kernel Version 2.6.29). </p>","545691","TheCottonSilk","545691","","2011-01-19 05:33:48","2011-01-19 05:37:42","read/write /dev/ttySDIO0 like a file?","<android>","1","5","","",""
"4510249","1","4513194","","2010-12-22 14:37:07","0","1430","<p>hiHow do i multiselect images in the Gallery and send there URL to my activity?In the gallery I have added my Item to the share menu. But i can only shareone image and making my Activity start. This code give me the URL for one image.Is it possible to set up the Gallery or the share menu so that user canselect one or many pictures?</p><p>`if (Intent.ACTION_SEND.equals(action))  { if extras.containsKey(Intent.EXTRA_STREAM))   { Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM); //path to image    Toast toast = Toast.makeText(this, ""path: ""+     getRealPathFromURI(uri),     Toast.LENGTH_SHORT); toast.show();     return;   } else if    (extras.containsKey(Intent.EXTRA_TEXT)) {         } </p><p>} public String getRealPathFromURI(Uri contentUri) { String[] proj = {   MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(contentUri,   proj, null, null, null); int column_index =   cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);   cursor.moveToFirst(); return cursor.getString(column_index);}`</p>","538837","","","","","2010-12-22 20:00:48","How do i multiselect images in the Gallery and send there URL to my activity?","<android>","1","0","","",""
"4510280","1","4510365","","2010-12-22 14:40:02","6","7122","<p>This has been killing me for two days now. I have a main Activity A which calls a second Activity B. Activity B simply presents the user with a listview. When I press an item on the list view I want a couple of strings to be passed back to the main Activity A and Activiy B will finish.</p><p>The problem is I always get a resultcode of 0 and the data bundle is null. I really don't understand why this is happening.</p><p>Here is my code.</p><p>Start Activity B for result;</p><pre><code>Test.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            Intent i = new Intent(recipeActivity.this, BrowseLoadRecipes.class);            startActivityForResult(i, RECIPE_CHOOSER);    }      });</code></pre><p>This starts the second Activity fine. Activity B populates a listview and when I click an item I'm trying to send some data back to the calling Activity A.</p><p>Any text at the moment, so I used the following in Activity B;</p><pre><code>     lv.setOnItemClickListener(new OnItemClickListener() {     @Override     public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {        Bundle bundle = new Bundle();        bundle.putString(""TEXT"", ""Please work... pleeeeaasee"");        Intent mIntent = new Intent();        mIntent.putExtras(bundle);        setResult(RESULT_OK, mIntent);        finish();     }     });</code></pre><p>In the calling activity I have the following listening for the return as follows;</p><pre><code>protected void onActivityResult(int requestCode, int resultCode,         Intent data) {             switch(requestCode) {             //TODO            case RECIPE_CHOOSER:                Toast.makeText(getApplicationContext(), ""In recipe return"", Toast.LENGTH_SHORT).show();                Toast.makeText(getApplicationContext(), ""resultCode is "" + String.valueOf(resultCode), Toast.LENGTH_SHORT).show();                if (resultCode == RESULT_OK) {                Bundle b = getIntent().getExtras();                Toast.makeText(getApplicationContext(), ""Returned "" + b.getString(""TEXT""), Toast.LENGTH_LONG).show();                }                if (resultCode == RESULT_CANCELED) {                    }                break;                }             }         }</code></pre><p>I can see that the request code is correctly returned, but the resultcode is always a 0 and the data is always a null.</p><p>I've ran through the debug and the setResult is doing its job and the bundle does indeed have the data I'm passing, but it's lost at some point along the way.</p><p>Is there something in the manifest I'm missing or something. It's killed my progress on this project so far.</p><p>Any help would truly be appreciated.</p><p>Thanks,Dean</p>","447123","","","","","2012-12-06 10:10:41","Android onActivityResult is always 0","<android><result><subactivity>","3","0","2","",""
"4510294","1","","","2010-12-22 14:41:53","1","407","<p>Hi I try to implement something like this , i have textview inside the listview and inside the textview i have string with word like (""look:"") i made it look like a link with Linkify but i have to redirect this to my activity so that (""look:java"") will call activity that will redirect and search the word java. How can i define new scheme that do the job , just asking how to define the new scheme other part just extra info.</p>","155332","","155332","","2010-12-22 16:59:44","2010-12-22 16:59:44","Define new scheme in the android textview with url","<java><android><android-intent><textview>","1","2","","",""
"4510339","1","4510389","","2010-12-22 14:47:07","4","192","<p>The terms ""task"" and ""application"" are both part of the new Android terminology I am learning. In the <a href=""http://developer.android.com/guide/topics/fundamentals.html#acttask"" rel=""nofollow"">Activities and Tasks</a> section in the Dev Guide, the following sentence caught my attention:</p><blockquote>  <p>The user presses the HOME key, goes to  the application launcher, and selects  a new application <strong>(actually, a new  task)</strong>.</p></blockquote><p>Which raised the question: Is ""task"" a synonym for ""application"" in the Android world?</p><p>If not, what are the differences between the two?</p>","418055","","","","","2010-12-22 14:53:19","In Android, is Task == Application?","<android><terminology><task>","1","0","","",""
"4510346","1","","","2010-12-22 14:47:43","0","55","<p>Please Help.</p><p>I'm trying to create a menu that pops up if an android user clicks ""menu"" on his phone.and i want on the screen a button so when the user clicks it a sound starts playing for a second or two.&amp;&amp;this error keeps popping up in my java class in the part where it says ""                public boolean onCreateTutorial(Menu menu) {""</p><p>heres my code.</p><pre><code>package com.Tutorial;import com.Tutorial.R;import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class Tutorial extends Activity {    private SoundManager mSoundManager;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mSoundManager = new SoundManager();        mSoundManager.initSounds(getBaseContext());        mSoundManager.addSound(1, R.raw.sound);        Button SoundButton = (Button)findViewById(R.id.Button);        SoundButton.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                mSoundManager.playSound(1);                @Override                public boolean onCreateTutorial(Menu menu) {                    MenuInflater inflater = getMenuInflater();                    inflater.inflate(R.menu.menu, menu);                    return true;                }                      }        @Override        public boolean onOptionsItemSelected(MenuItem item) {            switch (item.getItemId()) {                case R.id.icon:     Toast.makeText(this, ""Rate this app on Android Market!"", Toast.LENGTH_LONG).show();                                    break;                case R.id.text:     Toast.makeText(this, ""Name: Wahid"", Toast.LENGTH_LONG).show();                                    break;                case R.id.icontext: Toast.makeText(this, ""MeSoundFx Pro on the Android Market! (Coming Soon)"", Toast.LENGTH_LONG).show();                                    break;            }            return true;        }        });    }}</code></pre>","551318","","180538","","2010-12-22 14:50:10","2010-12-22 14:53:40","Errors in Layout Cant figure it out!","<android><eclipse>","2","0","","",""
"4510500","1","","","2010-12-22 15:06:17","0","3998","<p>I want to have a broadcast receiver listening for BT devices connecting.Could anybody tell me which broadcast I have to listen to?I tried <code>android.bluetooth.device.action.ACL_CONNECTED</code> but it doesn't seem to work.</p><p>Thank you.</p>","455048","","222159","","2010-12-22 15:07:29","2013-08-27 06:55:33","Android - Bluetooth device connected broadcast","<android><bluetooth><broadcastreceiver>","2","1","","",""
"4510526","1","4510623","","2010-12-22 15:08:59","3","1115","<p>Our application could support landscape mode without any problem, but it is such a pain that we are thinking about <b>forcing portrait mode</b>.</p><p><b>Question: Is it BAD?</b></p><p>The main problem is that changing orientation generates <b>random crashes</b> on many screens. Avoiding those crashes would potentially allow us to spend more time on the core aspects of the app. Will the same crashes happen when users switch apps anyway?</p><p>Also, are there landscape-oriented devices where our app will become useless?</p>","226958","","","","","2010-12-22 20:51:08","Is disabling landscape mode unforgivable?","<android><screen-orientation>","3","2","","",""
"4510585","1","4510622","","2010-12-22 15:16:05","5","8315","<p>I need to create black iphone like gradient in my android application. Please view black gradient at the top in the image below. How to do it? Thanks</p><p><img src=""http://i.stack.imgur.com/7csI5.png"" alt=""alt text""></p>","340002","","","","","2013-04-07 07:23:07","Android create iphone-like Gradient","<android><gradient>","4","2","1","",""
"4510935","1","4511748","","2010-12-22 15:52:56","0","2838","<p>I have an application in which use a RSS feed reader. My problem is that I don't know what is the best way to display an image. The closer I could get was to pull the image description (). I know I could parse this String by myself and get the image url, but I was wondering if there is a more elegant way to solve this issue.  I tried using the SAX and the DOM classes, but I couldn't figure it out. </p><p>Thanks a lot,Gratzi</p>","460611","","","","","2011-04-20 15:36:06","Display image using a RSS feed","<android>","3","1","","",""
"4510974","1","10266994","","2010-12-22 15:57:28","17","13009","<p>Fundamentally, I would like to establish a callback to an Activity from an IntentService.  My question is very similar to the one answered here:</p><p><a href=""http://stackoverflow.com/questions/3197335/android-restful-api-service"">Android: restful API service</a></p><p>However, in the answer code, the activity code is seen as implementing a ResultReceiver.  Unless I'm missing something, ResultReceiver is actually a class, so it cannot perform this implementation.</p><p>So essentially, I'm asking what would be the correct way to wire up a ResultReceiver to that service.  I get confused with Handler and ResultReceiver concepts with respect to this.  Any working sample code would be appreciated.</p>","326536","","","","","2014-01-10 10:01:12","Using ResultReceiver in Android","<android><service><callback><activity>","3","0","14","",""
"4511057","1","","","2010-12-22 16:03:59","4","3779","<p>I have an Activity which takes photos (with full possible resolution, so quite large), the application have then the chance to analyze them. Only one photo is handled at a time. The problem is that I run in to a ""Out of memory"" after 4 - 5 photos. I see</p><blockquote>  <p>dalvikvm-heap   Out of memory on a 5070745-byte allocation</p></blockquote><p>(the byte size varies) followed by </p><blockquote>  <p>Camera-JNI      Couldn't allocate byte array for JPEG data</p></blockquote><p>My application does not crash but as it appears to me the Camera simply becomes unable to deliver the images from this point on. I pay attention to memory usage in my application but here it seems that there is a memory leak somewhere outside and I'm asking me how can I cope with this. Any solution approaches existing for this?</p>","170448","","","","","2011-02-28 13:46:17","Android out of memory on image capture","<android><image><capture><out-of-memory>","2","1","2","",""
"4511137","1","4511313","","2010-12-22 16:13:08","0","1281","<p>As a new android programmer I have my obligatory todo app running.  It is acceptable for Christmas shopping, but I'd really like to make the whole list-item row clickable.  Right now I have to tap the text.  The shorter the item the harder to hit.</p><p>My main activity extends ListActivity.  I use a subclass of ResourceCursorAdapter for the list itself.  My layout looks like this (thanks!):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/todo_row""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;CheckBox android:text=""""        android:id=""@+id/todo_checkbox""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:focusable=""false""        android:checked=""false""        &gt;&lt;/CheckBox&gt;&lt;TextView android:text=""""        android:id=""@+id/todo_text""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre>","282157","","","","","2011-03-06 13:59:45","I'd like to click anywhere (blank area) in a list view","<android><listview>","1","0","","",""
"4511170","1","","","2010-12-22 16:16:40","2","4336","<p>I'm following the <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"" rel=""nofollow"">Hello, MapView</a> documentation for Android. </p><p>I've followed it successfully most of the way through, including creating the HelloItemizedOverlay class, but when I get to this section:</p><pre><code>List&lt;Overlay&gt; mapOverlays;Drawable drawable;HelloItemizedOverlay itemizedOverlay;</code></pre><p>I suddenly start getting errors saying <code>HelloItemizedOverlay cannot be resolved to a type</code>. </p><p>I guess this is because I haven't imported the class (the documentation doesn't generally include instructions for doing this), but how do I import the class that I have created in my project?</p>","267831","","","","","2011-11-19 09:34:23","Android: how to import a class I have created?","<android>","3","0","","",""
"4511173","1","","","2010-12-22 16:16:59","1","903","<p>The description for EXTRA_AUTHORITIES in android.provider.Settings says :</p><p>""This can be passed as an extra field in an Activity Intent with one or more syncable content provider's authorities as a String[]. This field is used by some intents to alter the behavior of the called activity.</p><p>Example: The ACTION_ADD_ACCOUNT intent restricts the account types available based on the authority given.""</p><p>I want to show only the Corporate account type (or the activesync) to the user. I'm unable to find what String constants need to be passed as EXTRA_AUTHORITIES for this.</p><p>Can anyone point me to account type strings ? Or, provide an example of restrictively launching the add accounts page ?</p>","517940","","","","","2011-06-03 20:21:55","Providing EXTRA_AUTHORITIES when showing the ACTION_ADD_ACCOUNTS in order to show restricted account types to the user","<android>","1","1","","",""
"4511309","1","4511376","","2010-12-22 16:30:52","0","1155","<p>The following code is crashing my application on startup.It compiles just fine but just crashes.Without this code it runs perfectly.</p><p>This is the code</p><pre><code>private OnClickListener listentest = new OnClickListener() {    public void onClick(View v) {      // do something when the button is clicked    }};    public void onCreate(Bundle savedInstanceState) {    Button teamsbtn = (Button)findViewById(R.id.teams);  //  teamsbtn.setOnClickListener(listentest);      }</code></pre><p>Thanks,Andrew</p>","531315","","","","","2013-12-13 17:03:25","OnClickListener crashing application","<android><button><onclick>","1","1","","",""
"4511394","1","4515200","","2010-12-22 16:38:51","0","1830","<p>I've got a ASP.Net webservice that is functioning perfectly called from iPhone SOAP code or another .Net client.  However, when I try to use Ksoap2 the parameters passed to the service are not set. In service the parameter ""AuthenticationID"" must not be coming in because the first thing the WebMethod does is to check if the string is null or empty and returns an ""AuthenticationFailure"" response.  I do get that response so I know the SOAP stuff is just fine, just the parameter is not being passed.</p><pre><code>public SoapObject soap(String METHOD_NAME, String SOAP_ACTION, String NAMESPACE, String URL) throws IOException, XmlPullParserException {      SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);       request.addProperty(""AuthenticationID"", ""5"");             SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);       envelope.dotNet = true;      envelope.setOutputSoapObject(request);        HttpTransportSE httpTransport = new HttpTransportSE(URL);        httpTransport.debug = true;        httpTransport.call(SOAP_ACTION, envelope);       SoapObject result=(SoapObject)envelope.getResponse();       return result;  }</code></pre><p>And the WSDL looks as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;      &lt;soap:Body&gt;        &lt;LookupStores xmlns=""http://blah.com/Services/""&gt;          &lt;AuthenticationID&gt;string&lt;/AuthenticationID&gt;          &lt;NameMatch&gt;string&lt;/NameMatch&gt;        &lt;/LookupStores&gt;      &lt;/soap:Body&gt;    &lt;/soap:Envelope&gt;</code></pre><p>Please give me some things to try this is just a simple service and I thought it would be easy to consume using KSoap2.Thanks!</p>","446347","","21234","","2010-12-23 05:12:19","2013-08-15 22:42:20","ksoap2 - request parameters are always missing","<android><ksoap2>","2","0","","",""
"4511426","1","4512273","","2010-12-22 16:41:44","1","12021","<p>i'm tring to start a new activity from the main one but i'm getting an error when the application is launched <strong>the application ... has stopped unexpectedly. please try again</strong> (no error on eclipse ). that's my code:</p><pre><code>public class clubber extends Activity {    protected SearchData sData ;    protected boolean club;    protected boolean resto;    protected boolean bar;    protected String searchTerms;    protected String city;    protected String distance;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);       (...)        //Search button action         final Button button = (Button) findViewById(R.id.search);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks                Toast.makeText(clubber.this, ""Let's find something !"", Toast.LENGTH_SHORT).show();                  Intent intent = new Intent();                intent.setClass(clubber.this, Map.class);                startActivity(intent);            }        });    }    (...)}</code></pre><p>the target class:</p><pre><code>package com.clubber;import android.os.Bundle;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;public class Map extends MapActivity {    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() {        // TODO Auto-generated method stub        return false;    }}</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.club""      android:versionCode=""1""      android:versionName=""1.0""&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=""com.clubber.ClubberActivity"" 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="".Map""&gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt; </code></pre><p>map.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;    &lt;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=""*******************************""        /&gt;    &lt;LinearLayout android:id=""@+id/zoom""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""         android:layout_centerHorizontal=""true""         /&gt; &lt;/RelativeLayout&gt;</code></pre><p>logcat :</p><pre><code> D/AndroidRuntime(  512): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  512): CheckJNI is OND/AndroidRuntime(  512): Calling main entry com.android.commands.am.AmI/ActivityManager(   60): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.club/com.clubber.ClubberActivity } from pid 512I/ActivityManager(   60): Start proc com.club for activity com.club/com.clubber.ClubberActivity: pid=520 uid=10036 gids={3003, 1015}D/AndroidRuntime(  512): Shutting down VMI/AndroidRuntime(  512): NOTE: attach of thread 'Binder Thread #3' failedD/dalvikvm(  512): GC_CONCURRENT freed 102K, 69% free 319K/1024K, external 0K/0K, paused 1ms+3msD/dalvikvm(  512): Debugger has detached; object registry had 1 entriesW/dalvikvm(  520): Unable to resolve superclass of Lcom/clubber/Map; (36)W/dalvikvm(  520): Link of class 'Lcom/clubber/Map;' failedE/dalvikvm(  520): Could not find class 'com.clubber.Map', referenced from method com.clubber.ClubberActivity$5.onClickW/dalvikvm(  520): VFY: unable to resolve const-class 35 (Lcom/clubber/Map;) in Lcom/clubber/ClubberActivity$5;D/dalvikvm(  520): VFY: replacing opcode 0x1c at 0x0013D/dalvikvm(  520): VFY: dead code 0x0015-0022 in Lcom/clubber/ClubberActivity$5;.onClick (Landroid/view/View;)VI/ActivityManager(   60): Displayed com.club/com.clubber.ClubberActivity: +2s131msD/dalvikvm(  129): GC_EXPLICIT freed 70K, 50% free 2952K/5831K, external 2638K/3237K, paused 103msD/AndroidRuntime(  520): Shutting down VMW/dalvikvm(  520): threadid=1: thread exiting with uncaught exception (group=0x40015560)E/AndroidRuntime(  520): FATAL EXCEPTION: mainE/AndroidRuntime(  520): java.lang.NoClassDefFoundError: com.clubber.MapE/AndroidRuntime(  520):    at com.clubber.ClubberActivity$5.onClick(ClubberActivity.java:121)E/AndroidRuntime(  520):    at android.view.View.performClick(View.java:2485)E/AndroidRuntime(  520):    at android.view.View$PerformClick.run(View.java:9080)E/AndroidRuntime(  520):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(  520):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(  520):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  520):    at android.app.ActivityThread.main(ActivityThread.java:3647)E/AndroidRuntime(  520):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  520):    at java.lang.reflect.Method.invoke(Method.java:507)E/AndroidRuntime(  520):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)E/AndroidRuntime(  520):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)E/AndroidRuntime(  520):    at dalvik.system.NativeStart.main(Native Method)W/ActivityManager(   60):   Force finishing activity com.club/com.clubber.ClubberActivityW/ActivityManager(   60): Activity pause timeout for HistoryRecord{406b0d20 com.club/com.clubber.ClubberActivity}D/dalvikvm(   60): GC_CONCURRENT freed 1010K, 47% free 4446K/8263K, external 2046K/2554K, paused 11ms+10ms</code></pre>","476101","","476101","","2010-12-22 18:08:07","2012-04-30 14:10:26","Starting a new activity (android)","<java><android><eclipse><activity><android-emulator>","4","0","","",""
"4511518","1","","","2010-12-22 16:51:46","0","249","<p>This is kind of a repost, and I apologize for any broken rules, but I have a couple of questions about the soft keyboard on Android phones:</p><p>1)  I have an Android app with a couple different views (that the user switches between). How can I determine which is the current view??  I need to get the current view to execute the code that hides the virtual keyboard.</p><p>2)  How can I check whether the virtual keyboard is currently being displayed (so I can filter the actions of my various hard keys)??</p><p>Thanks,R.</p>","453989","","","","","2011-08-25 13:21:23","A Couple Android Soft Keyboard Questions","<android><user-interface><soft-keyboard>","1","0","","",""
"4511522","1","","","2010-12-22 16:53:25","0","498","<p>We are considering using Titanium to develop for Android and iPhone version of an application originally made for Blackberry. However, we want the authenticate the device and not through the traditional method (username + password). In the case of Blackberry, we use Blackberry PIN  to authenticate devices against a database of a web service. We think using the IMEI of the device, but do not know how safe it is.</p><p>Does anyone know a way to authenticate a device using a similar method? Is it possible to extract the IMEI of a team using Titanium?</p>","315748","","","","","2010-12-22 18:32:50","Device authentication with Titanium","<javascript><iphone><android><titanium>","1","0","","",""
"4511533","1","4511558","","2010-12-22 16:54:52","0","185","<p>I need to replicate the layout-weight parameter that you can set in XML within the onCreate method of my class I am creating. Does anybody know how to do this? </p>","400406","","","","","2010-12-22 16:57:49","Setting the weight of LinearView within code","<android><android-layout>","1","0","","",""
"4511549","1","4512099","","2010-12-22 16:56:40","0","6808","<p>Hi guys if i try to assign the string to string Array i am getting NULL POINTER EXCEPTION..Pls give me a solution..</p><p>Here is my code and i am getting null pointer in this line   thumbs[j]=title;as code Follows...</p><pre><code>for (int i = 0; i &lt; items.getLength(); i++) {        Node item = items.item(i);        NodeList properties = item.getChildNodes();        for (int j = 0; j &lt; properties.getLength(); j++) {            Node property = properties.item(j);            String name = property.getNodeName();            if (name.equalsIgnoreCase(""title"")) {                try{                    property.normalize();                    Spanned title2 = Html.fromHtml(property.getFirstChild().getNodeValue().replaceAll(""\\&lt;.*?&gt;"", """"));                    title =  title2.toString();                  }catch(Exception e){                     Log.v(""Exception"",""""+e);                }                thumbs[j]=title;            }        }    }</code></pre>","555221","","","","","2010-12-22 17:55:25","Android Array String","<android><arrays>","2","1","","",""
"4511642","1","4511677","","2010-12-22 17:05:21","1","212","<p>I am developing an app that need to display information on the stock of a store. Each activity will have upto 100 items.</p><p>My plan is to layout this information in a 10 * 10 grid. Each box in the grid represents an item of stock. Each of these items will be represented by an icon and a piece of text beneath the icon (the name). I setup a new layout which has an ImageView and a TextView for this. I called the layout Tab.xml</p><p>So, I need to know if it is possible to write a java class which will use the Tab.xml as the layout.Then I can programmatically create each java class item, setting the image and text as I go along.</p><p>Can anyone please give me some direction about this?</p>","504612","","644450","","2012-03-14 07:31:07","2012-03-14 07:31:07","Android OOP objects + Complex view","<android><oop><layout>","1","0","","",""
"4511740","1","4658602","","2010-12-22 17:16:09","0","1271","<p>I have to make an application which uploads videos for specific YouTube user. I've tried several libraries but unfortunately without any success. So since what I want to do is really very simple, I've decided to do it on my own, but with not much luck until now. I am able to retrieve authentication token successfully, but couldn't manage to make the file upload work. Here is my code:</p><pre><code>    File file = new File(videoPath);   String boundary = ""f93dcbA3"";   String endLine = ""\r\n"";   StringBuilder sb = new StringBuilder();   sb.append(""--"");   sb.append(boundary);   sb.append(endLine);   sb.append(""Content-Type: application/atom+xml; charset=UTF-8"");    sb.append(endLine);   sb.append(endLine);   sb.append(entry);   sb.append(endLine);   sb.append(""--"");   sb.append(boundary);   sb.append(endLine);   sb.append(""Content-Type: video/3gpp"");   sb.append(endLine);   sb.append(""Content-Transfer-Encoding: binary"");   sb.append(endLine);   sb.append(endLine);   String bodyStart = sb.toString();   sb = new StringBuilder();   sb.append(endLine);   sb.append(""--"");   sb.append(boundary);   sb.append(""--"");   String bodyEnd = sb.toString();   HttpURLConnection conn;   try {    FileInputStream fIn = new FileInputStream(file);    byte fileBytes[] = new byte[(int) file.length()];    fIn.read(fileBytes);    conn = (HttpURLConnection) new URL(""http://uploads.gdata.youtube.com/feeds/api/users/"" + username + ""/uploads"")      .openConnection();    conn.setRequestMethod(""POST"");             conn.setRequestProperty(""Content-Type"", ""multipart/related; boundary=\"""" + boundary + ""\"""");             conn.setRequestProperty(""Host"", ""uploads.gdata.youtube.com"");             conn.setRequestProperty(""Authorization"", ""GoogleLogin auth="" + auth);             conn.setRequestProperty(""GData-Version"", ""2"");             conn.setRequestProperty(""X-GData-Key"", ""key="" + devKey);             conn.setRequestProperty(""Slug"", ""video.3gp"");             conn.setRequestProperty(""Content-Length"", """" + (bodyStart.getBytes().length                + fileBytes.length + bodyEnd.getBytes().length));              conn.setRequestProperty(""Connection"", ""close"");             conn.setDoOutput(true);             conn.setDoInput(true);             conn.setUseCaches(false);             try {     conn.connect();     Log.d(""ID"", """" + file.length());     try {      OutputStream os = new BufferedOutputStream(conn.getOutputStream());      os.write(bodyStart.getBytes());               os.write(fileBytes);               os.write(bodyEnd.getBytes());               os.flush();               String response = """";               try {                response = ""Success! "" + read(conn.getInputStream());               } catch (FileNotFoundException e) {                   // Error Stream contains JSON that we can parse to a FB error                   response = ""Error!"" + read(conn.getErrorStream());               }               Log.d(""ID"", response);     } catch (FileNotFoundException e1) {      Log.d(""ID"", e1.getMessage(), e1);     } catch (IOException e) {      Log.d(""ID"", e.getMessage(), e);     }    } catch (IOException e2) {     Log.d(""ID"", e2.getMessage(), e2);    }   } catch (MalformedURLException e3) {    Log.d(""ID"", e3.getMessage(), e3);   } catch (IOException e3) {    Log.d(""ID"", e3.getMessage(), e3);   }</code></pre><p>And the xml entry (a simple copy-paste from the specification):</p><pre><code>     private static String entry = ""&lt;?xml version=\""1.0\""?&gt;""  + ""&lt;entry xmlns=\""http://www.w3.org/2005/Atom\""""  + "" xmlns:media=\""http://search.yahoo.com/mrss/\""""  + "" xmlns:yt=\""http://gdata.youtube.com/schemas/2007\""&gt;""   + ""&lt;media:group&gt;""    + ""&lt;media:title type=\""plain\""&gt;Bad Wedding Toast&lt;/media:title&gt;""    + ""&lt;media:description type=\""plain\""&gt;""     + ""I gave a bad toast at my friend's wedding. Maybe""    + ""&lt;/media:description&gt;""    + ""&lt;media:category""    + "" scheme=\""http://gdata.youtube.com/schemas/2007/categories.cat\""&gt;People""    + ""&lt;/media:category&gt;""    + ""&lt;media:keywords&gt;toast, wedding&lt;/media:keywords&gt;""   + ""&lt;/media:group&gt;""  + ""&lt;/entry&gt;"";</code></pre><p>The code above is written according to the <a href=""http://code.google.com/intl/bg/apis/youtube/2.0/developers_guide_protocol_direct_uploading.html#Sending_a_Direct_Upload_API_Request"" rel=""nofollow"">YouTube specification</a>In short - the response I receive is ""411 Length Required"", meaning that I don't have Content-Length in the header, but I do! I have no idea where the problem is, I don't know if any of my code is correct :(I'd appreciate any help you could offer me :(</p>","434378","","434378","","2011-01-11 14:19:17","2012-08-31 17:45:20","YouTube direct upload using ClientLogin via Android","<android><youtube><http-post>","1","0","","",""
"4511798","1","","","2010-12-22 17:21:44","1","1080","<p>I've been trying to find a way to measure the size of a pupil in a close-up image of an eye. I want to turn this into an Android app. I have previous Android experience but can't find any Java solutions to the problem itself. </p><p>There is lots of example code for face detection and even eye detection but none that will examine a still image and find the pupils, then measure them. Does anybody know how I could proceed in trying to measure the size of the pupil?</p><p>Thanks,</p><p>Mark</p>","537932","","21234","","2011-01-28 10:11:01","2011-05-09 19:45:48","Measure pupil size in image of eyes","<java><android><eye-tracking>","2","3","1","",""
"4511873","1","","","2010-12-22 17:30:33","1","360","<p>I'm investigating if I can make an app that runs in background but is able to interact with others by ""enriching"" texts adding relevant information. For Instance, interact with an existent twitter app colouring words considered to be relevant. Thanks in advacen for any help</p>","551499","","","","","2011-02-15 19:54:32","Android apps interaction","<android>","1","0","","",""
"4511894","1","","","2010-12-22 17:32:53","3","2855","<p>I'm an android novice and I have a problem with my cursor. I can't access the data using:<code>cursor.get(cursor.getColumnIndex(columnName));</code></p><p>I tried the following code to test for an error:</p><pre><code>while (cursor.moveToNext()) {        int x = 2;        Log.i(""MyDebug"", ""Index: "" + x);        Log.i(""MyDebug"", ""Name: "" + cursor.getColumnName(x));        Log.i(""MyDebug"", ""Index again: "" + cursor.getColumnIndex(cursor.getColumnName(x)));    }</code></pre><p>Result from the Debug Monitor:</p><pre><code>Index: 2 Name: mainMenu.title Index again: -1</code></pre><p>Shouldn't the result of ""Index again"" be 2? What am I doing wrong?</p>","551492","","1341006","","2012-09-25 06:00:37","2012-10-04 09:16:33","Android getColumName and getColumnIndex ","<android><sqlite>","2","0","","",""
"4511955","1","","","2010-12-22 17:39:06","1","678","<p>I am working on a RSS feed reader for a particular RSS feed, and I am having a problem with SAX and the  tag.  The tag looks like this</p><pre><code>&lt;description&gt;&lt;![CDATA[&lt;img src=http://www.lamaruniversitypress.com/polopoly_fs/1.1832584!image/2678128836.jpg_gen/thumbnails/100x100/2678128836.jpg&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;    South Korea vowed Wednesday to completely punish North Korea if it attacks again....&lt;/p&gt;]]&gt;&lt;/description&gt;</code></pre><p>My startElement method has this element to handle the description tag looks like this:</p><pre><code>if (localName.equals(""description""))        {                        currentstate = RSS_DESCRIPTION;            return;        }</code></pre><p>and my chars method looks like this:</p><pre><code>case RSS_DESCRIPTION:            _item.setDescription(theString);            Log.i(""DESCRIPTION"",""characters["" + theString + ""]"");            currentstate = 0;            break;</code></pre><p>The log file displays this:</p><pre><code>12-22 11:21:06.517: INFO/TITLE(489): characters[SKorea holds massive new drills after North attack]12-22 11:21:06.527: INFO/DESCRIPTION(489): characters[12-22 11:21:06.527: INFO/DESCRIPTION(489): ]</code></pre><p>This is my first attempt at working with SAX, and I am getting pretty close to rewriting the whole thing with a different parser, asking you guys is my last ditch effort.</p><p>I have tried handling the paragraph tag, that does not work, presumably because it is inside of the CDATA.  I have attempted to substring the descriptions like this</p><pre><code>String theString = new String(ch,start,length);        /*        if ( currentstate == RSS_DESCRIPTION){            theString = new String(ch, theString.indexOf(""&lt;p&gt;"") + 3, theString.indexOf(""&lt;/p&gt;""));        }</code></pre><p>and the program just halts when it hits it.  </p><p>Thanks in advance for any help!!!-David</p>","475134","","90848","","2010-12-22 17:49:10","2010-12-22 17:53:14","SAX parser issue","<java><android><rss><sax>","2","7","1","",""
"4512011","1","4513794","","2010-12-22 17:44:37","0","347","<p>Is it possible to send a SMS text message to a AIM screen name? I am trying to do this in my Android application.</p>","389899","","","","","2010-12-22 21:13:43","SMS message to AIM screen name","<android><sms><aim>","1","1","","",""
"4512107","1","4512747","","2010-12-22 17:56:22","0","998","<p>Ok, I hope I don't get slammed for asking such an ambiguous question but I am stumped and don't even know how to ask this. I am going to try as best as possible to communicate my problem and will clarify if needed. </p><p>I have two cursors merged using MergeCursor. I also have a custom cursor adapter. In my custom cursor adapter I have overridden BindView. I am noticing strange behavior where items are not showing up in my listview. Essentially I have two textviews for each row in the listview. In the last row one of the fields is empty.</p><p>I step through the BindView and I notice it gets executed 3 times. My listview only has 7 items in it (so that's 7x3). All of them show on the screen except one of the fields in item 7. I notice that on two passes though BindView a field value is missing.</p><p>What I want to know is, why is BindView executing 3 times. So when I say 3 I mean 3x7. 7 items in the list, so it cycles through BindView 21 times. I hope I'm making sense. </p><p>Please don't slam me if this is not clear. I am happy to modify or provide additional info. </p>","485438","","","","","2010-12-22 19:06:32","Android custom cursor adapter and BindView","<android><sqlite><cursor>","1","0","","",""
"4512247","1","4512774","","2010-12-22 18:12:45","0","561","<p>Can the TTS Extended library be installed on the Android Emulator?</p><p>If the answer is positive, how do I accomplish that?</p>","418055","","168868","","2012-01-01 21:55:41","2012-01-01 21:55:41","Can the TTS Extended library be installed on the Android Emulator?","<android><android-emulator><apk><text-to-speech>","1","2","","",""
"4512380","1","4512887","","2010-12-22 18:27:47","1","2069","<p>I have a very basic Activity at the moment. It creates a GLSurfaceView and sets the Renderer. The problem is all I see is red, which is from glClearColor, and no texture. Not even a white area. Also glGetError() is not reporting anything.</p><p>Here is the Renderer:</p><pre><code>public class MyRenderer implements Renderer {    public MyRenderer(Context context)    {        mContext = context;    }    public void onDrawFrame(GL10 gl) {        gl.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);        gl.glBindTexture(GL10.GL_TEXTURE_2D, texture[0]);        gl.glVertexPointer(2, GL10.GL_FLOAT, 0, vertex);        gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texCoords);        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);        gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);        gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    }    public void onSurfaceChanged(GL10 gl, int width, int height) {        gl.glViewport(0, 0, width, height);        gl.glMatrixMode(GL10.GL_PROJECTION);        gl.glLoadIdentity();        gl.glOrthof(-160.0f, 160.0f, -240.0f, 240.0f, 0.1f, 1.0f);        gl.glMatrixMode(GL10.GL_MODELVIEW);        gl.glLoadIdentity();    }    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        float vertexBuffer[] = {                -160.0f, -240.0f,                -160.0f, 240.0f,                160.0f, -240.0f,                160.0f, 240.0f        };        vertex = ByteBuffer.allocateDirect(8 * 4).asFloatBuffer().put(vertexBuffer);        float texCoordsBuffer[] = {                0.0f, 0.0f,                0.0f, 480.0f/512.0f,                320.0f/512.0f, 0.0f,                320.0f/512.0f, 480.0f/512.0f        };        texCoords = ByteBuffer.allocateDirect(8 * 4).asFloatBuffer().put(texCoordsBuffer);            BitmapFactory.Options options = new BitmapFactory.Options();        options.inDensity = 240; // needed so that the image will be 512x512        Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.image, options);        int width = bitmap.getWidth();        int height = bitmap.getHeight();        Log.i(TAG, ""Bitmap:{w:"" + width + "" h:"" + height + ""}"");        gl.glEnable(GL10.GL_TEXTURE_2D);        texture = new int[1];        gl.glGenTextures(1, texture, 0);        gl.glBindTexture(GL10.GL_TEXTURE_2D, texture[0]);        gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);        gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);        GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);        bitmap.recycle();        int error = gl.glGetError();        if (error != GL10.GL_NO_ERROR)        {             Log.e(TAG, ""GL Texture Load Error: "" + error);        }    }    private Context mContext;    private int texture[];    private FloatBuffer vertex;    private FloatBuffer texCoords;}</code></pre>","398640","","398640","","2010-12-22 21:18:10","2010-12-22 21:18:10","Android OpenGL ES not drawing Texture","<android><opengl-es>","2","0","","",""
"4512399","1","4512462","","2010-12-22 18:30:46","0","321","<p>How can we take data from sql with a sql request like ""SELECT * FROM ..."" to an arraylist (more precise in a listview or a autocompletetext or a spinner).</p>","439058","","","","","2010-12-22 18:38:46","sql selection to arraylist android","<sql><android><listview><arraylist><request>","1","0","","",""
"4512426","1","4512769","","2010-12-22 18:34:14","1","1707","<p>I am trying to make my game a bit easier on the phone, so I am trying to figure out a way to print a bunch of bitmaps onto another big one, so I can just do it once, rather than every time the screen is redrawn. So, is there any way to do this? I know there is a way to print everything that is printed to the canvas to a bitmap, but I can't seem to get that to work. If that is the only way can someone explain how to do that? Thanks in advance.</p><p>Here is something I tried, but it didn't work out so well</p><pre><code>Bitmap background; Canvas canvas; private void methodName() {    background = Bitmap.createBitmap(width, height, someKindOfConfigThing);     canvas = new Canvas(background);    canvas.drawBitmap(blahblah);}</code></pre>","551555","","180538","","2010-12-22 19:09:41","2010-12-22 19:22:10","Print Bitmaps onto other bitmap android","<android><canvas><bitmap>","2","0","1","",""
"4512458","1","7446532","","2010-12-22 18:37:39","51","103479","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3480201/how-do-you-install-an-apk-file-in-the-android-emulator"">How do you install an APK file in the Android emulator?</a>  </p></blockquote><p>I download an APK file and I want to run it on an Android emulator but I don't know how.  Please help me.  Thanks!</p>","377983","","495935","","2010-12-22 18:39:41","2013-02-02 03:51:17","Android:How to run .APK file on emulator","<android><android-emulator><emulator><apk>","4","1","22","2011-09-17 13:46:17",""
"4512558","1","4512581","","2010-12-22 18:48:40","1","328","<p>How do I change the visibility of my custom view?</p><p>I know how to do it with a listview(- getListView().setVisibility(View.GONE) -) but I don't know how to do it with my custom view ""compview"" defined in the xml like this:</p><pre><code>&lt;View android:id=""@+id/compview"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;</code></pre><p></p><p>Any help appreciated.</p>","531315","","","","","2010-12-22 18:51:05","How do I change the visibility of a view?","<android><view>","1","0","","",""
"4512717","1","4512824","","2010-12-22 19:03:25","0","3782","<p>I am attempting to create a custom messaging app. Just something basic but I am getting some error that I have never heard of. Tried for 2 days to fix it so I thought I would bother you guys with it. This is the code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ListView messages = (ListView) findViewById(R.id.messages);    msgList = getSMS();     for(int i = 0; i&lt;msgList.size(); i++) {        System.out.println(msgList.get(i));    }    adapter = new ArrayAdapter&lt;String&gt;(MainActivity.this, 0, R.layout.list_item, msgList);    **messages.setAdapter(adapter);**    messages.setOnItemClickListener(new OnItemClickListener()    {        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int pos,long id)         {               SmsManager m = SmsManager.getDefault();               String destinationNumber=(String) ((TextView) view).getText();                             m.sendTextMessage(destinationNumber, null, destinationNumber, null, null);        }              });}public List&lt;String&gt; getSMS() {          List&lt;String&gt; messages = new ArrayList&lt;String&gt;();    Uri uri = Uri.parse(""content://sms/inbox"");    Cursor c = null;    try{        c = getApplicationContext().getContentResolver().query(uri, null, null ,null,null);     }catch(Exception e){        e.printStackTrace();    }    try{        for (boolean hasData = c.moveToFirst(); hasData; hasData = c.moveToNext()) {            final String address = c.getString(c.getColumnIndex(""address""));            final String body = c.getString(c.getColumnIndexOrThrow(""body""));            messages.add(""Number: "" + address + "". Message: "" + body);        }    }catch(Exception e){        e.printStackTrace();    } c.close();  return messages;}</code></pre><p>And here is the error:</p><pre><code>12-22 18:49:24.752: ERROR/AndroidRuntime(2054): FATAL EXCEPTION: main12-22 18:49:24.752: ERROR/AndroidRuntime(2054): android.content.res.Resources$NotFoundException: Resource ID #0x012-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.content.res.Resources.getValue(Resources.java:892)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.content.res.Resources.getLayout(Resources.java:731)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.LayoutInflater.inflate(LayoutInflater.java:318)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.AbsListView.obtainView(AbsListView.java:1315)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.ListView.onMeasure(ListView.java:1109)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.View.measure(View.java:8171)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.View.measure(View.java:8171)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.View.measure(View.java:8171)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:526)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.View.measure(View.java:8171)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.View.measure(View.java:8171)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.ViewRoot.performTraversals(ViewRoot.java:805)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1731)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.os.Handler.dispatchMessage(Handler.java:99)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.os.Looper.loop(Looper.java:123)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at java.lang.reflect.Method.invokeNative(Native Method)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at java.lang.reflect.Method.invoke(Method.java:521)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)12-22 18:49:24.752: ERROR/AndroidRuntime(2054):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I know the error is occurring when I set the adapter, but I have checked the messages are being retrieved fine and I cannot seem to find where the error is occurring.Any ideas on the error(s) are greatly appreciated!</p><p>EDIT: Yep, Sorry here is the list_item.xml. If it helps, I have had a similar program working on a 2.1 phone, but throws this error on 2.2. Haven't tried this app on 2.1, however.</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=""15dp""    android:textSize=""22sp"" &gt;&lt;/TextView&gt;</code></pre>","528258","","528258","","2010-12-22 19:09:39","2011-05-24 01:27:01","Android: Array Adapter and ListView, throwing some weird Reference error?","<java><android><listview><android-arrayadapter>","1","1","","",""
"4512896","1","4514639","","2010-12-22 19:27:20","6","3344","<p>I have an activity that gets some data from the internet in background while showing a progress dialog. When I get the data (or an error) I dismiss that dialog and show another one.</p><p>If for some reason the website takes too long to deliver the response (15+ seconds for example), the phone will turn off the screen. Now, while the screen is off, if I get a response and try to show a dialog, there will be an error (WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@483fa968 is not valid; is your activity running?)</p><p>The reason of this problem is simple: when the screen turned off, another activity came to the foreground (keyguard or something).</p><p><strong>Question:</strong> Now, whats the best method for invoking showDialog on an activity that we know that <em>might</em> not be running? (the activity was created but it's not the one the user is interacting with.. in other words, it's in stopped state).</p><p>I believe a similar behavior would happen if I clicked home and changed to the Home activity. (Although I can't do this in my particular case because my activity would cancel the request and everything would shutdown correctly).</p><p>I don't think that this makes any difference, but I reproduced this in Android 2.1</p>","372076","","","","","2011-06-10 07:29:23","Activity.showDialog when activity may not be in foreground","<android>","2","2","3","",""
"4512981","1","5153262","","2010-12-22 19:35:51","11","56627","<p>I am receiving many errors of kind displayed in the subj. These errors seems to be occasional and I cannot reproduce them. From stack I can learn that such error may occurs for my different layout resources. The line of XML is also varying.</p><p>Can anybody explain why this error occurs? And what I can do to fix this problem?</p><p>Stack </p><pre><code>=============================================================com.fsp.android.f generated the following exception:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fsp.android.f/com.life360.android.ui.tour.TourActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class &lt;unknown&gt;--------- Stack trace ---------1. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2649)2. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2674)3. android.app.ActivityThread.access$2200(ActivityThread.java:131)4. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1975)5. android.os.Handler.dispatchMessage(Handler.java:99)6. android.os.Looper.loop(Looper.java:123)7. android.app.ActivityThread.main(ActivityThread.java:4702)8. java.lang.reflect.Method.invokeNative(Native Method)9. java.lang.reflect.Method.invoke(Method.java:521)10. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)11. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12. dalvik.system.NativeStart.main(Native Method)------------------------------------------ Cause -----------android.view.InflateException: Binary XML file line #12: Error inflating class &lt;unknown&gt;1. android.view.LayoutInflater.createView(LayoutInflater.java:513)2. com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)3. android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)4. android.view.LayoutInflater.rInflate(LayoutInflater.java:618)5. android.view.LayoutInflater.rInflate(LayoutInflater.java:621)6. android.view.LayoutInflater.inflate(LayoutInflater.java:382)7. android.view.LayoutInflater.inflate(LayoutInflater.java:320)8. android.view.LayoutInflater.inflate(LayoutInflater.java:276)9. com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:208)10. android.app.Activity.setContentView(Activity.java:1629)11. com.solvek.sample.ui.BaseActivity.onCreate(BaseActivity.java:23)12. com.solvek.sample.ui.tour.TourActivity.onCreate(TourActivity.java:161)13. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)14. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2587)15. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2674)16. android.app.ActivityThread.access$2200(ActivityThread.java:131)17. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1975)18. android.os.Handler.dispatchMessage(Handler.java:99)19. android.os.Looper.loop(Looper.java:123)20. android.app.ActivityThread.main(ActivityThread.java:4702)21. java.lang.reflect.Method.invokeNative(Native Method)22. java.lang.reflect.Method.invoke(Method.java:521)23. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)24. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)25. dalvik.system.NativeStart.main(Native Method)------------------------------------- Environment --------Time =2010-12-20 08:27:35 AMDevice =tmobile/htc_espresso/espresso/espresso:2.1-update1/ERE27/216830:user/release-keysMake =HTCModel =T-Mobile myTouch 3G SlideProduct =htc_espressoApp =com.fsp.android.f, version 2.0.9 (build 1232)</code></pre><p>Here is a result of XML, however such error occurs in other xmls</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ViewFlipper android:layout_gravity=""fill"" android:id=""@+id/flipper"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_1""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_2""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_3""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_4""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_5""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_6""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_7""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_8""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_9""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_10""/&gt;        &lt;ImageView android:scaleType=""fitXY"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/tour_11""/&gt;    &lt;/ViewFlipper&gt;    &lt;LinearLayout android:id=""@+id/exit_bar"" android:layout_gravity=""top"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""@drawable/blue_bar"" android:visibility=""invisible""&gt;        &lt;Button android:background=""@drawable/orange_btn"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_gravity=""center"" android:textStyle=""bold"" android:textColor=""#000000"" android:shadowColor=""#ffffff"" android:shadowRadius=""1.6"" android:shadowDx=""1.5"" android:shadowDy=""1.3"" android:id=""@+id/exit_tour_btn"" android:text=""Exit"" android:layout_marginLeft=""20dip""/&gt;        &lt;TextView android:layout_height=""wrap_content"" android:textColor=""#ffffff"" android:layout_gravity=""center"" android:layout_width=""110dip"" android:layout_marginLeft=""20dip"" android:textSize=""16dip"" android:textStyle=""bold"" android:text=""Life360 Tour""/&gt;    &lt;/LinearLayout&gt;    &lt;Button style=""@style/BlueBtn"" android:text=""Continue"" android:layout_marginTop=""40dip"" android:id=""@+id/continue_btn"" android:visibility=""gone"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:layout_gravity=""center"" /&gt;    &lt;FrameLayout android:id=""@+id/bottom_bar"" android:layout_gravity=""bottom"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""@drawable/blue_bar"" android:visibility=""invisible""&gt;        &lt;ImageView android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/left"" android:layout_gravity=""left|center"" android:background=""@drawable/tour_left"" android:layout_marginLeft=""10dip""/&gt;        &lt;ImageView android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/right"" android:layout_gravity=""right|center"" android:background=""@drawable/tour_right"" android:layout_marginRight=""10dip""/&gt;                   &lt;/FrameLayout&gt;&lt;/merge&gt;</code></pre>","120574","","120574","","2010-12-23 16:01:32","2013-04-02 08:03:02","android.view.InflateException: Binary XML file line #12: Error inflating class <unknown>","<android><xml><resources><inflate>","3","1","0","",""
"4513084","1","4513231","","2010-12-22 19:47:10","1","1475","<p>I've created a custom arrayadapter to handle a json response that I'm successfully throwing into a listview. However, I'm unsure of the best way to display radio buttons next to each item... I've read about using android.R.layout.simple_list_item_single_choice as the default view, but I'm using a custom adapter and a custom xml to display my data... so I'm wondering in this case what is the best way to implement radio buttons on a listview? thx</p>","522868","","","","","2011-09-28 19:28:50","What is the best way to implement single choice radio buttons on an android listview that uses a custom array adapter?","<java><android>","1","0","1","",""
"4513122","1","","","2010-12-22 19:51:06","8","1320","<p>Whenever I switch to DDMS view and start method profiling, I get the following error message when I stop profiling:</p><pre><code>Method Profiling Error:Unable to download trace file:Remote object doesn't exist!</code></pre><p>This only happens with 1.6 and 2.1 AVDs, 2.2 and 2.3 work fine. I've been having this problem ever since the latest update to the Eclipse Android plugin. I'm using Eclipse 3.5.2 on Ubuntu 10.04 with Android Development Toolkit version 8.0.0.v201011171904-77661. Let me know if you need any more information.</p><p>Edit 1:</p><p><a href=""http://pastebin.ca/2034034"" rel=""nofollow"">Logcat output</a></p><p>Edit 2:</p><p>The trace file is actually created on the sdcard and I can pull it with adb or from DDMS file explorer and view it in traceview. I just get the error message when I click on the ""stop method profiling"" icon and the trace file isn't automatically displayed. I tried deleting the AVDs and creating new ones, installing the latest plugin version, and reinstalling the plugin but the issue remains. I can live with it, but it'd be nice to get it working like it used to.</p>","23153","","23153","","2010-12-31 12:05:37","2011-03-24 06:56:06","Unable to download trace file","<android><eclipse><profiling>","2","0","","",""
"4513207","1","4515094","","2010-12-22 20:02:28","1","307","<p>I'd like to know what is the format for an android intent. IE, what should I pass to the method :</p><blockquote>  <p>getBaseContext().startService(Intent);</p></blockquote><p>If I want to pass this: </p><blockquote>  <p>android.provider.CallLog.Calls.CONTENT_URI</p></blockquote><p>can i? What would be the format. </p><p>Can someone give a good explanation of how to use Intents, and how to use it on Service implementation, like, <code>startService()</code>, or <code>onStartCommand (Intent intent, int flags, int startId)</code>.</p><p>Thanks!</p>","399459","","","","","2010-12-23 01:08:24","What is the format for an android intent?","<android><android-intent><android-service><android-contentprovider>","1","0","","",""
"4513440","1","6307721","","2010-12-22 20:31:24","1","3731","<p>I have been trying to change the background color of the app widget on the fly for sometime now, with no success.</p><p>I had found one solution (http://stackoverflow.com/questions/2726295/android-changing-linearlayout-in-a-widget) which we have been using. </p><p>Problem is we already have 8 layout files for 8 background colors, which is really difficult to maintain.</p><p>We would also like to add a color picker so that users can select their own choice of color.</p><p>Is there a better way to work around the RemoteViews limitations?</p><p>Thanks...</p>","551675","","64605","","2011-10-08 18:18:52","2011-10-08 18:18:52","Android-widget :  Change app widget background on the fly","<android><android-widget>","2","1","2","2011-09-26 13:12:32",""
"4513457","1","","","2010-12-22 20:33:33","0","175","<p>Hi I am new to android and developing a android app which captures the user's location. I need to store the last 10 known locations and display them to the user on button click. So please help me how to do this.. </p><p>The last 10 locations needs to be updated and shown to the users. I should display only 10 recent locations</p>","551679","","","","","2010-12-22 20:42:41","store previous 10 locations in android location application","<android><location><storage>","2","0","","",""
"4513538","1","","","2010-12-22 20:43:31","2","9969","<p>I need to grab selected item TEXT (not id).What can I write under onListItemClick to do that?I get:</p><pre><code>java.lang.ClassCastException: org.eclipse.jdt.internal.debug.core.model.JDIObjectValue cannot be cast to org.eclipse.jdt.debug.core.IJavaArrayat org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.getCompiledExpression(JavaDetailFormattersManager.java:396)at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.resolveFormatter(JavaDetailFormattersManager.java:167)at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.access$1(JavaDetailFormattersManager.java:152)at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager$3.run(JavaDetailFormattersManager.java:143)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>","380490","","380490","","2010-12-23 16:29:30","2012-08-10 09:29:57","Listview get item text","<android><listviewitem>","1","0","2","",""
"4513581","1","","","2010-12-22 20:50:01","1","6317","<p>My eclipse flipped out, and now will not run any of my Android projects, all of which were working fine before.</p><p>If I try to right click and run as Android project, nothing happens. If I go to properties of the project and go to run/debug settings and try to create a new one, I get an error dialog that says 'Update LCD' has encountered a problem. An internal error has occured. The details show: ""An internal error occurred during: ""Launching InsideCarolina2"".com/android/ddmlib/InstallException""</p>","1639706","","","","","2014-03-23 06:08:49","Running Android projects in Eclipse has error: An internal error occurred during: ""Launching InsideCarolina2"". com/android/ddmlib/InstallException","<android><eclipse>","1","0","","",""
"4513732","1","","","2010-12-22 21:07:00","-1","499","<p>I installed Eclipse Classic (Helios) and Android Sdk and the Adt plugins as derscribed by goodle at the Android Developers site. I could immediately run Hello World perfectly. But the next time I used my computer I could run Hello World anymore and get this error message:</p><pre><code>E/ddms: shutting down due to uncought exceptionE/ddms: Bad version: standalonejava.lang.IllegalArgumentException: BadVersion: standalone    at com.android.sdkstats.SdkStatsService.normalizeVersion&lt;...&gt;    at com.android.sdkstats.SdkStatsService.doPing&lt;...&gt;    at com.android.sdkstats.SdkStatsService.ping&lt;...&gt;    at com.android.ddms.Main.main&lt;Main.java:78&gt;</code></pre><p>And the console says:</p><pre><code>[2010-12-22 21:38:52 - HelloAndroid] ------------------------------[2010-12-22 21:38:52 - HelloAndroid] Android Launch![2010-12-22 21:38:52 - HelloAndroid] adb is running normally.[2010-12-22 21:38:52 - HelloAndroid] Performing org.example.hello.Hello activity launch[2010-12-22 21:38:52 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'AnnasPhone'[2010-12-22 21:38:52 - HelloAndroid] Launching a new emulator with Virtual Device 'AnnasPhone'[2010-12-22 21:38:58 - HelloAndroid] New emulator found: emulator-5554[2010-12-22 21:38:58 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...[2010-12-22 21:39:39 - HelloAndroid] HOME is up on device 'emulator-5554'[2010-12-22 21:39:39 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'[2010-12-22 21:39:39 - HelloAndroid] Installing HelloAndroid.apk...[2010-12-22 21:40:26 - HelloAndroid] Success![2010-12-22 21:40:26 - HelloAndroid] Starting activity org.example.hello.Hello on device emulator-5554[2010-12-22 21:40:29 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.example.hello/.Hello }</code></pre><p>and nothing happens... What should I do? Does Eclipse Classic needs some kind of configuration??</p><p>Anna</p>","551678","","142162","","2010-12-22 21:16:39","2010-12-22 21:26:07","Eclipse Classic can not find java? and not run Hello World as last week","<java><android>","1","0","","",""
"4513766","1","4513858","","2010-12-22 21:10:09","2","4153","<p>I simply want a mapview to recognize a click, in order to call another activity.</p><p>Until now, i tried the regular ""onClick"",that always worked for me in regular Views, followed by overriding ""onTouchEvent"" and last but not least using an onClickListener.</p><p>I out all three ways into the following code. Any help is highly appreciated.</p><pre><code>import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;public class HelloMapView extends MapActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {     final MapView map;        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        map = (MapView) findViewById(R.id.mapview);        map.setOnClickListener(new MapView.OnClickListener() {         public void onClick(View v){          System.out.println(""I listened!"");         }          });    }    @Override    protected boolean isRouteDisplayed() {        return false;    }    @Override    public boolean onTouchEvent(MotionEvent arg0) {     System.out.println(""onTouchEvent happened!"");                super.onTouchEvent(arg0);        return super.onTouchEvent(arg0);        }    public void onClick(){     System.out.println(""onClick entered!"");    }    }</code></pre>","551714","","","","","2014-02-11 08:55:30","android: MapView does not recognize clicks","<android><android-mapview><mapactivity>","4","0","2","",""
"4513825","1","5137629","","2010-12-22 21:17:13","12","2495","<p>I am trying to catch the package replaced broadcast for my app and only my app, but for some reason in my reciever I am the broadcast for every app that is updated.  I thought you only needed to set the intent filter in the manifest file to your app, but maybe I am wrong?  </p><p>Here's my code(manifest):</p><pre><code>        &lt;receiver android:name="".UpdateReciever""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.PACKAGE_REPLACED"" /&gt;            &lt;data android:scheme=""package"" android:path=""com.my.app"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>Reciever:</p><pre><code>public class AppUpdateReciever extends BroadcastReceiver {    @Override    public void onReceive(Context con, Intent intent) {        //code..        }}</code></pre>","408079","","611600","","2012-08-15 01:12:30","2014-02-03 14:20:12","How to correctly filter Package replaced broadcast","<android><broadcastreceiver><broadcast><intentfilter>","2","0","3","",""
"4513888","1","4514170","","2010-12-22 21:24:11","7","5644","<p>I've attached an OnKeyListener to an EditText.  I've overrode the onKey handler to capture a KeyEvent.</p><p>When a user hits the enter key (either their computer enter key while using the emulator, or the hardware enter key on their phone with a hardware keyboard), the onKey handler gets executed twice.  Both executions have the keyCode 66.</p><p>Why is this happening?</p><p>I want my screen so when the user hits the enter key, a search is performed.  Because of what is happening, the search is needlessly happening twice.</p><p>My method looks like this:</p><pre><code>   mFilter.setOnKeyListener(new View.OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {            if (keyCode == KeyEvent.KEYCODE_ENTER) {                // perform search                return true;            }            return false;        }    });</code></pre>","406790","","","","","2014-03-13 06:01:44","Enter key on EditText hitting onKey twice","<android>","5","0","","",""
"4513902","1","4514090","","2010-12-22 21:26:21","4","3740","<p>So i'm just trying to make a ball bounce around the screen which should slow down due to gravity and reflect (bounce) from the wall like a normal ball would.Can someone give some basics and VERY simple implementation of this?Other examples seem a bit ""overdone"" and seem to go beyond what I want to do.I've tried this:</p><pre><code>public void updateLogic() {    if (x &lt; -1) {        xPos += (-x * gravity);    } else if (x &gt; 1) {        xPos -= (x * gravity);    }    if (y &gt; 1) {        yPos += (y * gravity);    } else if (y &lt; -1) {        yPos -= (-y * gravity);    }}</code></pre><p>This is the closest I got by myself.By the way the x and y values are from the accelerometer.Any help would be much appreciated, thanks!</p>","507007","","","","","2010-12-22 22:43:59","Android bouncing ball","<java><android><accelerometer>","3","3","4","",""
"4513935","1","","","2010-12-22 21:31:02","3","739","<p>I've searched high and low to find an answer to why our application is crashing when a user will click on one Context Menu item and then repeatedly clicks on another.  Here is the stack trace I have, which is all on Android internal classes:</p><pre><code>11-11 15:08:30.904: ERROR/AndroidRuntime(3489): FATAL EXCEPTION: main11-11 15:08:30.904: ERROR/AndroidRuntime(3489): 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(16908808, class com.android.internal.app.AlertController$RecycleListView) with Adapter(class com.android.internal.view.menu.MenuBuilder$MenuAdapter)]11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.widget.ListView.layoutChildren(ListView.java:1550)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.widget.AbsListView.onTouchEvent(AbsListView.java:2192)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.widget.ListView.onTouchEvent(ListView.java:3377)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.View.dispatchTouchEvent(View.java:3766)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1720)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1117)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.app.Dialog.dispatchTouchEvent(Dialog.java:642)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1704)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1794)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.os.Handler.dispatchMessage(Handler.java:99)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.os.Looper.loop(Looper.java:143)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.app.ActivityThread.main(ActivityThread.java:4701)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at java.lang.reflect.Method.invokeNative(Native Method)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at java.lang.reflect.Method.invoke(Method.java:521)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at dalvik.system.NativeStart.main(Native Method)11-11 15:08:30.912: WARN/ActivityManager(1261):   Force finishing activity com.pyxismobile.pyxWholesaler.ui.activity/.GNBActivity11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 111-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 011-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 1</code></pre><p>The basic design we have is on an Activity class we override the onCreateContextMenu and onContextMenuItem.  On the create, the code basically populate a collection of MyMenuItems where each item has a run method to execute whatever we need the menu item to do.  The onContextMenuItem basically takes the ID from the MenuItem passed in, looks up on the collection the given id, and then just runs that run method.</p><p>To try and narrow down what the cause is, I've commented out the run portion to do nothing.  This still causes the exception.  I didn't see anything special going between the creation and clicking where we would modify any data.  Everything is done once in the creation.</p><p>I tried to create a very simple test app, however I could not get this exception to occur.  I've also briefly looked at the internal Android source code to see if I could figure out anything, but nothing came to light.</p><p>If anyone has any suggestions on what I may be doing wrong, or what to look into it would be appreciated.</p><p>Edit: I've also determined for this to be device agnostic.  I have been able to recreate on multiple devices, however on rare occasion it does not happen.  My assumption is there is some sort of race condition.</p>","88270","","213525","","2011-01-03 17:02:57","2011-04-22 21:29:48","Android - Context Menu - Exception due to MenuBuilder$MenuAdapter changing without AlertController$RecycleListView receiving a notification","<android><contextmenu>","2","2","2","",""
"4514063","1","4514133","","2010-12-22 21:50:45","0","470","<p>I'm trying to develop a simple Android app, fixed in landscape mode.  I am using Eclipse 1.3, compiling for Android SDK version 7 (OS version 2.1).  When I try to run it in the emulator, it crashes on boot.  (It gets as far as the unlock slider, but shortly after that when trying to launch the application itself, I get ""The application Failtest (process com.wcs.failtest) has stopped unexpectedly. Please try again."".)</p><p>Here is main.xml (with the tags escaped so this displays properly):</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=""480px""  android:layout_height=""320px""  &gt;  &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""96px""    android:layout_height=""320px""    android:id=""@+id/action_menu""    &gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:orientation=""horizontal""      android:layout_width=""96px""      android:layout_height=""48px""      &gt;      &lt;Button          android:layout_width=""48px""         android:layout_height=""48px""        android:background=""#f00""        android:id=""@+id/action_button_11""        /&gt;    &lt;/LinearLayout&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is AndroidManifest.xml (again with the tags escaped so this displays properly):</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.wcs.failtest""      android:versionCode=""1""      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="".FailtestActivity""                  android:screenOrientation=""landscape""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt;</code></pre><p>And here is FailtestActivity.java:</p><pre><code>package com.wcs.failtest;import android.app.Activity;import android.os.Bundle;import android.widget.Button;import android.view.View.OnClickListener;import android.view.View;public class FailtestActivity extends Activity {    private OnClickListener action11Listener = new OnClickListener() {        public void onClick(View v) {        }    };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Button button;        button = (Button)findViewById(R.id.action_button_11);        button.setOnClickListener(action11Listener);        setContentView(R.layout.main);    }}</code></pre><p>I suspect it is something simple I'm overlooking.  What is it?</p>","551718","","","","","2010-12-23 00:32:14","Hello-World-grade landscape Android app fails to start (complete code included)","<android><boot>","1","2","","",""
"4514098","1","","","2010-12-22 21:57:20","0","645","<p>Hey all,I have created a program in Java that uses Jpanels within Jpanels. One example of this is having a side view containing buttons that change the main view when pressed. The main view also has buttons that can be used to alter itself.</p><p>I am trying to re-create this on the android. I have my layout set up from an xml, with a side panel containing buttons and the main view.</p><p>There is another xml that contains what I want in the main view.</p><p>Now I am struggling to get this separate xml to be displayed in the main view and can’t figure out how I would get the class to handle its own input. I don’t want to paste the code into the main.xml as I want to keep things object orientated and each view needs some custom elements such as different textviews.</p><p>An example of what I am trying to convert for the android is below:-</p><pre><code>//The ViewInt class has its own layoutViewInt tempView = new ViewInt(i, mFloorNo);//The viewInt class is then added to the main window.mainWindowPanel.add(tempView);</code></pre><p>This small bit of code would create a view, add it to the main view and then any input in the main window is handled by that class, but at the same time any input not in this main window is handled by another class (probably the root class).Any help is greatly appreciated, thanks.</p><p>To clarify:The program has a side panel layout, containing buttons. And a main view layout that is empty. I am trying to set a .xml layout to this main view layout, and have it so that if any buttons are pressed in that main view then a class for that layout will handle it.</p>","518118","","518118","","2010-12-22 22:15:54","2010-12-23 04:50:11","Android layouts within layouts, with separate classes handling their input?","<android><xml><layout>","1","2","","",""
"4514195","1","","","2010-12-22 22:12:36","0","532","<p>I have about 100 xml files on my sd cardthe xml files each contain about 30 elements each and are 5KB each in size.</p><p>I do not need to run any complex queries (1 element in the xml file is a link to another xml file is about as complex as it gets)</p><p>I am an android newbie and have a steep learning curve ahead so was hoping to leave learning the sqlite until later.</p><p>My plan was to read each file into a DOM and just get the elements as needed (will only ever need 1 file at a time and 1 DOM instance at a time).</p><p>A cunning plan yes/no? Do you know if there any advantages in this scenario to putting the xml into an sqllite database ?</p><p>If you have any thoughts please replyThanksSte</p>","551758","","","","","2010-12-22 22:24:22","Android Sql or XML storage question","<android><sqlite>","1","1","","",""
"4514238","1","4514321","","2010-12-22 22:19:34","5","2016","<p>When I try uploading the APK to the Android Market, I get this message:</p><blockquote>  <p>Market requires the minSdkVersion to  be set to a positive 32-bit integer in  AndroidManifest.xml.</p></blockquote><p>But I have defined <code>android:minSdkVersion</code> in 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.mkainc.tabwidget""          android:versionCode=""7""          android:minSdkVersion=""7""          android:versionName=""2.1""&gt;...</code></pre>","300129","","","","","2010-12-22 22:37:26","minSdkVersion Error when uploading APK to Android Market","<android><sdk><version><google-play><apk>","1","1","1","",""
"4514299","1","","","2010-12-22 22:29:09","1","604","<p>I need to draw a rectangle that is drawn over the notification bar, but I'm unable to get it to work. The code looks like this:</p><pre><code>canvas.drawRect(0,0, 200, 200, mLoadPaint);</code></pre><p>But <code>0, 0</code> is just bellow the notification bar, instead of over it. How can I draw over the notification bar?</p>","467780","","881229","","2014-01-31 04:04:08","2014-01-31 04:04:08","How can I draw over the notification bar?","<android><android-canvas><draw><android-notification-bar>","1","0","1","",""
"4514326","1","4514864","","2010-12-22 22:34:36","1","203","<p>I recently ran into a problem with my app, On most android phones I have encountered, the UI seems to be mostly light colored.  Now though, it seems phones are making a switch over to a darker UI(droid x).  Now I found this to be a problem for instance with spinners.  I have not set a font color on my spinner, but it gets defaulted to black on all the UI's I have tested on, making it harder to read on the darker UI's.  What is the best way to handle this?  Pick a neutral color? Design for each UI?  Or is there a way to set the font color so the phone's UI can pick it up and set it to their default color?<img src=""http://i.stack.imgur.com/exq1H.png"" alt=""alt text""></p>","408079","","","","","2010-12-23 00:08:17","How to handle different android UI's","<android><android-ui>","1","0","1","",""
"4514361","1","4515699","","2010-12-22 22:38:25","1","885","<p>I'm storing my images in subdirectories under the cache directory. I have a cache cleaning task I want to run, that checks the size of the cache and deletes files if necessary (according to some rules I've set up). My question is, what's the best time to run this? I was thinking in one of the Activity lifecycle methods. Any suggestions?</p>","413414","","","","","2010-12-23 03:44:08","Android: What activity lifecycle method to clean cache in app?","<android><caching>","2","3","","",""
"4514389","1","","","2010-12-22 22:41:30","1","290","<p>Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. </p><p>I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer. </p><p>When I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language. </p><p>Thank you</p>","551785","","","","","2010-12-23 08:03:28","Beginner's Language app","<iphone><python><android>","5","0","","",""
"4514428","1","","","2010-12-22 22:47:44","2","2520","<p>How do I do this? For example, when I create a question on stackoverflow, the Title text field has this in the edit TextView box:</p><blockquote>  <p>what's your programming question? be specific.</p></blockquote><p>As soon as you tab into it, or start typing it goes away.How do you accomplish this for the android?thanks,</p>","524140","","223391","","2010-12-22 22:53:03","2010-12-23 00:53:48","How to create hints in the textview edit box that go away when textview has focus?","<android><textview><type-hinting>","3","1","","",""
"4514570","1","4514621","","2010-12-22 23:12:16","0","633","<p>I have a service running in my Android application which contains a HashMap that I would like to use in an Activity.  So I bound the service to my activity and created a link between to two in order to use the data structure.</p><p>This is how I did it so far:</p><p>Activity (relevant code):</p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder service) {        imService = ((IMService.IMBinder) service).getService();                }    public void onServiceDisconnected(ComponentName className) {        imService = null;        Toast.makeText(ViewFlipperTest.this,                R.string.local_service_stopped, Toast.LENGTH_SHORT).show();    }};public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    bindService(new Intent(ViewFlipperTest.this, IMService.class),            mConnection, Context.BIND_AUTO_CREATE);                  .                 .                 .}protected void onResume() {    super.onResume();    bindService(new Intent(ViewFlipperTest.this, IMService.class),            mConnection, Context.BIND_AUTO_CREATE);     }private void getMap(ViewFlipper flipper2) {    Map&lt;Integer, internalChatObj&gt; tempMap = imService.getMapwData();   }</code></pre><p>Service (relevant code):</p><pre><code>public class IMService extends Service implements IAppManager{                .                .                .public Map getMapwData(){    if(getNumberOpenChats()&gt;0){        return openChatMapwData;    }    else        return null;}}</code></pre><p>Each time I try and run the method getMap(), I get a null pointer.  I even put a check to see if the imService was null and it was null each time.  It seems that it is trying to obtain the data from the Service but the binding to the service is null, is that right?  I have a check in the Service to send null if the map is empty, so that shouldn't be a problem.</p><p>Any help?</p><p><strong>Edit based on Will's tips</strong>New code</p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder service) {        imService = ((IMService.IMBinder) service).getService();        dialog.dismiss();    }    public void onServiceDisconnected(ComponentName className) {        imService = null;        Toast.makeText(ViewFlipperTest.this,                R.string.local_service_stopped, Toast.LENGTH_SHORT).show();    }};public void onCreate(Bundle savedInstanceState) {    dialog = ProgressDialog.show(getApplicationContext(), null,""Loading.."", true, false);}</code></pre><p><strong>Edit II</strong></p><p>IMBinder Class (Seems standard, no?)</p><pre><code>public class IMBinder extends Binder {    public IAppManager getService() {        return IMService.this;    }}</code></pre><p>Is it necessary to have IMService.this instead of this?</p>","544884","","544884","","2010-12-23 00:34:19","2010-12-23 00:34:19","Null Pointer When Access Data Structure Located Within Android Service","<android><binding><service><activity><nullpointerexception>","1","0","","",""
"4514652","1","","","2010-12-22 23:27:55","1","1222","<p>I have a button with inage in background and I set text for the button on the right of the image, how to set the text verticaly ??</p>","508377","","","","","2011-06-30 06:12:24","how to set text in button with image in center - android?","<android>","2","0","","",""
"4514786","1","4514821","","2010-12-22 23:50:36","0","325","<p>I know I MUST be a total idiot, but I don't see anything in the documentation that resembles an onFocus event handler for an InputText view in Android.</p><p>What am I overlooking?</p>","59947","","","","","2010-12-22 23:58:38","How do I detect focus on an InputText field in Android?","<android>","1","0","","",""
"4514847","1","","","2010-12-23 00:04:55","6","2110","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4904560/where-can-i-find-android-video-tutorials"">Where can I find Android video tutorials?</a>  </p></blockquote><p>Are there any places that have Android development tutorials similar to the iPhone Stanford videos?</p>","444021","","","","","2011-11-08 13:17:51","Are there any Android development video tutorials?","<iphone><android>","3","0","2","2011-12-18 07:10:06",""
"4514862","1","","","2010-12-23 00:08:03","9","8580","<p>Currently planning on doing a photography app utilizing RAW data provided by the camera in Android devices.</p><p>I wrote a quick skeleton using the camera API and noticed that in the callback with the RAW image data, the data buffer given is always NULL, regardless of how large or small I make the image, but I'm able to access the JPG buffer.</p><p>I did some searching and found this thread:<a href=""http://markmail.org/message/sraudbyrsi2hjqfr#query:I%27m%20talking%20about%20deprecating%20the%20raw%20picture%20callback%20that%20has%20never+page:1+mid:sraudbyrsi2hjqfr+state:results"">http://markmail.org/message/sraudbyrsi2hjqfr#query:I%27m%20talking%20about%20deprecating%20the%20raw%20picture%20callback%20that%20has%20never+page:1+mid:sraudbyrsi2hjqfr+state:results</a></p><p>Which mentions that at the time of that writing (February 2009), it ""had never worked"". So, am I right to assume that today it still doesn't work, or am I perhaps setting something up incorrectly?</p><p>The phone I'm using to debug with is a Droid X.</p><p>Just confused because I do see that the API mentions that the RAW data buffer in the callback can be null if there isn't enough memory available on the device, but it's being returned as null even when I set the image to extremely small sizes(100x100)</p><p>Thanks</p><p>Edit:</p><p>Adding some debug output which I get from LogCat:</p><blockquote>  <p>DEBUG/CameraHal(1156): Initializing capture memory raw: 0x42d39000 (155648), jpg: 0x429c4000 (57856), pv 0x42d5f000 (276736)</p>    <p>DEBUG/CameraHal(1156): Received raw yuv 0x4119f000 size 153600<br>  DEBUG/CameraHal(1156): Received jpg 0x429c4000 size 57584</p>    <p>DEBUG/CamTest(4716): RAW callback- data is NULL<br>  DEBUG/CamTest(4716): JPEG callback- data is valid</p></blockquote><p>""CamTest"" is my custom debug output.</p>","551859","","551859","","2010-12-23 00:16:10","2010-12-23 00:29:06","Android: Impossible to obtain RAW image data from camera?","<android><android-camera>","1","0","","",""
"4514912","1","5379911","","2010-12-23 00:18:05","2","9721","<p>With html below I expected that the green rectangle would occupy only half of the screen, but on practice it occupies the whole screen width. I tried other values for viewport width, no luck. Any ideas why it does not work?</p><p><strong>Html</strong></p><pre><code>&lt;html&gt;&lt;head&gt;    &lt;meta name=""viewport"" content=""width=640"" /&gt;&lt;/head&gt;&lt;body&gt;    &lt;div style=""width: 300px; height: 50px; background: green;""&gt;300px&lt;/div&gt;    &lt;div style=""width: 600px; height: 50px; background: yellow;""&gt;600px&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p><strong>Xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    &gt;    &lt;WebView        android:id=""@+id/web_view""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        /&gt;&lt;/LinearLayout&gt;</code></pre>","62192","","62192","","2010-12-23 02:32:27","2011-03-21 15:33:52","Android WebView viewport","<android><webview><width><viewport>","2","2","1","",""
"4515032","1","","","2010-12-23 00:52:29","4","2954","<p>I am making a program that takes a picture and then shows it's thumbnail.When using the emulator all goes well and the discard button deletes the photo.But on a real device the camera intent saves the image at the imageUri variable and a second one that is named like if I had just opened up the camera and took a picture by itself.</p><pre><code>private static final int CAMERA_PIC_REQUEST = 1337;  /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.camera);    //start camera    values = new ContentValues();    values.put(MediaStore.Images.Media.TITLE, ""New Picture"");    values.put(MediaStore.Images.Media.DESCRIPTION,""From your Camera"");    imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);    image = (ImageView) findViewById(R.id.ImageView01);    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);    intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);    startActivityForResult(intent, CAMERA_PIC_REQUEST);    //save the image buttons    Button save = (Button) findViewById(R.id.Button01);    Button close = (Button) findViewById(R.id.Button02);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == CAMERA_PIC_REQUEST &amp;&amp; resultCode == RESULT_OK) {        try{            thumbnail = MediaStore.Images.Media.getBitmap(getContentResolver(), imageUri);            image.setImageBitmap(thumbnail);        }        catch(Exception e){            e.printStackTrace();        }    }     else{         finish();     }}public void myClickHandler(View view) {    switch (view.getId()) {    case R.id.Button01:        finish();        break;    case R.id.Button02:        dicard();    }}private void dicard(){    getContentResolver().delete(imageUri, null, null);    finish();}</code></pre>","551883","","","","","2012-02-09 16:38:30","Android Camera intent creating two files","<android><android-camera><android-camera-intent>","1","1","6","",""
"4515132","1","","","2010-12-23 01:20:03","2","162","<p>I want to make an app that is able to process the user input as they type it in, but allow them to enter text using their chosen input method. (This is not some nasty keylogger or anything, don't worry!).Is this possible?</p>","434731","","","","","2010-12-23 01:20:03","Is it possible to make an Android input method which employs an existing one?","<android><input>","0","1","","",""
"4515158","1","","","2010-12-23 01:26:42","5","651","<p>I've been scratching my head all day over this. on one of my activities (and only one) when i call up the virtual keyboard the sliding drawer handle appears above it. i managed to fix this problem on all the other activities in my app by putting android:windowSoftInputMode=""adjustPan"" in every activity in my Manafest.xml file including the activity in question. also as far as i've been able to determine none of the objects on the activity has focus (if one does i cant figure out how to find it). i've checked for focus by using this.getCurrentFocus() then doing view.clearFocus() on the returned view if there was one. so far it hasn't returned a view so as far as i can tell nothing has focus.</p><p>any ideas?</p>","549314","","","","","2012-03-16 16:12:36","how to keep sliding drawer off the top of the virtual keyboard","<android><keyboard><focus><drawer>","1","1","","",""
"4515257","1","4539558","","2010-12-23 01:53:53","1","3687","<p>Has anyone ever seen this error while trying to run an android application in the emulator?</p><p>No command output when running: 'am start -n </p><p>If so how were you able to resolve the issue?</p>","167698","","","","","2011-02-18 10:48:12","No command output when running: 'am start -n","<android><android-emulator>","2","0","","",""
"4515308","1","4515351","","2010-12-23 02:04:44","3","823","<p>Are there any scale on the touch inputs? I know there is sensibility settings to say if you touch or not, but does it has a scale for hard pressure and low pressure too?</p><p>If so, what scale is it? 0 to 1 or 0-255 or what possiblities?</p>","108056","","","","","2011-03-22 17:41:06","Touch devices (iOS, Android)","<android><ios><touch><pressure>","3","0","1","",""
"4515377","1","4515569","","2010-12-23 02:22:11","3","2139","<p>In order to make the streaming and saving data of the recording at the same time, I would like to use the output of Mediarecorder which an Api in Android to record a video.<br />However, when I save the data that produced by recorder.setOutputFile, It is not a legal 3gp format.<br />Therefore, I would like to study the source code of camera.start(); and camera.stop(); to make the output file become readable.<br />Does someone can tell me where can I find the native code of these member?</p>","551919","","","","","2010-12-23 03:12:18","where can I find the native source code of android api of camera?","<android><camera><3gp>","2","0","","",""
"4515411","1","4515507","","2010-12-23 02:30:37","1","3281","<p>Here is my custom adapter:</p><pre><code>...@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    LayoutInflater inflater = LayoutInflater.from(context);    View v = inflater.inflate(android.R.layout.simple_list_item_checked, parent, false);    return v;}...</code></pre><p>Now this visually appears to be exactly what I needed. The problem is that I can't get toggle the checked state when I click on the listview item. Any solutions?</p>","200477","","","","","2014-03-11 14:31:07","android.R.layout.simple_list_item_checked not toggling in ListView","<java><android><listview><checkedtextview>","2","0","","",""
"4515493","1","","","2010-12-23 02:48:03","0","401","<p>I have list of contacts with custom fields. I can display them in ListView sorting themwith respect to Displayname, which is not a custom field.</p><p>I need to display those contacts ordered/sorted by Company name which is a custom field.</p><p>I want to know if it is possible through androids API or should I go with my own manual sorting approach?</p><p>Contact tables format for Company field is:MIMETYPE as INFO_BASIC, and column is Data.DATA4</p><p>Thanks in advance.</p>","536379","","","","","2010-12-23 03:00:37","Sort android contacts with custom fields","<android>","1","0","","",""
"4515705","1","","","2010-12-23 03:45:17","1","660","<p>I have a form login with Edittext. I want to post and get multi language (English, Japanese,..) but it don't work without English. Keyboard supports other languages.Help me, thanks so much.</p>","551961","","","","","2010-12-23 06:01:07","Multi language in edittext android","<android>","1","0","1","",""
"4515780","1","4516463","","2010-12-23 04:05:57","0","1210","<p>I want to test my app on a Samsung Galaxy Tab device emulator. But I don't have one installed. I want to know where can I get it from? I am using Eclipse Galileo.</p><p>Many Regards.</p>","533635","","","","","2010-12-23 06:43:13","Android App Testing for Samsung Galaxy Tab","<android><emulator>","2","0","","",""
"4515821","1","4516301","","2010-12-23 04:14:46","0","222","<p>Are there any nice ways to save and then restore the values for a group of preferences (i.e. stored using SharedPreferences) in Android?</p><p>For my game app, I have about 10 preferences concerning how the game should be rendered. What I'd like to do is add various profiles that can be selected, where each profile would set the values of the 10 preferences. For example, I might have a ""low battery usage"" profile that would set all the rendering preferences to values that use the least amount of battery or a ""high detail"" profile to set all the rendering preferences to their highest settings.</p><p>I will also have several preference that are not set by these profiles. For example, I will have a preference that stores the name of the current active profile.</p><p>What options do I have about how I save/restore profiles? How would changing profiles be implemented?</p>","483701","","","","","2010-12-23 06:05:12","Saving and restoring sets of preferences","<java><android><mobile>","1","1","1","",""
"4515838","1","","","2010-12-23 04:20:23","0","385","<p>We're working on a web apps. To keep components pre-configured, I did a lot Ext.extend work.</p><p>Here is the pre-definitions.</p><p>In the entrance, in <strong>index.js</strong></p><pre><code>Ext.setup({    onReady: function() {        var app = new App();    }});</code></pre><p>The main class, in <strong>App.js</strong>, App will new some card components, such as:</p><pre><code>App = Ext.extend(Ext.Panel,{    initComponent: function(){        this.sub1 = new Sub_Class_1();        this.sub2 = new Sub_Class_2();        this.sub3 = new Sub_Class_3();        this.items = [this.sub1, this.sub2, this.sub3];        App.superclass.initComponent.call(this);        this.sub1.on('Event1', this.Event1_fn, this)    },    Event1_fn: function() {        //some codes    }});</code></pre><p>The problem comes, in the definition of Sub_Class_1, in <strong>Sub_Class_1.js</strong>:</p><pre><code>var firefun = function() {    this.fireEvent('Event1');};Sub_Class_1 = Ext.extend(Ext.Panel,{    //some similar init configure jobs.    //add *firefun* into this class})</code></pre><p>The problem is, if I fire the event in firefun, there is no reaction from the program. Is there something wrong with the scope? Can the community help me with suggestions that I can use to fix it?</p>","544343","","835806","","2012-06-14 09:11:25","2012-06-14 09:11:25","About Sencha/Ext JS Events fire & on","<javascript><android><events><extjs><sencha-touch>","1","0","","",""
"4515922","1","","","2010-12-23 04:44:23","1","1635","<p>I have a zenithink zt-180 tablet connected to my usb port. I can use adb (from the command line) to get a shell command, reboot the tablet, and stuff like that, though I do have to kill and start the server first on the initial connect.</p><p>I can also run ddms and it shows me the device threads and statistics and so forth for the tablet.</p><p>However, whenever I try to load the helloAndroid example adb and ddms hang. To recover I have to cntr-C out of them, kill the server and then start the server. I can then do the above stated operations, just not load. In Eclips I get an error saying ""failed to install HelloAndroid on device 0123456.... : timeout when i try to debug on the device.</p><p>I know the application can run because I loaded it onto a USB stick and installed it on the tablet. It ran fine.</p><p>What is it about the load program command that is hanging up adb???</p><p>Note: USB debugging is enabled in the device. I make sure that only one DDMS and adb are running. All eclips components and the USB driver were loaded two days ago. The tablet is running android 2.1.1</p>","551998","","","","","2013-03-15 20:29:06","Android adb sort of works but can't load to device","<android>","2","6","","",""
"4515927","1","4516186","","2010-12-23 04:45:59","4","2242","<p>I am using below code to display web page</p><pre><code>Uri uri = Uri.parse(""http://myurl""); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);</code></pre><p>but when i click the back button to navigate to previous it is not loading the previous page instead it loads the same page</p><p>This happens with some urls not all</p><p>Why does this happens? Any Solution???</p>","528965","","379693","","2010-12-23 05:38:16","2011-04-27 11:48:15","Android Displaying Web Page using Intent","<android>","1","1","","",""
"4515966","1","","","2010-12-23 04:56:49","4","1181","<p>I am trying to rotate image in image view coresponding with touch to fix pivote pint of image . i have seen many of example but i dont clear with all of it .somebody have idea ..how can do it this this ?</p>","501483","","510491","","2011-08-12 06:41:21","2011-08-25 15:26:59","Rotate image along with touch to fix point in android","<android><rotation><touch>","1","2","3","",""
"4515980","1","","","2010-12-23 05:00:32","0","180","<p>I am getting trouble in sending and receiving an objects From Pc to An Android device.I tried using <code>ObjectInputStream</code>, but I wasn't able to get it to work.</p><p>Any suggestions?</p>","552010","","331473","","2011-11-23 07:11:29","2011-11-23 07:11:29","how to send and receive an object from PC to an Android Device","<android><object><receive>","1","1","","",""
"4516063","1","4516115","","2010-12-23 05:18:45","0","2338","<p>I saw in one of my android  project, at the beginning of the file:i have used import com.sun.media.sound.Toolkit;</p><p>When I hover the mouse on the line <strong>""Toolkit   toolkit = Toolkit.getDefaultToolkit();""</strong> in my code to get more details on this, it shows ""<strong>This element has no attached source and the Javadoc could not be found in the attached Javadoc.</strong>"" i have even included JRE System Library[JRE6] in my android project...</p><p>How to resolve this? Any detailed answer will be appreciated.</p>","505580","","","","","2010-12-23 05:42:41","error in java This element has no attached source and the Javadoc could not be found in the attached Javadoc","<java><android>","2","1","","",""
"4516127","1","4516156","","2010-12-23 05:30:40","1","232","<p>sir i have got an error while running my project in ecclipse. The error is:</p><p><em><strong>([2010-12-23 10:42:26 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting)</em></strong></p><p>kindly you please help me to solve this error.</p><p>thanks.</p>","552027","","","","","2010-12-23 05:36:35","Error while running the project in android(eclipse)","<android>","1","1","","",""
"4516260","1","4516387","","2010-12-23 05:55:25","0","336","<p>I am really interesting at how ""Angry Bird"" simulate the collision and casting.<br>If I want to implement the similar affect, what knowledge should I acquire ? Any references for that ?<br>Thanks very much !</p>","140899","","","","","2010-12-23 06:27:07","anyone know how angry bird simulate collision and casting?","<android><collision-detection><collision>","1","4","","",""
"4516304","1","","","2010-12-23 06:06:16","0","369","<p>I have installed Java, Eclipse and Android SDk in my laptop. But it's OS is windows vista. While downloading the sdk files in the eclipse my system is getting crashed. Is Android not supported by Windows Vista?</p>","518783","","","","","2010-12-23 06:10:28","Is Android SDK not supported by windows vista?","<android>","1","1","","",""
"4516408","1","4516452","","2010-12-23 06:31:29","1","396","<p>I have an app, which is doing some basic operations like: download files, install files, query the phone, Using threads, HttpClient connections, etc.. (nothing too complicated).</p><p>it's also running a perm service inside(kind of Listener)</p><p>The wierd thing is: when I first intall it on my device, it's size in the memory is around 150 kb. but after a while (could be couple of days of activity), the size is growing unexpectedly, last time I check it got to 664KB.</p><p>What could be the reason? is this memory measure is realiable ? what should I check or how sould I solve it in order to keep it small while it's extracted in the memory?</p><p>Thanks,ray.</p>","260511","","","","","2010-12-23 06:40:53","App memory size unexpectedly growth","<android>","1","0","1","",""
"4516428","1","","","2010-12-23 06:35:26","1","4679","<p>In android 2.1 &amp; 2.2 R.java file is auto-generated. But in 2.0 platform we have to built R.java file. anyone know how to generate R.java file from program.</p>","544345","","213269","","2011-01-19 11:18:27","2013-12-30 08:17:48","R.java auto generated file","<android><r.java-file>","2","1","","",""
"4516434","1","","","2010-12-23 06:36:08","0","94","<p>I want to build an application which involves playing videos on android stimulator.Has anyone implemented it before?.Can he tell me how to play videos in android stimulator.....</p>","475349","","","","","2010-12-23 06:41:10","regarding playing video in android stimulator","<android>","1","4","","",""
"4516493","1","","","2010-12-23 06:49:14","0","505","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4966496/location-manager-doesnt-remove-location-updates"">Location manager doesnt remove location updates!</a>  </p></blockquote><p>Hi i added one Broadcast listener for LocationManager [GPS_PROVIDER] with a pending intent.</p><p>so now when i close my application on phone location manager is updating the broadcast listener perfectly... so this is working fine.</p><p>Now issue is, i want to stop the LocationManager to update the Broadcast listener... but i am not able to do so... i am again running the application and using locationManager.removeUpdates function to stop it but it still updating the location to Broadcast Manager.</p><p>Please help me out... its very urgent...</p><p>Thanks in advance..</p><p>Started the Location Manager.</p><pre><code>Intent intent = new Intent(""com.test.geoL.RECEIVE""); //Broadcast Receiver ActionPendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(),0, intent, 0);locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,        0, pendingIntent);</code></pre>","552074","","345717","","2010-12-23 07:02:40","2010-12-23 07:02:40","How to stop LocationManager to broadcast the location to BroadcastManager","<android><broadcastreceiver><stop><locationmanager>","0","3","","2012-08-15 14:25:44",""
"4516527","1","","","2010-12-23 06:57:44","2","1116","<p>I am a computer science student, and need to do a final project in the communication field. I have experience with java but not with development to the android. My prof suggested I should develop a packet sniffer for the android os.I know there are some packet sniffing programs, but I saw they require a root access.Does that mean it can't be done via the regular SDK?Does the wifi api (or any other api) allows you to get packets that are not aimed to your phone?can you please tell me how it can be done? (or refer me to something helpul)</p><p>Thanks!</p>","552082","","21234","","2011-01-01 15:56:24","2011-01-01 15:56:24","is it possible to develop a packet sniffer in android?","<android><wifi>","0","3","","",""
"4516556","1","","","2010-12-23 07:02:50","3","775","<p>Hi i am facing low memory issue in my game due to large number of bitmaps.i am recycling them as well but is there any way to decrease display resolution of screen(game) to support low memory?</p>","452349","","","","","2010-12-23 13:00:20","How to decrease Android Screen Resolution to support low memory","<android>","3","0","1","",""
"4516645","1","","","2010-12-23 07:19:45","8","2665","<p>I've looked in DDMS but didn't see anything. Thanks.</p>","385051","","","","","2011-02-26 01:31:13","how can i see how much memory my app is using out of its VM budget?","<android><memory-management><ddms>","3","0","1","",""
"4516737","1","","","2010-12-23 07:38:17","0","827","<p>I need to play a radio station in my application and that file format is "".pls"".</p><p>I tried by using VideoView and MediaPlayer and i cannot able to play that station. I am getting ""prepared failed"" error.</p><p>Can you please explain how to play that .pls files in our android application. </p><p>I thought Android SDK having some view or class to handle that. But, unfortunately it does not have.. :-( :-(..</p><p>I have searched for all and still got any solution for this.</p><p>Any help or suggestion will be very much appreciated and helpful for me....</p><p>Thanks.</p>","552107","","","","","2010-12-23 07:38:17","How to play radio station in android application?","<android><media-player>","0","2","1","",""
"4516743","1","","","2010-12-23 07:40:00","2","2464","<p>i have tried XML normal layout for HVGA and  WVGA (hdpi), but when i try it in AVD different result. any one can help me? thanks </p>","552101","","","","","2013-03-21 00:13:57","Normal layout for HVGA and WVGA (hdpi) but different result","<android>","3","3","3","",""
"4516755","1","","","2010-12-23 07:42:50","0","586","<p>HI,</p><p>Want to implement automatic slideshow in my application, the images should change automatically with some time. Should look like a flash type changing screens,Please help?</p>","487604","","","","","2010-12-23 08:10:32","Automatic Slide show?","<android>","1","0","","",""
"4516821","1","","","2010-12-23 07:55:35","4","782","<p>I'm working on a multi-platform (iPhone, Android, WM7, web), multiplayer game with Rails backend (2.3.10) and needs server push functionality. What is the best Rails solution for handling server push that works with multiple client side platforms? Is it Juggernaut, Comet, Cramp, pusherapp, or ? </p>","149002","","149002","","2010-12-23 08:03:05","2012-09-23 09:50:59","Server push solution on Rails","<iphone><android><ruby-on-rails>","3","0","3","",""
"4516823","1","","","2010-12-23 07:56:25","-1","250","<p>sir while i am running our project on android it gives an error then i start my emmulator again but still it shows an error:</p><p>[2010-12-23 12:45:25 - helloandroid.project] ActivityManager: Warning: Activity not started, its current task has been brought to the front.</p><p>kindy help to solve this problem</p>","552027","","","","","2010-12-23 07:59:26","Error while running the project in android(eclipse)","<android>","2","0","","",""
"4516829","1","","","2010-12-23 07:57:46","2","1470","<p>I need to create language package for supporting a Regional language in my device, which is Currently not available in Android os. How can I create that ?</p><p>I don't know where to start, please point me to right direction.</p>","482604","","104117","","2010-12-23 08:10:32","2010-12-23 08:10:32","How to create language pack for Android?","<android>","0","5","","",""
"4516959","1","","","2010-12-23 08:20:44","0","1075","<p>I implemented tab bar in android application but i m facing a issue with black line.Can any one help me with this</p><p><img src=""http://i.stack.imgur.com/LZjkg.png"" alt=""alt text""></p><pre><code> &lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@android:id/tabhost""         style=""@style/tabhost""&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=""wrap_content""                      android:layout_height=""wrap_content""&gt;&lt;/TabWidget&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            style=""@style/tabcontent""/&gt;                    &lt;/LinearLayout&gt;&lt;/TabHost&gt;&lt;style name=""tabhost""&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;item name=""android:background""&gt;#b1b1b1&lt;/item&gt;&lt;/style&gt;&lt;style name=""tabcontent""&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;item name=""android:background""&gt;#FFFFFF&lt;/item&gt;    &lt;item name=""android:paddingTop""&gt;1dip&lt;/item&gt;&lt;/style&gt;</code></pre>","396473","","","","","2011-05-28 04:43:17","How to remove black line from tabbar in Android?","<android>","1","0","","",""
"4516997","1","5323066","","2010-12-23 08:28:19","2","2525","<p>My application needs to open the gallery and pick an image to crop. I set the target size as a value(87%*screenWide). Now, problems occur. In large screen devices, the gallery failed to return the cropped image and the log said ""!!! FAILED BINDER TRANSACTION !!!"". In most of the devices, it is OK.</p><p>Can any one help me for this? Thanks!</p><p>I use Intent.ACTION_GET_CONTENT to crop, and set the outputX, outputY etc. It's routine to crop images.</p>","414787","","","","","2012-02-19 22:51:57","Fail to crop for large images","<android><image><crop>","3","1","","",""
"4517002","1","4519334","","2010-12-23 08:29:08","0","992","<p>The following is my code. I want an interface where I have a single line textbox, a multiline textbox with 2 buttons below. I want the multiline textbox to occupy all the  space available after rendering the buttons and textbox. For this I created two LinearLayouts inside the main layout. The first one has vertical orientation with layout_width set to fill_parent. The second one is horizontal with fill_parent again.</p><p>The first one has a textbox for which I have set the layout_height to fill parent. The second one has two textboxes OK and Cancel.</p><p>When I run this application I get the UI, but the Buttons are very small (about 5px in height). I have to set the button height manually. What am I doing wrong here. I don't want to hard code the button height.</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;LinearLayout android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_weight=""1""&gt;    &lt;TextView android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""Name""&gt;&lt;/TextView&gt;    &lt;EditText android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;    &lt;TextView android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""Contents""&gt;&lt;/TextView&gt;    &lt;EditText android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:gravity=""top""  /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:orientation=""horizontal"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_weight=""1""&gt;    &lt;Button android:id=""@+id/okbutt"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""OK"" android:layout_weight=""1""  /&gt;    &lt;Button android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:text=""Cancel"" android:layout_weight=""1"" /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>Thanks,Arun</p>","161633","","161633","","2010-12-23 12:01:01","2010-12-23 13:52:42","Android - Linear Layout arrangement, not positioning as expected","<android><layout>","2","0","","",""
"4517073","1","4594842","","2010-12-23 08:41:29","0","319","<p>I want to create a simple TabActivity and followed the tutorial on the developer site. The implementation works fine, but the layout bothers me. First of all the text is white, when the background is white and gray, when the background is gray. I thought the regular behavior would be the opposite. But also this one white line on the bottom, that should connect the different tabs is missing.</p><p>Here are my layouts:</p><p><strong>General Tab layout</strong>        </p><pre><code>    &lt;TabHost        android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""&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=""wrap_content"" /&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;    &lt;include layout=""@layout/menu_back_only"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Selectos</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item         android:drawable=""@drawable/menu_home""        android:state_selected=""true"" /&gt;    &lt;item         android:drawable=""@drawable/menu_logout"" /&gt;&lt;/selector&gt;</code></pre><p>And this is, how it looks right now:</p><p><img src=""http://i.stack.imgur.com/FIMKX.png"" alt=""Wrong Tab Layout""></p>","463910","","","","","2011-01-04 14:48:31","Why does my TabWidget not look, like it is supposed to?","<android><tabwidget>","1","0","","",""
"4517165","1","4517676","","2010-12-23 08:55:29","2","473","<p>I'm using a datePicker dialog to pick the date, and I must set a lower and an upper bound. How can i do this?Should I use the <code>public void onDateChanged(DatePicker view, int year, int month, int day)</code> method?</p><p>Please be explicit because I'm working with Android from 4 days only!</p>","396133","","365188","","2012-08-27 16:12:00","2012-08-27 16:12:00","Dialog datePicker bounds - Android","<android>","1","0","0","",""
"4517218","1","4537619","","2010-12-23 09:04:13","1","6911","<p>My application's function about Google Maps doesn't work, the map only displays a grid instead of a map.</p><p>I have a map key, and the function is good previously. From logcat I can get the location.</p><p>Today, I had to make change in my code to fix a bug (not associated with the Google Maps code). The problem has started since then.</p><p>In my phone (HTC G8 os2.1) the Map Software is OK, but my application's doesn't show the map normally.  </p><p>I haved tried to apply for a new Google Map key. Then I used this key make a demo.  The same issue occurs.</p><hr><p>Today I observed something new:</p><p>When I make a demo for Google Maps, the demo has same problem.  Some previously installed demos run fine. Their map keys are same as my my current application's. </p><p>The problem persists even after uninstalling and installing these demos again.</p>","517055","","646382","","2012-07-05 10:45:11","2012-10-19 09:39:12","Google map does not display properly and only shows grid","<android><google-maps>","5","1","","",""
"4517289","1","4517512","","2010-12-23 09:14:01","2","6176","<p>If, in a layout xml file, I set the size to be, for example 12dip.  Will that always be 12px in mdpi and so 18px in hdpi?</p><p>So is dip always true for mdpi and will scale accordingly for other densities?</p>","324943","","1140748","","2012-05-06 16:15:16","2012-05-06 16:15:16","Relations between dip, px and dpi","<android><layout><resolution>","1","0","1","",""
"4517388","1","4644781","","2010-12-23 09:25:32","4","3225","<p>I am trying to write a Java application that will generate SVG image based on XML file. The application should also be able to show SVG file. My application should run on Android platform and desktop PCs. I read about Swing + Batik but afaik it will not work on Android. What is the best library to achieve this ? </p>","137261","","","","","2013-02-04 12:51:35","SVG processing under Java on Android and desktop","<java><android><svg>","3","0","2","",""
"4517470","1","","","2010-12-23 09:35:41","1","1294","<p>I'm struck with some problem will calling the method from one activity to other......</p><p>I have a activity called Transaction2 in this activity,I have a method like getProposal().I need to call this method in to the other activity called PaymentDetails. I called the method like this : I import the activity(import com.Transaction2;) in to the paymentDetails and i create an object as </p><pre><code>Transaction2 ts2 = new Transaction2(); </code></pre><p>and i call the method as <code>ts2.getProposal();</code></p><p>when i called like this I am getting the exception like </p><pre><code>java.lang.IllegalStateException: System services not available to Activities before onCreate()</code></pre><p>Can anyone help me ?</p>","552215","","104117","","2010-12-23 09:56:39","2010-12-28 05:17:11","call the methods from one activite to other( java.lang.IllegalStateException: System services not available to Activities before onCreate())","<android>","1","0","","",""
"4517477","1","","","2010-12-23 09:36:30","1","895","<p>Could anyone guide me creating a custom login activity and passing it to facebook...i dont want the dialog pop up coming....any advice is welcome</p>","552217","","","","","2010-12-23 11:00:08","Android Facebook sdk login avoiding the webview client popup and using a custom Activity with login and password","<android><facebook>","1","0","","",""
"4517500","1","","","2010-12-23 09:39:13","0","447","<p>I faced with such problem, different paint of the same xml layout on same screen sizes, there are two images, first  is eclipse ADT layout paint, and second is emulator layout paint.</p><p><img src=""http://i.stack.imgur.com/oc9dE.jpg"" alt=""alt text""><img src=""http://i.stack.imgur.com/YR6U3.jpg"" alt=""alt text""></p><p>My questions:</p><ol><li><p>Why it so different? </p></li><li><p>How tocreate normal textfields which arenot cutted(on both images)?</p></li></ol><p>layout xml:</p><pre><code>&lt;?xml version=""1.0"" encoding= ""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""       android:layout_width=""fill_parent"" android:layout_height=""fill_parent""       android:orientation=""vertical"" android:gravity= ""center""       android:layout_weight=""1"" &gt;       &lt;LinearLayout android:orientation=""horizontal""             android:layout_width=""fill_parent"" android:layout_height=""fill_parent""             android:layout_weight=""0.33"" &gt;       &lt;/LinearLayout&gt;       &lt;LinearLayout android:orientation=""vertical""             android:layout_width=""fill_parent"" android:layout_height=""fill_parent""             android:layout_weight=""0.33"" android:gravity= ""center""&gt;             &lt;TextView android:text=""@string/entertitle"" android:id=""@+id/EnterTitle""                   android:gravity=""center"" android:layout_width=""wrap_content""                   android:layout_height=""wrap_content"" android:textStyle=""bold"" &gt;&lt;/TextView&gt;             &lt;LinearLayout android:layout_width=""fill_parent""                   android:layout_height=""fill_parent"" android:layout_weight=""1""                   android:orientation=""horizontal"" android:gravity=""center"" &gt;                   &lt;LinearLayout android:layout_width=""wrap_content""                         android:layout_height=""fill_parent"" android:layout_weight=""0.3""                         android:orientation=""vertical"" android:gravity=""center"" &gt;                         &lt;TextView android:text=""@string/yourlogin"" android:id=""@+id/YourLogin""                               android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:minWidth='150dp' &gt;&lt;/TextView&gt;                         &lt;TextView android:text=""@string/password"" android:id=""@+id/YourPass""                               android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:minWidth='150dp' &gt;&lt;/TextView&gt;                   &lt;/LinearLayout&gt;                   &lt;LinearLayout android:layout_width=""fill_parent""                         android:layout_height=""fill_parent"" android:layout_weight=""0.7""                         android:orientation=""vertical"" android:gravity=""center"" &gt;                         &lt;EditText android:text="""" android:id=""@+id/EditLogin""                               android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                               android:minWidth='150dp' android:gravity=""right"" &gt;&lt;/EditText&gt;                         &lt;EditText android:text="""" android:id=""@+id/EditPass""                               android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                               android:gravity=""right"" android:minWidth='150dp' &gt;&lt;/EditText&gt;                   &lt;/LinearLayout&gt;             &lt;/LinearLayout&gt;             &lt;LinearLayout android:layout_width=""fill_parent""                   android:layout_height=""fill_parent"" android:layout_weight=""1""                   android:orientation=""horizontal"" android:gravity=""center"" &gt;                   &lt;CheckBox android:text=""@string/saveauth"" android:id=""@+id/CheckSavePass""                         android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/CheckBox&gt;                   &lt;Button android:text=""@string/entertitle"" android:id=""@+id/ButtonEnter""                         android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" &gt;&lt;/Button&gt;             &lt;/LinearLayout&gt;       &lt;/LinearLayout&gt;       &lt;LinearLayout android:orientation=""horizontal""             android:layout_width=""fill_parent"" android:layout_height=""fill_parent""             android:layout_weight=""0.33"" &gt;       &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","309955","","","","","2012-04-10 06:16:34","android displayed layout with cutted EditText","<android><layout>","3","0","","",""
"4517611","1","4518203","","2010-12-23 09:55:24","0","573","<p>I plan to go with the free version in order to promote the paid version.Few questions:</p><ol><li>In your experience,  is it helps?</li><li>After a user has installed the free version, if he wants to install the paid version,he needs to remove the free version first ?</li><li>how it effects downloads rates ?</li><li>What is the correct way to do it?</li></ol>","552222","","19679","","2010-12-23 15:55:32","2012-10-10 08:58:08","How to handle application upgrades from free to paid version on Android","<java><android>","2","1","1","",""
"4517634","1","","","2010-12-23 09:58:03","20","14380","<p>I'm getting picture to my app from camera / gallery intent. In many phones picture that I read from the intent / Uri is already rotated to correct orientation. For example N1, Legend, Desire that is the case.</p><p>But then on some phones ( for example Milestone1, GalaxyS) the picture is always in landscape more no matter which way the picture was taken. This means that in my application portrait picture is presented wrong way to the user. I tried to read EXIF info of the picture but orientation tag is always 0. There has to be a way to find out the right orientation of the picture because in Milestone1 the gallery application shows the portrait pictures correctly. </p><p>How do I know if I need to rotate the picture myself before showing it to the user?</p><p>Thank you for you help!</p>","422863","","","","","2014-02-21 08:42:22","Picture orientation from gallery/camera intent","<android><orientation><image>","10","3","9","",""
"4517680","1","","","2010-12-23 10:03:22","0","299","<p>I am using this code... please rectify it btnLogin.setOnClickListener(new OnClickListener()         {        @Override        public void onClick(View v)<br>        {         // Check Login         String username = etUsername.getText().toString();         String password = etPassword.getText().toString();</p><pre><code>      String str1 = DownloadText(""http://........"");      if(str1.length()==1)      {      AlertDialog dialog = new AlertDialog.Builder(btnLogin).setTitle(""Alert 1"").setMessage(""Login Success"").create();       alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {                         public void onClick(DialogInterface dialog, int which) {                                 return;                         }});</code></pre><p>}}</p>","542936","","","","","2010-12-23 11:16:59","what context should i use AlertDialog.builder on event of a button?","<android><context>","1","0","","",""
"4517686","1","","","2010-12-23 10:04:04","0","760","<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-> eeeeeeeeeeeeeeeeeeeeeeeeeee after 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>i have used this android:ellipsize=""end""</p>","487219","","","","","2010-12-23 10:21:17","android EditText and textformatting","<android>","1","0","","",""
"4517688","1","","","2010-12-23 10:04:08","0","634","<p>in my app i want to receive some message form the server and based on that i want to display pop up message and for this i want to do socket communication in android.</p><p>When i am try to read response form the server using socket.getInputstream i will get error ""request time out :Address family not supported by the protocol""</p><p>Here is my code.</p><pre><code>        Socket socket = new Socket(""localhost"",62000));        boolean isconnect = socket.isConnected();        Log.e(""Socket Connection "", String.valueOf(isconnect));        // Read and display the response message sent by server application        //         ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());        String message = (String) ois.readObject();        System.out.println(""Message: "" + message);        ois.close();        socket.close();</code></pre>","336004","","","","","2011-04-09 04:56:54","address family not supproted by protocol error while connecting socket communication in android","<android>","1","0","","",""
"4517689","1","","","2010-12-23 10:04:16","1","1813","<p>I've got an image that is 800 by 300, which I know is the width of my test platform's resolution (HTC Desire at 800x480). When I try to draw this image to the screen it scales oddly. It spills over the left hand side of the screen and fills almost all the vertical. </p><p>I'm using code like this:</p><p>canvas.drawBitmap( screen[1], new Rect(0,0,800,300), new Rect(0,0,800,300), null);</p><p>For some reason</p><p>width_x = canvas.getWidth();</p><p>width_y = canvas.getHeight();</p><p>reports my resolution as 533 by 320. Now I assume this is for the <em>expletive-deleted</em> fascinating scaling system android uses so apps appear the same size on all phones but I want to ignore this. I'm writing a game, so want to handle scaling and positioning myself - for instance using more screen estate if it becomes available. Best android practice may be suitable for an icon based application, but I would like to draw to absolute pixel positions, and get absolute resolution information for the screen. </p><p>Therefore my question is this - is this absolutely impossible? If it is completely contraindicated because android has a simple and effective system in place to do this then I would be interested to know what it is. dpi is not relevant to my game design (just like if this was a pc game, it would be irrelevant)</p><p>Perhaps my screen actually 533 by 320 unless I specify a resolution somehow? I tried using the scaling values from width and height and the image was the correct size on screen, roughly, but had jagged edges because some sort of scaling had occurred. I therefore did not have access to all the pixels my screen is capable of displaying.</p><p>To scale it I used something like </p><p>canvas.drawBitmap( screen[1], new Rect(0,0,800,300), new Rect((int)(0.0f),(int)(0.0f),(int)(533.0f),(int)(187.5f)), null); // numbers just whacked in for testing - ratio equivalent to reported screen resolution. Looks horrid</p><p>Any help would be very much appreciated.</p><p>Cheers,</p><p>Robin. </p>","552238","","","","","2010-12-24 10:31:29","How to draw full 800 by 480 images on Android","<android><screen-resolution>","2","0","","",""
"4517693","1","10549944","","2010-12-23 10:04:45","6","5755","<p>In a 9patch png, there are black edges in its four sides, but there is usually difference between the left to right, and the up to down side. Why? How does this difference impact?</p>","484432","","104117","","2010-12-23 10:06:10","2012-05-16 14:39:02","how does a 9patch png work in android apps","<android><nine-patch>","3","0","1","",""
"4517735","1","","","2010-12-23 10:09:09","3","886","<p>Can we use same signing keys for paid and unpaid app, I basically want to push out 2 version free and paid, do I need to do some thing special, thanks.</p>","392574","","272824","","2011-01-14 16:13:15","2011-01-14 16:13:15","Paid and unpaid app with Android","<android><google-play>","1","2","","",""
"4517743","1","4518375","","2010-12-23 10:10:00","5","10618","<p>I'm a beginner at Android programming, unfortunately I have a problem :)</p><p>I have method <strong>writeSettings()</strong> in my game in which I'm trying to save some variables to use it when want to load last game by <strong>readSettings()</strong> method. There are parameters such as <strong>first(second)PlayerName, first(second)PlayerScore</strong> and so on. I'm trying to use SharedPreferences to save them, but I get ""Force Close"" dialog, when starting program.</p><pre><code>SharedPreferences preferences = getPreferences(MODE_PRIVATE); //Global variable    private void writeSettings() {                SharedPreferences.Editor editor = preferences.edit();                editor.putInt(""timeSave"", time);                editor.putString(""firstPlayerNameSave"", firstPlayerNameTextView.getText().toString());                editor.putString(""secondPlayerNameSave"", secondPlayerNameTextView.getText().toString());                editor.putString(""firstPlayerScoreSave"", firstPlayerScoreTextView.getText().toString());                editor.putString(""secondPlayerScoreSave"", secondPlayerScoreTextView.getText().toString());                editor.putInt(""nowPlayerSave"", nowPlayer);                        editor.commit();        }       private void readSettings() {    //""time"" parameter program reads in another method                    firstPlayerNameTextView.setText(preferences.getString(""firstPlayerNameSave"", """"));                    secondPlayerNameTextView.setText(preferences.getString(""secondPlayerNameSave"", """"));                    firstPlayerScoreTextView.setText(preferences.getString(""firstPlayerScoreSave"", """"));                    secondPlayerScoreTextView.setText(preferences.getString(""secondPlayerScoreSave"", """"));                    nowPlayer = preferences.getInt(""nowPlayerSave"", -1);            }</code></pre><p>How I could know, problem appears in first entry of writeSettings().But I don't know what I'm doing wrong? </p><p>Sorry for my English.</p><p><strong>upd.</strong></p><pre><code>12-23 16:23:31.334: ERROR/AndroidRuntime(410): Uncaught handler: thread main exiting due to uncaught exception12-23 16:23:31.520: ERROR/AndroidRuntime(410): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.game/com.game.Game}: java.lang.NullPointerException12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.os.Handler.dispatchMessage(Handler.java:99)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.os.Looper.loop(Looper.java:123)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.ActivityThread.main(ActivityThread.java:4363)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at java.lang.reflect.Method.invokeNative(Native Method)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at java.lang.reflect.Method.invoke(Method.java:521)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at dalvik.system.NativeStart.main(Native Method)12-23 16:23:31.520: ERROR/AndroidRuntime(410): Caused by: java.lang.NullPointerException12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.content.ContextWrapper.getPackageName(ContextWrapper.java:120)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.Activity.getLocalClassName(Activity.java:3410)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.Activity.getPreferences(Activity.java:3444)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at com.game.Game.&lt;init&gt;(Game.java:69)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at java.lang.Class.newInstanceImpl(Native Method)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at java.lang.Class.newInstance(Class.java:1479)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)12-23 16:23:31.520: ERROR/AndroidRuntime(410):     ... 11 more</code></pre><p>Game.java:69 is a <code>SharedPreferences preferences = getPreferences(MODE_PRIVATE);</code></p>","552246","","552246","","2010-12-23 13:46:58","2010-12-23 14:13:45","Save preferences","<android>","3","4","2","",""
"4517859","1","","","2010-12-23 10:25:04","0","1065","<p>I'm new to android programming, and i'm writing a piece of code based on Fedor's LazyList example. The idea is to load images and text from a feed, so that works fine but a little prob occured :Images are downloaded and cached on SD Card, queued and displayed the problem is that the listview displayes the default images (on drawable folder) until i scroll it up or down there it shows the real images.</p><p>Please help.</p><p>Here's a link to code <a href=""http://db.tt/xeEgyTd"" rel=""nofollow"">link text</a></p><p>thanks</p>","552264","","","","","2010-12-23 12:14:22","Listview displays images only after scroll","<android><listview><scroll><lazy-loading>","2","0","","",""
"4518284","1","4521473","","2010-12-23 11:20:41","1","1366","<p>In the following snippet the <code>onDraw</code> method is called around 10-15 times. Can anyone explain this behaviour</p><pre><code>LinearLayout ll = new LinearLayout(this);        View v = new View(this) {            @Override            protected void onDraw(Canvas canvas) {                // TODO Auto-generated method stub                System.out.println(""large view on draw called"");                super.onDraw(canvas);            }        };        v.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 2000));        LinearLayout ll2 = new LinearLayout(this);        ll2.addView(v);        ScrollView sv = new ScrollView(this);        sv.addView(ll2);        ll.addView(sv);        LinearLayout ll1 = new LinearLayout(this);        ll1.addView(ll);</code></pre>","266272","","","","","2010-12-23 18:37:33","Android onDraw called a large number of times","<android>","1","0","2","",""
"4518323","1","4562229","","2010-12-23 11:26:42","1","1857","<p>What is the elegant way to convert <a href=""http://developer.android.com/reference/org/json/JSONObject.html"" rel=""nofollow"">JSONObject</a> to URL parameters.For example, JSONObject:</p><pre><code>{stat: {123456: {x: 1, y: 2}, 123457: {z: 5, y: 2}}}}</code></pre><p>this should be like:</p><pre><code>stat[123456][x]=1&amp;stat[123456][y]=2&amp;stat[123457][z]=5&amp;stat[123457][y]=2</code></pre><p>of course with escaped symbols, and of course JSON object could be more complicated..Maybe there already exist some mechanisms for that?</p><p>Thanks,</p>","136834","","","","","2010-12-30 11:32:19","Java convert JSONObject to URL parameter","<java><android><json><url><urlencode>","2","3","","",""
"4518343","1","","","2010-12-23 11:30:13","0","1591","<p>I have a custom view, DisView(Context, bitmap), which I want to add a LongCLickListener to.</p><p>The view is displayed once something else is clicked.</p><pre><code>public void onClick(View view) {    ...    RelativeLayout toplayout = new RelativeLayout(this);    setContentView(toplayout);    Bitmap bmp2 = BitmapFactory.decodeResource(getResources(), R.drawable.tag3);    tag3 = new DisView(this,bmp2);    tag3.setOnLongClickListener(this);</code></pre><p>I should add that originally the activity's contentview is set to a linearlayout, but on a button being clicked, setContentLayout() makes a relativelayout the new layout.</p><p>Next I did the onLongClick method ( a method of the activity, implementing onlongclicklistener):</p><pre><code>@Overridepublic boolean onLongClick(View view) {    moveTag(view);    return true;}</code></pre><p>moveTag() is a very simple TranslateAnimation. I have no idea why it doesn't work. I have a feeling it may be because I changed the layout.</p>","485498","","512958","","2013-01-25 17:24:20","2013-01-25 17:24:20","Android OnLongClickListener issue","<android><onlongclicklistener>","3","2","","",""
"4518452","1","","","2010-12-23 11:46:51","0","2515","<p>This is my layout XML file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""&gt;    &lt;TableRow 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=""One""/&gt;        &lt;EditText android:layout_width=""wrap_content""                  android:layout_height=""wrap_content""/&gt;    &lt;/TableRow&gt;        &lt;TableRow android:layout_width=""fill_parent""              android:layout_height=""wrap_content""&gt;        &lt;TextView android:layout_width=""wrap_content""                  android:layout_height=""wrap_content""                  android:text=""Two""/&gt;        &lt;EditText android:layout_width=""wrap_content""                  android:layout_height=""wrap_content""                  android:inputType=""numberSigned""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>The problem, however, is that EditText views are ridiculously small - as small as possible I reckon. Is there a way to make them as wide as possible?</p>","552346","","","","","2010-12-23 11:53:37","How can I stretch EditText views in Android?","<android><layout>","2","0","","",""
"4518587","1","4518642","","2010-12-23 12:05:53","1","2586","<p>I am trying to develop an application that will customize the income call screen.I understood that it is impossible to customize or to change the exiting income screen, Is it right?if the answer is no than how?if the answer is yes than I want to know how to add screen above the income call screen?</p><p>thanks-Z</p>","449466","","35245","","2010-12-23 12:47:53","2013-11-05 20:23:29","Android: How to customize income call screen","<android><activity><android-intent>","1","0","4","",""
"4518689","1","","","2010-12-23 12:19:32","3","2918","<p>I wrote opengl android code to show a bitmap on a square. But bitmap was drawn in reverse. When i change texture array combination to the commented code it is drawn correctly. But i insist my texture array must be as below . Am i thinking wrong ?</p><blockquote><pre><code>  /** The initial vertex definition */  private float vertices[] = {                       -1.0f, 1.0f, 0.0f,      //Top Left                      -1.0f, -1.0f, 0.0f,     //Bottom Left                      1.0f, -1.0f, 0.0f,      //Bottom Right                      1.0f, 1.0f, 0.0f        //Top Right                                      };  /** Our texture pointer */  private int[] textures = new int[1];  /** The initial texture coordinates (u, v) */  private float texture[] = {                   //Mapping coordinates for the vertices//            1.0f, 0.0f,//            1.0f, 1.0f,//            0.0f, 1.0f,//            0.0f, 0.0f,          0.0f, 1.0f,          0.0f, 0.0f,          1.0f, 0.0f,          1.0f, 1.0f,                              };    /** The initial indices definition */     private byte indices[] = {                      //2 triangles          0,1,2, 2,3,0,                                                     };</code></pre></blockquote>","459904","","44729","","2010-12-23 17:24:40","2013-07-11 20:48:24","Texture coordinates in opengl android showing image reversed","<android><opengl-es>","2","0","2","",""
"4518806","1","4519475","","2010-12-23 12:37:21","0","1710","<p><code>R.java</code> is not responding. I made 4 layouts in res/layout and it took 3 layouts but not responding for 4th </p><p>If i edit the <code>R.java</code> will it stop regenerating the code ?</p>","542936","","","","","2011-09-05 17:18:30","Is there any way to reset R.java for android application development on eclipse?","<android><r.java-file>","3","2","","",""
"4518995","1","4519102","","2010-12-23 13:06:38","5","11207","<p>I have an activity with MapView. I have overlays on that map and I would like to position a hovering dialog over an item if it is tapped.</p><p>I already have my own custom dialog I've made up with my own layout and custom background. My only problem is how to tell Android where (in x, y terms) to position the dialog.</p><p>It's even more complicated since to know what's the dialog x, y. I first need to know the dialog's width and height after measurement (since I need that to calculate the position relative to my overlay).</p>","312288","","815724","","2013-01-20 12:44:54","2013-01-20 12:44:54","Positioning a dialog on screen","<android><dialog>","1","0","3","",""
"4519103","1","4560309","","2010-12-23 13:22:44","6","2255","<p>I'm having an issue with RadioGroup's clearChecked(). I'm displaying a multiple choice question to the user and after the user selects an answer I check the answer, give him some feedback and then move to the next question. In the process of moving to the next question I clearCheck on the RadioGroup.</p><p>Can anyone explain to me why the onCheckedChanged method is called 3 times? Once when the change actually occurs (with the user changes), once when I clearCheck(with -1 as the selected id) and once in between (with the user changes again)?</p><p>As far as I could tell the second trigger is provoked by clearCheck. Code below:</p><pre><code>private void checkAnswer(RadioGroup group, int checkedId){    // this makes sure it doesn't blow up when the check is cleared    // also we don't check the answer when there is no answer    if (checkedId == -1) return;    if (group.getCheckedRadioButtonId() == -1) return;    // check if correct answer    if (checkedId == validAnswerId){        score++;        this.giveFeedBack(feedBackType.GOOD);    } else {        this.giveFeedBack(feedBackType.BAD);    }    // allow for user to see feedback and move to next question    h.postDelayed(this, 800);}private void changeToQuestion(int questionNumber){    if (questionNumber &gt;= this.questionSet.size()){        // means we are past the question set        // we're going to the score activity        this.goToScoreActivity();        return;    }    //clearing the check    gr.clearCheck();    // give change the feedback back to question    imgFeedback.setImageResource(R.drawable.question_mark); //OTHER CODE HERE}</code></pre><p>and the run method looks like this</p><pre><code>public void run() {        questionNumber++;        changeToQuestion(questionNumber);    }</code></pre>","552400","","","","","2012-09-22 21:55:14","Error in Android's clearCheck() for RadioGroup?","<android><android-emulator>","2","0","1","",""
"4519153","1","","","2010-12-23 13:28:57","1","580","<p>I was trying to switch from tabview (those took about 1/3rd of a small screen) to fullscreens selectable via notification messages.</p><p>So far so good, everything done following the instructions on many howto's its all working like a charm. (that is on the sdk emulator)</p><p>now i've transfered the app to my actual android telephone and now it doesn't switch the screens anymore via the notifications. it ALWAYS opens the MainActivity.</p><pre><code>private void DroiDCNotification(int NotificationID, CharSequence tickerText, CharSequence contentTitle, CharSequence contentText) {    //throw new UnsupportedOperationException(""Not yet implemented"");    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);    int icon = R.drawable.droidc_icon;        // icon from resources    long when = System.currentTimeMillis();         // notification time    Context context = getApplicationContext();      // application Context    Intent notificationIntent = new Intent(this, MainActivity.class);    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);    // the next two lines initialize the Notification, using the configurations above    Notification notification = new Notification(icon, tickerText, when);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    mNotificationManager.notify(NotificationID, notification);}</code></pre><p>So how can i make the notification called by a specific Activity open that specified Activity?</p>","418858","","","","","2012-08-16 09:37:28","Android Notification message (doesn't) switch from activity","<android><notificationmanager>","2","0","","",""
"4519297","1","6656765","","2010-12-23 13:47:50","0","1486","<p>I have a problem in titanium developer, when sending the values from one window to other. I tried as like in the documentation of the appcelarator but i cant make it.</p><h1>Ex:</h1><pre><code>//create tableView event listenertableView.addEventListener('click', function(e){    //set properties for passed info    var newWin = Titanium.UI.createWindow({        title:e.row.name,        url:'customerDetail.js',        passedName:e.row.name,        passedID:e.row.id        });    newWin.open({animated:true, modal:true});});//In next windowvar custName = win.passedName;</code></pre><p>I want to send the values from one window to other. Something like using bundle in android. Please help me out from this. im new to titanium developer.</p>","484897","","377961","","2011-07-11 16:48:12","2011-07-11 21:23:52","Problem in Titanium Developer(Appcelerator): Passing the values to another window","<android><appcelerator>","2","0","","",""
"4519389","1","4519414","","2010-12-23 13:59:23","4","3346","<p>Before I go into location based mode I check for existence of any location providers by calling</p><pre><code>List&lt;String&gt; android.location.LocationManager.getProviders(boolean enabledOnly) //enabledOnly = true</code></pre><p>and checking the size of the resulting list.</p><p>Now I tested my App on a HTC Desire with Android 2.2. The system settings don't allow any location tracking (GPS and mobile is turned off). </p><p>However, the list get returned has 1 entry, whose value is ""passive"". What is it? Can I work with it? The provider seems to be slow / not working.</p>","433718","","","","","2010-12-23 14:03:03","What's location provider ""passive""? Seen on HTC Desire with Android 2.2","<android><htc><locationmanager><android-location>","1","0","","",""
"4519487","1","4519534","","2010-12-23 14:15:29","1","1371","<p>I have a little irritating problem. How can I count files in directory in Zip? I want to avoid use <code>ZipFile.entries()</code> and then test every enum.</p>","552453","","59087","","2010-12-23 14:34:26","2010-12-23 14:43:02","Count files in ZIP's directory - JAVA, Android","<java><android><file><count><zip>","1","0","","",""
"4519495","1","","","2010-12-23 14:16:46","3","411","<p>I developed one application in sdk 2.1. Now i want to test this in all sdk version. I trying to test in 2.2 ,1.6,1.5. But all get failed ,all throw exception. what are the changes I need be do in application to work in all sdk?</p><p>Please anyone help me to solve this issues.</p><p>Thanks</p>","450596","","","","","2010-12-24 04:31:34","How to test my android app in all sdk versin of android?","<android><android-sdk-2.2><android-sdk-1.6>","2","2","1","",""
"4519548","1","6455094","","2010-12-23 14:23:08","2","390","<p><br>    While I try to take a screen shot in C:\android-sdk_r08-windows\android-sdk-windows\tools\ddms, if I click this ddms I get the error: Failed to get adb version, Cannot run adb...</p>","555221","","469983","","2011-02-18 14:43:55","2011-06-23 13:48:55","Android Screen Shot","<android>","1","1","","",""
"4519556","1","","","2010-12-23 14:24:01","7","2519","<p>I have an app that runs on several mobile devices running either Fedora or Android. To consolidate my codebase and distribution I would like to determine which OS I am on. I tried System.getProperty(""os.name""), but that just returns ""Linux"". Is there something unique to Android in the System properties?Thanks</p>","552447","","","","","2011-07-29 13:09:38","How to determine if my app is running on Android","<java><android>","3","0","1","",""
"4519559","1","4520823","","2010-12-23 14:24:20","0","60","<p>I modified a TabHost to have more than one activity running at the same time, it works like a charm. But the question is, is there any problem when doing this?</p><p>I already checked the memory usage, and the isn't much difference in using a view and a activity.</p>","552465","","","","","2010-12-23 16:58:03","There is any problem in having multiple activities running together","<android>","1","0","","",""
"4519605","1","4519738","","2010-12-23 14:30:16","23","12948","<p>Please, what is the device with the minimum screen resolution on the market?</p>","396133","","822","","2011-08-01 19:13:28","2014-03-04 15:27:07","Minimum screen resolution for Android devices","<android><screen-resolution>","4","0","4","",""
"4519646","1","6201554","","2010-12-23 14:33:40","7","3769","<p>Right now, you have to use fakeTagsActivity ( <a href=""http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/FakeTagsActivity.html"" rel=""nofollow"">http://developer.android.com/resources/samples/NFCDemo/src/com/example/android/nfc/simulator/FakeTagsActivity.html</a>) if you want to test tags with your android application.Do the Android team plan to include this feature in to the emulator, so you could create RFID tags and ""connect"" them to the phone just with a click? This thing was implemented very well in 2 years old Nokia NFC Manager that came with Nokia 6212 ( <a href=""http://www.forum.nokia.com/info/sw.nokia.com/id/5bcaee40-d2b2-4595-b5b5-4833d6a4cda1/S40_Nokia_6212_NFC_SDK.html"" rel=""nofollow"">http://www.forum.nokia.com/info/sw.nokia.com/id/5bcaee40-d2b2-4595-b5b5-4833d6a4cda1/S40_Nokia_6212_NFC_SDK.html</a>).    </p><p>Somehow off topic, are there any good code samples for using NFC in Android besides those at official page?</p><p>Thank you.</p>","324417","","","","","2011-08-11 09:11:27","RFID tags emulation in Android emulator","<java><android><nfc>","1","2","3","",""
"4519731","1","","","2010-12-23 14:43:02","0","1157","<p>I have seven view all of which I'm trying to set an onLongCLickListener. WHen the user longclicks the the function moveTheView(view) starts. However, no matter which view I use moveTheView(view) always uses the last view to be added to my layout, instead of the clicked view. I can't understand this at all. If I LongClick on view1, view7 moves, etc. So I deleted view7 and now the same thing happens but with view6 moving no matter which view I longclick. I tried as many things as I could to fix this. My final (failed) attempt was this:</p><pre><code>private OnLongClickListener listener = new OnLongClickListener() {    @Override    public boolean onLongClick(View view) {        moveView(view);        return true;    } }; private OnLongClickListener listener2 = new OnLongClickListener() {     @Override     public boolean onLongClick(View view) {        moveView(view);        return true;     }  };</code></pre><p>...</p><p>In my frustration I created 7 (now 6 since one view was deleted) OLCLs. I thought this must work, as everything else failed. No matter which view is Longclicked view6 moves. I should also note that moveView is a very simple animation method. </p><p>DisView is an extension of view. r is a relaticelayout.</p><pre><code>view1 = new DisView(this,bmp1);</code></pre><p>view2 = new DisView(this,bmp2);view3 = new DisView(this,bmp3);view4 = new DisView(this,bmp4);view5 = new DisView(this,bmp5);view6 = new DisView(this,bmp6);</p><pre><code> r.addView(view1);r.addView(view2);r.addView(view3);r.addView(view4);r.addView(view5);r.addView(view6);view1.setOnLongClickListener(listener); ...private void animateBodyPart(View image, float fposx, float fposy){        AnimationSet set = new AnimationSet(true);        TranslateAnimation translate = new TranslateAnimation(                80.0f, fposx,-10.0f,fposy);        set.addAnimation(translate);        translate.setDuration(5000);        image.setAnimation(set);        image.startAnimation(set);        set.setFillAfter(true);}</code></pre>","485498","","485498","","2010-12-23 15:16:07","2010-12-23 15:16:07","Android onLongClickListener with multiple views","<android><onlongclicklistener>","0","4","","",""
"4519785","1","4928781","","2010-12-23 14:50:16","0","999","<p>I am wondering if anyone can definitively tell me if Flash / AIR can find all these mobile devices front facing camera and use RTMP to stream the video captured ?</p><p>I would like to create a video conferencing app for these devices. Of course none of them support testing this in the simulators and I don't have the funds to purchase or access all of them that I would like to test. </p><p>Wondering if anyone can shed some light on this for me. I have seen some posts where they have done this for android but not sure about support for finding a list of cameras, choosing one and streaming from iphone 4 and playbook.</p><p>thanks for any help on this.</p>","339427","","","","","2011-03-03 00:26:44","AIR for Android, Flash iphone packager, Playbook support for streaming camera and choosing camera","<iphone><android><flash><blackberry><air>","2","0","","",""
"4519820","1","4519857","","2010-12-23 14:53:44","3","2432","<p>Hi<br/>I need help in finding a way to store</p><pre><code> ArrayList&lt;HashMap&lt;String,String&gt;&gt; </code></pre><p>in an Bunble object so that i can retrieve  them back in  onRestoreInstanceState(Bundle state) when an orientation happens .I can find  methods to store simple Arrays in an Bunble,but not an ArrayList like this.     </p>","286044","","","","","2012-08-24 15:36:56","How to save ArrayList in an Bundle Object","<android>","1","1","","",""
"4519892","1","","","2010-12-23 15:02:15","1","818","<p>How can I change the background color of an option item of a spinner? I don't want to change the whole background color, so i can't define it in the layout.</p>","551943","","168352","","2011-12-05 15:52:39","2011-12-05 16:38:00","How to change the background color of a text in a spinner item?","<java><android><android-layout><android-widget>","1","0","","",""
"4519932","1","","","2010-12-23 15:08:40","1","612","<p>I am having a main Layout that is not having a list view and on button i am pop up a window in that pop up window i am having a button namely Add Event if i click Add Event button i vil raise another pop up in that there is a List View,. I wanna to list some string Array values in Pop up layout but if i have declare List in Pop up Layout i am getting error but if i create List ID in Main layout i am getting List View in Main Layout but what i want is that i wanna to display my List inside the Pop up layout... HERE is my Code...PLACE i am getting Error=--------------------------------------------------------------</p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(Main.this,    android.R.layout.simple_list_item_1, mStrings));getListView().setTextFilterEnabled(true);</code></pre><hr><pre><code>public class Main extends ListActivity implements OnClickListener {// String name, id_val, title_val, date_val, desc_val, link_val, linkname_val,name_val;// String[] PROJECTION = { BaseColumns._ID, Constants.TITLE};// String[] FROM = { Constants.TITLE};// int[] TO = { R.id.event_txt};//   private String[] mStrings = {             ""Abbaye de Belloc"", ""Abbaye du Mont des Cats"", ""Abertam"", ""Abondance"", ""Ackawi"",             ""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"",              ""Four Herb Gouda"", ""Fourme d' Ambert"", ""Fourme de Haute Loire"", ""Fourme de Montbrison"",              ""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""};// ContentValues values = new ContentValues(); private final String[] months = { ""January"", ""February"", ""March"", ""April"", ""May"", ""June"", ""July"", ""August"", ""September"", ""October"", ""November"", ""December"" };  private static final String tag = ""Main"";  private Button selectedDayMonthYearButton;  private Button currentMonth;  private ImageView prevMonth;  private ImageView nextMonth;  private GridView calendarView;  private GridCellAdapter adapter;  private Calendar _calendar;  private int month, year;  private final DateFormat dateFormatter = new DateFormat();  private static final String dateTemplate = ""MMMM yyyy"";  private PopupWindow pw,pw1;  TextView txt1;  static ViewHolder holder;  String title;  private void getRequestParameters()   {    Intent intent = getIntent();    if (intent != null)     {      Bundle extras = intent.getExtras();      if (extras != null)       {         if (extras != null)         {          Log.d(tag, ""+++++-----------------&gt;"" + extras.getString(""params""));         }       }     }   }  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState)   {    super.onCreate(savedInstanceState);    setContentView(R.layout.simple_calendar_view);    _calendar = Calendar.getInstance(Locale.getDefault());    month = _calendar.get(Calendar.MONTH);    Log.v(""Months"", """"+month);    year = _calendar.get(Calendar.YEAR);    Log.v(""YEAR"", """"+year);    selectedDayMonthYearButton = (Button) this.findViewById(R.id.selectedDayMonthYear);    selectedDayMonthYearButton.setText(""Selected: "");    prevMonth = (ImageView) this.findViewById(R.id.prevMonth);    prevMonth.setOnClickListener(this);    currentMonth = (Button) this.findViewById(R.id.currentMonth);    currentMonth.setText(dateFormatter.format(dateTemplate, _calendar.getTime()));    nextMonth = (ImageView) this.findViewById(R.id.nextMonth);    nextMonth.setOnClickListener(this);    calendarView = (GridView) this.findViewById(R.id.calendar);    // Initialised    adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);    adapter.notifyDataSetChanged();    calendarView.setAdapter(adapter);  }  @Override  public void onClick(View v)   {    if (v == prevMonth)     {      if (month &lt;= 1)       {        month = 11;        year--;       } else       {        month--;       }      adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);      _calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));      currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + ""-"" +_calendar.get(Calendar.YEAR));      //currentMonth.setText(_calendar.getTime().toString());      adapter.notifyDataSetChanged();      calendarView.setAdapter(adapter);     }    if (v == nextMonth)     {      if (month &gt;= 11)       {        month = 0;        year++;       } else       {        month++;       }      adapter = new GridCellAdapter(getApplicationContext(), R.id.day_gridcell, month, year);      _calendar.set(year, month, _calendar.get(Calendar.DAY_OF_MONTH));      currentMonth.setText(months[_calendar.get(Calendar.MONTH)] + ""-"" +_calendar.get(Calendar.YEAR));      //currentMonth.setText(_calendar.getTime().toString());      adapter.notifyDataSetChanged();      calendarView.setAdapter(adapter);     }   }  // Inner Class  public class GridCellAdapter extends BaseAdapter implements OnClickListener   {    final ClipboardManager clipBoard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);    private static final String tag = ""GridCellAdapter"";    private final Context _context;    private final List&lt;String&gt; list;    private final String[] weekdays = new String[] { ""Sun"", ""Mon"", ""Tue"", ""Wed"", ""Thu"", ""Fri"", ""Sat"" };private final int[] daysOfMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };private final int month, year;int daysInMonth, prevMonthDays;private final int currentDayOfMonth;private Button gridcell;// Days in Current Monthpublic GridCellAdapter(Context context, int textViewResourceId, int month, int year) {  super();  this._context = context;  this.list = new ArrayList&lt;String&gt;();  this.month = month;  this.year = year;  Log.d(tag, ""Month: "" + month + "" "" + ""Year: "" + year);  Calendar calendar = Calendar.getInstance();  currentDayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);  printMonth(month, year); }public String getItem(int position) {  return list.get(position); }@Overridepublic int getCount() {  return list.size(); }private void printMonth(int mm, int yy) {  // The number of days to leave blank at  // the start of this month.  int trailingSpaces = 0;  int leadSpaces = 0;  int daysInPrevMonth = 0;  int prevMonth = 0;  int prevYear = 0;  int nextMonth = 0;  int nextYear = 0;  GregorianCalendar cal = new GregorianCalendar(yy, mm, currentDayOfMonth);  // Days in Current Month  daysInMonth = daysOfMonth[mm];  int currentMonth = mm;  if (currentMonth == 11)   {    prevMonth = 10;    daysInPrevMonth = daysOfMonth[prevMonth];    nextMonth = 0;    prevYear = yy;    nextYear = yy + 1;   } else if (currentMonth == 0)   {    prevMonth = 11;    prevYear = yy - 1;    nextYear = yy;    daysInPrevMonth = daysOfMonth[prevMonth];    nextMonth = 1;   } else   {    prevMonth = currentMonth - 1;    nextMonth = currentMonth + 1;    nextYear = yy;    prevYear = yy;    daysInPrevMonth = daysOfMonth[prevMonth];   }  // Compute how much to leave before before the first day of the  // month.  // getDay() returns 0 for Sunday.  trailingSpaces = cal.get(Calendar.DAY_OF_WEEK) - 1;  if (cal.isLeapYear(cal.get(Calendar.YEAR)) &amp;&amp; mm == 1)   {    ++daysInMonth;   }  // Trailing Month days  for (int i = 0; i &lt; trailingSpaces; i++)   {    list.add(String.valueOf((daysInPrevMonth - trailingSpaces + 1) + i) + ""-GREY"" + ""-"" + months[prevMonth] + ""-"" + prevYear);   }  // Current Month Days  for (int i = 1; i &lt;= daysInMonth; i++)   {    Log.v(""Current Days"",""""+String.valueOf(i) + ""-WHITE"" + ""-"" + months[mm] + ""-"" + yy);    list.add(String.valueOf(i) + ""-WHITE"" + ""-"" + months[mm] + ""-"" + yy);   }  // Leading Month days  for (int i = 0; i &lt; list.size() % 7; i++)   {    Log.d(tag, ""NEXT MONTH:= "" + months[nextMonth]);    list.add(String.valueOf(i + 1) + ""-GREY"" + ""-"" + months[nextMonth] + ""-"" + nextYear);   } }@Overridepublic long getItemId(int position) {  return position; }@Overridepublic View getView(int position, View convertView, ViewGroup parent) {  Log.d(tag, ""getView ..."");  View row = convertView;  if (row == null)   {    // ROW INFLATION    Log.d(tag, ""Starting XML Row Inflation ... "");    LayoutInflater inflater = (LayoutInflater) _context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    row = inflater.inflate(R.layout.day_gridcell, parent, false);    Log.d(tag, ""Successfully completed XML Row Inflation!"");   }  // Get a reference to the Day gridcell  gridcell = (Button) row.findViewById(R.id.day_gridcell);  gridcell.setOnClickListener(this);  // ACCOUNT FOR SPACING  Log.d(tag, ""Current Day: "" + currentDayOfMonth);  String[] day_color = list.get(position).split(""-"");  Log.d(""setText"", ""Current Day: "" + day_color[0]);  gridcell.setText(day_color[0]);  gridcell.setTag(day_color[0] + ""-"" + day_color[2] + ""-"" + day_color[3]);  //gridcell.setText(clipBoard.getText());  if (day_color[1].equals(""GREY""))   {    gridcell.setTextColor(Color.LTGRAY);   }  if (day_color[1].equals(""WHITE""))   {    gridcell.setTextColor(Color.WHITE);   }  if (position == currentDayOfMonth)   {    gridcell.setTextColor(Color.BLUE);   }  return row; }@Overridepublic void onClick(View view) { LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);     // inflate our view from the corresponding XML file     final View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));     final View layout1 = inflater.inflate(R.layout.event, (ViewGroup)findViewById(R.id.pop_event));  final String date_month_year = (String) view.getTag();  pw = new PopupWindow(layout, 200,75, true); TextView txt =(TextView)pw.getContentView().findViewById(R.id.pop_txt); txt.setText(date_month_year);  holder = new ViewHolder();  holder.text1 = (TextView) view.findViewById(R.id.pop_txt);  //holder.text1.setText(""HIIIIIII"");  pw.dismiss();  pw.showAtLocation(layout, Gravity.CENTER_VERTICAL, 10, 30);  Toast.makeText(getApplicationContext(), date_month_year, Toast.LENGTH_SHORT).show();  selectedDayMonthYearButton.setText(""Selected: "" + date_month_year);  Log.v(""Button ID"",""""+R.id.bttn2);  pw.getContentView().findViewById(R.id.bttn2).setOnClickListener(new OnClickListener(){   @Override   public void onClick(View arg0) {    // TODO Auto-generated method stub    //LayoutInflater inflater = (LayoutInflater) Main.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        // inflate our view from the corresponding XML file     pw1 = new PopupWindow(layout1, 270,370, true);     TextView txt1 =(TextView)pw1.getContentView().findViewById(R.id.event_head);     txt1.setText(date_month_year);     pw1.dismiss();     pw1.showAtLocation(layout1, Gravity.CENTER, 7, 20);     setListAdapter(new ArrayAdapter&lt;String&gt;(Main.this,                   android.R.layout.simple_list_item_1, mStrings));           getListView().setTextFilterEnabled(true);   }  });  layout1.findViewById(R.id.event_bttn2).setOnClickListener(new OnClickListener(){   @Override   public void onClick(View v) {    // TODO Auto-generated method stub    pw1.dismiss();    pw.dismiss();   }  });  final EditText et=(EditText)layout1.findViewById(R.id.event_edit_txt);  layout1.findViewById(R.id.event_bttn1).setOnClickListener(new OnClickListener(){   @Override   public void onClick(View v) {    // TODO Auto-generated method stub    Log.v(""GET TEXT"",""""+et.getText());    clipBoard.setText(et.getText());    Log.v(""SET TEXT"",""""+clipBoard.getText());    //gridcell.getId();    title=clipBoard.getText()+"""";    Log.v(""title"",""""+title);   }  }); }}  static class ViewHolder {   TextView text1;  } }</code></pre>","555221","","321697","","2010-12-23 16:20:57","2010-12-23 16:20:57","Android List View","<android><list>","0","1","","",""
"4520077","1","4521103","","2010-12-23 15:27:43","1","1483","<p>I am parsing an html message which may contain user-defined tags, e.g. <code>&lt;usertag uservalue=""value"" /&gt;</code>.</p><p>I am using standard Html.fromHtml() function to parse the html source. Unfortunately it simply ignores non-standard tags and remove these from the output. I would like to keep them.</p><p>I've tried to supply my own TagHandler to the fromHtml() function, but I do not know what to do inside the handleTag() function. Looks like I do not have access to the non-standard tag attributes\content from the TagHandler.handleTag() function? How do I use xmlReader passed inside fromHtml()?</p><p>Thanks</p>","552516","","115145","","2010-12-23 17:27:31","2010-12-23 17:34:19","Android: Html.fromHtml() handle non-standard html tags","<android><html-parsing>","2","0","","",""
"4520159","1","","","2010-12-23 15:38:08","1","421","<p>I've just installed Eclipse and am trying to create my first Emulator. The problem is that I have a partioned drive and my C drive only has 750Mb left, so I installed Eclipse on my D drive which has over 10Gb. My workspace is also on the D drive but when I try to create an emulator virtual device it defaults to c:\documants and settings... when I try to change it to a new folder in my workspace I get an error saying 'Not a valid keystore path'. How can I get around this?</p>","552529","","","","","2013-01-20 04:41:09","problem creating Android emulator","<android><android-emulator>","1","3","","",""
"4520524","1","4521716","","2010-12-23 16:21:23","1","5495","<p>I have a listview which loads its data from sqlite database. Each row in listview has image , textview and a checkbox. The sqlitedatabase rows has image and text data + some other columns.</p><p>My question is can I bind my listview with the database so that all rows will be loaded with required data automatically. (image + textview) There are examples to bind a simple list of textviews. What about complex rows ? Also there are few spinners which can filter the data in list depending on its value. (Which act as a WHERE clause on my DB)</p><p>Currently I am managing this all by generating the view for my custom adapter for each row. So each time I query database and populate data. I hold the last listview results , make a newer results based on actions/conditions like spinner values, then notifydatachanged to adapter to load my new results.</p><p>To add features like DELETE , ADD , SEARCH  -- I have to manage it all using collections. </p><p>Is there any simple way of doing this ? As if the db is large then the approach of holding such huge set of results in memory is not good. And is painful for managing it.Thanks.</p>","315619","","","","","2011-04-29 08:13:00","Binding listview row with sqlite database for custom rows","<android><database><listview><binding>","2","1","1","",""
"4520531","1","4520647","","2010-12-23 16:21:43","1","2118","<p>Greetings,</p><p>I'm almost finished developing my Android app, however I'd like to be able to give the user the option to run it minimised in the background and be alerted whenever some event happens.</p><p>However, I don't really know where to start. I'm trying to get an icon to show up on the status bar, to no avail. Essentially I'd like functionality similar to the 'Trapster' app where a little icon appears and the app notifies you when you're approaching a speed camera!</p><p>Here's the code I have sofar:</p><pre><code>import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.widget.Toast;public class Background extends Service{    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {          super.onCreate();          Toast.makeText(this,""Service created ..."", Toast.LENGTH_LONG).show();    }    @Override    public void onDestroy() {          super.onDestroy();          Toast.makeText(this, ""Service destroyed ..."", Toast.LENGTH_LONG).show();    }}</code></pre><p>Also, is it necessary to set some permission to use a service? Here's what I have in my manifest file:</p><pre><code>&lt;uses-permission    android:name=""android.permission.ACCESS_BACKGROUND_SERVICE"" /&gt;</code></pre>","395974","","59058","","2010-12-23 16:27:50","2014-03-01 16:59:52","Android: Minimize Application and Display Icon","<java><android><service><background>","1","0","1","",""
"4520682","1","4521910","","2010-12-23 16:39:14","0","2152","<p>My usb port looks like broken. No more connection to the computer, just in some cases. Charging the device works. But as a developer i would need it because of the ADB Connection. Is it possible to virtualise this connection over Wifi or Bluetooth? The phone is rooted, a solution which needs root is okay.</p>","142405","","","","","2010-12-23 19:41:25","Virtual USB Port over Wifi/Bluetooth","<android><emulation>","3","0","","",""
"4520829","1","","","2010-12-23 16:58:19","1","352","<p>Hello I am aware of android's voice recognition capabilities but I have seen some applications like vligo for example that are able to detect a given sentence, how is this possible? as far as I know you can't set up android's api to do that.regards maxsap</p>","234898","","","","","2010-12-23 17:21:40","android voice recognition","<android>","1","0","","",""
"4520850","1","4521140","","2010-12-23 17:01:15","0","3748","<p>Hey, I'm trying to implement a service on my Android Application. And the Service must do the same task of the Activity. IE, if some change happen on the CallLog.Calls content provider the service must be notified and insert the data in the database even if the application is not running, I mean, a service will be running after the application is started, so if the application is killed, the service will keep running until the OS stop it, right?</p><p>So it will be running on background collecting all data that changes on the CallLog.Calls service. But, the service is not running. I star it in onCreate() method of the Activity. And inside the Service I implemented a ContentObserver class that uses the method onChange() in case somethind changes in the CallLog.Calls content provider.</p><p>What I don't know is why the Service is not started, and why it doesn't work even if I kill the app on the DDMS perspective.</p><p>Here is the code.</p><p>The Activity called <strong>RatedCalls.java</strong></p><pre><code>public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RATEDCALLSOBSERVER"";private Handler handler = new Handler();private SQLiteDatabase db;private CallDataHelper cdh;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);private Integer contentProviderLastSize;private Integer contentProviderCurrentSize;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    cdh = new CallDataHelper(this);    db = openHelper.getWritableDatabase();    startService(new Intent(this, RatedCallsService.class));    registerContentObservers();    Log.i(""FILLLIST"", ""calling from onCreate()"");    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    contentProviderLastSize = cursor.getCount();}class RatedCallsContentObserver extends ContentObserver {    public RatedCallsContentObserver(Handler h) {        super(h);    }    @Override    public boolean deliverSelfNotifications() {        return true;    }    @Override    public void onChange(boolean selfChange) {        Log.d(LOG_TAG, ""RatedCallsContentObserver.onChange( "" + selfChange                + "")"");        super.onChange(selfChange);        searchInsert();    }}private void searchInsert() {    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    Log.i(""FILLLIST"", ""Calling from searchInsert"");    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 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;    SimpleDateFormat dateFormat = new SimpleDateFormat(""M/dd/yyyy"");    Date date = new Date();    cursor.moveToFirst();                       String contactNumber = cursor.getString(numberColumnId);            String contactName = cursor.getString(contactNameId);            String duration = cursor.getString(durationId);            String numType = cursor.getString(numTypeId);            stopManagingCursor(cursor);            ContentValues values = new ContentValues();            values.put(""contact_id"", 1);            values.put(""contact_name"", contactName);            values.put(""number_type"", numType);            values.put(""contact_number"", contactNumber);            values.put(""duration"", duration);            values.put(""date"", dateFormat.format(date));            values.put(""current_time"", currTime);            values.put(""cont"", 1);            db.insert(CallDataHelper.TABLE_NAME, null, values);         }    public void registerContentObservers() {    this.getApplicationContext()            .getContentResolver()            .registerContentObserver(                    android.provider.CallLog.Calls.CONTENT_URI, true,                    new RatedCallsContentObserver(handler));}</code></pre><p>And this is the Service called <strong>RatedCallsService.java</strong></p><pre><code>public class RatedCallsService extends Service {private static final String TAG = ""RatedCallsService"";private static final String LOG_TAG = ""RatedCallsService"";private Handler handler = new Handler();private SQLiteDatabase db;private CallDataHelper cdh;OpenHelper openHelper = new OpenHelper(RatedCallsService.this);class RatedCallsContentObserver extends ContentObserver {    public RatedCallsContentObserver(Handler h) {        super(h);    }    @Override    public boolean deliverSelfNotifications() {        return true;    }    @Override    public void onChange(boolean selfChange) {        Log.d(LOG_TAG, ""RatedCallsContentObserver.onChange( "" + selfChange                + "")"");        super.onChange(selfChange);        searchInsert();    }}@Overridepublic IBinder onBind(Intent arg0) {    // TODO Auto-generated method stub    return null;}@Overridepublic void onCreate() {    Toast.makeText(this, ""Rated Calls Service Created"", Toast.LENGTH_LONG).show();    Log.i(TAG, ""onCreate"");    registerContentObservers();}@Overridepublic void onDestroy() {    Toast.makeText(this, ""Rated Calls Service Stopped"", Toast.LENGTH_LONG).show();    Log.i(TAG, ""onDestroy"");    cdh = new CallDataHelper(this);    db = openHelper.getWritableDatabase();}@Overridepublic void onStart(Intent intent, int startid) {    Toast.makeText(this, ""Rated Calls Service Started"", Toast.LENGTH_LONG).show();    Log.d(TAG, ""onStart"");          registerContentObservers();}private void searchInsert() {    Cursor cursor = getContentResolver().query(            android.provider.CallLog.Calls.CONTENT_URI, null, null, null,            android.provider.CallLog.Calls.DATE + "" DESC "");    Log.i(""FILLLIST"", ""Calling from searchInsert"");    int numberColumnId = cursor            .getColumnIndex(android.provider.CallLog.Calls.NUMBER);    int durationId = cursor            .getColumnIndex(android.provider.CallLog.Calls.DURATION);    int contactNameId = cursor            .getColumnIndex(android.provider.CallLog.Calls.CACHED_NAME);    int numTypeId = cursor            .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);    Date dt = new Date();    int hours = dt.getHours();    int minutes = dt.getMinutes();    int seconds = dt.getSeconds();    String currTime = hours + "":"" + minutes + "":"" + seconds;    SimpleDateFormat dateFormat = new SimpleDateFormat(""M/dd/yyyy"");    Date date = new Date();    if (cursor.moveToFirst()) {        do {            String contactNumber = cursor.getString(numberColumnId);            String contactName = cursor.getString(contactNameId);            String duration = cursor.getString(durationId);            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"", dateFormat.format(date));            values.put(""current_time"", currTime);            values.put(""cont"", 1);            db.insert(CallDataHelper.TABLE_NAME, null, values);        } while (cursor.moveToNext());        cursor.close();    }}public void registerContentObservers() {    this.getApplicationContext()            .getContentResolver()            .registerContentObserver(                    android.provider.CallLog.Calls.CONTENT_URI, true,                    new RatedCallsContentObserver(handler));} }</code></pre>","399459","","750987","","2011-05-29 06:31:29","2013-02-27 13:39:54","Android Application doesn't start Service","<android><android-service><android-contentprovider>","4","0","","",""
"4520961","1","4520990","","2010-12-23 17:14:40","21","5700","<p>I have a search screen which can be launched from clicking on a ""name"" field of another screen.</p><p>If the user follows this workflow, I add an extra to the Intent's Extras called ""search"". This extra uses the text populating the ""name"" field as its value.  When the search screen is created, that extra is used as a search parameter and a search is automatically launched for the user.</p><p>However, since Android destroys and recreates Activitys when the screen rotates, rotating the phone causes an auto-search again.  Because of this, I'd like to remove the ""search"" extra from the Activity's Intent when the initial search is executed.</p><p>I've tried doing this like so:</p><pre><code>    Bundle extras = getIntent().getExtras();    if (extras != null) {        if (extras.containsKey(""search"")) {            mFilter.setText(extras.getString(""search""));            launchSearchThread(true);            extras.remove(""search"");        }    }</code></pre><p>However, this isn't working.  If I rotate the screen again, the ""search"" extra still exists in the Activity's Intent's Extras.</p><p>Any ideas?</p>","406790","","","","","2010-12-23 17:18:08","Removing extras from passed-in Intent","<android><android-intent>","1","0","3","",""
"4521000","1","4521068","","2010-12-23 17:19:07","1","1001","<p>Hey all, right now I have a drawable-hdpi, drawable-mdpi, drawable-ldpi folder inside my res directory... I hear that android now filters out applications based on screen size and density. All of my images are inside the drawable-hdpi folder. Should I make just 1 folder called ""drawable"" and delete the other 3? Or should I convert all the images to the proper size and place them inside all three folders?</p>","533049","","","","","2010-12-23 17:27:59","Having 1 drawable folder instead of 3 in eclipse","<android><eclipse>","1","0","1","",""
"4521013","1","4521113","","2010-12-23 17:20:22","9","8318","<p>SSO for facebook android gives me invalid_key every time, i tried to debug by every means but it is not working.So is there any way/hack to disable Single Sign on and work with web view authenticating method even if Facebook App is installed on device...</p>","529664","","","","","2011-07-01 09:19:30","How to disable Facebook single sign on for android - Facebook-android-sdk","<android><facebook><sdk><single-sign-on>","3","0","4","",""
"4521117","1","4521598","","2010-12-23 17:36:28","2","5177","<p>I just finished a couple of activities in my game and now I was going to start to wire them both up to use real game data, instead of the test data I was using just to make sure each piece worked. Since multiple Activities will need access to this game data, I started researching the best way to pass this data to my Activities.</p><p>I know about using putExtra with intents, but my GameData class has quite a bit of data and not just simple key value pairs. Besides quite a few basic data types, it also has large arrays. I didn't really want to try and pass all that, unless I can pass the entire object, instead of just key/data pairs.</p><p>I read the following post and thought it would be the way to go, but so far, I haven't got it to work.</p><p><a href=""http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables"">Android: How to declare global variables?</a></p><p>I created a simple test app to try this method out, but it keeps crashing and my code seems to look the same as in the post above - except I changed the names. Here is the error I am getting. Can someone help me understand what I am doing wrong?</p><p>12-23 00:50:49.762: ERROR/AndroidRuntime(608): Caused by: java.lang.ClassCastException: android.app.Application</p><p>It crashes on the following statement: </p><p>GameData newGameData = ((GameData)getApplicationContext());  </p><p>Here is my code:</p><pre><code>package mrk.examples.MainActivity;import android.app.Application;public class GameData extends Application {    private int intTest;    GameData () {        intTest = 0;    }    public int getIntTest(){        return intTest;    }    public void setIntTest(int value){        intTest = value;    }}</code></pre><p>// My main activity</p><pre><code>package mrk.examples.MainActivity;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;public class MainActivity extends Activity {    int intLocal;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        GameData newGameData = ((GameData) getApplicationContext());        newGameData.setIntTest(0);        intLocal = newGameData.getIntTest();        Log.d(""MainActivity"", ""IntLocal = "" + intLocal);        newGameData.setIntTest(1);        Log.d(""MainActivity"", ""IntLocal = "" + intLocal                + "" newGameData IntTest: "" + newGameData.getIntTest());        Intent intentNew = new Intent(this, PassData2Activity.class);        startActivity(intentNew);    }}</code></pre><p>// My test Activity to see if it can access the data and its previous state from the last activity</p><pre><code>package mrk.examples.MainActivity;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class PassData2Activity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        GameData gamedataPass = ((GameData)getApplicationContext());        Log.d(""PassData2Activity"", ""gamedatapass IntTest =  "" +                                         gamedataPass.getIntTest());               }}</code></pre><p>Below is the relevant portion of my manifest:</p><pre><code>&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;activity android:name="".PassData2Activity""&gt;&lt;/activity&gt;&lt;/application&gt; &lt;application android:name="".GameData""         android:icon=""@drawable/icon""         android:label=""@string/app_name""&gt;        &lt;/application&gt;</code></pre><p>Thanks in advance for helping me understand why this code is crashing. </p><p>Also, if you think this is just the wrong approach to let multiple activities have access to the same data, please give your suggestion. Please keep in mind that I am talking about quite a few variables and some large arrays.</p>","503760","","281545","","2013-03-25 21:15:47","2013-03-25 21:15:47","Android: Having trouble creating a subclass of application to share data with multiple Activities","<android><data><activity><context>","3","0","1","",""
"4521146","1","4521430","","2010-12-23 17:42:50","2","388","<p>I am trying to have a <a href=""http://members.quicknet.nl/lm.broers/download/riskmap_en.png"" rel=""nofollow"">complex image like this</a> in my application. I want to let users click on the complex polygons (countries with borders in this case) and highlight the polygon they clicked on. I have the images that I need to use for that state. </p><p>How can I achieve this in android. [Preferably from Java but please let me know any other options that are feasible]. </p><p>Thank you</p>","229266","","229266","","2010-12-23 19:13:39","2011-12-26 08:04:50","How to highlight complex images/polygons","<android><android-ndk>","1","0","1","",""
"4521317","1","4521344","","2010-12-23 18:12:37","2","118","<p>Is this a good idea to create a Service that make all the hard work for the Activity. IE, the Activity will just care about the interface and for calling the services, and other functionalities it must need, and the service will be the 'tool' that will work for the Activity.</p>","399459","","","","","2010-12-24 05:56:40","Is this a good idea to create a service to make all the hard work for the activity?","<android><activity><android-service><android-contentprovider>","2","0","0","",""
"4521674","1","4521736","","2010-12-23 19:03:43","3","1367","<p>I have two surface Views1> MediaRecorder display surfaceview.2> MediaPlayer SurfaceView displaying the Media recorded by MediaRecorder.</p><p>I want to display both the views simultaneously on the screen z ordered.</p><p>The mediaPlayer will be palying in full screen and the MediaRecorderPreview shd appear in the top right corner with some smaller size.</p><p>I am able to do this using two surfaces but the issue is that the MediaRecorder Preview always goes to the background z order and gets hidden by the mediaplayer full screen display.</p><p>Is their any way to define the Z order of Surface View.</p><p>Or is their any other suzzestion i can do to make this work. Can i start both MediaRecorder and MediaPlayer in a single surface?</p><p>Pls suggest. Thanks!!</p>","552712","","","","","2013-08-08 18:27:45","Handling two surfaceViews","<android><surfaceview>","2","1","2","",""
"4521682","1","4543470","","2010-12-23 19:04:38","3","922","<p>I recently added simple looping background music to my Android game. It uses <code>Canvas</code> to draw to the screen, so I am very careful about optimizing performance. I added music using the standard <code>MediaPlayer</code> which seems to be the most common and easiest way to handing looping music. Unfortunately, I'm having trouble with the music skipping occasionally and, far worse, sometimes causing significant lag in the game play.</p><p>My only phone to test on is a Droid Eris, which is a fairly old phone, so I suspect this would not be an issue on newer Android phones, but I would like my game to be playable on all Android devices. What can I do to add music while maintaining reasonable performance?</p><p>This is the code I added:</p><pre><code>// in setup() method of game threadmediaPlayer = MediaPlayer.create(context, R.raw.rl_theme);mediaPlayer.setLooping(true);mediaPlayer.start();// in method called when the player loosesmediaPlayer.stop();mediaPlayer.release();</code></pre>","118391","","","","","2010-12-28 03:31:58","Preventing skipping or lag when adding music to Android game","<android><audio><media-player>","2","0","1","",""
"4521757","1","","","2010-12-23 19:17:38","2","1053","<p>I try to develop an app which needs to send data to a MySql database.In order to achieve it, I create a httppost as follows</p><pre><code>public void postData() {         try {       // Create a new HttpClient and Post Header       HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(""myscript.php"");     // Add your data          List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();           nameValuePairs.add(new BasicNameValuePair(""name"", ""Noon""));           nameValuePairs.add(new BasicNameValuePair(""level"", ""0""));           httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));           // Execute HTTP Post Request           HttpResponse response = httpclient.execute(httppost);                    String text = EntityUtils.toString(response.getEntity());                      Log.i("""",""response = ""+text);      } catch (ClientProtocolException e) {           // TODO Auto-generated catch block       e.printStackTrace();     } catch (IOException e) {           // TODO Auto-generated catch block        e.printStackTrace();     }   }   </code></pre><p>On my server, I have the following script:</p><pre><code>&lt;?php$link = mysql_connect(""localhost"", ""user"", ""password"")    or die(""Impossible de se connecter : "" . mysql_error());echo 'Connected';$db_selected = mysql_select_db('db', $link);if (!$db_selected) {   die ('Impossible de sélectionner la base de données : ' . mysql_error());}mysql_query(""INSERT INTO players (name, level) VALUES ('"".$_REQUEST['name'].""', '"".$_REQUEST['level'].""')"");mysql_close($link);?&gt;</code></pre><p>The string text is filled with error 417 - expectation failed.</p><p>I understand the problem but does not understand how to fix it.I would appreciate your help on this issue as I am a bit stuck.</p>","552732","","182689","","2010-12-23 19:20:44","2012-03-28 08:45:27","Android app sends data to PHP script - Expectation failed","<php><android>","4","1","2","",""
"4521834","1","4522022","","2010-12-23 19:30:56","1","631","<p>Question : Is there any better way to implement a function that draws line on the screen other than drawing circles on the input points ?</p><p>Details : I am trying to write a function which basically will draw a line.However the line will not be a regular colored line. This line will let user to copy pixels from one image to another trough that line , you can think It like ""history brush"" or ""stamp"" on Photoshop . My first thought was just get the points and draw circles on each point. Which is working but not smooth and have some bugs. The first problem is it is not working if user sweep his finger too fast. I thought it would solve problem if i can fill the dots between two points and then draw the line which is kind of work but this time drawing gets very slow. One other problem is that it never looks smooth.</p>","458678","","881229","","2014-01-31 04:03:22","2014-01-31 04:03:22","How to implement a DrawLine function ?","<android><image-processing><drawing><android-canvas><draw>","2","2","","",""
"4521908","1","","","2010-12-23 19:41:20","3","624","<p>Should i abandon Copy protection for my android apps?  It will be deprecated soon and I recently noticed that some devices will not show these apps due to this copy protection. Generally, with the SDK you can easily extract these apks anyway, so anyone with any knowledge can bypass this 'security'.  </p><p>I really dont want to implement this new security protocol as it looks like it could cause problems for the user accessing apps without a connection.  Generally it looks too complicated.  Is anyone using this new copy protection?</p><p>My apps don't have many downloads so this is not super important, thanks </p>","552748","","","","","2011-02-11 16:52:57","android Copy protection Forward-locking - should I not bother?","<android><locking><copy><protection><forward>","2","0","3","",""
"4521953","1","4524407","","2010-12-23 19:47:04","0","837","<p>I've got a wigdet that is updated every minutes on the minute (but only when the phone is awake). However, after calling setRepeating() in the onEnabled method, the alarm doesn't ever seem to go off. What am I doing wrong? Here's (what I think) is the relevant code.</p><pre><code>public class BusStopWidgetProvider extends AppWidgetProvider{private static AlarmManager alarmManager;private static PendingIntent pendingIntent;private static LinkSchedule linkSchedule;@Overridepublic void onReceive(Context context, Intent intent){    super.onReceive(context, intent);    Log.i(""special"", ""in on recieve with"" + intent.getAction());    if(        intent.getAction().equals(context.getString(R.string.widget_update_action)) ||        intent.getAction().equals(Intent.ACTION_TIME_CHANGED) ||        intent.getAction().equals(Intent.ACTION_TIMEZONE_CHANGED))    {        AppWidgetManager widgetManager = AppWidgetManager.getInstance(context);        ComponentName appWidgetName =             new ComponentName(context, BusStopWidgetProvider.class);            int[] appWidgetIds = widgetManager.getAppWidgetIds(appWidgetName);        onUpdate(context, widgetManager, appWidgetIds);    }}@Overridepublic void onEnabled(Context context){    linkSchedule = LinkSchedule.getLinkSchedule(context.getResources());    Intent updateIntent =         new Intent(context.getString(R.string.widget_update_action));    pendingIntent =         PendingIntent.getBroadcast(context, 0, updateIntent, 0);    alarmManager =         (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);    GregorianCalendar nextMinute = (GregorianCalendar)Calendar.getInstance();    nextMinute.add(Calendar.MINUTE, 1);    nextMinute.set(Calendar.SECOND, 0);    alarmManager.setRepeating(        AlarmManager.RTC,         nextMinute.getTimeInMillis(),        60000,        pendingIntent);}@Overridepublic void onDisabled(Context context){    alarmManager.cancel(pendingIntent);}@Overridepublic void onUpdate(    Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){    final int N = appWidgetIds.length;    for(int i=0; i&lt;N; i++){        int appWidgetId = appWidgetIds[i];        RemoteViews views = new RemoteViews(context.getPackageName(),             R.layout.bus_stop_widget);        views.setTextViewText(R.id.time, linkSchedule.getNextTime(context.getString(R.string.sexton_name)));        views.setTextViewText(R.id.stopLabel, context.getString(R.string.sexton_name));        appWidgetManager.updateAppWidget(appWidgetId, views);    }}}</code></pre>","527288","","","","","2010-12-24 05:25:15","setRepeating not working for widget","<android><widget><alarmmanager>","1","0","1","",""
"4521970","1","4522315","","2010-12-23 19:49:47","2","2427","<p>I am using VideoView in Android for displaying streaming videos.While playing the videos if a user receives &amp; disconnects the call , the video starts playing from beginning instead of the behaviour which should be that after the call disconnection , the video should start playing from the same place when the call was received.</p><p>Kindly provide your suggestions/sample code if you have already implemented the same.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-12-23 20:40:45","Problem using VideoView in Android","<android>","2","0","2","",""
"4522010","1","","","2010-12-23 19:54:17","0","314","<p>hello i want to implement search in may android appdata is stored in XML filesa straightforward way to this is parsing every file and search in iti'm using xmlpullany faster approach ??thx in advance </p>","533111","","","","","2010-12-23 22:03:13","search inside xml","<java><android><xml><search>","2","2","","",""
"4522108","1","4578563","","2010-12-23 20:09:24","4","425","<p>On the Motorola Bravo, at the left bottom of a MapView, there is an ugly orange square rather than the google logo.  I notice this not only on my app, but on say, Yelp -- see screen shot:</p><p><img src=""http://i.stack.imgur.com/HOjeg.png"" alt=""alt text""> </p><p>Has anyone else seen this, and is there a workaround?  I don't know if it happens on other motorola phones, but I'm guessing it does because there is another, similar problem with a missing image on google maps, which is easy enough to solve and <a href=""http://dimitar.me/applications-that-use-the-mylocationoverlay-class-crash-on-the-new-droid-x/"" rel=""nofollow"">documented elsewhere</a> as being on Droid phones as well.</p>","226507","","","","","2011-01-03 01:55:05","google maps glitch on motorola phones","<android><google-maps>","1","3","1","",""
"4522127","1","","","2010-12-23 20:11:53","1","2348","<p>I'm attempting to pass data between two activities with startActivityForResult(). Here is my code:</p><pre><code>//Within an onOptionsItemSelected method//..intent.setClass(this, FileManager.class);startActivityForResult(intent, 0);//..}protected void onActivityResult(int requestCode, int resultCode, Intent intent){    Log.w(""result Recieved"", ""request code: "" + requestCode + "", result code: "" + resultCode);    super.onActivityResult(requestCode, resultCode, intent);    if (requestCode == 0 &amp;&amp; resultCode == Activity.RESULT_OK){        extras = intent.getExtras();        if(extras != null){            Log.w(""result Recieved"", ""extras non null\n"" + extras.toString());            root = new File(extras.getString(""SelectedDir""));            fileName = extras.getString(""SelectedFile"");            loadFile(root, fileName);        }    }}</code></pre><p>In the FileManager I have:</p><pre><code>//..Intent i = new Intent();Bundle bundle = new Bundle();bundle.putString(""selectedFile"", file.getName());bundle.putString(""selectedDir"", file.getPath());i.putExtras(bundle);setResult(RESULT_OK, i);Log.d(""Finishing status:"", ""Finishing"");finish();//..</code></pre><p>It doesn't receive a result until I re-open the activity at which point FileManager is forced to close. This causes the request and result code to be 0, indicating failure. The FileManager class works by displaying a list of files, when one is selected an alert dialog appears for confirmation and in the listener for yes input I call the method detailed above. How do I make it return a result following the call to finish? </p><p>EDIT:</p><p>I believe the problem is a listener or something continuing to run after finish is called. I'm not sure what though. I've written a test application that switches between two activities with buttons and it works, I have basically the same code as this project without all the extra methods.</p><p>EDIT2:  I commented out basically everything in the FileManager class and it still doesn't return the result right. So, it must be a problem with the activity that starts it.</p><p>EDIT3:  There error was in some old code I forgot to delete, before the switch case statement I put the FLAG_ACTIVITY_NEW_TASK flag on the intent.</p>","428740","","428740","","2010-12-24 15:25:00","2010-12-24 15:26:53","onActivityResult() is not called after I run finish in the child activity","<android>","1","4","","",""
"4522296","1","4526591","","2010-12-23 20:37:10","0","2231","<p>Wow, this is a doozie.  Basically I opened Eclipse today to test an Android App that I've been working on and receive this popup error when I attempt to run the app, or edit the Debug Configurations:""An error has occured. See error log for more details. java.lang.NullPointerException"".  Any suggestions are appreciated!  Thanks!</p>","518116","","","","","2010-12-24 13:28:24","Debug Configurations java.lang.NullPointerException error","<java><android><eclipse>","3","0","","",""
"4522302","1","4522335","","2010-12-23 20:37:43","6","6150","<p>Greetings,</p><p>I'm trying to allow my user to close the app but still maintain a connection which listens for events. An icon should appear in the status bar and when the user clicks on the notification, they are taken back to the app.</p><p>Any ideas on how I might go about this?</p><p>Many thanks in advance,</p>","395974","","","","","2010-12-23 20:43:43","Android: Run App in Background","<android><notifications>","2","0","3","",""
"4522337","1","4522563","","2010-12-23 20:43:38","6","12793","<p>I can't get a TextView to correctly dynamically display unicode characters, and it's driving me batty.  I've stripped it down to the bare minimum, but the TextView populated by setText still shows diamonds with question marks inside them for the unicode characters.  The version populated from strings.xml shows the multibyte characters perfectly.  Here's the activity:</p><pre><code>public class TestMultibyteActivity extends Activity{  /** Called when the activity is first created. */  @Override  public void onCreate( Bundle savedInstanceState )  {    super.onCreate( savedInstanceState );    setContentView( R.layout.main );    TextView textField = (TextView) findViewById( R.id.text_field );    String str = ""Tübingen systemportefølje"";    Log.d( ""MULTIBYTE"", str ); //note that this prints the multibyte chars correctly.    //EDIT: oh crap, no it doesn't.  might be onto something here...    textField.setText( str );  }}</code></pre><p>And here's the 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;TextView android:id=""@+id/text_field""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;  &lt;TextView android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/unicodechars""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Here's strings.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;string name=""app_name""&gt;TestMultibyteActivity&lt;/string&gt;  &lt;string name=""unicodechars""&gt;Tübingen systemportefølje&lt;/string&gt;&lt;/resources&gt;</code></pre><p>I'm building with ant.  Here's my default.properties:</p><pre><code>target=Google Inc.:Google APIs:8</code></pre><p>And here's 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.mycompany.android.multibyte""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:label=""@string/app_name"" android:icon=""@drawable/icon""&gt;        &lt;activity android:name=""TestMultibyteActivity""                  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>I've tinkered with everything I can think of, but it seems like unicode characters are getting split by the CharSequence interface, and I can't figure out why.</p>","214240","","","","","2013-04-26 00:19:19","Unicode characters not displayed in TextView.setText","<android>","1","0","3","",""
"4522392","1","4522659","","2010-12-23 20:53:23","0","1667","<p>So, i am using this code to get the whole HTML of a website. But i dont seem to get non-ascii characters with me. all i get is diamonds with question mark.<br>characters like this: å, appears like this: ?<br>I doubt its because of the charset, what could it then be?</p><pre><code>Log.e(""HTML"", ""henter htmlen.."");            String url = ""http://beep.tv2.dk"";            HttpClient client = new DefaultHttpClient();            client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,                     HttpVersion.HTTP_1_1);            client.getParams().setParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET, ""UTF-8"");            HttpGet request = new HttpGet(url);            HttpResponse response = client.execute(request);            Header h = HeaderValueFormatter            response.addHeader(header)            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();        //b = false;        html = str.toString();</code></pre>","552800","","203907","","2010-12-24 13:21:33","2012-04-02 12:57:11","Displaying NON-ASCII Characters using HttpClient","<java><android><html><httpclient>","3","0","1","",""
"4522454","1","","","2010-12-23 21:02:44","11","12274","<p>I have been struggling with this for a few days now.  I'm trying to switch tabs programmatically upon a button click.  My program works flawlessly if I just use the tabs to change activities, but wiring an onClick method with setCurrentTab results in an error.  This is the method that will not work.  It's a pretty basic and straightforward function but I haven't seen much documentation or examples of people attempting to wire a buttonclick with switching tabs.  Thanks.</p><pre><code>ImageButton next = (ImageButton) findViewById(R.id.ButtonAsk); next.setOnClickListener(new View.OnClickListener()          {           public void onClick(View view)               {                TabHost tabHost =  (TabHost) findViewById(android.R.id.tabhost);              tabHost.setCurrentTab(2);                             }         });</code></pre><p>This is the error log:</p><pre><code>12-23 15:39:21.439: ERROR/AndroidRuntime(327): Uncaught handler: thread main exiting due to uncaught exception12-23 15:39:21.459: ERROR/AndroidRuntime(327): java.lang.NullPointerException12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.example.tabssample.HomeActivity$1.onClick(HomeActivity.java:38)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.View.performClick(View.java:2364)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.View.onTouchEvent(View.java:4179)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.View.dispatchTouchEvent(View.java:3709)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.os.Handler.dispatchMessage(Handler.java:99)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.os.Looper.loop(Looper.java:123)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at android.app.ActivityThread.main(ActivityThread.java:4363)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at java.lang.reflect.Method.invokeNative(Native Method)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at java.lang.reflect.Method.invoke(Method.java:521)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-23 15:39:21.459: ERROR/AndroidRuntime(327):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","552797","","142162","","2010-12-23 21:06:38","2013-11-05 21:13:27","How to programmatically switch tabs using buttonclick in Android","<java><android><tabs><onclick><android-tabhost>","4","0","","",""
"4522630","1","","","2010-12-23 21:33:37","1","219","<p>I have read for several days different guides, posts and tutorials regarding Android publishing.  They all state that you can use the Android Market or it implies what I will call ""local"" publishing either for test purposes or not wanting to publish to the word.  What I haven't seen is the ""local"" publishing approach defined anywhere.  Can someone clarify how to get a developed app onto physical hardware ""locally""?</p><p>For reference sake, I am using Eclipse 3.6.1 and OS 2.3 SDK/ADT.  I see the compiled apk file from my AVD testing.</p><p>Additionally, are all the certificates and signing action necessary for Android Market publishing necessary for ""local"" publishing to install correctly on the device?</p>","552556","","","","","2010-12-27 23:12:37","Non-Market Content Publishing","<android><google-play>","2","0","1","",""
"4522637","1","4522854","","2010-12-23 21:34:24","3","7128","<p>I am new to android first of all so think of any newbie mistakes first</p><p>I am trying to add a fling function in my code.</p><pre><code>public class MainGamePanel extends SurfaceView implements    SurfaceHolder.Callback, OnGestureListener {private MainThread thread;private Droid droid;private Droid droid2;private static final String TAG = gameView.class.getSimpleName();private GestureDetector gestureScanner;public MainGamePanel(Context context){        super(context);        getHolder().addCallback(this);        droid = new Droid(BitmapFactory.decodeResource(getResources(), R.drawable.playerbox2), 270, 300);        droid2 = new Droid(BitmapFactory.decodeResource(getResources(), R.drawable.playerbox2), 50, 300);        thread = new MainThread(getHolder(), this);        setFocusable(true);        gestureScanner = new GestureDetector(this);}    public boolean onTouchEvent(MotionEvent event){    return gestureScanner.onTouchEvent(event);}@Overrideprotected void onDraw(Canvas canvas){    canvas.drawColor(Color.BLACK);    droid.draw(canvas);    droid2.draw(canvas);}@Override  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float                         velocityY)    {         droid.setX(50);        droid.setY(50);        Log.d(TAG, ""Coords: x="" + e1.getX() + "",y="" + e2.getY());        return true;    }@Overridepublic boolean onDown(MotionEvent e) {    droid2.setX((int)e.getX());    droid2.setY((int)e.getY());    Log.d(TAG, ""Coords: x="" + e.getX() + "",y="" + e.getY());    return false;}</code></pre><p>I got the gestureListener to work with: onDown, onLongPress, and onShowPress.</p><p>But i can't get any response with onFling, onSingleTapUp, and onScroll.</p><p>What mistake am I making? does it have to do with views?</p><p>I don't know what code would be useful to see.... so any suggestions would be much appreciated.Thank You!</p>","519235","","519235","","2010-12-23 21:55:17","2012-07-05 03:11:46","Android onFling not responding","<android>","3","1","3","",""
"4522730","1","4524454","","2010-12-23 21:56:06","1","147","<p>After somehow managing to create my first AVD, toy with it and ""contaminate"" with lots installs and uninstalls, it's time for me to start experimenting in a more controlled manner.</p><p>My initial thought is to create a ""master AVD"" which is very clean, from the beginning, and do all kinds of installs and experimentation on <strong>copies</strong> of it. So that I can always have some ""known state"" reference point.</p><p>My question is whether this is as simple as duplicating the MasterAVD folder and renaming it?</p><p>I noticed that my first AVD folder is accompanied by .INI file (on Windows XP) with the same basename. Should this .INI file be copied as well?</p><p>Are there additional requirements for AVD duplication?</p>","418055","","213269","","2011-03-22 08:38:18","2011-03-22 08:38:18","Is an AVD encapsulated in a single folder? Can it be replicated?","<android><android-emulator><avd>","1","2","","",""
"4522736","1","","","2010-12-23 21:58:01","1","1158","<p>I would like the user of my Android application to be able to move the contents of one TextView (A) to another TextView (B).  They should be able to do this by dragging from A and releasing over B.  I've tried to achieve this using the onTouch event, particularly ACTION_DOWN and ACTION_UP.  I thought this would be straight forward but I've encountered a few problems.</p><h2>Attempt One</h2><p>I first tried to capture the View passed to each call to the event handler.  This is fine for ACTION_DOWN as A is passed in as the View.  However, on the ACTION_UP event, A is also passed as the View rather than B.</p><h2>Attempt Two</h2><p>I capture the raw coordinates of the ACTION_UP event (getRawX(), regRawY()) and then compare these coordinates to the Left, Right, Top &amp; Bottom of the Views onto which the user can “drop”.  Unfortunately, the View coordinates don't appear to relate to the event coordinates.</p><h2>Question</h2><p>How do a implement this simple drag-and-drop or what mistake am I making in my two attempts.</p><h2>Listener code (attempt two)</h2><pre><code>OnTouchListener PlayerListener = new OnTouchListener () { public boolean onTouch(View v, MotionEvent me) {  boolean mProcessed = false;  int mActionX = 0;  int mActionY = 0;  int mAction = me.getAction();  /* Determine gesture */  switch (mAction) {      case MotionEvent.ACTION_DOWN:        mProcessed = theTeams.touchPlayer(v,mAction);        break;      case MotionEvent.ACTION_UP:       mActionX = (int) me.getX();       mActionY = (int) me.getY();       mProcessed = theTeams.endTouch(v,mActionX,mActionY);       break;</code></pre><h2>Handler code (attempt two)</h2><pre><code>  public boolean endTouch(View v, int dropX, int dropY) {   int mLeft = 0;   int mRight = 0;   int mTop = 0;   int mBottom = 0;   boolean mFound = false;   View mView = null;   /* Find control at that position */             mView = (TextView) findViewById(R.id.lCourt1ok);   mLeft = mView.getLeft();   mRight = mView.getRight();   mTop = mView.getTop();   mBottom = mView.getBottom();   if ((dropX &gt;= mLeft) &amp;&amp; (dropX &lt;= mRight )                            &amp;&amp; (dropY &lt;= mBottom) &amp;&amp; (dropY &gt;= mTop))    mFound = true;</code></pre><h2>Postscript</h2><p>Well, things seem to be broadly OK with Attempt Two when I subtract 50 from the RawY coordinate.  Any suggestions why?</p>","541770","","541770","","2010-12-23 22:47:10","2011-01-14 18:43:56","Android - Implementing drag-and-drop between TextViews","<android><drag-and-drop><coordinates><ontouchevent>","1","0","","",""
"4522742","1","4522789","","2010-12-23 21:59:06","0","1271","<p>Hy!</p><p>I want to make my first Menue</p><p>I just createt the folder /res/menu and the file menu.xml</p><p>Code:</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/quit""          android:icon=""@drawable/icon""          android:title=""Quit"" /&gt;&lt;/menu&gt;</code></pre><p>In my code i add:</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,                                ContextMenuInfo menuInfo) {  super.onCreateContextMenu(menu, v, menuInfo);  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.menu,menu);}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {  Main.this.finish();  return true;}</code></pre><p>If i start my app and press the menu button nothing appear.</p><p>Whats wrong?</p>","547995","","","","","2012-10-03 20:07:01","Menu doesn't appear","<android>","3","0","0","",""
"4522831","1","","","2010-12-23 22:12:24","1","202","<p>anybody knows how to set contacts photo to default(no picture) from code?when i update the database and set Photo.PHOTO to null , and then when i open contacts , the emulator starts giving</p><p>DEBUG/skia(1298): --- SkImageDecoder::Factory returned null     forever.Why?</p><p>thanks in advance. </p>","536853","","","","","2010-12-23 22:12:24","set contact's photo to null causes skia","<android><android-emulator>","0","3","","",""
"4522905","1","","","2010-12-23 22:24:43","3","4856","<p>I am trying to make my UpdateService for my digital clock widget stop when the screen is turned off to conserve battery, and then back on when the screen is activated. I currently have it in my onReceive() in my AppWidgetProvider, but I have also tried it in a BroadcastReciever.</p><p>My current code is:</p><pre><code>public static boolean wasScreenOn = true;public void onReceive(Context context, Intent intent) {super.onReceive(context, intent);if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {    Log.d(""Screen switched on. "", ""Starting DigiClock UpdateService."");    context.startService(new Intent(UpdateService2by2.ACTION_UPDATE));    wasScreenOn = false;} else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {    Log.d(""Screen switched off. "", ""Stopping DigiClock UpdateService."");    context.stopService(new Intent(context, UpdateService2by2.class));    wasScreenOn = true;}</code></pre><p>Can anyone help me out here? I am stumped.</p>","525720","","","","","2012-04-01 11:07:34","How to stop service when ACTION_SCREEN_OFF","<android><service>","5","2","1","",""
"4522976","1","4523159","","2010-12-23 22:39:01","2","5473","<p>I just press right on my appproject and choose Android Tools --> Export Unsigned Application Package...</p><p>But if i want to install the apk on my phone the install process dont finish</p><p>What do i have made wrong?</p>","547995","","","","","2013-08-08 07:29:45","Getting APK file from my project","<android><eclipse><eclipse-plugin>","4","0","","",""
"4523005","1","","","2010-12-23 22:44:39","2","4785","<p>Im writing up a business plan and im having some trouble with the finance part. I put an estimate on the cost of developers, web designers and everything but server costs. Im not a programmer so I dont know all the details. But how much would you think servers are going to cost for a complex app. I cant get into too many details but it keeps track of user preferences, stores data about the user and there is quite alot of back-end to it.</p>","552858","","","","","2010-12-24 12:17:16","How can I estimate server costs for creating an app?","<android><financial>","5","2","2","",""
"4523065","1","4527003","","2010-12-23 22:57:52","4","528","<p>So I've noticed that there are no Android Development podcasts, so I'm thinking that I'd like to start one, with a group of developers, and I would like to know, what would fellow android developers like to hear about? And would you like to take part in creating a podcast? I'm thinking about creating a podcast about once every 1 or 2 weeks. Let me know any thoughts/ideas!</p>","481082","","481082","","2011-11-26 03:57:16","2011-11-26 03:57:16","Android Podcasts","<android><podcast>","4","0","5","2011-09-18 02:58:23",""
"4523181","1","4524449","","2010-12-23 23:21:54","2","7087","<p>I have read through the similar questions but do not see one like this.  I have a simple calculator application there are two tabs.  Each has their own activity class.  I initially wrote this with a button on the first screen which onClick would take the inputs and pass them to the results screen which would do some calculation and then display the results.  Now I want to do it with a TabHost.  I have the two screens all set, but no idea how to take the inputs and pass them to the results activity to do the calculations and display the resulting values.</p><p>Thanks in advance Dean-O</p>","408112","","","","","2010-12-24 05:37:38","android tab pass intent extras to new tabs activity","<android><tabs><android-intent><extras>","1","2","","",""
"4523309","1","4811477","","2010-12-23 23:45:56","3","5810","<p>I have some HTML code in a PhoneGap application that displays a <code>&lt;select&gt;</code> box to the user. When I tap on it, the usual Android selection screen doesn't pop up. I had a <a href=""http://stackoverflow.com/questions/2877597/dropdowns-dont-work-on-webos-with-phonegap"">similar problem</a> with this earlier on webOS (although at that time the drop-downs were working properly).</p><p>The <code>&lt;select&gt;</code> is inside a <code>&lt;div&gt;</code> that gets hidden or shown at certain times during execution:</p><pre><code>&lt;div id=""submit""&gt;  &lt;ul class=""rounded""&gt;    &lt;li&gt;&lt;select id=""item""&gt;&lt;/select&gt;&lt;/li&gt;  &lt;/ul&gt;&lt;/div&gt;</code></pre><p>The problem only occurs when the <code>&lt;div&gt;</code> has been hidden and then shown again (either directly through CSS or by using jQuery's <code>hide()</code> and <code>show()</code> methods. If I move the <code>&lt;select&gt;</code> box outside of that <code>&lt;div&gt;</code>, or if I make the <code>&lt;div&gt;</code> always visible, then the drop-down behaves as it should; no problems.</p><p>Why is this?</p>","191521","","","","","2013-03-25 11:45:26","<select> box not displaying on Android in PhoneGap","<android><html><phonegap>","3","2","","",""
"4523328","1","4523601","","2010-12-23 23:52:32","1","1339","<p>Here is my XML layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt; &lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@android:id/list""   android:orientation=""vertical""  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""&gt; &lt;/ListView&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""     android:layout_alignParentBottom=""true""&gt;    &lt;EditText xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""         android:layout_weight=""1"" /&gt;    &lt;Button xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:layout_weight=""2"" /&gt; &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Which causes this problem:<br><img src=""http://i.stack.imgur.com/kXKX9.png"" alt=""The problem""><br>The listview item (outlined in red) is behind the fixed footer and cannot be used. Any solutions?<br><strong>UPDATE:</strong><br>I would prefer to be pointed out the changes in my code to fix that problem and then some sort of explanation. But that's just my preference.</p>","200477","","200477","","2010-12-24 00:15:30","2012-07-14 18:21:16","Fixed footer not displaying the bottom-most list item","<android><xml><listview><footer>","1","0","","",""
"4523349","1","4524186","","2010-12-23 23:57:09","0","699","<p>What exactly happens when you set the flag on a pending intent to 0?  Does it just not raiise a flag or does it default to one of the others?</p>","408079","","","","","2010-12-24 04:18:43","What happens if you set the flag on a PendingIntent to 0?","<android><flags><android-pendingintent>","1","0","","",""
"4523434","1","","","2010-12-24 00:15:13","1","3442","<p>If you have a ""ball"" inside a 2D polygon, made up of say, 4 line segments that act as bounding walls, how do you calculate the angle of the ball after the collision with the irregularly sloped wall?</p><p>I know how to make the ball bounce if the wall is horizontal, vertical, or at a 45 degree angle.  I also have my code setup to detect a collision with the wall.</p><p>I've read about dot products and normals, but I cannot figure out how to implement these in Java / Android.  I'm completely stumped and feel like I've looked up everything 10 pages deep in Google 10 times now.  I'm burned out trying to figure this out, I hope someone can help.</p>","179518","","","","","2010-12-24 02:48:20","Calculate angle of moving ball after collision with angled or sloped wall that is a 2D line segment","<android><game-physics>","2","4","1","",""
"4523457","1","4523525","","2010-12-24 00:21:50","2","6042","<p>I saw this android app called Lyrics App. It provides the lyrics of the song currently played but needs internet connection always. Now, I wanted to make a similar app, that it gets the lyrics from the web for the first time and then saves it to my android device, so that next time a song is played, it'll get the lyrics from the device instead of the web.. no need for constant internet connection.</p><p>I've searched already but I can't find the right one for my case. I checked webview, but I think it's just for displaying webcontent, not extracting.</p><p>I am new to this, so please bear with me.</p>","552899","","","","","2014-03-04 10:50:49","Android Dev: How do I extract data from the web and use the data in my app?","<android>","2","0","4","",""
"4523464","1","","","2010-12-24 00:25:16","2","587","<p>If I draw a bitmap on a view canvas using drawBitmap(), the images will be resampled so that 1 pixel in the image will be 1 dip on the screen. On a device I have with high pixel density, that means each image pixel is spread across 1.5 screen pixels, degrading the image.  Handy in general, but in some cases I want to carefully select the images I want to draw, then draw them explicitly at their native size, so they won't degrade.  How do I do this?</p>","226507","","","","","2010-12-24 00:34:06","drawBitmap where one pixel equals one pixel","<android>","1","0","1","",""
"4523609","1","4536955","","2010-12-24 01:03:54","30","19999","<p>I'm trying to create a screen with both text and images. I want the images to be laid out like a grid, as shown below, but I want them to have no scroll functionality other that the one provided by the surrounding ScrollView. </p><p>An image will best illustrate my question:</p><p><img src=""http://i.stack.imgur.com/RaW7R.png"" alt=""alt text""></p><pre><code>&lt;ScrollView&gt;    &lt;LinearLayout&gt;        &lt;ImageView /&gt;        &lt;TextView /&gt;        &lt;GridView /&gt;        &lt;TextView /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>What is the best way to make show a grid of a varying number of images, where the grid does not have scroll functionality?</p><p>Please note that disabling the scroll functionality for the GridView does not work, as this just disables the scrollbars but does not show all items.</p><p>Update:The image below shows what it looks like with scrollbars disabled in the GridView.</p><p><img src=""http://i.stack.imgur.com/shsDH.png"" alt=""alt text""></p>","340145","","340145","","2010-12-24 08:15:59","2013-09-06 10:57:38","Grid of images inside ScrollView","<android><user-interface><gridview><imageview><scrollview>","3","4","31","",""
"4523614","1","4523678","","2010-12-24 01:04:47","0","1121","<p>For EfficientAdapter What code I need to use under onListItemClick to get text of selected item?I tried:</p><pre><code>str=(String) ((TextView)l.getItemAtPosition(position)).getText()</code></pre><p>But this only brings CastException, since it fetches the LinearLayout view holding the textview and imageview (see code <a href=""http://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"" rel=""nofollow"">here</a>)</p><p>Please help!</p><p>Some of the code:</p><pre><code>public class Bookmarks extends ListActivity {public static Typeface mFace;public EfficientAdapter eff;private static class EfficientAdapter extends BaseAdapter {    private LayoutInflater mInflater;    public EfficientAdapter(Context context) {        mInflater = LayoutInflater.from(context);    }    public int getCount() {        return DAT.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.list_item_text, null);            holder = new ViewHolder();            holder.text = (TextView) convertView.findViewById(R.id.text);            holder.text.setTypeface(mFace);            convertView.setTag(holder);        } else {            holder = (ViewHolder) convertView.getTag();        }        holder.text.setText(DAT[position]);        return convertView;    }    static class ViewHolder {        TextView text;    }}public Object getItem(int position) {     return position; }public void onResume(Bundle icicle) {    eff.notifyDataSetChanged();}protected void onListItemClick(ListView l, View v, int position, long id) {    //////////CRASHES on next line!!!!!!!!!!!!!!!!!!TextView tv = (TextView) l.getItemAtPosition(position);    String str = tv.getText().toString();}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    eff = (new EfficientAdapter(this));    setListAdapter(eff);    registerForContextMenu(getListView());}</code></pre><p>}</p>","380490","","380490","","2010-12-24 01:38:52","2010-12-24 02:16:10","EfficientAdapter and grabbing text of item clicked","<android>","1","1","","",""
"4523662","1","","","2010-12-24 01:21:31","0","795","<p>I am running a service that starts a new activity when specificapplications are launched.</p><p>For example, when I launch sms application, my service detects it bychecking a top activity package name and starts a new activity.</p><p>But the problem is that after starting a new activity, when I finishthat activity and press BACK button from sms application to go back toHome screen, it does not finish my sms application.</p><p>Even though the screen is at home(launcher), when I check top activityname, sms app is running as the top activity, which means sms app isnot finished after pressing BACK button.</p><p>I use Intent.FLAG_ACTIVITY_NEW_TASK intent flag for starting a newactivity and finish() to finish it. Does anyone have an idea why myBACK button does not finish sms application in this case?</p><p>thanks,</p><p>777</p>","552922","","","","","2014-04-14 10:32:39","BACK key does not finish activity","<java><android>","4","2","","",""
"4523715","1","4523821","","2010-12-24 01:40:27","1","566","<p>I'm using XmlPullParser to load some data gradually over http on mobile devices.</p><p>Since the speed of such connections can often be as low as 1KB/s or less, I would like to lower the default Buffer size of 8096 bytes for the PullParser.</p><p>Do anybody have an idea, how that might be possible?(Also, why does the PullParser even have its own buffer?)</p>","205521","","205521","","2010-12-24 12:31:56","2010-12-26 01:10:52","Indicating buffer size for XmlPullParser","<android><xml><connection><buffer><xmlpullparser>","1","0","","",""
"4523872","1","4524169","","2010-12-24 02:36:02","1","3287","<p>After reading some questions/answers about activity and process lifecycle. I suppose I understand the details about activity and process lifecycle. But I'm confused about these Observers like BroadcastReceiver/ContentObserver with process lifecycle .</p><p>What I want to know is, when I register a BroadcastReciver (i.e, a BroadcastReceiver listen on SMS receive intent),if the process which registered the BroadcastReceiver does exist already, when the system calls the BroadcastReceiver, </p><ol><li>is it in the same process ? </li><li>And because the process does not terminated, these static data in the process can be used directly, right ? </li><li>On the other hand, if the process has been terminated already, the system will launch the process again and of course these static data is null ?</li><li>When the system calls the BroadcastReceiver, will it call the main activity onCreate also ?</li></ol><p>Thanks.</p>","459062","","1043882","","2012-08-25 17:07:03","2013-05-01 05:04:10","What's BroadcastReceiver lifecycle in a process?","<android><lifecycle>","2","0","","",""
"4523919","1","4540387","","2010-12-24 02:54:51","1","1222","<p><strong>Microsoft</strong> provides very interesting approach on theirs ORM Entity Framework which called <strong>""Code first""</strong>.When database creates from your code and business logic automatically. Is there <strong>some tools</strong> to implement ""Code first"" approach on Android?</p>","215381","","","","","2010-12-27 17:09:35","Is there some tools to implement ""Code first"" approach on Android","<java><android><entity-framework><orm><code-first>","2","0","","",""
"4524062","1","4524594","","2010-12-24 03:46:22","4","112","<p>i'm new to Android and i'm developing an application who is supposed to show a list of places (the class extend activitylist) and when user choose a place it open a new activity with the place details (name, address, phone number, service..). Actually, i'm looking for a simple way to store those predefined locations details + a simple way to show them later on the app.</p>","476101","","","","","2010-12-24 09:27:12","Creating a location book with Android","<java><android><eclipse><frameworks><sdk>","1","0","1","",""
"4524161","1","4524918","","2010-12-24 04:12:12","0","1273","<p>The following is my code</p><pre><code>Cursor mCursor = this.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.HAS_PHONE_NUMBER + ""==1"", null, null);startManagingCursor(mCursor);ListAdapter adapter = new SimpleCursorAdapter(this,    R.layout.two_line_list_item, mCursor, new String[] {    PhoneLookup.DISPLAY_NAME, PhoneLookup.NUMBER}, new int[] {R.id.text1, R.id.text2});setListAdapter(adapter);</code></pre><p>I'm able to see the DISPLAY_NAME, but whenever I add PhoneLookup.NUMBER, the application crashes. I also added a condition to select only contacts that have a phone number assuming its crashing due to null data. Still no luck. Is there any permissions I need to add to get the phone number? I already have android.permission.READ_CONTACTS in my manifest.</p><p>Many Thanks</p><p>View Log:</p><pre><code>I/ActivityManager(   58): Starting activity: Intent { cmp=fourth.app/.food }D/AndroidRuntime(  335): Shutting down VMW/dalvikvm(  335): threadid=1: thread exiting with uncaught exception (group=0x4001d800)E/AndroidRuntime(  335): FATAL EXCEPTION: mainE/AndroidRuntime(  335): java.lang.RuntimeException: Unable to start activity ComponentInfo{fourth.app/fourth.app.food}: java.lang.IllegalArgumentException: column 'number' does not existE/AndroidRuntime(  335):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime(  335):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime(  335):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime(  335):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime(  335):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  335):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  335):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  335):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  335):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  335):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  335):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  335):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  335): Caused by: java.lang.IllegalArgumentException: column 'number' does not existE/AndroidRuntime(  335):        at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)E/AndroidRuntime(  335):        at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:99)E/AndroidRuntime(  335):        at android.widget.SimpleCursorAdapter.findColumns(SimpleCursorAdapter.java:312)E/AndroidRuntime(  335):        at android.widget.SimpleCursorAdapter.&lt;init&gt;(SimpleCursorAdapter.java:87)E/AndroidRuntime(  335):        at fourth.app.food.onCreate(food.java:21)E/AndroidRuntime(  335):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  335):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)E/AndroidRuntime(  335):        ... 11 moreW/ActivityManager(   58):   Force finishing activity fourth.app/.foodW/ActivityManager(   58):   Force finishing activity fourth.app/.fourW/ActivityManager(   58): Activity pause timeout for HistoryRecord{43f54e88 fourth.app/.food}</code></pre>","161633","","492624","","2013-03-05 08:06:06","2013-03-05 08:06:06","Reading PhoneLookup.NUMBER crashing application in Android","<android><list><adapter><lookup><phone>","1","1","","",""
"4524203","1","","","2010-12-24 04:25:56","0","969","<p>I have two radio buttons one is 'YES' and other one is 'NO' if i click yes then has to show me login form and if NO button it has to show me register form how i can i do that can anyone provide code that will be very helpful.</p>","552989","","1268895","","2012-11-13 01:54:19","2012-11-13 01:54:19","how to generate event in radiobutton","<android>","1","1","","",""
"4524263","1","4524351","","2010-12-24 04:47:50","0","550","<p>It seems like I might be overlooking something obvious, but I can't figure out how to retrieve the raw (unscaled) dimensions of a bitmap being displayed in an ImageView.</p><p>For example, if I load a bitmap using <code>Bitmap b = BitmapFactory.decodeResource(...)</code>, I can get those dimensions from <code>b.getWidth()</code> and <code>b.getHeight()</code>, and I could pass the bitmap into an ImageView using <code>setImageBitmap(b)</code>.  But if I have a subclass of ImageView, is there any way to retrieve those dimensions without having to pass them in explicitly?  I guess I'm looking for a <code>getImageBitmap()</code> analog of ImageView's <code>setImageBitmap()</code> method, which would retrieve a Bitmap object that I can call <code>getWidth()</code> and <code>getHeight()</code> on.  Any other way to retrieve the original dimensions would work too, though.</p>","361766","","544198","","2013-01-31 21:19:46","2013-01-31 21:19:46","How do I get the raw dimensions of a bitmap in an ImageView?","<android><android-imageview>","1","0","","",""
"4524288","1","4524418","","2010-12-24 04:55:33","6","11148","<p>I m working on a word scramble game which allows user to move the image to image..if the image doesn't match then it should come back to it's original position from where it was dragged.I have written a sample code to move the image but the problem here is if I move one image the neighbouring image also starts moving.. Here is the sample code.</p><pre><code> /** Touchmoveimage.java*/     package com.examples.Touchmoveimage;     import android.app.Activity;     import android.content.Intent;     import android.os.Bundle;     import android.view.MotionEvent;     import android.view.View;     import android.view.View.OnTouchListener;     import android.widget.ImageView;     import android.widget.LinearLayout.LayoutParams;     public class Touchmoveimage extends Activity implements OnTouchListener{int windowwidth;int windowheight;   private LayoutParams layoutParams ;   private LayoutParams layoutParams1 ;   @Override   public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   setContentView(R.layout.main);  windowwidth = getWindowManager().getDefaultDisplay().getWidth();  windowheight = getWindowManager().getDefaultDisplay().getHeight();  ImageView ball= (ImageView)findViewById(R.id.ball);  ball.setOnTouchListener(this);  ImageView ball1 = (ImageView)findViewById(R.id.ball1);  ball1.setOnTouchListener(this);  }    public boolean onTouch(View v,MotionEvent event) { switch(v.getId()) { case R.id.ball:   ImageView ball= (ImageView)findViewById(R.id.ball);   layoutParams = (LayoutParams) ball.getLayoutParams();      switch(event.getAction())      {      case MotionEvent.ACTION_DOWN:                break;      case MotionEvent.ACTION_MOVE:                   int x_cord = (int)event.getRawX();                   int y_cord = (int)event.getRawY();                   if(x_cord&gt;windowwidth){x_cord=windowwidth;}                   if(y_cord&gt;windowheight){y_cord=windowheight;}                  layoutParams.leftMargin = x_cord -25;                 layoutParams.topMargin = y_cord - 75;                 ball.setLayoutParams(layoutParams);             break;             default : break;      } case R.id.ball1:     ImageView ball1= (ImageView)findViewById(R.id.ball1);       layoutParams1 = (LayoutParams) ball1.getLayoutParams();          switch(event.getAction())          {          case MotionEvent.ACTION_DOWN:                    break;          case MotionEvent.ACTION_MOVE:                       int x_cord = (int)event.getRawX();                       int y_cord = (int)event.getRawY();                       if(x_cord&gt;windowwidth){x_cord=windowwidth;}                       if(y_cord&gt;windowheight){y_cord=windowheight;}                      layoutParams1.leftMargin = x_cord -25;                       layoutParams1.topMargin = y_cord - 75;                       ball1.setLayoutParams(layoutParams1);                 break;                 default : break;        }      }     return true;}      }</code></pre><pre><code>     &lt;!-- main.xml --&gt;       &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;       &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""       android:orientation=""vertical""       android:layout_width=""fill_parent""      android:layout_height=""fill_parent""     &gt;     &lt;ImageView      android:layout_width=""50sp""      android:layout_height=""50sp""      android:id=""@+id/ball""    android:src=""@drawable/ball""&gt;   &lt;/ImageView&gt;   &lt;ImageView     android:layout_y=""30dip""     android:layout_x=""118dip""     android:layout_width=""50sp""     android:layout_height=""50sp""     android:id=""@+id/ball1""    android:src=""@drawable/ball1""&gt;   &lt;/ImageView&gt;    &lt;/LinearLayout&gt;</code></pre><p>Anyone plz help me out..Trying all possible thing to solve it..</p>","553007","","19750","","2010-12-24 04:57:35","2012-12-24 07:10:15","Drag and drop images in android","<android><image><drag-and-drop><ontouchlistener>","5","1","4","",""
"4524322","1","4534974","","2010-12-24 05:04:36","0","1338","<p>I have a problem with a list view and a custom cursor adapter and I just can't seem to figure out what is wrong with my code. Basically, in my activity I call initalize() that does a bunch of stuff to handle getting the proper data and initializing the listview. On first run of the activity you can see from the images that one of the items is missing from the list. If I go to another activity and go back to this activity the item that was missing shows up. I believe it has something to do with setContentView(R.layout.parent). If I move that to my initialize() then the item never shows up even when returning from another activity. So, for some reason, returning from another activity bypasses setContentView(R.layout.parent) and everything works fine. I know it's impossible for me to bypass setContentView(R.layout.parent) so I need to figure out what the problem is. Also, I did not include the layout because it is nothing more then two textviews.</p><p>Also, the images I have attached do not show that the missing item is the last one on the list.<img src=""http://i.stack.imgur.com/74vs1.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/Ss47O.png"" alt=""alt text""></p><p>Custom Cursor Adapter:</p><pre><code>public class CustomCursorAdapter extends SimpleCursorAdapter {private Context context;private int layout;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 View newView(Context context, Cursor cursor, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(context); final View view = inflater.inflate(layout, parent, false); return view;}@Overridepublic void bindView(View v, Context context, Cursor c) {    if (c.getColumnName(0).matches(""section"")){        int nameCol = c.getColumnIndex(""section"");        String section = c.getString(nameCol);        TextView section_text = (TextView) v.findViewById(R.id.text1);        if ((section.length() &gt; 0)) {            section_text.setText(section);        }   else {         //so we don't have an empty spot            section_text.setText("""");            section_text.setVisibility(2);            section_text.setHeight(1);        }    } else if (c.getColumnName(0).matches(""code"")) {        int nameCol = c.getColumnIndex(""code"");        String mCode = c.getString(nameCol);        TextView code_text = (TextView) v.findViewById(R.id.text1);        if (code_text != null) {      int i = 167;      byte[] data = {(byte) i};      String strSymbol = EncodingUtils.getString(data, ""windows-1252"");         mCode = strSymbol + "" "" + mCode;            code_text.setText(mCode);            code_text.setSingleLine();        }    }    if (c.getColumnName(1).matches(""title"")){        int nameCol = c.getColumnIndex(""title"");        String mTitle = c.getString(nameCol);        TextView title_text = (TextView) v.findViewById(R.id.text2);        if (title_text != null) {            title_text.setText(mTitle);        }    } else if (c.getColumnName(1).matches(""excerpt"")) {        int nameCol = c.getColumnIndex(""excerpt"");        String mExcerpt = c.getString(nameCol);        TextView excerpt_text = (TextView) v.findViewById(R.id.text2);        if (excerpt_text != null) {            excerpt_text.setText(mExcerpt);            excerpt_text.setSingleLine();        }    }}</code></pre><p>The Activity:</p><pre><code>public class parent extends ListActivity {private static String[] TITLE_FROM = {  SECTION, TITLE, _ID,  };private static String[] CODE_FROM = { CODE, EXCERPT, _ID,  };private static String ORDER_BY = _ID + "" ASC"";private static int[] TO = { R.id.text1, R.id.text2, };String breadcrumb = null;private MyData data;private SQLiteDatabase db;CharSequence parent_id = """";@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);          data = new MyData(this);    db = data.getReadableDatabase();    setContentView(R.layout.parent);    initialize();}public void initialize() { breadcrumb = null; Bundle bun = getIntent().getExtras(); TextView tvBreadCrumb; tvBreadCrumb = (TextView)findViewById(R.id.breadcrumb);     if (bun == null) {     //this is the first run      tvBreadCrumb.setText(null);  tvBreadCrumb.setHeight(0);        parent_id = ""0"";        try {         Cursor cursor = getData(parent_id);         showSectionData(cursor);        } finally {         data.close();        }    } else {     CharSequence state = bun.getString(""state"");  breadcrumb = bun.getString(""breadcrumb"");  tvBreadCrumb.setText(breadcrumb);  CharSequence code = bun.getString(""code"");        parent_id = code;     if (state.equals(""chapter"")) {            try {             Cursor cursor = getData(parent_id);             showSectionData(cursor);            } finally {             data.close();            }     } else if (state.equals(""code"")) {            try {             Cursor cursor = getCodeData(parent_id);             showCodeData(cursor);            } finally {             data.close();            }     }    }}@Overridepublic void onStart() { //initialize(); super.onResume();}@Overridepublic void onResume() { initialize(); super.onResume();}private Cursor getData(CharSequence parent_id) { Cursor cTitles = db.query(TITLES_TABLE_NAME, TITLE_FROM, ""parent_id = "" + parent_id, null, null, null, ORDER_BY); Cursor cCodes = db.query(CODES_TABLE_NAME, CODE_FROM, ""parent_id = "" + parent_id, null, null, null, ORDER_BY); Cursor[] c = {cTitles, cCodes}; Cursor cursor = new MergeCursor(c); startManagingCursor(cursor); return cursor;}private Cursor getCodeData(CharSequence parent_id2) {    Bundle bun = getIntent().getExtras(); CharSequence intent = bun.getString(""intent""); CharSequence searchtype = bun.getString(""searchtype"");  //SQLiteDatabase db = data.getReadableDatabase(); if (intent != null) {  String sWhere = null;       if(searchtype.equals(""code"")) {       sWhere = ""code LIKE '%""+parent_id2+""%'"";      } else if(searchtype.equals(""within"")){       sWhere = ""definition LIKE '%""+parent_id2+""%'"";      }      //This is a search request  Cursor cursor = db.query(CODES_TABLE_NAME, CODE_FROM, sWhere, null, null, null, ORDER_BY);   startManagingCursor(cursor);     return cursor; } else {  Cursor cursor = db.query(CODES_TABLE_NAME, CODE_FROM, ""parent_id = ""+ parent_id2, null, null, null, ORDER_BY);  startManagingCursor(cursor);     return cursor; }}private void showSectionData(Cursor cursor) { CustomCursorAdapter adapter= new CustomCursorAdapter(this, R.layout.item, cursor, TITLE_FROM, TO); setListAdapter(adapter);}private void showCodeData(Cursor cursor) { CustomCursorAdapter adapter = new CustomCursorAdapter(this, R.layout.item, cursor, CODE_FROM, TO); setListAdapter(adapter); Bundle bun = getIntent().getExtras(); CharSequence intent = bun.getString(""intent""); if (intent != null) {  Cursor cursor1 = ((CursorAdapter)getListAdapter()).getCursor();  startManagingCursor(cursor1);  TextView tvBreadCrumb;  tvBreadCrumb = (TextView)findViewById(R.id.breadcrumb);   tvBreadCrumb.setText(cursor1.getCount() + "" Records Found"");  //cursor1.close(); //mdl }}</code></pre>","485438","","485438","","2010-12-24 08:01:56","2010-12-26 18:47:02","Android strange behavior with listview and custom cursor adapter","<android><listview><cursor>","1","8","","",""
"4524377","1","","","2010-12-24 05:18:14","1","349","<p>I am trying to use the SQLiteTransactionListener to know when a batch transaction has committed so I can send an notifyChange event to observers in a ContentProvider.</p><p>The code starts a transaction for the bulk operation, and has nested transactions for each insert or update.</p><p>I receive the onBegin message for each startTransaction of the bulk operation, however I never receive the onCommit or onRollback</p><p>I have logged out the begin and end transaction calls to confirm that the nested calls are completing for each transaction, and as can be seen below, these are always matching.</p><pre><code>Finish batch operation: success = trueEnd batch transactionBegin batch transactionBulk transaction: onBeginInserting values into ""Messages""tableinsert values transaction begininsert values transaction successnotifyChange not sent due to currently processing batch operationinsert values transaction endInserting values into ""Content""tableinsert values transaction begininsert values transaction successnotifyChange not sent due to currently processing batch operationinsert values transaction endUpdate values transaction beginUpdate values transaction successnotifyChange not sent due to currently processing batch operationUpdate values transaction endFinish batch operation: success = trueEnd batch transactionDownload begining for content ID 12</code></pre><p>I have also looked at the code for SQLiteDatabase <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/database/sqlite/SQLiteDatabase.java"" rel=""nofollow"">here</a>, but could see no reason this function would not be called. I have tried to find some examples of this online (here and in google search) but only find API documentation. </p><p>Has anyone had some success using this class? Or can someone please tell me why I would not be getting this event?</p>","496721","","","","","2012-06-08 06:00:28","SQLiteTransactionListener onCommit and onRollback never called","<android>","1","1","","",""
"4524401","1","4524465","","2010-12-24 05:23:43","0","1622","<p>In my program i am using postmethod to call the web services . But the web service is based on Get method .I dont know how to write the code for Get method.Please tell me the how to write the code for Get method to call web services.My code is shown below based on post method.</p><p>RestClient arc = new RestClient(""http:.............."");arc.AddParam(""search"", msft);</p><p>Here i created a object to RestClient and adding parameters by calling AddParam method.The RestClient class is</p><p>public class AddSubRestClient {</p><pre><code>private ArrayList &lt;NameValuePair&gt; params;private ArrayList &lt;NameValuePair&gt; headers;private InputStream instream;private String url;private int responseCode;private String message;private String response;public String getResponse() {    return response;}public InputStream inResponse() {     return instream;}public String getErrorMessage() {    return message;}public int getResponseCode() {    return responseCode;}public AddSubRestClient(String url){    this.url = url;    params = new ArrayList&lt;NameValuePair&gt;();    headers = new ArrayList&lt;NameValuePair&gt;();}public void AddParam(String name, String value){    params.add(new BasicNameValuePair(name, value));}public void AddHeader(String name, String value){    headers.add(new BasicNameValuePair(name, value));}public void Execute() throws Exception{   //Postmethod    HttpPost request = new HttpPost(url);    Log.e(""in"",""rest client"");     //add headers     for(NameValuePair h : headers)     {         request.addHeader(h.getName(), h.getValue());     }     if(!params.isEmpty()){         UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity(params,HTTP.UTF_8);         request.setEntity(p_entity);         Log.e(""params"",params.toString());         Log.e(""request"",request.toString());     }         executeRequest(request, url);    }public void executeRequest(HttpUriRequest request, String url){    HttpClient client = new DefaultHttpClient();   HttpResponse httpResponse;    try {       httpResponse = client.execute(request);       responseCode = httpResponse.getStatusLine().getStatusCode();       message = httpResponse.getStatusLine().getReasonPhrase();        HttpEntity entity = httpResponse.getEntity();       if (entity != null) {      intream = 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 {        Log.e(""in"",""try block"");        line = reader.readLine();        Log.e(""line"",line);        if(line==null)        {            Log.e(""Line"",""is null"");        }        else{            Log.e(""Line"",""is not null"");             sb.append(line );        }         } catch (IOException e) {        e.printStackTrace();    } finally {        try {            Log.e(""line"",""close"");            is.close();        } catch (IOException e) {            e.printStackTrace();        }    }    return sb.toString();}</code></pre><p>}</p><p>so please tell me how to write the code for get method in place of post method or tell me the solution</p><p>Thank you in advance</p>","745367","","","","","2010-12-24 05:44:22","how to use Get method for calling web services in android","<android><web-services>","1","0","","",""
"4524500","1","4524625","","2010-12-24 05:54:01","1","221","<p>I have an application in which i am trying to create a Database. On the first run the application works properly. Subsequent launch of the application it crashes. The error is because the application is trying to create the db again. </p><p>So i want to know how to create a database or tables only if they dont exists or only if the application is run the first time.</p>","155196","","","","","2012-06-04 15:00:52","App Crashes due to Db creation on every launch","<android><sqlite><crash>","2","1","","",""
"4524513","1","","","2010-12-24 05:57:49","0","629","<p>I am trying to write a TCP server that listens on the loopback address and a client that connects to it. Both reside within the emulator. Since this is only using the loopback address. Should this still need firewall forwarding rules to be set in the android emulator ?</p>","553043","","","","","2011-02-21 01:37:51","Android Emulator SocketServer and Client","<android><emulator>","1","0","","",""
"4524520","1","4524557","","2010-12-24 05:59:04","1","233","<p>Anyone know what limits are for models loaded in android?</p><p>390k seems awfully small for limitations.</p><p>Any help is appreciated.</p>","510848","","44729","","2010-12-24 17:05:24","2010-12-24 17:05:24","Out of memory loading a 390k md2 model","<android><memory-management><opengl-es>","1","0","","",""
"4524536","1","","","2010-12-24 06:03:16","0","899","<p>i have create an table contain two columns and insert some rows into that. now i have to display those rows in listview. one column is display in textview and that column related value is display in edittext field. But i got an error called (NullPointer Exception)</p><p>i used some code that shown in below public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);</p><pre><code>   setContentView(R.layout.category1);   lv = (ListView)findViewById(android.R.id.list);  getList();  lv.setAdapter(new EfficientAdapter(this));</code></pre><p>} public void getList()   {       cur=db.rawQuery(""SELECT * FROM detaillist ORDER BY symbol"",null);      </p><p>while(cur.moveToNext())      {          sy = cur.getString(cur.getColumnIndex(""symbol""));           po = cur.getString(cur.getColumnIndex(""position"")); }         strArray = new String[]{sy};         strArray1 = new String[]{po};}}</p><p>private static class EfficientAdapter extends BaseAdapter {       private LayoutInflater mInflater;</p><pre><code>   public EfficientAdapter(Context context) {   mInflater = LayoutInflater.from(context);   }   public int getCount() {       return symbols.size();       }   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(android.R.layout.simple_list_item_1, null);       convertView = mInflater.inflate(R.layout.editcategorylist, null);       holder = new ViewHolder();       holder.text = (TextView) convertView.findViewById(R.id.symbol);       holder.text2 = (EditText) convertView.findViewById(R.id.postion);       convertView.setTag(holder);       } else {       holder = (ViewHolder) convertView.getTag();       }       holder.text.setText(strArray[position]);       Log.e(""text"",holder.text.toString());       holder.text2.setText(strArray1[position]);       Log.e(""text2"",holder.text2.toString());          return convertView;       }       static class ViewHolder {       TextView text;       EditText text2;       }       }</code></pre><p>}</p><p>Thank you.</p>","552978","","","","","2010-12-24 06:03:16","how can i display values in edittext field in listview that values are coming from sqlite?","<android><listview><edittext>","0","2","","",""
"4524560","1","4524638","","2010-12-24 06:11:16","3","422","<p>I need to on the screen, when received a notification for my application. Is there any specific way to on the screen?</p><p>Thank You </p>","377438","","","","","2010-12-24 06:35:29","Android screen on when notification recived","<android>","1","0","","",""
"4524562","1","4524745","","2010-12-24 06:11:42","0","1296","<p>i want to set image view in bottom. if possible how to set? this is for my xml 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=""match_parent""&gt;&lt;VideoView android:id=""@+id/VideoView01"" android:layout_width=""wrap_content"" android:layout_height=""500dip""android:layout_centerVertical=""true""/&gt;&lt;Button android:text=""Back"" android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre><p>and this is for my emulator screen:</p><p><img src=""http://i.stack.imgur.com/tc3yD.png"" alt=""alt text""></p><p>now my videos play in this emulator...at the same time i want to set imageview in this bottom....</p><p><img src=""http://i.stack.imgur.com/WH2ZR.png"" alt=""alt text""></p>","486554","","486554","","2010-12-27 08:36:50","2010-12-27 08:36:50","how to set imageview in bottom","<java><android><video><imageview>","1","0","","",""
"4524603","1","4524879","","2010-12-24 06:26:45","2","342","<p>I'm working an Android AudioRecord app.  If I do not call the <code>release()</code> method on the AudioRecord object at the end of the script, it will not run correctly until I restart the phone.</p><p>This becomes a major hassle when working on this project because if the app should ever crash (which happens sometimes while testing and there's an unexpected buffer overflow, etc.) then I have to restart the phone every time.</p><p>I have the method to release the buffers inside the <code>finalize()</code> method of my AudioListener class, and I also call them <code>onStop()</code> of the main Activity.</p><p>Neither of these seem to work when the app freezes or crashes.  Is there a way to attach the release action to an error handler or some general way of ensuring that an app will execute some code to release resources properly even after a crash.</p><p>Thanks for any help.</p>","107083","","","","","2010-12-24 07:26:11","How to release Android resources when an app crashes","<android><crash><finalize><audiorecord>","1","1","2","",""
"4524640","1","4525165","","2010-12-24 06:35:53","1","1055","<p>I succeeded in opening hierarchy viewer from tools directory. I have two emulators running but hierarchy viewer doesn't show any. Even the refresh doesn't have any difference. Can anyone help me?</p>","246942","","321731","","2013-10-04 06:47:12","2013-10-04 06:47:12","Android: hierarchy viewer","<android><android-layout>","1","0","","",""
"4524752","1","4525030","","2010-12-24 06:58:19","28","19709","<p>I'm using Eclipse to develop applications for android, and I want to integrate Admob to make money.The tutorial says I should watch the LogCat to find ID, but where is it?<img src=""http://i.stack.imgur.com/hAF2V.png"" alt=""alt text""></p><p>When I run in either the test mode or the real mode, sometimes the eclipse will notify that Ads returned, yet it does not show in the emu... can anyone explain? </p>","552319","","","","","2014-04-15 07:00:45","How can I get device ID for Admob","<android><eclipse><admob>","3","0","6","",""
"4524805","1","4524829","","2010-12-24 07:10:18","0","85","<p>How can i upgrade my android device htc hero??</p>","432559","","","","","2010-12-24 07:14:21","how can we upgrade our android device htc hero?","<android>","1","0","","2012-08-18 05:12:41",""
"4524828","1","","","2010-12-24 07:14:08","-1","1838","<p>I am developing a google map application.I have called map activity class.On the google map I have showed the current location as well as multiple markers.Now the problem i am facing is to calculate distance between 2 coordinates having there respective value....Has anyone implemented it before??It will be a great help for me.....Thanks in advance</p>","475349","","","","","2010-12-24 07:33:59","finding distance between 2 coordinates in google map in android","<android>","1","5","","",""
"4524874","1","4525012","","2010-12-24 07:25:20","1","760","<p>hai every one . im my project while displaying a page  if there are some buttons for displaying videos then if i click on it then the video should play and when i stop the video then i should get the original page with image button. i wrote the code as .......</p><pre><code> Uri uri = Uri.parse(myPath);     Intent intent = new Intent(android.content.Intent.ACTION_VIEW, uri);     myContext.startActivity(intent);</code></pre><p>In place of mypath i gave the path where the video is located. </p><p>Actually my problem is when the video playing is finished  , i am not getting the original page with buttons but empty page with image button. can any body tel where the exasct problem is.. thank you in advance</p>","493244","","19601","","2010-12-24 08:21:09","2010-12-24 08:21:09","how to know the intent is finished or not in android","<android>","1","1","","",""
"4524904","1","4529557","","2010-12-24 07:30:56","0","910","<p>I'm adding some interception routines to Dalvik libcore methods (e.g. file open method in libcore/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java), which I think only changes basic sharing libraries. But to my surprise, every time I run <em>make</em> after modifications, it rebuilds nearly everything of the framework, such as Calculator application, W3C DOM parser, etc. It really takes time to build the framework after a small modification. I'm wondering if it is possible to reduce number of rebuilt components after modifying dalvik libcore? Thanks.</p>","111896","","","","","2010-12-26 02:40:44","Changing dalvik/libcore causes rebuilding the whole framework","<java><android><dalvik>","1","0","","",""
"4524962","1","","","2010-12-24 07:44:29","0","264","<p>I've got an Android application I'm writing.  It has a ListActivity in it that's all set up to load my data using this layout for each item.</p><p> </p><p></p><p></p><p></p><p></p><p>   </p><p>My data Adapter binds with no problem and I've set it up so that when an item is selected from the list this method is called.</p><pre><code>private void showPasswordBox(View v) { EditText passwordBox = (EditText)v.findViewById(R.id.hidden_box); Button passwordSubmit = (Button)v.findViewById(R.id.hidden_box_submit); passwordSubmit.setText(""Login""); passwordSubmit.setVisibility(View.VISIBLE); passwordBox.setFocusableInTouchMode(true); passwordBox.setHint(R.string.password); passwordBox.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); passwordBox.setVisibility(View.VISIBLE);}</code></pre><p>This has the effect of displaying and EditText and a Button (hidden_box and hidden_box_submit in my layout). Which is just what I wanted.</p><p>However a problem occurs when the user taps on the newly visible EditText (hidden_box).  The IME pops up and hidden_box immediately loses focus.  Consequently anything typed on the IME does not appear in the EditText.  Instead it's doing this weird thing where anything typed appears above the keyboard in grey letters and remains at the bottom of the screen when the IME is dismissed.  It's like the IME is typing into it's own temporary invisible box.</p><p>If the user taps on the EditText after the IME is already showing then the application behaves as it should.  Anything typed on the IME appears in the EditText and remains when the IME is dismissed.</p><p>It seems to me that when the IME pops up (which it does immediately when the user taps on the EditText, as it should) it completely de-associates with my application and does its thing in IME la-la land unless I direct it to the EditText by tapping on the EditText before typing and dismissing the keyboard.  How do I make it behave normally so it types directly into the EditText as soon as it pops up?</p>","354271","","","","","2010-12-24 08:19:38","Why does the IME on my android application de-associate from the EditText it should be editing?","<android><focus><android-layout><edittext><ime>","1","0","","",""
"4524981","1","","","2010-12-24 07:48:09","13","34275","<p>When I checked the Android 2.3 doc, I found the information about OBB(Opaque Binary Blob) in Storage section.</p><p>But I can't find any information of OBB(Opaque Binary Blob) in Google.</p><p>Can you give me a information or address about what Obb(Opaque Binary Blob) is?</p>","553105","","","","","2012-09-18 06:42:02","What is OBB(Opaque Binary Blob) in Android develop site?","<android>","2","1","6","",""
"4525068","1","","","2010-12-24 08:08:23","11","8233","<p>how can we solve this types of the error -> ""This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.""</p>","432559","","","","","2012-04-09 15:47:20","This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz","<android>","2","0","3","",""
"4525191","1","4525241","","2010-12-24 08:46:09","0","663","<p>I need to convert a string containing accented German letters to their two letter equivalents as follows:</p><p>ae = ä | oe = ö | ue = ü | sz = ß</p><p>How can I do this in Java? I see their are other questions where the accents are simply removed, but I can't figure out how to change it to do what I want. I'm completely new to Java, so don't even know how to start approaching this.</p><p><a href=""http://stackoverflow.com/questions/3322152/java-getting-rid-of-accents-and-converting-them-to-regular-letters"">Java - getting rid of accents and converting them to regular letters</a></p>","317033","","","","","2010-12-24 09:00:45","Java - Converting a German accented characters to two letter equivalents","<java><android><string>","1","0","1","",""
"4525199","1","","","2010-12-24 08:47:36","0","427","<p>When I use the following code:</p><pre><code>public void onSurfaceCreated(SurfaceHolder holder) {    super.onSurfaceCreated(holder);    MediaPlayer mp = new MediaPlayer();    try {        mp.setDataSource(""/sdcard/download/downloadfile.mp4"");        mp.setDisplay(holder);        mp.prepare();        mp.start();        ...    }    ...}</code></pre><p>I get a message in logcat:</p><pre><code>E/AndroidRuntime(  375): java.lang.UnsupportedOperationException: Wallpapers do not support keep screen onE/AndroidRuntime(  375):  at android.service.wallpaper.WallpaperService$Engine$2.setKeepScreenOn(WallpaperService.java:194)E/AndroidRuntime(  375):  at android.media.MediaPlayer.updateSurfaceScreenOn(MediaPlayer.java:866)E/AndroidRuntime(  375):  at android.media.MediaPlayer.setDisplay(MediaPlayer.java:570)</code></pre><p>So it seems that <code>setDisplay()</code> implicitly calls <code>setKeepScreenOn()</code>, which automatically fails and throws an exception.</p><p>Is there any way to prevent it from calling this function?</p>","553144","","1820695","","2012-12-30 21:43:06","2012-12-30 21:43:06","Wallpaperservice / MediaPlayer in android","<android>","1","0","","",""
"4525200","1","4525286","","2010-12-24 08:47:39","0","970","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/8063494/virtually-create-sd-card-in-eclipse"">Virtually create sd card in eclipse</a>  </p></blockquote><p>how to create memory card in android emulator?</p>","432559","","","","","2010-12-24 09:05:15","how to create memory card in android emulator?","<android>","1","0","","2012-08-18 12:27:04",""
"4525206","1","","","2010-12-24 08:48:42","37","33603","<p>I want to record audio from the mic and access it for possible playback in near real-time. I am unsure of how to use the Android AudioRecord class to record some mic audio and quickly access it. </p><p>For the AudioRecord class, the official site says 'the app polls the AudioRecord object in time', and 'the size of the buffer being filled determines the time-length of the recording before over-running unread data'. Later it's suggested that a larger buffer should be used when polling less frequently. They never actually show an example in code. </p><p>One example I've seen in a book uses the AudioRecord class to continuously read a buffer freshly populated with live mic audio, and then the app writes this data to an SD file. The pseudo-code looks something like - </p><pre><code>set up AudioRecord object with buffer size and recording format infoset up a file and an output streammyAudioRecord.startRecording();while(isRecording){    // myBuffer is being filled with fresh audio    read audio data into myBuffer    send contents of myBuffer to SD file}myAudioRecord.stop();</code></pre><p>How this code synchronizes its reading with the rate of recording is unclear - is the boolean ""isRecording"" sequenced on and off properly elsewhere? It seems this code could either read too frequently or too infrequently, depending on how long the reading and writing takes. </p><p>The site doc also says the AudioRecord class has a nested class named OnRecordPositionUpdateListener which is defined as an interface. The information suggests that somehow, you specify the period you want for being notified of the progress of the recording, and the name of your event handler, and a call is automatically made to your event handler at the specified frequency. I think the structure, in pseudo-code would be something like - </p><pre><code>set target of period update message = myListenerset period to be about every 250 msother codemyListener(){    if(record button was recently tapped)        handle message that another 250 ms of fresh audio is available        ie, read it and send it somewhere)</code></pre><p>I need to find some specific code which allows me to capture and process mic audio with a delay of less than about 500 ms. Android offers another class called MediaRecorder, but it doesn't support streaming, and I may want to stream live mic audio over a Wi-Fi network in near real-time. Where can I find some specific examples?</p>","492403","","45974","","2011-01-24 15:49:51","2012-11-22 05:02:48","Android AudioRecord class - process live mic audio quickly, set up callback function","<java><android><audiorecord><android-hardware>","4","2","41","",""
"4525220","1","4525282","","2010-12-24 08:50:19","0","1432","<p>Which is the best datatype to be used for creating a datetime field like in MysQL ?</p><p>i wanna store in this format YYYYMMDD HHMMSS</p>","155196","","","","","2010-12-24 09:03:55","android Sqlite datatime datatype","<android><sqlite><datetime><sqlite3>","1","0","","",""
"4525239","1","","","2010-12-24 08:53:50","2","2274","<p>I want to get udid of android emulator..How can i get it.Has anyone implemented it before?</p>","475349","","111896","","2010-12-24 08:59:33","2010-12-24 15:53:56","getting udid of android emulator","<android>","1","1","1","",""
"4525317","1","","","2010-12-24 09:11:40","1","529","<p>I want to add a pdf viewing feature in my android app.I got results that apv library is best &amp; fast.</p><p>Can anyone tell how to compile that stuffs in windows.</p><p>Suggestion are welcomed fro other pdf viewing libraries also.</p><p>Thanks in Advance.</p>","536148","","","","","2012-06-04 09:56:45","How to compile apv library in windows to read pdf file in android","<android><pdf-reader>","0","5","1","",""
"4525395","1","4526528","","2010-12-24 09:26:40","0","96","<p>How can we add sounds, in a memory card, in Android?</p>","432559","","651104","","2012-07-15 15:14:19","2012-07-15 15:14:19","How can we add sounds, in a memory card, in Android?","<android>","1","4","","",""
"4525415","1","","","2010-12-24 09:31:05","0","409","<p>I want to display thumbnail of a video from SD card in an imageView.</p><p>I know theres new Video.Thumbnail class available but its from android 2.1 and I want this to work on 1.6.</p><p>From research I got to know that theres some MediaMetadataRetriever interface but its giving me runtime exceptions.</p><p>Can neone please help.</p>","447238","","","","","2011-03-11 21:08:36","Video Thumbnail android 1.6","<android><video><thumbnails><sd-card>","1","0","","",""
"4525485","1","4525521","","2010-12-24 09:44:35","0","300","<p>I have same mobile number in my mobile and SIM also. When I am query contacts it give SIM contacts first. But  i need to get phone contact before get SIM contacts.</p><p>Is there any way to do that?</p><p>Thank You.</p>","377438","","","","","2010-12-24 09:51:22","Android contact query issue","<android>","1","0","","",""
"4525516","1","","","2010-12-24 09:50:19","1","48","<p>I am using flex as my front end and would like that only that app is able to communicate with my site/service. Suggest a way to implement this. My main concern as you can see is security. </p><p>My backend is php (cakephp/yii/normal php). I do also have mobile apps mainly iPhone and Android and they too will need to be validated by my php. </p>","406659","","","","","2010-12-24 10:09:48","Validating services","<php><iphone><android><flex>","1","0","1","",""
"4525661","1","","","2010-12-24 10:13:49","4","9426","<p>I have a problem with Proguard and use of external libraries. My project compiles without errors and runs successfully on a real device, but only when I run it from Eclipse. Now I want to make an obfuscated release version so I did the following:ran ""android update project -p ./""added </p><pre><code>proguard.dir=/home/stoned/android-sdk-linux_86/proguard4.5.1/libproguard.config=/home/stoned/workspace/Fidoo/proguard.cfg</code></pre><p>when I run ""ant release"" I get the following:</p><pre><code>... skipped many irrelevant messages ...-obfuscate:    [mkdir] Created dir: /home/stoned/workspace/Fidoo/bin/proguard      [jar] Building jar: /home/stoned/workspace/Fidoo/bin/proguard/original.jar [proguard] ProGuard, version 4.4 [proguard] ProGuard is released under the GNU General Public License. The authors of all [proguard] programs or plugins that link to it (com.android.ant, ...) therefore [proguard] must ensure that these programs carry the GNU General Public License as well. [proguard] Reading input... [proguard] Reading program jar [/home/stoned/workspace/Fidoo/bin/proguard/original.jar] [proguard] Reading program jar [/home/stoned/workspace/Fidoo/libs/exapi-1.16.jar] [proguard] Reading program jar [/home/stoned/workspace/Fidoo/libs/libthrift.jar] [proguard] Reading program jar [/home/stoned/workspace/Fidoo/libs/log4j-1.2.14.jar] [proguard] Reading library jar [/home/stoned/android-sdk-linux_86/platforms/android-4/android.jar] [proguard] Initializing... [proguard] Warning: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeRenderer: can't find superclass or interface javax.swing.tree.DefaultTreeCellRenderer [proguard] Warning: org.apache.log4j.lf5.viewer.categoryexplorer.TreeModelAdapter: can't find superclass or interface javax.swing.event.TreeModelListener [proguard] Warning: org.apache.log4j.lf5.viewer.LogBrokerMonitor$32: can't find superclass or interface java.awt.event.ActionListener [proguard] Warning: org.apache.log4j.lf5.viewer.LogBrokerMonitor$31: can't find superclass or interface java.awt.event.ActionListener... skipped many lines of similar messages ... [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener [proguard] Note: org.apache.log4j.spi.LocationInfo: can't find dynamically referenced class com.ibm.uvm.tools.DebugSupport [proguard] Note: there were 5 unresolved dynamic references to classes or interfaces. [proguard]       You should check if you need to specify additional program jars. [proguard] Warning: there were 1656 unresolved references to classes or interfaces. [proguard]          You may need to specify additional library jars (using '-libraryjars'), [proguard]          or perhaps the '-dontskipnonpubliclibraryclasses' option.</code></pre><p>Obviously, javax.swing. classes are not needed in Android application, as well as log4j classes. How do I make proguard not to search for those referenced libraries? </p>","553203","","","","","2010-12-25 10:31:27","(Android) Proguard can't find dynamically referenced class javax.swing.*","<android><proguard>","3","0","2","",""
"4525696","1","","","2010-12-24 10:22:00","2","570","<p>yesterday I uploaded an application to the market and I had to add the <code>uses-sdk android:minSdkVersion=""4""</code> Item to the Manifest file. After I add this item, I get a strange behavior from my ViewFlipper widget. Without the minSdkVersion the view Flipper is using animations without a problem, after adding it it ignores them or at least it seems that no animation is used. I also tested with minSdkVersion=""8"" but saddly it didin't help to get the animation working. Also tried adding both: (<code>uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""8""</code>), same behavior.  Removing the minSdkVersion item from the manifes (local testing) makes the ViewFlipper work like a charm. Market does not let me upload an APK without minSdkVersion item in Manifest.</p><p>Does anybody know what this is all about? It's really a strange behavior in my opinion and it really lowers the quality / user experience of the app. Please help if somebody knows how to fix this.</p><p>Code snippen of how I use the flipper to flip through content.</p><pre><code>// call for the flipper to show the next itemflipper.setInAnimation(AnimationHelper.inFromLeftAnimation());flipper.setOutAnimation(AnimationHelper.outToRightAnimation());flipper.showNext();// animation example methodpublic static Animation inFromRightAnimation() {  Animation inFromRight = new TranslateAnimation(  Animation.RELATIVE_TO_PARENT, +1.0f,  Animation.RELATIVE_TO_PARENT, 0.0f,  Animation.RELATIVE_TO_PARENT, 0.0f,  Animation.RELATIVE_TO_PARENT, 0.0f);  inFromRight.setDuration(150);  inFromRight.setInterpolator(new AccelerateInterpolator());  return inFromRight;}// XML: current Android manifest config for minSdkVersion&lt;uses-sdk android:minSdkVersion=""4""  android:targetSdkVersion=""8"" /&gt;</code></pre><p>Thank you all and best regards,Mitja</p>","504728","","473070","","2010-12-24 10:28:40","2011-06-24 01:56:39","ViewFlipper animations and minSdkVersion","<android><animation><google-play><viewflipper>","1","1","","",""
"4525743","1","6593687","","2010-12-24 10:31:02","6","5851","<p>I'm trying to explore the behavior of the new concurrent garbage collector in GingerBread (2.3).</p><p>Could someone please explain these example log lines in details (especially the ""paused"" parts of <code>GC_CONCURRENT</code> and <code>GC_FOR_MALLOC</code>)?</p><pre><code>12-24 10:20:54.912 D/dalvikvm(  414): GC_CONCURRENT freed 510K, 57% free 2529K/5831K, external 716K/1038K, paused 8ms+5ms12-24 10:20:54.963 D/dalvikvm(  414): GC_FOR_MALLOC freed 510K, 57% free 2529K/5831K, external 716K/1038K, paused 47ms</code></pre>","289463","","418183","","2011-07-06 08:37:54","2011-07-06 09:16:16","What are the ""paused"" values in GC_CONCURRENT log messages?","<android><garbage-collection><android-sdk-2.3>","2","0","1","",""
"4525790","1","","","2010-12-24 10:38:47","0","676","<p>i want to draw ecg data on canvas but i cant find any method which plot data in sine type wave.i used path and quadto method but it doesnt seemed to work</p>","544537","","","","","2010-12-24 10:38:47","canvas draw for sinetypewave","<android><canvas>","0","3","","",""
"4525800","1","","","2010-12-24 10:40:28","0","502","<p>I Want to perform junit test on android Activity</p><p>i have activity name Thmnail.java in Thumb ProjectNow i create the test project called ThumbTest and make the testclass called ThmnailTest Now when i called the method of the Thmnail from the ThmnailTest     </p><p>getSetTagName(tagId,R.id.edTag11);</p><p>the above called the tagid i m pass but the R.id.edTag11 is the AutoCompleteTextView is in the thmnail it can give the error </p><p>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.at android.view.ViewRoot.checkThread(ViewRoot.java:2802)at android.view.ViewRoot.invalidateChild(ViewRoot.java:607)at android.view.ViewRoot.invalidateChildInParent(ViewRoot.java:633)at android.view.ViewGroup.invalidateChild(ViewGroup.java:2505)at android.view.View.invalidate(View.java:5115)at android.widget.TextView.invalidateCursor(TextView.java:3625)at android.widget.TextView.spanChange(TextView.java:6221)at android.widget.TextView$ChangeWatcher.onSpanAdded(TextView.java:6346)at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:906)at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:611)at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:514)at android.text.Selection.setSelection(Selection.java:74)at android.text.Selection.setSelection(Selection.java:85)at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java:497)at android.widget.TextView.setText(TextView.java:2676)at android.widget.TextView.setText(TextView.java:2556)at android.widget.EditText.setText(EditText.java:75)at android.widget.TextView.setText(TextView.java:2531)at com.avisun.fileaway.FileawayThumbnail.getSetTagName(FileawayThumbnail.java:276)at com.avisun.fileaway.FileawayThumbnail.getAutoTextFillwithTag(FileawayThumbnail.java:245)at com.avisun.fileAway.test.FileawayThumbnailTest.testAutotext(FileawayThumbnailTest.java:51)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</p>","544297","","","","","2011-03-14 12:32:33","junit test with android","<android>","1","0","","",""
"4525844","1","4525895","","2010-12-24 10:46:55","0","432","<p>I have created SQLiteOpenHelper class to help me open write the database. but i am not able to invoke it from the main.java activity</p><p>I have created an Class which extends the Database Helper which is stored at</p><p>/Messaging/src/com/v3/messaging/DatabaseHelper.java</p><p>Code: <a href=""http://pastebin.com/Z5qp32xu"" rel=""nofollow"">http://pastebin.com/Z5qp32xu</a></p><p>now i have this class called Main.java which will be the first activity on the launch of the application. But how can i make the DatabaseHelper.java run just to create the database but still be at the Main.java file.</p><p>The database should be created with the tables only when the db or the tables dont exist.</p><p>Main.java code: <a href=""http://pastebin.com/LVFVuhA0"" rel=""nofollow"">http://pastebin.com/LVFVuhA0</a></p><p>Now when i run the program. the database is not being created :(</p><p>I am trying to learn Android. So please excuse me if i forgot to tell something.</p>","155196","","","","","2010-12-25 06:40:28","SQLiteOpenHelper problem","<android><sqlite><sqlite3>","2","0","0","",""
"4525865","1","4533208","","2010-12-24 10:49:58","14","6135","<p>I have an Android project in eclipse and would like to move to Intellij IDEA.But I didn't find easy way to import existing <strong>android</strong> project.General project import doesn't recognize that my project for Android.</p>","553237","","553237","","2010-12-24 11:15:30","2011-12-23 12:28:41","How do easily I import eclipse android project into Intellij IDEA 10","<android><intellij-idea>","1","0","1","",""
"4525887","1","4525963","","2010-12-24 10:53:35","0","397","<p>I have a problem. I have release application using A keystore, after that i found a bug and release the second version i sign  using the same A keystore.But when i upload my apk in android market, they reject it, with this warning:</p><p>Market does not accept apks signed with the debug certificate. Create a new certificate that is valid for at least 50 years.Market requires that the certificate used to sign the apk be valid until at least October 22, 2033. Create a new certificate.</p><p>What could be the problem?</p>","430926","","491044","","2011-03-11 12:55:45","2011-03-11 12:55:45","Android sign keystore","<android><google-play>","1","0","","",""
"4525973","1","","","2010-12-24 11:12:11","0","116","<p>hi i have using shared preference for saving user name and password ,but when my application crashes i lost  my data,i need to re login again(Only some crashes i lost the data  ),how can i solve this problem ? </p><p>SharedData.userInfo = PreferenceManager    .getDefaultSharedPreferences(ctx);  SharedData.userAdd = SharedData.userInfo.edit();  SharedData.userAdd.putString(""userEmailAddress"", uname);  SharedData.userAdd.putString(""userPassword"", upassword);  SharedData.userAdd.commit();</p>","487219","","487219","","2010-12-24 11:25:29","2010-12-24 11:28:51","Android shared prefrance","<android>","1","3","","",""
"4526038","1","","","2010-12-24 11:26:27","1","330","<p>As I m beginneers in Android OpenGl Es.I am working on 3D project,when I run project on G1 android phone, texture is rendering on Screen. But With Same code is  run on Samsang Galaxy, Texture has not been displayed. Screen is displayed Black. I don't understand what should do. plz tell me solution if anybody know.</p><p>I have This Egl configuration used.</p><pre><code>public int[] getConfigSpec() {    int[] configSpec =     {        EGL10.EGL_DEPTH_SIZE,16,        //EGL10.EGL_STENCIL_SIZE,0,        EGL10.EGL_RED_SIZE, 5,        EGL10.EGL_GREEN_SIZE, 6,        EGL10.EGL_BLUE_SIZE, 5,                    EGL10.EGL_NONE    };</code></pre><p>Then no ms3d Texture was dispalyed.Only blackscreen  was diaplayed. After  I modified code then to then texture was getting displayed in White.     public int[] getConfigSpec()     {        int[] configSpec =         {            EGL10.EGL_DEPTH_SIZE,16,            //EGL10.EGL_STENCIL_SIZE,0,            //EGL10.EGL_RED_SIZE, 5,            //EGL10.EGL_GREEN_SIZE, 6,            //EGL10.EGL_BLUE_SIZE, 5,            ,            EGL10.EGL_NONE</p><pre><code>    };</code></pre><p>public void sizeChanged(GL10 gl, int width, int height)     {        gl.glViewport(0, 0, width, height);</p><pre><code>    gl.glMatrixMode(GL10.GL_PROJECTION);                            gl.glLoadIdentity();    gl.glFrustumf( -0.1f,0.1f,-0.15f,0.15f,0.55f,1000.0f);            gl.glTranslatef(0.0f, 0.0f, -296);            gl.glMatrixMode(GL10.GL_MODELVIEW);                         // Select The Modelview Matrix    gl.glLoadIdentity();    }</code></pre><p>Can Anybody tell what need to be Changed. How to set getConfig for samsang Galaxy (480*800)</p><p>Thanking you.</p><p>pratibha</p>","553260","","553260","","2010-12-29 07:23:11","2010-12-29 07:23:11","Texture using ms3d not rendering on samsung galaxy","<android><opengl-es>","0","2","","",""
"4526093","1","","","2010-12-24 11:39:46","0","1121","<p>I am developing game in android. In my game i have SurfaceView(i.e., GameView) which is set on    setContentView(new GameView(this));.  During the runtime i have to add no of imageviews to the surface view.  Each ImageView should listen for TouchEvent.  and now How to add ImageViews to surfaceview?</p>","392339","","","","","2010-12-25 08:12:57","Adding ImageViews to SurfaceView","<android>","1","0","0","",""
"4526288","1","4527668","","2010-12-24 12:22:03","2","11624","<p>I have a listview with custom listadapter, which populates the listview with a checkbox and some textviews. When the user selects a checkbox, I need a button bar to slide into the view from the bottom of the screen and sit there. I have made the buttons-bar and can make it appear and disappear from screen by changing it's visibility to ""gone"" and ""visible"", but it does not do these with slide-in and slide-out effect. How do I make it do those animations??</p>","553267","","","","","2011-11-23 06:51:56","How to make a buttons bar slide in from bottom upon clicking checkbox in ListView?","<android><animation><slide>","2","1","1","",""
"4526320","1","4526626","","2010-12-24 12:29:57","1","1270","<p>Is there a way to exit ('continue;') a loop iteration after a certain timeout period?</p><p>I have a loop that will run gathering data from the web and then use this data to make a calculation.</p><p>The data become obsolete after about 1 to 2 seconds so if the loop iteration takes longer than 1 second then i want it to 'continue' to the next iteration.</p><p>Sometimes gathering the data can take time but sometimes the calculation can take longer than 1 second so a HTTP timeout won't work for what i need.Also, while doing the calculation the thread i am using is blocked so i cannot check System.currentTimeMillis();</p><p>Is there a way to use another Thread to check the time and force the original for loop to continue.</p>","381258","","","","","2010-12-24 15:48:49","Java - 'continue' loop iteration after certain timeout period","<java><android><for-loop>","4","0","2","",""
"4526411","1","4549193","","2010-12-24 12:49:23","0","2439","<p><br>  With Android-Emulator I am not able to write/create a file on the SD Card (for logging).<br> Here is what I have done so far<br>- Run mksdcard 8192K C:\android-dev\emu_sdcard\emu_logFile<br>- Create a new AVD, when assign emu_logFile to it so that when I view the AVD Details it says C:\android-dev\emu_sdcard\emu_logFile against the field ""SD Card""<br>- Here is the relevant code  </p><pre><code>public class ZLogger {     static PrintWriter zLogWriter = null;private static void Initialize() {    try {        File sdDir = Environment.getExternalStorageDirectory();        if (sdDir.canWrite()) {            :            File logFile = new File (sdDir, VERSION.RELEASE + ""_"" + "".log"");            FileWriter logFileWriter = new FileWriter(logFile);            zLogWriter = new PrintWriter(logFileWriter);            zLogWriter.write(""\n\n - "" + date + "" - \n"");                       }    } catch (IOException e) {        Log.e(""ZLogger"", ""Count not write to file: "" + e.getMessage());    }}</code></pre><p><strong>sdDir.canWrite</strong> returns false - please note it not the exception</p><p>from adb shell when I do ls I see sdcard as link to /mnt/sdcard. When I do ls -l /mnt here is what I see  </p><h1>ls -l /mnt</h1><p>ls -l /mnt<br>drwxr-xr-x root     system            2010-12-24 03:41 asec<br>drwx------ root     root              2010-12-24 03:41 secure<br>d--------- system   system            2010-12-24 03:41 sdcard  </p><p>whereas if I go to the directory where I created emu_sdcard - I see a lock has been issued, as shown here  </p><p>C:>dir android-dev\emu_sdcard<br> Volume in drive C is Preload<br> Volume Serial Number is A4F3-6C29  </p><p>Directory of C:\android-dev\emu_sdcard  </p><p>12/24/2010  03:41 AM                .<br>12/24/2010  03:41 AM              ..<br>12/24/2010  03:17 AM         8,388,608 emu_logFile<br>12/24/2010  03:41 AM              emu_logFile.lock<br>               1 File(s)      8,388,608 bytes<br>               3 Dir(s)  50,347,704,320 bytes free  </p><p>I have looked at these and other SO questions<br>Android Emulator sdcard push error: Read-only file system (2)<br>Not able to view SDCard folder in the FileExplorer of Android Eclipse  </p><p>I have added the following to AndroidManifest.xml<br>**uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""   **</p><p>Please let me know your thoughts - what am I missing here? Why does <strong>canWrite</strong> return false? What should I do to add permissions to sdcard? </p>","446006","","446006","","2010-12-24 12:54:47","2010-12-28 20:19:08","android logging sdcard","<android><logging><android-emulator><sd-card>","2","1","","",""
"4526562","1","4528365","","2010-12-24 13:19:13","3","1174","<p>I'm looking into possible means of efficiently creating an Android and iPhone targeted application from the same code base, be it in C/C++/C#/Objective-C or Java (using VMKit). </p><p>LLVM looks promising, however I'm slightly confused regarding compatibility issues surrounding the differing ARM CPU implementations, mainly from the aspect of how graphics and sound code are 'resolved' by underlying chipsets (i.e. do I have to code to specific ARM chipsets, or will a higher-level API, like OpenGL, suffice?).</p><p>I do know a little about various Cross Dev products (i.e. Airplay SDK, MoSync (GPL-GCC), Unity3d, XMLVM etc.), but what I'd really like to do is either write in Java or use a C/C++ engine, emit LLVM IR and create compatible ARM executables, if possible.</p><p>Apologies if any of the above is vague.</p><p>Thanks</p><p>Rich</p>","304330","","","","","2010-12-24 21:14:37","can LLVM IR (Intermediate Representation) be used to create cross-platform (iphone and Android) ARM executables?","<iphone><android><embedded><arm><llvm>","3","0","3","",""
"4526585","1","4529235","","2010-12-24 13:26:14","5","24546","<p>i had taken one imageview and set a drawable on it.Now i need to get id of drawable onclick event of imageview dynamicaly.How can i get it?anyone who already messes with it and have a solution pls help me.</p>","544537","","","","","2013-01-23 08:04:11","imageview drawable id in android","<android><imageview>","3","3","3","",""
"4526612","1","","","2010-12-24 13:33:10","12","2561","<p>I'm trying to encrypt image files on Android with password based encryption. To save the encrypted image I just do this:</p><pre><code>FileOutputStream fos = new FileOutputStream(thumbnailFile);CipherOutputStream cos = new CipherOutputStream(fos, encryptCipher);Bitmap thumbnail = Bitmap.createScaledBitmap(bm2, 140, 140, true);thumbnail.compress(Bitmap.CompressFormat.JPEG, 80, cos);</code></pre><p>and to read it, this:</p><pre><code>FileInputStream fis = new FileInputStream(f);CipherInputStream cis = new CipherInputStream(fis, decryptCipher);Bitmap b = BitmapFactory.decodeStream(cis);</code></pre><p>but the Bitmap ends up as null.  The code works when I bypass the encryption; that is when I use the File(Input|Output)Streams rather than the Cipher(Input|Output)streams.</p><p>My Ciphers are created as follows:</p><pre><code>public void initCiphers(char password[]) {PBEKeySpec pbeKeySpec;PBEParameterSpec pbeParamSpec;SecretKeyFactory keyFac;byte[] salt = {   (byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c,   (byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99};int count = 20;pbeParamSpec = new PBEParameterSpec(salt, count);          pbeKeySpec = new PBEKeySpec(password);try {    keyFac = SecretKeyFactory.getInstance(""PBEWithMD5AndDES"");    SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);    encryptCipher = Cipher.getInstance(""PBEWithMD5AndDES"");    decryptCipher = Cipher.getInstance(""PBEWithMD5AndDES"");        encryptCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec);    decryptCipher.init(Cipher.DECRYPT_MODE, pbeKey, pbeParamSpec);       } catch (Exception e) {     Log.v(""tag"", e.toString()); }</code></pre><p>I don't get any exceptions.</p><p>There is obviously some problem with using Cipher(Output|Input)Streams with the android functions for encoding and/or decoding images, but since those functions are opaque and there are no exceptions, its hard to know what it is. I suspect it has to do with padding or flushing. Any assistance would be gratefully appreciated.</p>","553338","","597607","","2011-09-07 19:19:59","2011-11-27 22:41:21","Encryption of image files on Android -- Cipher(Output|Input)Stream problems","<java><android>","2","2","4","",""
"4526615","1","","","2010-12-24 13:34:04","10","14059","<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>I have to detect current android os version at run time. how can i do this if any one know please help me.</p>","395627","","244296","","2010-12-24 13:51:23","2012-03-07 14:37:39","To get android os version at run time","<android>","0","1","0","2012-06-22 15:17:07",""
"4526813","1","4526845","","2010-12-24 14:24:42","1","1664","<p>I have an android app which I started write on sdk 2.2, but my android phone has the 1.5 version of the android.  I have to downgrade my app to 1.5 seamlessly.  I am not fully sure but I didn't use too many 2.2-specific features.  Can you tell me how to do it?</p>","155332","","82118","","2010-12-24 16:13:22","2010-12-24 18:46:49","How to downgrade my android app from 2.2 to 1.5 sdk seamlessly","<java><android><sdk>","3","1","","",""
"4526825","1","4527143","","2010-12-24 14:29:43","1","1032","<p>My android app have a layout like this when i open keyboard two imageview at the bottom of the page shows up over the keyboard , i couldnt see the problem why it goes upward with the keyboard can you help me about this ?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;LinearLayout        android:id=""@+id/searchLinear""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:background=""@color/upperbackground""&gt;           &lt;EditText            android:id=""@+id/searchBox""            android:layout_alignParentTop=""true""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:singleLine=""true""            android:layout_margin=""12dip""            android:paddingLeft=""35dip""            android:textSize=""15sp""            android:background=""@drawable/search_bar""/&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout            android:id=""@+id/searchButtons""            android:layout_below=""@id/searchLinear""            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:gravity=""center_vertical|center_horizontal""            android:background=""@color/upperbackground""&gt;            &lt;ImageView            android:id=""@+id/btnSukela""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:clickable=""true""            android:focusable=""true""            android:onClick=""sukelaClickEvent""            android:paddingRight=""8dip""            android:paddingBottom=""5dip""            android:src=""@drawable/sukela""/&gt;        &lt;ImageView            android:id=""@+id/btnSearch""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_toRightOf=""@+id/btnSukela""            android:clickable=""true""            android:focusable=""true""            android:onClick=""searchEntryClickEvent""            android:paddingLeft=""8dip""            android:paddingBottom=""5dip""            android:src=""@drawable/search""/&gt;    &lt;/LinearLayout&gt;    &lt;RelativeLayout        android:id=""@+id/bottomLinear""        android:layout_alignParentBottom=""true""        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""center_vertical|center_horizontal""        android:background=""@drawable/bottom_back""&gt;             &lt;ImageView              android:id=""@+id/btnToday""            android:src=""@drawable/today""            android:background=""@color/bottombackground""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_alignBottom=""@+id/bottomLinear""            android:layout_marginBottom=""19dip""            android:layout_centerVertical=""true""            android:clickable=""true""            android:focusable=""true""            android:onClick=""todayClickEvent""/&gt;         &lt;ImageView              android:id=""@+id/btnPopular""            android:src=""@drawable/popular""            android:background=""@color/bottombackground""            android:layout_toRightOf=""@+id/btnToday""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_centerVertical=""true""            android:clickable=""true""            android:focusable=""true""            android:onClick=""popularClickEvent""/&gt;    &lt;/RelativeLayout&gt;       &lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_below=""@+id/searchButtons""        android:layout_above=""@+id/bottomLinear""        android:background=""@color/background""&gt;        &lt;ListView            android:id=""@android:id/list""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","155332","","","","","2010-12-24 15:51:36","Part of my layout goes upward with keyboard","<java><android><android-layout>","1","1","1","",""
"4526830","1","","","2010-12-24 14:30:29","17","2619","<p>We want to establish TCP/IP connection between two android devices.For now we thought that it would be simpler if we make the connection device to device. So there is no server that is between the two phones.</p><p>Most of the time (if not always) one has no real IP address (NAT and so on). Is this a problem for creating a TCP socket?I didn't manage to find any exact information for this. Any advice and opinion will be highly appreciated.</p><p>Thanks</p>","553368","","","","","2011-05-20 18:07:02","How to make two android devices to communicate through TCP","<android><tcp><connection><nat>","5","1","5","",""
"4526866","1","4527636","","2010-12-24 14:39:07","0","125","<p>I'm interested in creating companion apps to several current Android apps and was curious if there is a legal issue with using their name and/or icons from the app. Like the companion app being called Angry Birds Companion or something and you were to use a picture of the level or one of the characters, etc (I'm simply pulling from thin air so don't judge the idea, just the question, please). I know there are Strategy guides to video games that use icons and names, but I'm assuming they have prior consent. Does anyone have any factual input on this?</p>","490642","","","","","2010-12-25 01:24:28","Legalities of programming companion Android apps","<android>","4","3","","",""
"4526931","1","4526947","","2010-12-24 14:57:56","0","492","<p>I have main activity which call other object, for example GPS class. This GPS class extends Activiy class. </p><p>snapshot main activity:</p><pre><code>public class MemoPosition extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        GPS GPSnode = new GPS();        if (!GPSnode.isGPSenabled()){            createGpsDisabledAlert();        }    }    private void createGpsDisabledAlert(){    }}</code></pre><p>snapshot GPS class:</p><pre><code>public class GPS extends Activity{    private Double latitude;    private Double longitude;    private LocationManager locationManager;    public void GPS(){        // Construction        String context = Context.LOCATION_SERVICE;        locationManager = (LocationManager)getSystemService(context);        if (isGPSenabled()){           // do something         }    }</code></pre><p>I've also put the GPS class to manifest as part of Activity apps.Running the code, and fatal error Force close.Logcat:</p><pre><code>12-24 22:51:32.270: ERROR/AndroidRuntime(5558): FATAL EXCEPTION: main12-24 22:51:32.270: ERROR/AndroidRuntime(5558): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dromdev.project.memoposition/com.dromdev.project.memoposition.MemoPosition}: java.lang.NullPointerException12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.os.Handler.dispatchMessage(Handler.java:99)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.os.Looper.loop(Looper.java:123)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at java.lang.reflect.Method.invokeNative(Native Method)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at java.lang.reflect.Method.invoke(Method.java:521)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at dalvik.system.NativeStart.main(Native Method)12-24 22:51:32.270: ERROR/AndroidRuntime(5558): Caused by: java.lang.NullPointerException12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at com.dromdev.project.memoposition.GPS.isGPSenabled(GPS.java:48)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at com.dromdev.project.memoposition.MemoPosition.onCreate(MemoPosition.java:23)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)12-24 22:51:32.270: ERROR/AndroidRuntime(5558):     ... 11 more</code></pre><p>I'm curious if class which inherit activity class couldn't be initialized as normal Activity. Should it be called by Intent ? I just need GPS class as object which responsible to GPS functionality, however it's required to extend Activity for some context. Please advice.</p>","436498","","244296","","2010-12-24 15:02:04","2010-12-24 15:02:04","Is it possible to initialize object which is extend to class Activity","<android>","1","0","","",""
"4526938","1","","","2010-12-24 14:59:37","1","1031","<p>In my application I have two separated APKs. The Activity (A1) from the first APK starts local service and is able to call methods provided by this Service. Later the activity A1 starts another activity (A2) from the second APK. The A2 activity tries to connect to the local service started by A1. Both activities are running in the same process with the same SharedUserID. Service interface is provided as shown in API examples of LocalService. onBind method of service returns LocalBinder instance which has method getService().When onServiceConnected of A2 is called I got ClassCastException when I try to cast from IBinder to MyService.LocalBinder.</p><p>In the debugger I can see that the service argument of onServiceConnected of A2 activity is the right instance of MyService.LocalBinder. I can even watch all attributes of MyService in debugger, but when I tries to cast the IBinder service to the MyService.LocalBinder I got the ClassCastException exception? Is there some way around or do I have to use AIDL?</p><pre><code>public void onServiceConnected(ComponentName className, IBinder service){  try  {       MyService.LocalBinder binder = (MyService.LocalBinder)service;       m_IService = binder.getService();  }  catch(ClassCastException e)  {  } }</code></pre>","553379","","71034","","2010-12-24 15:34:33","2010-12-26 16:39:51","ClassCastException when binding to local service from another Activity","<android><service><local><classcastexception>","1","0","","",""
"4526943","1","4527083","","2010-12-24 15:00:39","0","852","<p>I want to create an application that runs everytime a song is played, say, a notification saying the title of the song and the corresponding artist. A similar application exists - Lyrics App. It gets the lyrics of the song currently played. So, this means, what I wanted to happen is possible.</p><p>The question is, How? How do I access the current instance of media player.. I need to do this to integrate my listeners to it.</p><p>Thanks :)</p>","552899","","","","","2010-12-24 15:39:50","Android How do I get a reference to a current instance of media player?","<android>","1","0","","",""
"4527136","1","4527602","","2010-12-24 15:48:43","14","3646","<p>Is there any Eclipse plugin that takes strings from code and puts them in strings.xml? I found ""Externalize strings"" function in Eclipse, but I don't know how to get it to work with strings.xml.</p>","238123","","","","","2013-07-26 08:15:01","Externalize strings for Android project","<android><eclipse><eclipse-plugin>","3","1","5","",""
"4527159","1","4527171","","2010-12-24 15:57:08","3","731","<p>I'm working with the Android tutorial and I just got to the debugging section and I'm wondering what the purpose of a Breakpoint is.  I can't tell just yet... is it actually stopping the app so I can be sure it runs up until that point, or can I set multiple breakpoints and use them as markers to ""stop and go"" from breakpoint to breakpoint checking my code?</p>","197606","","203907","","2010-12-24 16:04:44","2010-12-24 16:14:51","Eclipse java breakpoints - What is the purpose?","<java><android><eclipse><debugging>","2","0","1","",""
"4527191","1","","","2010-12-24 16:03:32","0","132","<p>Just like the ""Angry Bird"", the apps is up to 10MB when downloaded form marketAfter installation, the apps will only remain around 1.92MB (Seen form Setting --> Applications --> Manage Application) </p><p>Why they can do that? My apps have many picture, it makes the file very large, I want all picture auto move to SDcard when install the apps.</p><p>Many Thanks!</p>","553415","","","","","2010-12-24 16:11:00","Can move the image to SDcard when install the android apps?","<android><app2sd>","1","0","","",""
"4527390","1","4528200","","2010-12-24 16:51:09","1","358","<p>I'm not sure this is the exact cause of my problem but I'll explain the 2 symptoms I noticed:</p><ol><li>If I put a break point on a Toast.makeText(..).show(), step over, then wait a few seconds before running, the toast will never appear.</li><li>I have a location callback that tries to show a toast, but it never appears. Maybe I'm doing something else wrong, this is the line in question <a href=""http://code.google.com/p/emergencybutton/source/browse/trunk/src/com/emergency/button/Emergency.java?r=7#48"" rel=""nofollow"" title=""the line in question"">in my open source distress signal app</a>.</li></ol><p>Any help or pointers would be appreciated,</p><p>--uber</p>","177498","","","","","2010-12-24 20:25:14","Why do toast notifications die if delayed?","<android><eclipse>","2","2","","",""
"4527414","1","4527556","","2010-12-24 16:56:54","51","63035","<p>I am trying to add the add SDK Platform 1.6 to an existing Install of 2.2, with the help of <a href=""http://stackoverflow.com/questions/4490726/how-to-install-old-sdk-platform"">this thread</a>.</p><p>As suggested, I ran <kbd>Help</kbd> ? <kbd>Check for Updates</kbd> which found and installed the following:</p><pre><code>  + Android DDMS              8.0.1.v201012062107-82219  + Android Development Tools 8.0.1.v201012062107-82219</code></pre><p>It prompted for restarting Eclipse and when it restarted it gave me the following error message:</p><pre><code>""SDK Platform Tools component is missing!Please use the SDK Manager to install it.""</code></pre><p>Huh? Why? I still have the SDK Platform Tools on C:\android-sdk-windows that was working perfectly before I did this ""upgrade"".</p><p>What do I need to have both 2.2 and 1.6 supported in my development environment?</p>","418055","","944657","","2012-12-28 07:57:09","2013-06-22 21:42:45","Huh? ""SDK Platform Tools component is missing!""","<android><eclipse><sdk><eclipse-plugin><adt>","6","2","11","",""
"4527430","1","4528006","","2010-12-24 17:00:30","0","823","<p>Here is my goal. I am designing a server that will spit out data every second. I need to also design a client (on android) that will connect to that server and gather the data that is being sent by the server. I have already wrote up some code for this in java and for the android. However, my experience with java and android is very minimal. I have been having a lot of difficulty with this but have started making progress. <strong>I was wondering if everyone could take a look at my code and give some tips on how to best perform this design.</strong></p><p>The server will just be constantly spitting out data and the client will connect to the server and then start gathering the data that is being sent.</p><p>The data that is being sent is not important. Right now it will just be something random for testing.</p><p>Thanks in advance!</p><pre><code>THE JAVA SERVERimport java.io.IOException;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.net.ServerSocket;import java.net.Socket;public class SmartServerSocket {    private ServerSocket server;    private int port = 7777;    public SmartServerSocket() {        try {            server = new ServerSocket(port);        } catch (IOException e) {            e.printStackTrace();        }    }    public static void main(String[] args) {        SmartServerSocket smart = new SmartServerSocket();        smart.handleConnection();    }    public void handleConnection() {        // TODO Auto-generated method stub        System.out.println(""Waiting for client message..."");        while (true) {            try {                Socket socket = server.accept();                new ConnectionHandler(socket);            } catch (IOException e) {                e.printStackTrace();            }        }    }}class ConnectionHandler implements Runnable {    private Socket socket;    public ConnectionHandler(Socket socket) {        this.socket = socket;        Thread t = new Thread(this);        t.start();    }    public void run() {        ObjectOutputStream oos = null;        int test = 0;        try {            while(true)            {                oos = new ObjectOutputStream(socket.getOutputStream());                oos.writeObject(Integer.toString(test));                test++;                System.out.println(""Waiting for client message..."");            }         } catch (IOException e) {                e.printStackTrace();        } finally {            try {                    oos.close();                    socket.close();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        }    }THE ANDROID CLIENTimport java.io.IOException;import java.io.ObjectInputStream;import java.net.InetAddress;import java.net.Socket;import java.net.UnknownHostException;//import android.app.Activity;public class ConnectDevice implements Runnable {    public void run(){        try {            System.out.println(""test1"");            //InetAddress host = InetAddress.getLocalHost();            InetAddress host = InetAddress.getByName(""THEIPADDRESS"");            Socket socket = new Socket(host.getHostName(), 7777);            System.out.println(""test2"");            ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());            System.out.println(""test3"");            String message = (String) ois.readObject();            System.out.println(""test4"");                System.out.println(""Message: "" + message);            ois.close();        } catch (UnknownHostException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        } catch (ClassNotFoundException e) {            e.printStackTrace();        }    }}</code></pre>","427763","","","","","2010-12-24 19:24:49","android/java sockets help","<java><android><sockets>","1","0","","",""
"4527607","1","","","2010-12-24 17:44:55","4","16602","<p>I just started playing around with android development, and already with just an attempt at making a button, I have encountered a problem.The error I'm given in the following code is right on ""R.id.button1"".It says id cannot be resolved or is not a field.Do I need to manually reference every single object I make in the layout xml file? I found that this did work, but it does seem to be a bit much for every button I want to make...</p><pre><code>package com.example.helloandroid;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class HelloAndroid extends Activity {    /** Called when the activity is first created. */ private Button button1;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button1 = (Button)findViewById(R.id.button1);        button1.setOnClickListener(new OnClickListener()        {         public void onClick(View v)         {          finish();                   }                });    }}</code></pre>","553475","","","","","2013-09-19 00:30:16","eclipse error with android: id cannot be resolved or is not a field","<android><eclipse>","8","0","","",""
"4527616","1","4527644","","2010-12-24 17:47:49","4","11490","<p>I'm diving into Java (this is day 1) and I'm trying to create a button that will trigger a notification when I click it...</p><p>This code is based off of the notification documentation <a href=""http://developer.android.com/guide/topics/ui/notifiers/notifications.html"" rel=""nofollow"">here</a>, and UI events documentation <a href=""http://developer.android.com/guide/topics/ui/ui-events.html"" rel=""nofollow"">here</a></p><pre><code>package com.example.contactwidget;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.widget.Button;public class ContactWidget extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Button calc1 = (Button) findViewById(R.id.calc_button_1);        calc1.setOnClickListener(buttonListener);        setContentView(R.layout.main);    }    private static final int HELLO_ID = 1;    //Error: OnClickListener cannot be resolved to a type    private OnClickListener buttonListener = new OnClickListener() {        public void onClick (View v) {            String ns = Context.NOTIFICATION_SERVICE;            NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);            int icon = R.drawable.icon;            CharSequence ticketBrief = ""Button Pressed Brief"";            CharSequence ticketTitle = ""Button pressed"";            CharSequence ticketText = ""You pressed button 1"";            long when = System.currentTimeMillis();            Notification notification = new Notification(icon, ticketBrief, when);            Intent notificationIntent = new Intent(this, ContactWidget.class);            PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);            notification.setLatestEventInfo(getApplicationContext(), ticketTitle, ticketText, contentIntent);            mNotificationManager.notify(HELLO_ID, notification);        }    }}</code></pre><p>I'm running into a problem: <code>OnClickListener cannot be resolved to a type</code>.  The problem here is that I don't see any problems with my code in relation to the example I'm using</p>","197606","","197606","","2010-12-24 17:53:45","2013-08-30 06:17:48","OnClickListener cannot be resolved to a type","<java><android>","2","2","","",""
"4527623","1","","","2010-12-24 17:49:02","2","475","<p>I have a two ImageView.</p><p>1.ImageView zomeImageMoveable : should zome in,out and moveable. 2.ImageView zomeImageFixed : show zome this is guide line.</p><p>i want this two views work same touch.</p><pre><code>{FrameLayout myFrmae = new FrameLayout(this.getContext()); myFrame.addView(zomeImageMoveable); myFrame.addView(zomeImageFixed);}</code></pre><p>Case 1. below two ImageView have each listener ,but works only one.</p><p>Case 2. FrameLayout add OnTouchListener and forward. but it doesn't work</p><pre><code> myFrame.setOnTouchListener(new OnTouchListener() {  @Override  public boolean onTouch(View v, MotionEvent event) {   zomeImageMoveable.onTouchEvent(event);   zomeImageFixed.onTouchEvent(event);   return false;  } });</code></pre><p>how do i have to do?</p>","553465","","244296","","2010-12-24 18:02:50","2010-12-24 18:02:50","two views ontouchlistener same area how to?","<android><imageview><ontouchlistener>","0","0","","",""
"4527695","1","4528043","","2010-12-24 18:07:16","10","7250","<p>Im trying to find out the max texture size for the original motorola droid. I believe the G1 has a max texture size of 512, but it would be nice if there was a more official way i could find out so i can build a proper tile system. Thank you.</p>","385051","","","","","2010-12-27 18:12:26","how an i find the maximum texture size for different phones?","<android><opengl-es><textures><renderer>","2","0","3","",""
"4527698","1","4527707","","2010-12-24 18:08:58","9","15475","<p>I have the content module loaded, the specific error I'm getting is: <code>The constructor Intent(new View.OnClickListener(){}, Class&lt;ContactWidget&gt;) is undefined</code></p><p>Any ideas on this?  I got this from the tutorial here: <a href=""http://developer.android.com/guide/topics/ui/notifiers/notifications.html"">http://developer.android.com/guide/topics/ui/notifiers/notifications.html</a></p><pre><code>package com.example.contactwidget;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class ContactWidget extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Button calc1 = (Button) findViewById(R.id.calc_button_1);        calc1.setOnClickListener(buttonListener);        setContentView(R.layout.main);    }    private static final int HELLO_ID = 1;    private OnClickListener buttonListener = new OnClickListener() {        public void onClick (View v) {            String ns = Context.NOTIFICATION_SERVICE;            NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);            int icon = R.drawable.icon;            CharSequence ticketBrief = ""Button Pressed Brief"";            CharSequence ticketTitle = ""Button pressed"";            CharSequence ticketText = ""You pressed button 1"";            long when = System.currentTimeMillis();            Notification notification = new Notification(icon, ticketBrief, when);            Intent notificationIntent = new Intent(this, ContactWidget.class);            PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);            notification.setLatestEventInfo(getApplicationContext(), ticketTitle, ticketText, contentIntent);            mNotificationManager.notify(HELLO_ID, notification);        }    };}</code></pre>","197606","","","","","2012-10-30 13:51:12","The constructor Intent is undefined","<java><android>","3","0","4","",""
"4527717","1","4527734","","2010-12-24 18:11:39","0","156","<p>In the code....</p><pre><code>NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);</code></pre><p>is it actually necessary to define the data type twice?</p>","197606","","","","","2010-12-25 00:37:53","Is it necessary to double define data type?","<java><android>","4","3","","",""
"4527749","1","4527763","","2010-12-24 18:20:12","0","396","<p>I have a listview that uses a customadapter based on the baseadapter. The listview populates ok using external data and I can pick up the click events and know which item has been selected. </p><p>I'm having a problem updating the clicked item's views, like TextView and ViewFlipper.</p><p>Do I have to update something via the listview or is it via the adapter. I've tried things like the following;</p><pre><code>View test = (View)adapter.getView(pos, null, myListView);ViewFlipper temp = (ViewFlipper)test.findViewById(R.id.flipholder);temp.showNext();TextView temp2 = (TextView)test.findViewById(R.id.filmtitle);temp2.setText(""Hello World"");</code></pre><p>Which results in the viewfliper flipping the first and third item or second and fourth and the text not updating at all.</p><p>Any ideas?</p><p>Cheers</p>","553462","","","","","2010-12-24 18:23:55","Update Custom ListView Item","<java><android>","1","0","1","",""
"4527768","1","4527792","","2010-12-24 18:24:00","0","72","<p>I just tried to test my first android app using the emulator, it crashed (as expected).  So I load the debug view in Eclipse and now I'm not really sure what I'm looking for...</p><p>I see a tab that within the first thread I see a bunch of executions (i guess that's the right word) and they say: <code>Source not found.</code> and has a button that reads <code>Edit Source Lookup Path...</code></p><p>Is there something wrong with my setup here?</p>","197606","","","","","2010-12-24 18:30:21","Testing my Java/Android app - is my setup wrong?","<java><android><eclipse><debugging>","1","0","","",""
"4527782","1","4527889","","2010-12-24 18:28:30","0","610","<p>I'm using SAX parser in my Android application to read a few feeds a time. The script is executed as follows.</p><pre><code>                     // Begin FeedLezer                    try {                        /** Handling XML **/                        SAXParserFactory spf = SAXParserFactory.newInstance();                        SAXParser sp = spf.newSAXParser();                        XMLReader xr = sp.getXMLReader();                        /** Send URL to parse XML Tags **/                        URL sourceUrl = new URL(                            BronFeeds[i]);                        /** Create handler to handle XML Tags ( extends DefaultHandler ) **/                        Feed_XMLHandler myXMLHandler = new Feed_XMLHandler();                        xr.setContentHandler(myXMLHandler);                        xr.parse(new InputSource(sourceUrl.openStream()));                    } catch (Exception e) {                        System.out.println(""XML Pasing Excpetion = "" + e);                    }                     sitesList = Feed_XMLHandler.sitesList;                    String titels = sitesList.getMergedTitles();</code></pre><p>And here are <a href=""http://pastebin.com/PMFdQTB1"" rel=""nofollow"">Feed_XMLHandler.java</a> and <a href=""http://pastebin.com/kAtHkPGh"" rel=""nofollow"">Feed_XMLList.java</a>, which I basically both just took from the web.</p><p>However, this code fails at times. I'll show some examples.</p><p><a href=""http://imm.io/media/2I/2IAs.jpg"" rel=""nofollow"">http://imm.io/media/2I/2IAs.jpg</a>It goes very well here. It even recognizes and displays apostrophes. Even when clicking the articles open, almost all of the text shows, so that's all good. The source feed is here. I can't control the feed. </p><p><a href=""http://imm.io/media/2I/2IB1.jpg"" rel=""nofollow"">http://imm.io/media/2I/2IB1.jpg</a> Here, it doesn't go so well. It does display the ï, but it chokes on the apostrophe (there's supposed to be 'NORAD' after the Waarom). <a href=""http://www.nrc.nl/rss.php"" rel=""nofollow"">Here</a></p><p><a href=""http://imm.io/media/2I/2IBQ.jpg"" rel=""nofollow"">http://imm.io/media/2I/2IBQ.jpg</a> This is the worst one. As you can see, the title only displays an apostrophe, whilst it is supposed to be a 'blablabla'. Also, the text ends in the middle of the line, without any special characters in the quote. <a href=""http://www.fd.nl/home/?view=RSS"" rel=""nofollow"">The feed is here</a></p><p>In all cases, I have no control over the feed. I think the script does choke on special characters. How can I make sure SAX fetches all the strings correctly?</p><p>If anyone knows an answer to this, you really help me out a LOT :D</p><p>Thanks in advance.</p>","484475","","","","","2010-12-25 15:36:57","Why does SaxParser fail at random?","<java><android><special-characters><saxparser>","1","0","1","",""
"4527866","1","4529421","","2010-12-24 18:48:52","0","781","<p>I need to find contact which saved in my Android phone, But save numbers are repeated in SIM and Google contact, Then That are returning before return Phone contact. </p><p>Is there any way to query phone contacts only?</p><p>Thank You.  </p>","377438","","","","","2010-12-25 05:38:00","Android Contact Search only phone book","<android>","1","0","","",""
"4527903","1","4534770","","2010-12-24 18:58:38","1","1200","<p>This one is really weird. I had a perfectly working Eclipse + Android 2.2 SDK working in <strong>both</strong> Administrator account <em>and</em> LUA (Limited User Account) under Windows XP.</p><p>Then I decided to add the Android 1.6 SDK (I could do it from an Administrator account only). It seemed to have gone well, since it still works perfectly -- but only in that Administrator account!</p><p>When I try to start Eclipse under a LUA, I receive the following error message box:</p><p><img src=""http://i.stack.imgur.com/CkLHH.png"" alt=""alt text""></p><p>Which disappears within 2-3 seconds and replaced with:</p><p><img src=""http://i.stack.imgur.com/h7Ge5.png"" alt=""alt text""></p><p>I then tried to check the Preferences page, but again, all I receive is error messages:</p><p><img src=""http://i.stack.imgur.com/KdQc3.png"" alt=""alt text""></p><p>and:</p><p><img src=""http://i.stack.imgur.com/kMpjZ.png"" alt=""alt text""></p><p>Any idea why this is happening and how to fix this?</p><p>(I would love to be able to continue working from a LUA)</p><p><strong>Update</strong>: I have uploaded the <a href=""https://doc-0s-68-docs.googleusercontent.com/docs/securesc/va467pin5j2onoki8telv4ohu2s1fe4h/uqs3cd2dk1k456db6c9aggo9v9ilnf3q/1318187700000/14031223452686937345/11871178236052463999/0B9-S3uwjca3jMzM0ZGJiYWMtMGUxNi00Yjc2LWJmNzUtYTQxNDZlNzI2ZWEx?authkey=COWwsLQD&amp;e=download&amp;nonce=vkuub5ko0se9a&amp;user=11871178236052463999&amp;hash=a7qm4urv202gqefvdunlvaaj154rh8b3"" rel=""nofollow"">error log file</a> (referred to in the ""Show Error Log"" in the message boxes), for your expert examination. Hopefully this can shed some light on the mystery.</p>","418055","","540162","","2011-10-09 19:26:46","2011-10-09 19:26:46","Huh? Android Preferences page refuses to load after adding SDK 1.6","<android><windows><sdk><android-sdk-1.6><limited-user>","3","2","0","",""
"4528014","1","4528378","","2010-12-24 19:27:05","1","8922","<p>When I comment out <code>calc1.setOnClickListener(buttonListener);</code> this runs fine, when I allow it to run, it crashes my script.  How can I figure out what's going on?  Logcat shows a bunch of red, but I'm not sure how to read it...</p><pre><code>package com.example.contactwidget;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class ContactWidget extends Activity {    private static final int HELLO_ID = 1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Button calc1 = (Button) findViewById(R.id.calc_button_1);        OnClickListener buttonListener = new View.OnClickListener() {          public void onClick(View v) {          }        };        calc1.setOnClickListener(buttonListener);        setContentView(R.layout.main);    }}</code></pre><p><strong>update</strong></p><p>Stack trace...</p><pre><code>E/AndroidRuntime(  339): FATAL EXCEPTION: mainE/AndroidRuntime(  339): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.contactwidget/com.example.contactwidget.ContactWidget}: java.lang.NullPointerExceptionE/AndroidRuntime(  339):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime(  339):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime(  339):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime(  339):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime(  339):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  339):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  339):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  339):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  339):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  339):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  339):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  339):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  339): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  339):    at com.example.contactwidget.ContactWidget.onCreate(ContactWidget.java:41)E/AndroidRuntime(  339):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  339):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)E/AndroidRuntime(  339):    ... 11 more</code></pre>","197606","","197606","","2010-12-24 20:44:39","2010-12-24 23:01:36","How to debug Android/Java in Eclipse","<android><eclipse><debugging>","3","2","1","",""
"4528018","1","4528497","","2010-12-24 19:27:46","0","204","<p>i have this two button.as i press the first it plays an mp3 file.but if i press the second and the first mp3 hasnt finished yet,they play both together.how could i fix it??this is  my btn code!!thanks</p><pre><code>Button button = (Button) findViewById(R.id.btn);          button.setOnClickListener(new View.OnClickListener() {             public void onClick(View v){            MediaPlayer mp = MediaPlayer.create(this, R.raw.myalo);              mp.start();             Toast.makeText(this, ""Eisai sto myalo"", Toast.LENGTH_SHORT).show();           }             });               Button button2 = (Button) findViewById(R.id.btn2);          button2.setOnClickListener(new View.OnClickListener() {             public void onClick(View v){            MediaPlayer mp = MediaPlayer.create(this, R.raw.thryleole);              mp.start();             Toast.makeText(this, ""thryle ole trelenomai"", Toast.LENGTH_SHORT).show();           }</code></pre>","519526","","519526","","2011-07-03 23:18:34","2011-07-03 23:18:34","onstop() for mp3 files","<android>","2","0","","",""
"4528044","1","4528739","","2010-12-24 19:35:57","1","540","<p>Hey, I'm trying to implement a ListView on Android, which will print the data retrieved from the SQLite Database. So I want to retrieve a lot of columns from the table and add this to a list, so I will print this list as a ListView.</p><p>For this I created a method that will select all the columns from the table in a separate class, and I will print the ListView in a ListActivity.</p><p>I want to retrieve 6 columns of the table, which is represented by the ids 2, 4, 5, 6, 7, 9.</p><p>But it shows a lot of errors:</p><pre><code>12-24 19:19:04.066: ERROR/AndroidRuntime(22630): FATAL EXCEPTION: main12-24 19:19:04.066: ERROR/AndroidRuntime(22630): java.lang.NullPointerException12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.AbsListView.obtainView(AbsListView.java:1418)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.ListView.makeAndAddView(ListView.java:1745)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.ListView.fillDown(ListView.java:670)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.ListView.fillFromTop(ListView.java:727)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.ListView.layoutChildren(ListView.java:1598)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.AbsListView.onLayout(AbsListView.java:1248)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.widget.FrameLayout.onLayout(FrameLayout.java:338)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.View.layout(View.java:7175)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1140)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.os.Handler.dispatchMessage(Handler.java:99)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.os.Looper.loop(Looper.java:123)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at android.app.ActivityThread.main(ActivityThread.java:3647)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at java.lang.reflect.Method.invokeNative(Native Method)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at java.lang.reflect.Method.invoke(Method.java:507)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)12-24 19:19:04.066: ERROR/AndroidRuntime(22630):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Here is the code of the method that select the data.</p><pre><code>public List&lt;String&gt; selectAll() {    List&lt;String&gt; list1 = new ArrayList&lt;String&gt;();    List&lt;String&gt; list2 = new ArrayList&lt;String&gt;();    List&lt;String&gt; list3 = new ArrayList&lt;String&gt;();    List&lt;String&gt; list4 = new ArrayList&lt;String&gt;();    List&lt;String&gt; list5 = new ArrayList&lt;String&gt;();    List&lt;String&gt; list6 = new ArrayList&lt;String&gt;();    Cursor cursor = this.db.query(TABLE_NAME, null, null, null, null, null,            ""duration desc"");    if (cursor.moveToFirst()) {        do {            list1.add(cursor.getString(2));            list2.add(cursor.getString(4));            list3.add(cursor.getString(5));            list4.add(cursor.getString(6));            list5.add(cursor.getString(7));            list6.add(cursor.getString(9));            list1.addAll(list2);            list1.addAll(list3);            list1.addAll(list4);            list1.addAll(list5);            list1.addAll(list6);        } while (cursor.moveToNext());        Log.i(TAG, ""After cursor.moveToNext()"");    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    Log.i(TAG, ""Before selectAll returnment"");    return list1;}</code></pre><p>And here is the code of the ListActivity class:</p><pre><code>public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RatedCallsActivity"";private CallDataHelper cdh;StringBuilder sb = new StringBuilder();OpenHelper openHelper = new OpenHelper(RatedCalls.this);@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Log.i(LOG_TAG, ""calling from onCreate()"");    cdh = new CallDataHelper(this);    Log.i(LOG_TAG, ""---&gt;&gt;&gt; before calling the service"");    startService(new Intent(this, RatedCallsService.class));    Log.i(LOG_TAG, ""Service called."");    Log.i(LOG_TAG, ""---&gt;&gt;&gt; after calling the service"");    fillList();}public void fillList() {    List&lt;String&gt; ratedCalls = this.cdh.selectAll();    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listitem,            ratedCalls));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            // When clicked, show a toast with the TextView text            Toast.makeText(getApplicationContext(),                    ((TextView) view).getText(), Toast.LENGTH_SHORT).show();        }    });}    }</code></pre>","399459","","135152","","2011-07-05 17:50:48","2011-09-14 05:20:47","JavaNullPointerException/Layout Error when working with lists and ListView on Android","<android><sqlite><android-layout><android-widget>","4","0","","",""
"4528493","1","4637935","","2010-12-24 21:57:22","2","1298","<p>When I eclipse, I get a whole bunch of error messages on the log about a missing ""Bundle file URL"". Nothing is obviously broken as far as I can tell, but dozens of error messages in the log everytime I open up an Android project seems like it could indicate a problem.</p><p>The messages seem to be triggered when I open a layout XML file.  </p><pre><code>!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.600!MESSAGE Bundle file URL not found at path '/gscripts/IViewRule.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.618!MESSAGE Bundle file URL not found at path '/gscripts/String.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.624!MESSAGE Bundle file URL not found at path '/gscripts/Map.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.639!MESSAGE Bundle file URL not found at path '/gscripts/INode.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.642!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.645!MESSAGE Bundle file URL not found at path '/gscripts/List.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.659!MESSAGE Bundle file URL not found at path '/gscripts/IMenuCallback.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.662!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.Action.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.679!MESSAGE Bundle file URL not found at path '/gscripts/Boolean.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.682!MESSAGE Bundle file URL not found at path '/gscripts/INodeHandler.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.686!MESSAGE Bundle file URL not found at path '/gscripts/Set.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.702!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.Choices.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.719!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.Group.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.725!MESSAGE Bundle file URL not found at path '/gscripts/IAttributeInfo.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.746!MESSAGE Bundle file URL not found at path '/gscripts/IGraphics.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.760!MESSAGE Bundle file URL not found at path '/gscripts/Rect.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.762!MESSAGE Bundle file URL not found at path '/gscripts/DrawingStyle.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.767!MESSAGE Bundle file URL not found at path '/gscripts/IDragElement.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.780!MESSAGE Bundle file URL not found at path '/gscripts/DropFeedback.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.784!MESSAGE Bundle file URL not found at path '/gscripts/Point.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:17.814!MESSAGE Bundle file URL not found at path '/gscripts/_rules_engine.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:18.083!MESSAGE Bundle file URL not found at path '/gscripts/ANDROID_URI.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:18.101!MESSAGE Bundle file URL not found at path '/gscripts/ATTR_ID.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:18.125!MESSAGE Bundle file URL not found at path '/gscripts/Closure.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:18.143!MESSAGE Bundle file URL not found at path '/gscripts/ATTR_TEXT.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:18.565!MESSAGE Bundle file URL not found at path '/gscripts/AndroidViewViewRuleBeanInfo.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 19:52:18.567!MESSAGE Bundle file URL not found at path '/gscripts/BaseViewBeanInfo.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.518!MESSAGE Bundle file URL not found at path '/gscripts/INode.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.520!MESSAGE Bundle file URL not found at path '/gscripts/IDragElement.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.522!MESSAGE Bundle file URL not found at path '/gscripts/DropFeedback.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.562!MESSAGE Bundle file URL not found at path '/gscripts/AndroidWidgetTimePickerRuleBeanInfo.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.564!MESSAGE Bundle file URL not found at path '/gscripts/IgnoredLayoutRuleBeanInfo.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.566!MESSAGE Bundle file URL not found at path '/gscripts/BaseLayoutBeanInfo.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.830!MESSAGE Bundle file URL not found at path '/gscripts/String.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.833!MESSAGE Bundle file URL not found at path '/gscripts/INode.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.835!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.837!MESSAGE Bundle file URL not found at path '/gscripts/List.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.840!MESSAGE Bundle file URL not found at path '/gscripts/ANDROID_URI.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.854!MESSAGE Bundle file URL not found at path '/gscripts/IMenuCallback.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.856!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.Action.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.860!MESSAGE Bundle file URL not found at path '/gscripts/Boolean.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.863!MESSAGE Bundle file URL not found at path '/gscripts/INodeHandler.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.866!MESSAGE Bundle file URL not found at path '/gscripts/MenuAction.Choices.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.871!MESSAGE Bundle file URL not found at path '/gscripts/IDragElement.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.873!MESSAGE Bundle file URL not found at path '/gscripts/DropFeedback.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.877!MESSAGE Bundle file URL not found at path '/gscripts/IFeedbackPainter.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.880!MESSAGE Bundle file URL not found at path '/gscripts/IGraphics.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.882!MESSAGE Bundle file URL not found at path '/gscripts/Rect.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.884!MESSAGE Bundle file URL not found at path '/gscripts/DrawingStyle.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.892!MESSAGE Bundle file URL not found at path '/gscripts/Point.groovy'!    ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:45.894!MESSAGE Bundle file URL not found at path '/gscripts/Integer.groovy'!ENTRY com.android.ide.eclipse.adt 1 0 2010-12-24 20:39:46.023!MESSAGE Bundle file URL not found at path '/gscripts/AndroidWidgetLinearLayoutRuleBeanInfo.groovy'</code></pre><p></p>","468495","","468495","","2010-12-24 23:12:32","2011-01-09 06:11:03","Error messages in Eclipse with the Android Plugin","<android><eclipse><adt>","3","0","","",""
"4528688","1","4529209","","2010-12-24 23:23:23","2","398","<p>I have a project and I'm curious what the community would recommend as the best approach to implementing it.</p><p>Process:On an android device allow the user to assemble an image composite that includes a background, some clip art (positioned and/or rotated/sized by the user), maybe a photo, and some text.</p><p>do some stuff...</p><p>print the image on the server.</p><p>The only mandatory requirement is that the server HAS to be a PC Laptop machine, though I can replace Windows with linux, if I need to (don't ask).</p><p>Should I go down the road of attempting to construct a finished JPG right on the Android device and delivering that to the server for printing? If so, what Java image library is best for such a task?Or should I try to implement imagemagik on the server (is that even possible if I kept the Windows that's pre-installed on it?) or some other image automation? </p><p>I could build this as an Adobe AIR app and run it on Android, but am worried about the 100% portability of Air onto Android and don't have the time to get stuck 1/2 way into something that involved only to have to start from scratch with a totally different approach. </p><p>All ideas welcome.</p>","59947","","","","","2010-12-25 03:34:43","Architectural conundrum between Android, the server and image creation","<android><imagemagick>","1","0","","",""
"4528824","1","7732267","","2010-12-25 00:14:32","2","3163","<p>So in my onUpdate method in my AppWidgetProvider class, I ended up executing a non-trivial amount of code so that I can completely recreate a new RemoteViews object. The reality is I really only need to be setting the text in one of the textviews in the RemoteViews each time I update. Is there anyway to just modify the RemoteViews that a particular widget is already using?</p><p>-Kurtis</p>","527288","","","","","2013-08-28 13:20:23","Just update a widget RemoteViews instead of completly creating a new one?","<android><android-widget><onupdate>","3","0","3","",""
"4528900","1","7774352","","2010-12-25 00:55:18","12","3691","<p>Reading from <a href=""http://developer.android.com/guide/topics/wireless/bluetooth.html"">http://developer.android.com/guide/topics/wireless/bluetooth.html</a>, </p><blockquote>  <p>The current Android Bluetooth API's require devices to be paired before an RFCOMM connection can be established. (Pairing is automatically performed when you initiate an encrypted  connection with the Bluetooth APIs.)</p></blockquote><p>However, to my knowledge, the Bluetooth protocol allows <a href=""http://en.wikipedia.org/wiki/VCard"">.vcf (vCard)</a> files to be sent without having paired two devices. This is what makes <a href=""http://en.wikipedia.org/wiki/Bluejacking"">Bluejacking</a> possible on older phones like Sony Ericsson k7** series, Nokia 63** series etc.</p><p>In the interests of writing an android bluejacking application I would like to be able to send vCard files from Android without having to first pair with the device. Does anyone know if this is possible?</p>","885287","","","","","2013-01-18 16:13:44","Android Bluetooth Bluejacking Possible?","<android><bluetooth><vcard>","2","2","","",""
"4528976","1","4535633","","2010-12-25 01:31:23","3","2402","<p>I'm trying to extend Spinner Android class in my code to implement a new function, but for some reason this didn't work.</p><p>This is the extended class:</p><pre><code>import android.content.Context;import android.widget.AdapterView;import android.widget.Spinner;public class CustomSpinner extends Spinner {    public CustomSpinner(Context context) {        super(context);    }    public void setSelectionByItemId(AdapterView&lt;?&gt; parent, long id){        for (int i = 0; i &lt; parent.getCount(); i++) {                          long itemIdAtPosition = parent.getItemIdAtPosition(i);            if (itemIdAtPosition == id) {                parent.setSelection(i);                break;            }        }    }}</code></pre><p>And this is the way I'm instantiating this class:</p><pre><code>CustomSpinner spinner = (CustomSpinner) findViewById(R.id.sphofentries);</code></pre><p>This give me an error at runtime.</p><p>All this is if R.id.sphofentries is declared in my layout as an spinner.</p><p>But now, if I declare sphofentries as a CustomSpinner I get a runtime error just in the moment I set the Layout to the Activity:</p><pre><code>setContentView(R.layout.settings);</code></pre><p>Also I am pretty sure that the problem is that I need to declare sphofentries as a CustomSpinner because if I do this:</p><pre><code>CustomSpinner spinner = new CustomSpinner(this);spinner = (CustomSpinner) findViewById(R.id.sphofentries);</code></pre><p>This goes without problem trough the first line but gives a runtime error in the second then the problem isn't creating a new CustomSpinner but setting the sphofentries in this CustomSpinner (This with sphofentries declared like a Spinner not a CustomSpinner).</p><p>Maybe I am doing something wrong in the layout, this is the way I am declaring sphofentries as a CustomSpinner:</p><pre><code>&lt;CustomSpinner     android:id=""@+id/sphofentries""    android:layout_below=""@+id/tvhofentries""    android:layout_width=""300dip""    android:layout_height=""wrap_content""    android:gravity=""center_horizontal""/&gt;</code></pre>","470914","","470914","","2010-12-26 00:06:21","2010-12-26 22:23:12","How can I extend spinner to implement a new function?","<android><spinner>","3","1","","",""
"4529044","1","","","2010-12-25 02:02:54","3","4145","<p>i followed a guide on <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> and then created my own EditText field and a button. the code should explain it all, my problem is i keep getting a ""HelloWebViewClient cannot be resolved to a type"" Error, any suggestions? thanks in advance!</p><pre><code>    package com.text.text;import android.app.Activity;import android.os.Bundle;import android.text.Editable;import android.view.View;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Button;import android.widget.EditText;public class test extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.alt);        final EditText edittext = (EditText) findViewById(R.id.edittext);        final Button button = (Button) findViewById(R.id.okay);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Editable text = edittext.getText();                String Tekst = text.toString();                setContentView(R.layout.main);                WebView mWebView;                mWebView = (WebView) findViewById(R.id.webview);                mWebView.getSettings().setJavaScriptEnabled(true);                mWebView.loadUrl(Tekst);                mWebView.setWebViewClient(new HelloWebViewClient());                class HelloWebViewClient extends WebViewClient {                    @Override                    public boolean shouldOverrideUrlLoading(WebView view, String url) {                        view.loadUrl(url);                        return true;                    }        };    }});}}</code></pre>","553642","","","","","2013-12-14 22:13:01","HelloWebViewClient cannot be resolved to a type","<android><webclient>","3","0","","",""
"4529088","1","4654129","","2010-12-25 02:22:47","0","299","<p>ok to clarify. i understand that the map data is basically some images grouped in bounding boxes and drawn on a 2d canvas. is it possible to rotate the whole view so that it looks like on the image i posted from google earth, to get a kind of fly-over look? i know that there is a class in adroid used for 3d rotations on images(the camera class <a href=""http://developer.android.com/reference/android/graphics/Camera.html"" rel=""nofollow"">Graphics.camera</a>)There was a nice tutorial not long ago from sony-erricson with their 3d listview describing its functionality, but i don't think i can achieve what i need with it. is there a way that a view can be rendered maybe on a GL surface?</p><p>i realize that this isn't that simple to do but any suggestions or ideas on the matter can be helpful. </p><p>so where do i start?</p><p>tnx. <img src=""http://i.stack.imgur.com/CoDAa.jpg"" alt=""alt text""></p>","448192","","44729","","2010-12-25 15:39:21","2011-01-11 04:19:15","can we display a mapView like google earth(see screens)","<android><graphics><opengl-es><maps>","1","0","","",""
"4529093","1","","","2010-12-25 02:26:05","5","3418","<p>I've got a webview which makes use of the built in zoom controls, as follows:</p><pre><code>wv = new WebView(this);wv.getSettings().setBuiltInZoomControls(true);</code></pre><p>Note: this activates two main functions - pinch-to-zoom and invokeZoomPicker() (the latter is only called when a swiping action is done on the view, a simple touch doesn't enable it)</p><hr><p>and i also want things to happen when touch events occur, using the following</p><pre><code>wv.setOnTouchListener(new View.OnTouchListener() {      public boolean onTouch(View v, MotionEvent event) {        Log.i(""touch"", ""touched!"");        return false;    }});</code></pre><p>When the WebView loads, and I tap the screen, the log states ""touched"" every time I interact with the screen, as expected. However, if I do something that would set off invokeZoomPicker() (pinch to zoom doesn't seem to cause this problem, as long as the zoom widget doesn't appear), onTouchListener stops responding to my taps (even after a few seconds, when the widget disappears from view). </p><p>To make sure it was invokeZoomPicker(), I edited the second segment of my code as follows:</p><pre><code>wv.setOnTouchListener(new View.OnTouchListener() {      public boolean onTouch(View v, MotionEvent event) {        wv.invokeZoomPicker();        Log.i(""touch"", ""touched!"");        return false;    }});</code></pre><p>This new onTouch method now only triggers once (as a result of which the zoomwidget appears on the view - and disappears a few seconds later), and then the onTouch method doesn't get called again until the view is reloaded - so it is definitely a problem with the invokeZoomPicker()/Zoom widget</p><p>Have I missed some vital piece of code that allows them to coexist, or do I just have to choose which one I can live without?</p>","516951","","","","","2014-01-16 21:30:58","android: ZoomPicker breaks onTouchListener","<android><webview><zoom><ontouchlistener>","10","2","6","",""
"4529098","1","","","2010-12-25 02:29:07","0","429","<p>how can I use internal resource (e.g. R.drawable.myImage01) as an email attachment?I tried the following code. It shows the file is attach but actually the email gets send without any attachment.</p><pre><code>Context context = getApplicationContext();   String imagePath = context.getFilesDir() + ""/"" + ""myImage01.png"";emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(imagePath));</code></pre><p>ThanksAzam</p>","553652","","19750","","2010-12-25 02:46:47","2010-12-25 02:53:23","how can I use internal resource (e.g. R.id.myImage01) as an email attachment?","<android>","2","0","","",""
"4529160","1","","","2010-12-25 03:13:59","0","2003","<p>I have <code>TabHost</code> with tab child like this:</p><pre><code>tabHost.addTab(tabHost.newTabSpec(""web"")            .setIndicator(""web"")            .setContent(new Intent(this, webview.class)));</code></pre><p>In <code>WebView</code> class, I startactivityforresult:</p><pre><code>startActivityForResult(new Intent(Webview.this,EventManage.class),GET_CODE);</code></pre><p>In Eventmanage class, I set result but can not capture result in webview class.</p><p>Anybody can help me with this problem?</p>","541383","","272824","","2010-12-25 04:26:44","2011-02-08 14:42:25","How to startactivityforresult in tab child of TabHost","<android><activity>","2","0","","",""
"4529294","1","4529411","","2010-12-25 04:30:31","2","2489","<p>hello friends I am trying to find the current gps location of the android emulator i have used the command geo fix but if i try to retrieve the current location it is showing an exception...can anyone help me?</p>","553670","","","","","2013-02-23 22:35:28","how to find the gps location using android emulator?","<android>","3","3","","",""
"4529295","1","4529306","","2010-12-25 04:30:44","3","1974","<p>I would like to replace the default button style of a grouping header in an ExpandableListView (placed as gray button with black arrow on the left side of a group) by an own style.</p><p>Has anyone an idea or a reference to do this?</p>","432219","","","","","2010-12-25 04:36:53","Custom style of expander button of an ExpandableListView","<android>","1","0","1","",""
"4529431","1","4531080","","2010-12-25 05:46:08","2","256","<p>Im new to <code>OpenGL ES</code> and wanted to create a bunch of triangles that would represent a grid of squares that i could map map tiles to. Is it possible to map separate textures on the same shape in OpenGL ES or would i have to make every square of the grid its own object? Thanks.</p>","385051","","750613","","2012-06-27 04:16:34","2012-06-27 04:16:34","is it possible to map multiple textures onto a shape in openGL ES?","<iphone><android><opengl-es><texture-mapping><texture2d>","1","0","","",""
"4529483","1","4529629","","2010-12-25 06:09:11","0","243","<p>I have an application in which I'd like one row at a time to have a certain color. This seems to work about 95% of the time, but sometimes instead of having just one row with this color, it will allow multiple rows to have the color.  Specifically, a row is set to have the ""special"" color when it is tapped.  In rare instances, the last row tapped will retain the color despite a call to setBackgroundColor attempting to make it otherwise.</p><pre><code>private OnItemClickListener mDirectoryListener = new OnItemClickListener(){    public void onItemClick(AdapterView parent, View view, int pos, long id){        if (stdir.getStationCount() == pos) {            stdir.moreStations();              return;        }        if (playingView != null)            playingView.setBackgroundColor(Color.DKGRAY);        view.setBackgroundColor(Color.MAGENTA);        playingView = view;        playStation(pos);    }};</code></pre><p>I have confirmed with print statements that the code setting the row to gray is always called.  </p><p>Can anyone imagine a reason why this code might intermittently fail?  If there is a pattern or condition that causes it, I can't tell.</p><p>I thought it might have something to do with the activity lifecycle setting the ""playingView"" variable back to null, but I can't reliably reproduce the problem by switching activities or locking the phone.</p><pre><code>private class DirectoryAdapter extends ArrayAdapter {    private ArrayList&lt;Station&gt; items;    public DirectoryAdapter(Context c, int resLayoutId, ArrayList&lt;Station&gt; stations){        super(c, resLayoutId, stations);                    this.items = stations;    }    public int getCount(){        return items.size() + 1;    }    public View getView(int position, View convertView, ViewGroup parent){        View v = convertView;        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        if (position == this.items.size()) {            v = vi.inflate(R.layout.morerow, null);            return v;        }        Station station = this.items.get(position);        v = vi.inflate(R.layout.songrow, null);        if (station.playing)            v.setBackgroundColor(Color.MAGENTA);        else if (station.visited)            v.setBackgroundColor(Color.DKGRAY);        else            v.setBackgroundColor(Color.BLACK);        TextView title  = (TextView)v.findViewById(R.id.title);        title.setText(station.name);        return v;    }    };</code></pre>","458290","","458290","","2010-12-25 06:44:23","2010-12-25 07:40:56","Problem setting row backgrounds in Android Listview","<android><listview>","1","4","","",""
"4529607","1","","","2010-12-25 07:24:26","1","2052","<p>Is there a desktop based programming tool similar to <a href=""http://appinventor.googlelabs.com/about/"" rel=""nofollow"">App Inventor for Android</a>(<code>this is web-based</code>) for end users who do not know any programming language?</p>","143373","","750613","","2012-06-27 04:15:27","2012-06-27 04:15:27","Desktop programming tool similar to App Inventor for Android","<android><app-inventor>","3","1","0","",""
"4529620","1","","","2010-12-25 07:35:04","1","46","<p>I am trying to make an <a href=""http://developer.android.com/resources/articles/speech-input.html"" rel=""nofollow"">speech recognition enabled application</a> on Google Android, mainly for user experience. But during the testing stages I found that since there is misclassification , it can actually bring down user experience unless there is a good way to prevent it. What are some good ways in terms of programming and UI integration to handle mis-classifications?</p>","143373","","","","","2010-12-25 07:35:04","Strategy to recover from Speech recognition errors in a Android application","<android>","0","0","","",""
"4529661","1","4529671","","2010-12-25 07:50:46","2","155","<p>Is there an API for Android that will find other people nearby running the same app? For instance, if you were to perform a ""scan"" it tries to find other people running the same app nearby. Would it be possible to perform the same task across multiple OS (<code>Android, iPhone, Windows, etc.</code>)?</p><p>Or would the best way be to just have the app communicate to a server your location and have a server-side app that pushes a list of others nearby???</p><p>My goal is to find an easy way to eventually transmit data between two devices contigent on those that are nearby.</p>","537195","","750613","","2012-06-27 04:14:25","2012-06-27 04:14:25","Android App: Proximity","<android><iphone><windows>","1","1","","",""
"4529715","1","4532057","","2010-12-25 08:12:01","1","2222","<p>I wanna create an application in android to install a Hindi Font. Can some one guide me how i can go about it ? is it possible ?</p>","155196","","","","","2010-12-25 23:20:22","Android Application to Install a font","<android><fonts>","2","0","1","",""
"4529760","1","","","2010-12-25 08:36:28","1","2739","<p>I have a short question to the notepad tutorial on the android website. I wrote a simple function in the tutorial code to delete the whole database. It looks like this:</p><h2>DataHelper.java</h2><pre><code>public void deleteDatabase() {    this.mDb.delete(DATABASE_NAME, null, null);}</code></pre><h2>Notepadv1.java</h2><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    boolean result = super.onCreateOptionsMenu(menu);    menu.add(0, DELETE_ID, 0, ""Delete whole Database"");    return result;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {         case DELETE_ID:        mDbHelper.deleteDatabase();              return true;    }           return super.onOptionsItemSelected(item);}</code></pre><p>But when I run the app and try to delete the database I will get this error in LogCat:</p><p><em><strong>sqlite returned: error code = 1, msg= no such table: data</em></strong></p><p>Can you help how to fix this problem. It seems that the function deleteDatabase can not reach the database. </p><p>Thank you very much.</p><p>Felix</p><hr><p>Thank you for the posts. Now I updated the code:</p><h2>DataHelper.java</h2><pre><code>public boolean deleteDatabase(Context context) {    return context.deleteDatabase(DATABASE_NAME);}</code></pre><h2>Notepadv1.java</h2><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    boolean result = super.onCreateOptionsMenu(menu);    menu.add(0, DELETE_ID, 0, ""Delete whole Database"");    return result;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {         case DELETE_ID:        mDbHelper.deleteDatabase(this);              return true;    }           return super.onOptionsItemSelected(item);}</code></pre><p>But now I have to restart the app that the database is deleted. I is not working while the app is running.</p>","529756","","1228","","2013-08-13 19:53:32","2013-08-13 19:53:32","Notepad Tutorial: deleteDatabase() function","<android><database><sqlite3><notepad>","2","0","","",""
"4529770","1","","","2010-12-25 08:42:29","7","12967","<p>I am getting Application Not Responding (ANR) dialog while continuous tapping on the screen.There is no view on the screen where i am tapping. Frequency of this issue is less but still i am not able to remove it completely.</p><p>Here i am attaching the log what i caught during this error.</p><pre><code>ERROR/ActivityManager(1322): ANR in com.test.mj.and.ui     (com.test.mj.and.ui/.TermsAndCondActivity)ERROR/ActivityManager(1322): Reason: keyDispatchingTimedOutERROR/ActivityManager(1322): Parent: com.test.mj.and.ui/.SplashActivityERROR/ActivityManager(1322): Load: 6.59 / 6.37 / 5.21ERROR/ActivityManager(1322): CPU usage from 11430ms to 2196ms ago:ERROR/ActivityManager(1322):   rtal.mj.and.ui: 9% = 7% user + 1% kernel / faults: 649  minorERROR/ActivityManager(1322):   system_server: 4% = 2% user + 2% kernel / faults: 10 minorERROR/ActivityManager(1322):   logcat: 3% = 1% user + 1% kernel / faults: 675 minor 1  majorERROR/ActivityManager(1322):   synaptics_wq: 1% = 0% user + 1% kernelERROR/ActivityManager(1322):   ami304d: 1% = 0% user + 0% kernelERROR/ActivityManager(1322):   .process.lghome: 1% = 0% user + 0% kernel / faults: 47 minorERROR/ActivityManager(1322):   sync_supers: 0% = 0% user + 0% kernelERROR/ActivityManager(1322):   droid.DunServer: 0% = 0% user + 0% kernel / faults: 6 minorERROR/ActivityManager(1322):   events/0: 0% = 0% user + 0% kernelERROR/ActivityManager(1322):   oid.inputmethod: 0% = 0% user + 0% kernel / faults: 2 minorERROR/ActivityManager(1322):   m.android.phone: 0% = 0% user + 0% kernel / faults: 2 minorERROR/ActivityManager(1322):   ndroid.settings: 0% = 0% user + 0% kernelERROR/ActivityManager(1322):   sh: 0% = 0% user + 0% kernel / faults: 110 minorERROR/ActivityManager(1322):  -flush-179:0: 0% = 0% user + 0% kernelERROR/ActivityManager(1322): TOTAL: 19% = 13% user + 6% kernelWARN/WindowManager(1322): Continuing to wait for key to be dispatchedWARN/WindowManager(1322): No window to dispatch pointer action 1</code></pre><p>Can anyone please help me to solve this issue?</p><p>Thanks in advance.</p>","519846","","342925","","2011-09-29 00:02:40","2013-10-15 11:27:54","Android ANR keyDispatchingTimedOut Error while continuous tapping on screen","<android>","4","1","1","",""
"4529784","1","4529791","","2010-12-25 08:49:24","4","8343","<p>I started a local http server on Android and it can be reached by other computers in the same local network. But if I try to access this server using opera on the same phone, it won't work. So this means we are not able to access localhost on Android? Thanks!</p>","547589","","","","","2013-01-03 21:13:44","Android cannot access localhost?","<android><http><localhost>","2","4","1","",""
"4529797","1","4530660","","2010-12-25 08:54:46","0","1071","<p>In listview when it is scrolled, the top item which is going out of scene is attached at bottom which is coming in to scene.</p><p>Is this behaviour fixed or we can disable this feature.</p><p>In my listview, i got only 10 items so this feature is not that important to have.</p>","547515","","","","","2012-06-27 04:12:49","Listview disable scrolling optimization","<android><listview>","1","1","","",""
"4529986","1","4532072","","2010-12-25 10:15:57","1","698","<p>I have a SQL Lite database on places with a latitude and longitude and I want to get the data from SQL Lite and some way, either in the SQL question or in a custom adapter or what the best practice is sort out all places that are in a 5 miles distance from the phone location and show in a ListView.</p><p>I have one idea I figure out but wounder if someone has a better idea.</p><p>I can get out all data from SQL Lite and put it in a ListView with a custom adapter that gets the phone location from a LocationManager and then somehow remove the items that has a distanceTo longer then 5 miles and I hope with the custom adapter I can sorting also but don't have all pieces here yet.</p><p>And I think my solution going to work but is there any better solution?</p><p>I can also say that its around 400 places so maybe not a big deal to do this with custom adapter.</p><p>All solutions is good, I am relative new on Android but learning.</p>","553770","","377270","","2011-06-29 03:17:36","2011-06-29 03:17:36","Android: Best practice to get data from SQLite and show in a listview order by distance from phone","<android><sqlite><location><distance>","1","0","","",""
"4530269","1","4530722","","2010-12-25 12:35:37","0","372","<p>We are building a corporate web application that needs to run on every device available out there (on desktops, laptops, iPads, smart phones) etc.</p><p>May of the things we need to do in the app (e.g. access local file-system) cannot be done by traditional ways in javascript due to security implications.</p><p>Now, we are evaluating various options on how to do accomplish these tasks in a way that needs minimium effort duplication across devices.</p><p>The options are are evaluating have mainly narrowed down to Applets/NPAPI plugins for browsers. I know neither Android nor iPad support Applets currently (but Android 2.2 will, is that correct)??</p><p>The safest bet I see now is to create a NPAPI plugin for browsers (except IE which would need something based off Active-X).</p><p>So, are NPAPI plugins supported by Android/iPad/iPhone browsers as they are for PC based browsers?Are there any chances Applets would be available for all these platforms in the near future?Is there a better option available?</p>","172396","","","","","2010-12-25 16:02:25","iPad/Android support for exotic web technologies","<iphone><android><ipad>","1","0","2","",""
"4530472","1","4633676","","2010-12-25 14:07:41","6","1313","<p>I'm trying to create a widget that contains a single ImageView which, when clicked, starts speech recognition application. I've never worked with widgets and pending intents, so I'm confused: how to create a pending intent for starting speech recognition activity?</p><p>I tried with something like this, but it, of course, fails:</p><pre>   Intent intent = new Intent();   Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);   voiceIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,     RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);   voiceIntent.putExtra(RecognizerIntent.EXTRA_PROMPT,     ""Speech recognition demo"");   voiceIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);   intent.putExtra(RecognizerIntent.EXTRA_RESULTS_PENDINGINTENT, voiceIntent);   PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,     intent, 0);   RemoteViews views = new RemoteViews(context.getPackageName(),     R.layout.main);   views.setOnClickPendingIntent(R.id.button, pendingIntent);</pre>","133648","","","","","2012-11-30 08:32:08","Widget that calls speech recognition app","<android><widget><speech-recognition>","3","0","1","",""
"4530492","1","4530519","","2010-12-25 14:17:16","1","969","<p>Solved: <strong>The problem was: wrong version of Java. See my comments.</strong></p><p>Hi all,using fbreaderj-0.7.17 sources, and Android SDK update manager (Platform tools rev8, 1.6 SDK rev 3).</p><p>After <code>ant compile</code>, get the errors:</p><pre><code>-pre-build:-resource-src:     [echo] Generating R.java / Manifest.java from the resources...     [null] /opt/android-sdk-update-manager/platform-tools/aapt: /lib32/libz.so.1: no version information available (required by /opt/android-sdk-update-manager/platform-tools/aapt)     [null] /tmp/FBReaderJ-sources-0.7.17/res/layout/main.xml:8: error: No resource identifier found for attribute 'fadeScrollbars' in package 'android'BUILD FAILED/opt/android-sdk-update-manager/tools/ant/main_rules.xml:306: null returned: 1</code></pre><p>Targets:</p><pre><code>/opt/android-sdk-update-manager/tools/android list targetsAvailable Android targets:id: 1 or ""android-4""     Name: Android 1.6     Type: Platform     API level: 4     Revision: 3     Skins: QVGA, HVGA (default), WVGA800, WVGA854id: 2 or ""Google Inc.:Google APIs:4""     Name: Google APIs     Type: Add-On     Vendor: Google Inc.     Revision: 2     Description: Android + Google APIs     Based on Android 1.6 (API level 4)     Libraries:      * com.google.android.maps (maps.jar)          API for Google Maps     Skins: WVGA854, HVGA (default), WVGA800, QVGA</code></pre><p>Project update:</p><blockquote>  <p>/opt/android-sdk-update-manager/tools/android  update project --name FBReaderJ --path  . --target 1</p></blockquote><p>local.properties:</p><blockquote>  <p>sdk.dir=/opt/android-sdk-update-manager</p>    <p>ndk.dir=/opt/android-ndk-5/</p></blockquote>","438039","","438039","","2010-12-27 12:28:23","2012-01-15 17:00:59","can't compile FBReaderJ","<android><ant><build-process>","2","0","","",""
"4530639","1","4532033","","2010-12-25 15:27:57","1","894","<p>If I have an ApplicationInfo instance of a particular app, how can I make an Intent to launch the app?</p><p>I tried</p><pre><code>Intent intent = new Intent(ApplicationInfoInstance.packageName);</code></pre><p>but it gives an exception. The app is installed so the exception is not due to that.</p><p>I think I need to use</p><pre><code>setClassName (String packageName, String className);</code></pre><p>Could someone direct me to obtain these two values?Because most of my apps returns <strong>NULL</strong> for <code>ApplicationInfoInstance.className;</code></p><p>Thank you.</p>","455048","","","","","2010-12-27 08:20:19","Android - Starting an application from an ApplicationInfo instance","<android><android-intent>","1","0","","",""
"4530672","1","4530710","","2010-12-25 15:44:19","1","1635","<p>Why I'm getting IOException in this peace of code? Thanks.</p><pre><code>HttpClient httpclient = new DefaultHttpClient();HttpGet httpget = new HttpGet(""http://www.google.com/"");HttpResponse response;    try {        response = httpclient.execute(httpget);    } catch (ClientProtocolException e) {         Toast.makeText(this, ""ClientProtocolEx"", Toast.LENGTH_LONG).show();         e.printStackTrace();    } catch (IOException e) {         Toast.makeText(this, ""IOEx"", Toast.LENGTH_LONG).show();         e.printStackTrace();    } </code></pre><p>Exception:</p><pre><code>12-25 18:01:48.992: WARN/System.err(10749): java.net.UnknownHostException: www.google.com12-25 18:01:48.992: WARN/System.err(10749):     at java.net.InetAddress.lookupHostByName(InetAddress.java:513)12-25 18:01:48.992: WARN/System.err(10749):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)12-25 18:01:48.992: WARN/System.err(10749):     at java.net.InetAddress.getAllByName(InetAddress.java:242)12-25 18:01:48.992: WARN/System.err(10749):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)12-25 18:01:48.992: WARN/System.err(10749):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)12-25 18:01:48.992: WARN/System.err(10749):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)12-25 18:01:48.992: WARN/System.err(10749):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)12-25 18:01:48.992: WARN/System.err(10749):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)12-25 18:01:48.992: WARN/System.err(10749):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)</code></pre>","397991","","397991","","2010-12-25 16:03:19","2010-12-25 20:40:28","IO Exception on invoking execute() method of HttpGet class","<java><android><httpclient>","1","2","","",""
"4530682","1","","","2010-12-25 15:49:35","0","44","<p>I'm creating some public mobile application. Then before release I want to make some beta testing inside my company. Everyone who get distib must sign a non-disclosure agreement (NDA). But what if there would be a leak? How I would find a spy?</p><p>Can I subscribe somehow each instance to exactly find the traitor ?</p>","383187","","","","","2010-12-25 17:28:17","Can I identify application distributive?","<android><security><architecture><mobile>","1","0","","",""
"4530750","1","","","2010-12-25 16:15:23","4","509","<p>My RelativeLayout contains few ImageView/TextView controls of different height, e.g. 20, 70, 35. The controls alligned in a row. I want them to expand their height to the same value of the maximum control height, e.g. 70. The problem is that with my layout the RelativeLayout container and all controls expanded to the screen height instead. </p><pre><code>    &lt;RelativeLayout         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;        &lt;ImageView             android:src=""@drawable/image1""             android:background=""#FFCCDDEE""            android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:layout_centerVertical=""true""            android:layout_alignParentLeft=""true""            /&gt;        &lt;ImageView             android:src=""@drawable/image2""             android:background=""#FFCCDDEE""            android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:layout_centerVertical=""true""            android:layout_centerInParent=""true""            /&gt;        &lt;ImageView             android:src=""@drawable/image3""             android:background=""#FFCCDDEE""            android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:layout_centerVertical=""true""            android:layout_alignParentRight=""true""            /&gt;    &lt;/RelativeLayout&gt;</code></pre><p>I can set RelativeLayout height to 70, but consider that I don't know the child controls size upfront. </p><p>I also can achieve desired effect with LinearLayout, but want to use the RelativeLayout.</p><pre><code>    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;        &lt;ImageView             android:src=""@drawable/image1""             android:background=""#FFCCDDEE""            android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:gravity=""center_vertical""            /&gt;        &lt;ImageView             android:src=""@drawable/image2""             android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:gravity=""center_vertical""            /&gt;        &lt;ImageView             android:src=""@drawable/image3""             android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:gravity=""center_vertical""            /&gt;    &lt;/LinearLayout&gt;</code></pre><p>Any ideas?</p>","62192","","","","","2012-12-21 08:37:41","Keep RelativeLayout height as small as possible, but increase children height to fill all available space","<android><height><relativelayout>","1","1","","",""
"4530758","1","4532038","","2010-12-25 16:19:46","1","1609","<p>I am completly new to android programming and I try to get clicking on an android widget working:</p><pre><code>public class MyWidget extends AppWidgetProvider {public void onUpdate(Context context, AppWidgetManager appWidgetManager,        int[] appWidgetIds) {// Loop through all widgetsfor(int i=0;i &lt; appWidgetIds.length;i++) {    int appWigedid = appWidgetIds[i];    // Create an intent to launce something    Intent intent = new Intent(context,TestActivity.class);    PendingIntent pendingintent = PendingIntent.getActivity(context, 0, intent, 0);    // Get the layout for the app widget and attach on click listener    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.initial_layout);    views.setOnClickPendingIntent(R.id.UselessMessage, pendingintent);    views.setTextViewText(R.id.UselessMessage,""This text is useless"");    AppWidgetManager manager = AppWidgetManager.getInstance(context);    manager.updateAppWidget(appWigedid,views);}}</code></pre><p>my TestActivity class is just a stub because still trying to find out how it is called.</p><pre><code>public class TestActivity extends Activity {@Overrideprotected void onStart() {    System.out.println(""On Start called!"");}@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    System.out.println(""on create called!"");};</code></pre><p>}</p><p>The setting of the Text works. But the onStart method of the TestAcitivity is never executed (other sysout messages work). When I tap on the widget android logs:</p><pre><code>12-25 17:17:43.054  1279  1392 I ActivityManager: Starting activity: Intent { flg=0x10000000 cmp=org.rfc1149.android.simple/.TestActivity bnds=[120,272][360,371] }</code></pre><p>which would suggest that the activity is created but the onCreate does not work.</p>","325102","","","","","2010-12-25 23:06:43","Android: click on widget event","<java><android><android-widget>","3","0","","",""
"4530846","1","","","2010-12-25 16:48:01","4","5951","<p>I want to check programmatically whether there is an internet connection in android phone/emulator. So that once I am sure that an internet connection is present then I'll make a call to the internet.</p><p>So its like ""Hey emulator! If you have an internet connection, then please open this page, else doSomeThingElse();""</p><p>hope you get the idea. I would highly appreciate a quick response I need it quite early.</p>","553888","","982541","","2014-02-27 10:49:49","2014-02-27 10:49:49","How to programmatically check availibilty of internet connection in Android?","<java><android><android-emulator><android-manifest><internet-connection>","4","0","3","",""
"4530895","1","4531007","","2010-12-25 17:02:41","1","3117","<p>I've seen this with other platforms (especially iPhone/iPad) but have not been able to find-it/figure-it-out for Android and the other platforms don't seem to get much farther then asking the question.</p><p>I have a game that has a multiplayer component where two players have to press buttons on the same screen at the same time. Everything but simultaneous button presses is done.</p><p>As of right now it seems like Android calls the button's onTouchEvent and, since it is handled, it doesn't call the other button. Do you think something like having it call both buttons (if a touch is within the area of the button) would work? Is there any other way this could possibly be implemented?</p><p>Thanks for your time.</p><hr><p>Anwser:<br>I ended up implementing two distinct touch points in the Activity's onTouchEvent function.</p><p>The basic implementation:</p><pre><code>public class MainClass extends Activity { // ...btn1 = (CustomButton)findViewById(R.id.button_one);btn2 = (CustomButton)findViewById(R.id.button_one);btn1.ignoreMotionEvent(true);btn2.ignoreMotionEvent(true);// ...@Overridepublic boolean onTouchEvent(MotionEvent event){    if(r1 == null)    {        //r1 and r2 are Rect that define the absolute region of the button.        //They are both defined here to ensure that the everything will be layed out (didn't always work so just for extra ""sure-ness"" did it here)    }    CustomButton btn = null;    MotionEvent mevent = null;    switch(event.getAction())    {        case MotionEvent.ACTION_DOWN:        case MotionEvent.ACTION_UP:            int x = (int)event.getX();            int y = (int)event.getY();            if(r1.contains(x, y))            {                btn = btn1;            }            else if(r2.contains(x, y))            {                btn = btn2;            }            if(btn != null)            {                mevent = event;            }            break;    }    if(btn != null)    {        btn.ignoreMotionEvent(false);        btn.onTouchEvent(mevent);        btn.ignoreMotionEvent(true);    }    return super.onTouchEvent(event);}}</code></pre><p>CustomButton is simply an extended version of Button where a method ignoreMotionEvent exists, this simply sets a boolean determining if CustomButton's onTouchEvent function should return false instantly or call super.onTouchEvent.</p><p>Unfortunately if you tried this code it wouldn't work. So why mention it? It is the basic outline of the code. The issue I encountered was the functions to make this work don't exist on Android 1.6 and earlier. Eclair and higher is required to make this work.</p><p>Now just to help out any other who found this because they had the same issue, here nearly an exact copy of what I am running:</p><pre><code>public class MainClass extends Activity { // ...btn1 = (CustomButton)findViewById(R.id.button_one);btn2 = (CustomButton)findViewById(R.id.button_one);btn1.ignoreMotionEvent(true);btn2.ignoreMotionEvent(true);// ...@Overridepublic boolean onTouchEvent(MotionEvent event){    if(r1 == null)    {        //r1 and r2 are Rect that define the absolute region of the button.        //They are both defined here to ensure that the everything will be layed out (didn't always work so just for extra ""sure-ness"" did it here)    }    if(Utils.isEclairOrLater())    {        //Eclair and later        boolean froyo = Utils.isFroyoOrLater();        int action = froyo ? event.getActionMasked() : event.getAction();        CustomButton btn = null;        MotionEvent mevent = null;        switch(action &amp; MotionEvent.ACTION_MASK)        {            case MotionEvent.ACTION_DOWN:            case MotionEvent.ACTION_UP:                int x = (int)event.getX();                int y = (int)event.getY();                if(r1.contains(x, y))                {                    btn = btn1;                }                else if(r2.contains(x, y))                {                    btn = btn2;                }                if(btn != null)                {                    mevent = event;                }                break;            case MotionEvent.ACTION_POINTER_DOWN:            case MotionEvent.ACTION_POINTER_UP:                int index = froyo ? event.getActionIndex() : ((action &amp; MotionEvent.ACTION_POINTER_ID_MASK) &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT);                x = (int)event.getX(index);                y = (int)event.getY(index);                if(r1.contains(x, y))                {                    btn = btn1;                }                else if(r2.contains(x, y))                {                    btn = btn2;                }                if(btn != null)                {                    mevent = MotionEvent.obtain(event.getDownTime(), event.getEventTime(), (action &amp; MotionEvent.ACTION_MASK) == MotionEvent.ACTION_POINTER_DOWN ? MotionEvent.ACTION_DOWN : MotionEvent.ACTION_UP, event.getX(index), event.getY(index), 0);                }                break;        }        if(btn != null)        {            btn.ignoreMotionEvent(false);            btn.onTouchEvent(mevent);            btn.ignoreMotionEvent(true);        }    }    else    {        //Earlier then Eclair        CustomButton btn = null;        MotionEvent mevent = null;        switch(event.getAction())        {            case MotionEvent.ACTION_DOWN:            case MotionEvent.ACTION_UP:                int x = (int)event.getX();                int y = (int)event.getY();                if(r1.contains(x, y))                {                    btn = btn1;                }                else if(r2.contains(x, y))                {                    btn = btn2;                }                if(btn != null)                {                    mevent = event;                }                break;        }        if(btn != null)        {            btn.ignoreMotionEvent(false);            btn.onTouchEvent(mevent);            btn.ignoreMotionEvent(true);        }    }    return super.onTouchEvent(event);}}</code></pre><p>Utils is a simple utility class that, for the purpose of this example, gets the Build.VERSION.SDK_INT value and compares it to Eclair (5) and Froyo (8) for the appropriate functions.</p><p>Also it requires you compile with 2.2 or higher. If you don't know, Android is backwards-compatable as long as you do the checks for missing functions due to version differences. This means though you are compiling with 2.2, it will work all the way back to 1.0.</p><p>That is what I use and hopefully it helps others.</p>","492347","","492347","","2010-12-28 06:42:26","2012-08-24 13:09:50","Android: Simultaneous button presses","<android><button><touch><simultaneous>","2","0","2","",""
"4530940","1","4531097","","2010-12-25 17:14:35","4","9746","<p>I have a very basic ListView in android and had set a very basic adapter. My problem is that the list view does not show anything, regardless of the adapter and the notifyDataSetChanged(); </p><p>Here is my code:XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;TextView android:text=""@string/app_name""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  &gt;&lt;/TextView&gt;  &lt;ListView android:id=""@+id/selectView""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""&gt;    &lt;/ListView&gt;&lt;/RelativeLayout&gt;</code></pre><p>The Activity code:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.ListView;import com.androidcourse.phonemapper.R;import com.androidcourse.phonemapper.model.SelectViewAdapter;public class SelectActivity extends Activity {    private ListView mListView;    private SelectViewAdapter mAdapter;    @Override    public void onCreate(Bundle savedState) {        super.onCreate(savedState);        setContentView(R.layout.select_activity);        initializeListView();    }    private void initializeListView() {        mListView = (ListView) findViewById(R.id.selectView);        mAdapter = new SelectViewAdapter(this);        mListView.setAdapter(mAdapter);        mAdapter.notifyDataSetChanged();    }    @Override    public void onResume() {        super.onResume();    }}</code></pre><p>And the Adapter code:</p><pre><code>import android.content.Context;import android.graphics.Color;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.TextView;public class SelectViewAdapter extends BaseAdapter {    private Context mContext;    private TextView mMockTextView;    public SelectViewAdapter(Context cnt) {        mContext = cnt;        mMockTextView = new TextView(mContext);        mMockTextView.setText(""Test text"");        mMockTextView.setBackgroundColor(Color.CYAN);    }    @Override    public int getCount() {        return 3;    }    @Override    public Object getItem(int position) {        return mMockTextView;    }    @Override    public long getItemId(int position) {        return 3;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        return mMockTextView;    }}</code></pre><p>The problem is that nothing is shown on the screen. A black screen (and the first text view from the XML) is all I get. I cannot see the mockTextView and its text. Apparently I am doing something quite wrong, but I cant figure out what.</p>","346583","","46914","","2011-10-25 20:22:51","2014-01-05 19:12:37","Why is my ListView not showing anything?","<android><listview>","3","0","2","",""
"4531005","1","","","2010-12-25 17:33:24","0","426","<p>Hello everyone and merry Christmas!</p><p>I have asked a question recently on StackOverflow: <a href=""http://stackoverflow.com/questions/4521757/android-app-sends-data-to-php-script-expectation-failed"">Android app sends data to PHP script - Expectation failed</a></p><p>I didn't get the expected answer so I try another time with new clues.</p><p>First, I've found someone who gets the same error on this website: <a href=""http://www.anddev.org/novice-tutorials-f8/doing-http-post-with-the-current-sdk-t5911-15.html"" rel=""nofollow"">http://www.anddev.org/novice-tutorials-f8/doing-http-post-with-the-current-sdk-t5911-15.html</a></p><p><strong>---------------------------- Quote ------------------------------------------------</strong></p><p>Hi guys!I need a little help.. I've tested every code on this forum and other websites, sanitizing them or using as written, but I always return the same error: 417 Expectation Failed.. I don't know anything about status error different from 404, 500, and so on..Someone with more experience have a clue??Thanks you a lot! If someone will find an answer I'll work hard for this forum with some open code!!</p><p>Chances are the reason why your code isn't working is because you don't understand how to build an HTTP request. The code is fine, your headers and content probably isn't!</p><p>Using a network protocol analyser (such as Wireshark), or FireBug or Chrome's built in development tools, read the POST requests you make to websites then rebuild them (using the same headers) in Android.</p><p><strong>---------------------------- UNQuote ------------------------------------------------</strong></p><p>I've tried to use wireshark and the results are when I don't use </p><pre><code>List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();       nameValuePairs.add(new BasicNameValuePair(""Name"", ""Noon""));       nameValuePairs.add(new BasicNameValuePair(""Level"", ""0""));       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); </code></pre><p>the message sent is a httpPost</p><p>but when I use the nameValuePairs, no HttpPost is sent.</p><p>I am really lost with this error.</p><p>Thanks beforehand.</p>","552732","","750613","","2012-06-27 04:07:39","2012-06-27 04:07:55","Android app sends data to PHP script - Expectation failed v2.0","<php><android><http-post>","1","0","","",""
"4531031","1","7842979","","2010-12-25 17:38:26","1","912","<p>I am trying to add row to the cursor (which is done with matrix cursor), then pass the cursor to the list adapter (resource adapter). The list adapter takes only a cursor. How do I add a row to the list adapter?</p>","507466","","304","","2010-12-25 19:43:36","2011-10-20 22:24:10","How to display matrix cursor using list adapter in Android?","<sql><android><matrix><cursor><listadapter>","1","0","","",""
"4531062","1","","","2010-12-25 17:47:17","5","5382","<p>I need to download an HTML page programmatically and then get its Html. I am mainly concerned with the downloading of the page. If I download the page, where will I put it?Will I have to keep in an String variable? If yes then how? </p><p>Kindly help me out.</p>","553888","","982541","","2014-02-27 10:48:17","2014-02-27 10:48:17","How to programmatically download an Html page in android and get its Html?","<android><html><android-emulator><download>","1","1","0","",""
"4531101","1","4531663","","2010-12-25 17:58:18","1","188","<p>Merry Christmas, in the spirit of the season I had an idea of a peer to peer charity app for mobile platforms, where essentially you can go to find individual people who are in need of money and make a donation via Paypal to them. </p><p>It sounds pretty simple, but what I am concerned about is how to handle the Paypal side for the best security. I already know Paypal provides an approved SDK for use in mobile apps. </p><p>So how should I approach it? Should I have users create an account through the site, and provide their paypal email address in the account information (hidden from plain view) then when the other user wants to give to them, it would open the Paypal interface with that email address? Somehow that seems insecure.</p><p>What do you guys think?</p>","63","","","","","2011-12-24 20:11:06","Mobile P2P Charity App using Paypal - how to handle security","<iphone><android><mobile><paypal>","1","0","","",""
"4531104","1","","","2010-12-25 17:59:33","1","7645","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:columnWidth=""90dp""    android:stretchMode=""columnWidth""    android:gravity=""center""    android:background=""@drawable/background""     &gt;   &lt;/GridView&gt;</code></pre><p>help adding text view in dis...</p>","553915","","494543","","2010-12-25 18:06:25","2012-03-12 07:06:37","how to add text view in gridview in android xml","<android>","1","0","3","",""
"4531139","1","","","2010-12-25 18:09:14","2","2681","<p>I'm trying to run LVL on my app but I'm getting this error when debugging on my phone:</p><p><strong>ERROR/LicenseChecker(29924): Could not bind to service.</strong></p><p>I tried on emulator too and I'm getting the same error, so I decided investigate on LicenseChecker.java and I changed:</p><pre><code>               boolean bindResult = mContext.bindService(                    new Intent(ILicensingService.class.getName()),                    this,  // ServiceConnection.                    Context.BIND_AUTO_CREATE);</code></pre><p>to:</p><pre><code>                boolean bindResult = mContext.bindService(                    new Intent(""com.android.vending.licensing.ILicensingService""),                    this,  // ServiceConnection.                    Context.BIND_AUTO_CREATE);</code></pre><p>but same problem occurs.</p><p>I'm testing with SDK 8, any idea how to solve this problem?</p><p>Thanks in advance</p>","538384","","750613","","2012-06-27 04:08:55","2012-06-27 04:08:55","Android LVL: Could not bind to service","<android><android-lvl>","1","1","","",""
"4531199","1","","","2010-12-25 18:32:54","1","519","<p>how can i do that? is there a way to do it without a context: (getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth())</p>","472537","","","","","2010-12-25 23:12:59","android get screen width from an appwidget","<android><widget>","1","0","","",""
"4531212","1","4531581","","2010-12-25 18:37:05","1","1873","<p>I'm trying to use the PreferenceActivity in a java app and I'm able to bring up a screen to modify the preferences but I'm unable to read the preferences in a nother activity in the same App.</p><p>I have one xml file under the xml/ folder called default_values.xml that contains just a single preference. </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;EditTextPreference        android:key=""json_url_pref""        android:defaultValue=""@string/json_url""        android:title=""@string/title_edittext_preference""        android:summary=""@string/summary_edittext_preference""        android:dialogTitle=""@string/dialog_title_edittext_preference"" /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>This is the code I'm trying to use in my Activity to read the preference:</p><pre><code>SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(EarningsActivity.this);String tmp = sp.getString(""json_url_pref"",""-1"");</code></pre><p>sp.getString(...) is always returning -1.</p><p>I think this is a contextual issue that for some reason this activity does not have access to the application preferences (at least my intention is to have the preferences be visible by all activities in the application).</p>","549226","","549226","","2010-12-25 19:33:36","2010-12-25 20:30:29","Issue reading preferences in android activity","<java><android>","1","0","","",""
"4531226","1","4532025","","2010-12-25 18:41:41","0","4864","<p>I'm building a specialized media player for android and need a way to select a song from the device.  I like how the builtin music player groups everything by artist/album, is that something I would have to write or is there something I can just plug in to get that functionality for free?  </p><p>What is the easiest way to list music files on the phone with some basic grouping by the idtag info?</p>","3291","","","","","2010-12-25 22:54:35","How to list all media in Android?","<android>","2","0","1","",""
"4531295","1","","","2010-12-25 19:03:17","0","3113","<p>I have an issue with my ImageButton not changing state. When I click, or rather touch, the button it stays as the same image. Here is the XML I am using as a selector.</p><pre><code>&lt;selectorxmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_focused=""true"" android:state_pressed=""false"" android:drawable=""@drawable/pushed"" /&gt;&lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/pushed"" /&gt;&lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/pushed"" /&gt;&lt;item   android:drawable=""@drawable/default"" /&gt;&lt;/selector&gt;</code></pre><p>I call this selector from my main.xml as</p><pre><code>android:background=""@drawable/imagechoice""</code></pre><p>imagechoice.xml is the file with the selector</p><p>I don't understand why this is not working, unless I have to have some java code, but everything I've seen said this should work.</p>","553934","","331473","","2011-11-24 04:11:38","2012-10-12 11:28:35","Android ImageButton state not changing","<android><selector><state><imagebutton>","5","1","0","",""
"4531315","1","4531326","","2010-12-25 19:08:11","0","411","<p>I am trying to create a Option menu where there is a button to click register. on clicking that i want to go to the RegisterActivity.java</p><pre><code> @Override public boolean onOptionsItemSelected(MenuItem item) {  switch (item.getItemId()) {  case R.id.register:        Intent i = new Intent(this, RegisterActivity.class);        startActivity(i);        return true;  case R.id.exit:   return true;  default:   return super.onOptionsItemSelected(item);  } }</code></pre><p><img src=""http://i.stack.imgur.com/y6fDS.png"" alt=""alt text""></p><p><a href=""http://variable3.com/files/screenshots/2010-12-26_0034.png"" rel=""nofollow"">http://variable3.com/files/screenshots/2010-12-26_0034.png</a></p>","155196","","","","","2010-12-25 19:12:22","Activity Not Found Expection","<android><activity>","2","0","","",""
"4531319","1","","","2010-12-25 19:09:16","0","638","<p>I want the selector image for table row.. I was trying it from past few hours but i did't get any result for this.. </p><p>I want the same property as listSelector in ListView for my TableRow. Is there any way to do such thing..??</p><p>Please hemp me out..</p><p>Thanks.</p>","553946","","","","","2010-12-26 08:09:41","how to add custom selector on TableRow.? Same as lIstView's listSelector property","<android><tablelayoutpanel><tablerow>","1","0","","",""
"4531396","1","4531500","","2010-12-25 19:35:51","123","175363","<p>I am learning how to create UI elements. I have created a few EditText input fields. On the click of a Button I want to capture the content typed into that input field.</p><pre><code>&lt;EditText android:id=""@+id/name"" android:width=""220px"" /&gt;</code></pre><p>That's my field. How can I get the content?</p>","155196","","118729","","2011-11-09 00:23:04","2014-02-20 17:19:03","Get Value of a Edit Text field","<android><edittext>","4","2","12","",""
"4531444","1","4531779","","2010-12-25 19:46:59","1","1096","<pre><code>            Calendar calendar = Calendar.getInstance();        int hnow=calendar.get(Calendar.HOUR_OF_DAY);        String hour=Integer.toString(hnow);        String min=Integer.toString(calendar.get(Calendar.MINUTE));</code></pre><p>this is my code. i get the now time. i d like to get the now()-27 sec (hour, minute, second)</p><p>how i can do that?</p>","472537","","166339","","2010-12-25 20:38:30","2014-01-23 04:28:38","android / java get now()-27 second time","<java><android><date><time>","4","1","","",""
"4531539","1","4531561","","2010-12-25 20:15:54","30","20263","<p>I'm trying to use <code>Toast</code> inside <code>OnCLickListener</code>. My code triggers the following error:</p><pre><code>The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (new View.OnClickListener(){}, String, int)</code></pre><p>This is my code:</p><pre><code>    Button register = (Button) findViewById(R.id.register);    register.setOnClickListener(new View.OnClickListener() {        public void onClick(View arg0) {            EditText name = (EditText)findViewById(R.id.name);            String Lname = name.getText().toString();            Toast.makeText(this, Lname, Toast.LENGTH_SHORT).show();        }    });</code></pre>","155196","","1411723","","2014-02-08 05:57:40","2014-02-08 05:58:16","Error due to invalid combination of Toast and OnClickListener","<android><toast>","6","0","10","",""
"4531609","1","4531678","","2010-12-25 20:40:32","1","195","<p>I am trying to make a SQLite table for group of contacts, but I do know the number of contacts that are going to be in that table, so how could I account for ALL the contacts? I could make a single TEXT  column and have the String URI of each contact with a delimeter. I would like to support the wide range of users running Android 1.5 and (correct me if I'm wrong) the version of SQLite that runs on Android 1.5 doesn't support foreign keys (only Android 2.2 and above). What should I do?</p>","200477","","200477","","2010-12-25 20:53:36","2010-12-26 02:25:18","Account for an indefinite amount of SQLite column?","<android><sqlite><foreign-keys>","1","0","2","",""
"4531620","1","4532569","","2010-12-25 20:43:11","0","924","<p>I have been using this tutorial for reading incomging message. But Im not able to see Toast message. Dont know why ?<a href=""http://mobiforge.com/developing/story/sms-messaging-android"" rel=""nofollow"">http://mobiforge.com/developing/story/sms-messaging-android</a></p><p>I even downloaded the app and tried in my HTC Desire having Android 2.2</p><p>Is the code given in tutorial fine or wrong? </p>","490031","","","","","2010-12-26 02:58:24","Reading incoming sms","<android><sms><incoming>","1","4","","",""
"4531669","1","4532180","","2010-12-25 21:00:58","1","408","<p>I pretty much put my question in the title..</p><p>I spend quite a time with Android lately, but I'm still confused about how Android manage its resources? What's the role of the R.java file? What's the role of the /res folder and subfolders?</p><p>Is there any good article that gives satisfactory answer?</p><p>Thanks!</p>","481828","","","","","2010-12-25 23:45:41","How Android manage its resources?","<android><resources>","2","0","","",""
"4531694","1","4616683","","2010-12-25 21:07:27","1","3297","<p>I recently started exploring the android device policy administration APIs and have run into a bit of a wall.i'm having problems simply enabling the device administration. I'm fairly certain it is a problem with the manifest entry, however I can't quite pinpoint the problem area.</p><p>Manifest entry:</p><pre><code>&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:label=""DeviceAdminTrial"" android:icon=""@drawable/icon"" android:debuggable=""true""&gt;        &lt;activity android:name="".MyActivity""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;receiver android:name="".Receiver""                  android:label=""device_admin""                  android:permission=""android.permission.BIND_DEVICE_ADMIN""/&gt;                  &lt;meta-data android:name=""android.app.device_admin""                             android:resource=""@xml/device_admin""  /&gt;                  &lt;intent-filter&gt;                        &lt;action android:name=""android.app.action.DEVICE_ADMIN_ENABLED""/&gt;                  &lt;/intent-filter&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Error message:</p><pre><code>12-25 15:42:38.930: WARN/DeviceAdminAdd(394): Unable to retrieve device policy ComponentInfo{com.example/com.example.Receiver}        org.xmlpull.v1.XmlPullParserException: No android.app.device_admin meta-data</code></pre><p>device_admin.xml</p><pre><code>&lt;device-admin xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;uses-policies&gt;        &lt;limit-password /&gt;        &lt;watch-login /&gt;        &lt;reset-password /&gt;        &lt;force-lock /&gt;        &lt;wipe-data /&gt;    &lt;/uses-policies&gt;&lt;/device-admin&gt;</code></pre><p>Enabling Method:</p><pre><code> enable = (Button)findViewById(R.id.button);        enable.setOnClickListener(new View.OnClickListener()        {         public void onClick(View v)         {          Intent intent = new Intent (DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);          intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, receiver);          startActivityForResult(intent, 1);//1 is enabled, 0 is disabled.          output.setText(""""+policymanager.isAdminActive(receiver));         }        });</code></pre><p>And the Receiver class is as basic as the sample found here:<a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html</a></p><p>any help or advice would be much appreciated.</p>","556562","","19750","","2011-06-22 03:32:51","2012-06-18 04:24:33","device policy administration errors with Android","<android><policy><device-admin>","3","0","","",""
"4531843","1","4531890","","2010-12-25 21:59:03","1","587","<p>Case 1 in question:</p><p>I have been trying to have a ""pure"" 64-bit development environment on Windows 7. It cannot be done. See the two threads here:</p><p><a href=""http://stackoverflow.com/questions/4461575/64-bit-eclipse-wont-install-apk-on-android-emulator"">64-bit Eclipse won't install .apk on Android emulator</a></p><p><a href=""http://stackoverflow.com/questions/4474658/how-do-i-pause-the-command-window-when-launching-an-app"">How do I pause the command window when launching an app?</a></p><p><a href=""http://stackoverflow.com/questions/4499803/has-anyone-been-successful-in-using-64-bit-eclipse-for-android-2-3-dev-on-64-bit"">Has anyone been successful in using 64-bit Eclipse for Android 2.3 dev on 64-bit Windows 7?</a></p><p>I understand that 64-bit development on Windows 7 is not officially supported but then the obvious question is why? Why can't Google catch up with Microsoft?</p><p>Case 2 in question:</p><p>Even on 32-bit Windows XP, the recommended development platform/tools for Android, behaves in an unpredictable manner (how can one project schedules like this?):</p><p><a href=""http://stackoverflow.com/questions/4527903/huh-android-preferences-page-refuses-to-load-after-adding-sdk-1-6"">Huh? Android Preferences page refuses to load after adding SDK 1.6</a></p><p>Unlike programming for Windows using Microsoft's tools which is very stable and very predictable, my experience with Eclipse + Android plugin + Android SDKs is that I never know what kind of a ""landmine"" is waiting for me around the corner...</p><p>So my question is: Why is that?</p><ul><li>Is it because Eclipse is the alphaversion of WebSphere (similar to howFedora is the alpha for RHEL)?</li><li>Is it because Android plugins andSDKs are constantly in beta? (likeGmail used to be for many years)?</li><li>Is it because neither Eclipse norAndroid tools &amp; SDKs (for Windows) are adequatelytested?</li></ul><p>Please advise.</p><p>Note to the ""trigger-happy"" folks: If you vote to close this thread, you are essentially expressing distrust in community members to conduct an honest discussion about the current state of the Android development tools for Windows (with the potential of contributing to an improved tools set).</p><p>Update (1): Observing the down-votes, it is amusing to see how people prefer to 'click' instead of providing useful answers in the links above. Actually, it is not amusing, it is sad.</p><p>Update (2): I truly appreciate Paul McMillan's answer which was the most concrete and to-the-point. However, it was edited by someone else to include spin-doctoring like ""Fedora isn't the alpha for RHEL either - it's just more bleeding edge"" so I had to accept the next best answer.</p><p>Update (3): I can't believe that there are professionals who suggest working (on a daily basis, <em>not</em> for administration purposes) from an Admin account. I can understand lay home users doing so, but computer professionals?</p><p>Update (4): I managed to find a workaround for the problem described in case #2 (see link above). This took time that was intended for getting up and running with actual Android programming.</p><p>Update (5): I resorted to installing the same 64-bit development environment (Android 2.3) under Ubuntu 10.04 64-bit. Not a single hassle. And it's FAST. What a pleasure.</p><p><strong>Update (6)</strong>: I finally nailed down the source of this great ordeal. It turned out to be the <a href=""http://forums.comodo.com/firewall-help-cis/cis-firewall-blocking-android-sdk-t66863.0.html"" rel=""nofollow"">Comodo Firewal</a>l (aka <a href=""http://forums.comodo.com/firewall-help-cis/cis-firewall-blocking-android-sdk-t66863.0.html"" rel=""nofollow"">CIS</a>).</p>","418055","","418055","","2011-02-03 17:32:02","2011-02-03 17:32:02","Why is Setting Up a Development Environment for Android 2.3 under Windows so Nightmarish?","<android><windows><eclipse><eclipse-plugin>","2","5","","2010-12-25 23:24:18",""
"4532080","1","4532317","","2010-12-25 23:12:32","2","1117","<p>I'm developing a widget, it needs both to store data local to the widget instance and global to all widgets (cache and common data). Currently i'm using a PreferenceActivity setting its sharedpreference file to MYAPPNAME+WIDGETID, then i store common data (4/5 vars) in MYAPPNAME prefs.</p><p>I saw a lot of examples on the net using ContentProvider for this purpose, is there any advantage? Is it faster or different in some way to sharedpreferences? Sorry but its really not clear.</p>","376579","","","","","2010-12-26 00:30:51","Widget data: ContentProvider or SharedPreferences?","<android><widget><android-contentprovider><sharedpreferences>","1","0","2","",""
"4532121","1","4532172","","2010-12-25 23:24:20","4","3432","<p>I'm having the hardest time figuring out how to remove home screen AppWidget's programmatically (i.e. without the user actually dragging one into the trash). As an example, consider an app that can have multiple accounts, with any number of widgets for each account - once an account is removed, widget should be deleted as well.</p><p>I've tried following an obscure example from <a href=""http://www.netmite.com/android/mydroid/cupcake/frameworks/base/services/java/com/android/server/AppWidgetService.java"" rel=""nofollow"">http://www.netmite.com/android/mydroid/cupcake/frameworks/base/services/java/com/android/server/AppWidgetService.java</a>, but that doesn't seem to even trigger OnDeleted, much less remove the AppWidget from the home screen.</p><pre><code>Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_DELETED);intent.setComponent(info.componentName); // references AppWidgetProvider's classintent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId);sendBroadcast(intent);</code></pre><p>Does anyone have any advice on how this can be accomplished? An example would be the bee's knees. Thanks.</p>","132628","","","","","2011-10-14 23:09:26","Removing AppWidgets programmatically","<android><appwidget>","2","0","2","",""
"4532138","1","4906948","","2010-12-25 23:31:46","1","172","<p>The Android Market when doing a search, highlights the SoftKeyboard Return Key, hinting to the user the return key will execute the search.   </p><p>How can my App do the same? eg Highlight the Return Key?</p><p>Anyone know?  Thanks.</p>","553746","","553746","","2011-02-05 11:42:39","2011-02-05 12:58:31","Android Market highlights Return Key SoftKeyboard. How can my App do that?","<android>","1","0","0","",""
"4532216","1","4532290","","2010-12-25 23:57:25","2","1072","<p>I successfully mapped an image on a square in OpenGL ES...but its rotated 90 degrees. Im pretty new at OpenGL ES, and was wondering if someone could point out why exactly its rotated. Thanks!</p><pre><code>package se.jayway.opengl.tutorial;import java.io.IOException;import java.io.InputStream;import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.nio.FloatBuffer;import java.nio.ShortBuffer;import javax.microedition.khronos.opengles.GL10;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.opengl.GLUtils;public class Square {// Our vertices.private float vertices[] = {        -1.0f, -1.0f, 0.0f, //Vertex 0        1.0f, -1.0f, 0.0f,  //v1        -1.0f, 1.0f, 0.0f,  //v2        1.0f, 1.0f, 0.0f,   //v3    };//Our texture.private float texture[] = {        //Mapping coordinates for the vertices        0.0f, 0.0f,        0.0f, 1.0f,        1.0f, 0.0f,        1.0f, 1.0f, };// The order we like to connect them.private byte indices[] = {        //Faces definition        0,1,3, 0,3,2,           //Face front                            };// Our vertex buffer.private FloatBuffer vertexBuffer;// Our index buffer.private ByteBuffer indexBuffer;//texture buffer.private FloatBuffer textureBuffer;//Our texture pointer.private int[] textures = new int[1];public Square() {    ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4);    byteBuf.order(ByteOrder.nativeOrder());    vertexBuffer = byteBuf.asFloatBuffer();    vertexBuffer.put(vertices);    vertexBuffer.position(0);    //    byteBuf = ByteBuffer.allocateDirect(texture.length * 4);    byteBuf.order(ByteOrder.nativeOrder());    textureBuffer = byteBuf.asFloatBuffer();    textureBuffer.put(texture);    textureBuffer.position(0);    //    indexBuffer = ByteBuffer.allocateDirect(indices.length);    indexBuffer.put(indices);    indexBuffer.position(0);        }/** * This function draws our square on screen. * @param gl */public void draw(GL10 gl) {    //Bind our only previously generated texture in this case    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);    //Point to our buffers    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    //Set the face rotation    gl.glFrontFace(GL10.GL_CCW);    //Enable the vertex and texture state    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);    //Draw the vertices as triangles, based on the Index Buffer information    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer);    // Disable the vertices buffer.    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    //Disable the texture buffer.    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    // Disable face culling.    gl.glDisable(GL10.GL_CULL_FACE);}/** * Load the textures *  * @param gl - The GL Context * @param context - The Activity context */public void loadGLTexture(GL10 gl, Context context) {    //Get the texture from the Android resource directory    InputStream is = context.getResources().openRawResource(R.drawable.android);    Bitmap bitmap = null;    try {        //BitmapFactory is an Android graphics utility for images        bitmap = BitmapFactory.decodeStream(is);    } finally {        //Always clear and close        try {            is.close();            is = null;        } catch (IOException e) {        }    }    //Generate one texture pointer...    gl.glGenTextures(1, textures, 0);    //...and bind it to our array    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);    //Create Nearest Filtered Texture    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);    //Use the Android GLUtils to specify a two-dimensional texture image from our bitmap    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    //Clean up    bitmap.recycle();}}</code></pre>","385051","","","","","2010-12-26 00:21:40","mapping a texture on a square: Why is the image rotated?","<iphone><android><opengl-es><textures><texture-mapping>","2","0","","",""
"4532221","1","4532341","","2010-12-25 23:58:17","1","425","<p>I'm writing an android app that has a standard activity, but also needs to monitor incoming/outgoing calls and texts at all times. In addition, the app needs to notify users of information once a day without having the activity open. The information it notifies users of is stored in a database, so communication with the activity is not necessary.  I've been researching for a week and still can't decide how to go about doing this.  My instinct tells me I need a remote service that has a constantly running broadcast receiver, but every remote service example I see is overly complicated.  Could anyone help me better understand what steps I need to take? Thanks in advance.</p>","518060","","","","","2010-12-26 00:43:09","Structure question over Local/Remote Services, Broadcast Receivers, and Intent Services","<android><android-intent><android-service><android-lifecycle>","1","0","1","",""
"4532325","1","4532354","","2010-12-26 00:35:21","3","3646","<p>I have read the tutorial from ibm about xml parsing</p><p>(http://www.ibm.com/developerworks/opensource/library/x-android/)</p><p>In this example,there are four types of xml parsing.Dom,Sax,Android Sax and xml_pull.Could you please tell me what's the difference between these four types and when i have to use each one?</p><p>Also,with every way of xml parsing in this tutorial,the feeds are shown in a listView. What i have to do in order to appear every announcement in a btn for example?</p><p>thanks for your time!Merry Christmas:D</p>","519526","","","","","2010-12-26 00:51:10","different types of parsing","<android><xml>","1","0","","",""
"4532387","1","4532391","","2010-12-26 01:12:00","0","782","<p>I have an app which will start sending location data to a remote server, when I press a button. I am using <code>LocationListener</code> since I want to send the location points if a certain distance or time threshold is reached.</p><p>I want the <code>LocationListener</code> to send data to the server as long as the phone is on and the button is not pressed back to shut it down. </p><p>How can I do that? </p><p>How can I have the <code>LocationListener</code> to run continuously as long as the phone is on - even if I am not running the app which activated the location listener?</p>","522559","","944181","","2012-09-19 13:08:29","2012-09-19 13:08:29","android: LocationListener running permanently","<android><geolocation><gps><locationlistener>","1","0","","",""
"4532550","1","4852274","","2010-12-26 02:45:33","1","1229","<p>I'm sure that this question has been asked before but I've been unable to find a solid answer. I'm trying to load a streaming audio from a server. Its a audio/aac file</p><p><a href=""http://3363.live.streamtheworld.com:80/CHUMFMAACCMP3"" rel=""nofollow"">http://3363.live.streamtheworld.com:80/CHUMFMAACCMP3</a></p><p>The code that I'm using is </p><pre><code>private void playAudio(String str) {  try {   final String path = str;   if (path == null || path.length() == 0) {    Toast.makeText(RadioPlayer.this, ""File URL/path is empty"",      Toast.LENGTH_LONG).show();   } else {    // If the path has not changed, just start the media player    MediaPlayer mp = new MediaPlayer();    mp.setAudioStreamType(AudioManager.STREAM_MUSIC);    try{     mp.setDataSource(getDataSource(path));     mp.prepareAsync();     mp.start();    }catch(IOException e){     Log.i(""ONCREATE IOEXCEPTION"", e.getMessage());    }catch(Exception e){     Log.i(""ONCREATE EXCEPTION"", e.getMessage());    }    }  } catch (Exception e) {   Log.e(""RPLAYER EXCEPTION"", ""error: "" + e.getMessage(), e);  } } private String getDataSource(String path) throws IOException {  if (!URLUtil.isNetworkUrl(path)) {   return path;  } else {   URL url = new URL(path);   URLConnection cn = url.openConnection();   cn.connect();   InputStream stream = cn.getInputStream();   if (stream == null)    throw new RuntimeException(""stream is null"");   File temp = File.createTempFile(""mediaplayertmp"", "".dat"");   temp.deleteOnExit();   String tempPath = temp.getAbsolutePath();   FileOutputStream out = new FileOutputStream(temp);   byte buf[] = new byte[128];   do {    int numread = stream.read(buf);    if (numread &lt;= 0)     break;    out.write(buf, 0, numread);   } while (true);   try {    stream.close();   } catch (IOException ex) {    Log.e(""RPLAYER IOEXCEPTION"", ""error: "" + ex.getMessage(), ex);   }   return tempPath;  } }</code></pre><p>Is this the correct implementation? I'm not sure where I'm going wrong. Can someone please please help me on this.</p>","320293","","","","","2011-01-31 14:52:18","Streaming audio not working in Android","<android><audio><streaming><aac>","2","1","","",""
"4532566","1","4532587","","2010-12-26 02:56:29","2","645","<p>I have a background in protocol stack - for 3g handsets. Now I need to communicate from an Android slate PC to a server, and I will code both sides of the interfacet.</p><hr><p>Update: I ought to have said, from Android (multiple) slate to local server (multiple), then over satellite to a single central master server.    </p><p>And now I think that I might not be implementing, just designing so looking for something easy for junior engineers to handle  </p><hr><p>SOAP looks ok, but are their any good IDEs to develop something for SOAP (or GSOAP) for Android (not sure yet which o/s the server will run; with luck I will get to choose).</p><p>Or should I just roll my own and use TCP/IP?  (I have  feeling, which I can't justify, SOAP might be quicker to develop and easier for others to maintain).</p><p>If I roll my own, I can just use C or C++ at both ends. IF SOAP, can I use C/C++ on Android (I know that I can if it's non-SOAP), or do I go with Java? And, if I do, should I then go with Java at the server, for maintainability?</p><p>Final note: I guess that SOAP will add an overhead and I will be doing this over a satellite link, where every byte costs.</p><p>Does any of that make sense, or do I need to explain it better?</p>","192910","","192910","","2010-12-26 14:54:53","2010-12-26 16:08:04","To SOAP, or not to SOAP? That is the question","<java><android><web-applications><soap><ide>","1","0","1","",""
"4532626","1","4532839","","2010-12-26 03:26:34","0","404","<p>This is a pretty strange problem.  I have a book that I have been going through (The Android Developer's Cookbook)</p><p>I am making a pretty basic app (at least, I think it is basic)</p><p>The problem I am having is this.  When the service I create is stopped, the activity does the service's work.</p><p>I want to monitor the Z Axis reading on my phone (in the background, always)</p><p>Here is my project structure:  TiltMonitorActivity  TiltMonitorService</p><p>From TiltMonitorActivity:</p><pre><code>@Override        public void onClick(View v) {            boolean error = false;            if (tbService.isChecked()) {                                    try {                    startService(backgroundService);                }                catch (Exception e) {                                                 error = true;                }                finally {                    if (error)                    {                        errorToast();                    }                }            }            else if (!tbService.isChecked()) {                try {                    stopService(backgroundService);                }                catch (Exception e){                                                  error = true;                }                finally {                    if (error)                    {                        errorToast();                    }                }            }        }});</code></pre><p>I also put this in onBackPressed(), onPause, onDestroy</p><p><code>finish();</code></p><p>The intent I create when starting/stopping service</p><pre><code>final Intent backgroundService = new Intent(this, TiltMonitorService.class);</code></pre><p>From TiltMonitorService:</p><pre><code>  import android.app.Service;import android.content.Context;import android.content.Intent;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;import android.os.IBinder;import android.os.Vibrator;import android.widget.Toast;public class TiltMonitorService extends Service {    private SensorManager sensorManager = null;    private Vibrator vibrator = null;    private float[] accData = new float[3];    // These are for manual config    private float FORWARD_THRESHOLD = 5f;    private float BACKWARD_THRESHOLD = -5f;    // These are for auto config    // The phone will face forward, so a positive Z Axis means user is leaning backwards    // and that a negative Z Axis the user is leaning forward    private float AUTO_FORWARD_THRESHOLD = -1.5f;    private float AUTO_BACKWARD_THRESHOLD = 3.5f;    public static TiltMonitorActivity MAIN_ACTIVITY = null;    public static void setMainActivity(TiltMonitorActivity activity)    {        MAIN_ACTIVITY = activity;    }    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {        super.onCreate();        sensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);        vibrator = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);        sensorManager.registerListener( tiltListener,                                         sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),                                         SensorManager.SENSOR_DELAY_NORMAL);        Toast.makeText(this, ""Service created"", Toast.LENGTH_LONG).show();    }    @Override    public void onDestroy() {        super.onDestroy();        Toast.makeText(this, ""Service destroyed"", Toast.LENGTH_LONG).show();    }    private SensorEventListener tiltListener = new SensorEventListener() {        @Override        public void onAccuracyChanged(Sensor sensor, int accuracy) {            // TODO Auto-generated method stub        }        @Override        public void onSensorChanged(SensorEvent event) {            accData[0] = event.values[0];            accData[1] = event.values[1];            accData[2] = event.values[2];            checkData(accData);        }    };    private void checkData(float[] accData)    {        if ((accData[2] &lt; AUTO_FORWARD_THRESHOLD) || (accData[2] &gt; AUTO_BACKWARD_THRESHOLD))        {            vibrator.vibrate(100);        }    }    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);    }}</code></pre><p>Again, I get the Toast that the service has been started and stopped when hitting the ToggleButton in the activity.</p><p>But the task still happens. (Vibrates when below or above set thresholds)</p><p>When I open up a task killer, the service isn't running.  Only the activity is (and killing it kills the vibration)</p><p>I'm not sure what words to search for, I couldn't find any one else with the same problem.  I tried to post only relevant code in the Activity to avoid clutter.  The service is posted in its entirety.  If more is needed, I will put it up promptly.</p><p>Thanks you guys for any insight given</p>","554092","","","","","2010-12-26 05:10:55","Service destroyed, Activity still does service's work","<android><activity><android-service>","1","0","0","",""
"4532663","1","","","2010-12-26 03:42:14","0","151","<p>i have an idea for an Android game which is a little different from the typical game that usually moves sprites(bitmaps) around the screen. Id want to plot lots of little pixels to create my visuals.</p><p>PROS</p><ul><li>no bitmaps required</li><li>pixel plotting of stuff like ""fire"" can react to wind.</li><li>no need to scale bitmaps, works w/ any screen res (lets pretend device can handle more drawing because its got a bigger screen).</li></ul><p>CONS</p><ul><li>slower to plot pixels than blit bitmaps</li><li>need lot of animation frames.</li></ul><p>WISHES</p><ul><li>id like to update my game in real time, more is better 30fps is good but not essential, 15fps is enough.</li></ul><p>PERFORMANCE Q...</p><ul><li>Is the typical Android device fast enough to plot say half a screenful of pixels w/ a default background ?</li><li>if full screen is not practical what window size should be able to handle such refreshes</li></ul>","56524","","","","","2011-09-10 10:20:31","Is Android (read typical devices) fast enough for a game that requires plotting pixel by pixel rather than blitting","<android>","1","2","","",""
"4532669","1","4533367","","2010-12-26 03:45:17","0","696","<p>Without accessing private API's to get Content URI's, etc. for SMS, how are we expected to query this data? I am currently in the process of writing my own SMS app and I want to stay as compatible as possible. Without storing the information myself in my own database (such that I can store the text messages so that other programs can access the data when/if they delete my app) and without using private API's how the heck are we suppose to query SMS data?</p>","311147","","","","","2010-12-26 09:37:58","Private API and SMS content URI's on Android","<java><android><api><sms>","1","0","","",""
"4532701","1","","","2010-12-26 04:05:53","0","670","<p>I'm trying to run a SQL update, and it's returning errors.  For the life of me I can't figure out what's going wrong.  This first attempt errors out with a database can't be opened error, which makes no sense since the second try opens fine:</p><pre><code>    SQLiteDatabase db = null;    try{       db = SQLiteDatabase.openDatabase(dbnametmp, null, SQLiteDatabase.OPEN_READWRITE);       for (int x = 0; x &lt; ids.length; x++) {            ContentValues values = new ContentValues();            values.put(""color"", colors[x]);            db.update(""ColorTable"", values, ""id=?"", new String[] {Integer.toString(ids[x])});       }    }catch(SQLiteException e){       Log.e(""nowsciColor"", e.getMessage(), e);    }catch(Exception e){       Log.e(""nowsciColor"", e.getMessage(), e);    }    if (db != null)       db.close();</code></pre><p>The second attempt is below.  It does not throw an error, however the actual updates do not occur.  If I query the table right after (both without and with re-opening the DB), the values are the same as they were prior to the update.  I have also tried this without the begin and commits, and as separate sql calls.</p><pre><code>    SQLiteDatabase db = null;    try{       db = SQLiteDatabase.openDatabase(dbnametmp, null, SQLiteDatabase.OPEN_READWRITE);       String sql = ""begin transaction;"";       for (int x = 0; x &lt; ids.length; x++) {           sql += ""update ColorTable set color="" + Integer.toString(colors[x]) + "" where id="" + Integer.toString(ids[x]) + "";"";       }       sql += ""commit;"";       db.execSQL(sql);    }catch(SQLiteException e){       Log.e(""nowsciColor"", e.getMessage(), e);    }catch(Exception e){       Log.e(""nowsciColor"", e.getMessage(), e);    }    if (db != null)       db.close();</code></pre><p>Running these exact same queries in the DB on a computer works fine.  The database is also not in use by any other application.  Any help would be appreciated.</p>","554110","","","","","2010-12-27 19:24:38","SQLite updates won't save or can't execute","<android><sqlite>","1","5","","",""
"4532715","1","4582054","","2010-12-26 04:13:18","1","438","<p>The android app quitted without any warning and error when bluetoothServersocket.close() called in the main thread while bluetoothServersocket.accept(); was blocked for incoming connections in another thread.</p><p>Here is pieces of my code.</p><blockquote>  <blockquote>    <p>public void run() {</p>        <blockquote>      <blockquote>        <p>try {</p>                <blockquote>          <blockquote>            <p>bluetoothServerSocket = BluetoothAdapter.            getDefaultAdapter().listenUsingRfcommWithServiceRecord(LISTEN_NAME, LISTEN_UUID);</p>                        <p>/* the thread blocked here for incoming connections */</p>                        <p>bluetoothSocket = bluetoothServerSocket.accept();</p>                        <p>...</p>          </blockquote>        </blockquote>                <p>} catch(Exception e) {} finally {</p>                <blockquote>          <blockquote>            <p>try {bluetoothServerSocket.close();} catch(Exception ex) {}</p>                        <p>try {bluetoothSocket.close();} catch(Exception ex) {}</p>          </blockquote>        </blockquote>                <p>}</p>      </blockquote>    </blockquote>        <p>}</p>  </blockquote></blockquote><p>And in the activity.</p><blockquote>  <blockquote>    <p>public void onStop () {</p>        <blockquote>      <blockquote>        <p>try{thread.bluetoothSocket.close();} catch(Exception ex) {}</p>                <p>try{thread.bluetoothServerSocket.close();} catch(Exception ex) {}</p>                <p>super.onStop();</p>      </blockquote>    </blockquote>        <p>}</p>  </blockquote></blockquote><p>When I clicked the back button. The activity closed but after about one second the app quitted without any warning.</p><p>My android os version is 2.2. a HTC Desire device.</p>","523002","","523002","","2010-12-26 04:34:31","2011-01-03 04:22:20","Android app unexpectedly quitted when I closed the bluetooth serversocket or bluetooth socket","<android><bluetooth>","1","0","","",""
"4532822","1","4532929","","2010-12-26 05:02:43","0","4130","<p>I am trying to connect my android application to sqlite, i dont knw how to configure SD card in emulator to have a database... can anyone help me please?</p>","553670","","","","","2010-12-26 06:01:27","how to connect sqlite to an android application?","<android>","1","0","","",""
"4532900","1","4533101","","2010-12-26 05:41:13","3","2090","<p>I have a very basic knowledge on getting the location. My requirement is to get the Cell Network Provider Location without having Wifi or Gps enabled. I just need to get the location based on Cell Network Provider. Is that possible? If yes, could you please help me with some code snippets. I appreciate your help. Thanks. </p>","527053","","","","","2010-12-26 07:38:42","Android: How to get Cell Network Provider Location","<android><location>","1","0","1","",""
"4532936","1","4532956","","2010-12-26 06:04:25","0","1837","<p>I am trying to use MapView provided by Google API. I am not able to import the package i saw in google page we need to get a key for using google API do anyone know how to use Google API.Thanks in advance...</p>","553670","","","","","2010-12-26 06:17:11","How to use Google MapView in android apllication?","<android>","1","0","","",""
"4532974","1","4532978","","2010-12-26 06:29:38","1","1515","<p>I am trying to do a check if the User-name entered by the user exists in the DB.</p><pre><code>public Cursor checkUsername(String username) throws SQLException {    Cursor mCursor = db.query(true, TABLE_USERS, new String[] { ID,            KEY_NAME, KEY_USERNAME}, KEY_USERNAME + ""=""            + username, null, null, null, null, null);    if (mCursor != null) {        return true;    }    return false;}</code></pre><p>When i return true or false i am getting an Error saying</p><pre><code>Type mismatch: cannot convert from boolean to Cursor</code></pre><p>i just want to return true or false from the DBAdaptor back to the Activity.</p>","155196","","1288","","2010-12-26 13:52:35","2011-07-21 13:47:25","Check to see if a value exists in DB","<android><database>","2","0","1","",""
"4533022","1","4533027","","2010-12-26 06:55:14","0","179","<p>I am trying do a sign up process. Where i have a method inside the DbAdaptor where i check if the username exists.</p><pre><code>public Boolean checkUsername(String username) throws SQLException {    Cursor mCursor = db.query(TABLE_USERS, new String[] { ID,            KEY_NAME, KEY_USERNAME}, KEY_USERNAME + ""=""            + username, null, null, null, null, null);    if (mCursor != null) {        return true;    }    return false;}</code></pre><p>From the Edit text i sent a value ""harsha"" as username to test it. but i am getting the following error </p><p><img src=""http://i.stack.imgur.com/7kzIN.png"" alt=""alt text""></p><p><a href=""http://variable3.com/files/screenshots/2010-12-26_1215.png"" rel=""nofollow"">http://variable3.com/files/screenshots/2010-12-26_1215.png</a></p><p>the code inside the activity is this</p><pre><code>                DBAdapter db = new DBAdapter(RegisterActivity.this);                db.open();                if (db.checkUsername(username))                            Toast.makeText(RegisterActivity.this, ""Found"",                             Toast.LENGTH_LONG).show();                else                    Toast.makeText(RegisterActivity.this, ""Not Found"",                             Toast.LENGTH_LONG).show();                db.close();</code></pre>","155196","","135152","","2011-05-25 03:03:19","2011-05-25 03:03:19","No Such Column found","<android><sqlite>","2","0","","",""
"4533116","1","4533162","","2010-12-26 07:42:36","10","42257","<p>Need information about minimum hardware requirement for better experience in developing Android application.  </p><p>My current configuration is as follows. P4 3.0 GHz, 512 MB of ram.  </p><p>Started with Hello Android development on my machine and experience was sluggish, was using Eclipse Helios for development. Emulator used to take lot of time to start. And running program too.<br>Do I need to upgrade my machine for the development purpose or is there anything else I am missing on my machine(like heavy processing by some other application I might have installed).  </p><p>And If I do need to upgrade, do I need to upgrade my processor too(that counts to new machine actually, which I am not in favor of), or only upgrading RAM will suffice.  </p>","238748","","1228","","2013-06-04 17:10:54","2013-06-04 17:10:54","Minimum Hardware requirements for Android development","<android>","10","1","2","2013-06-04 17:11:01",""
"4533201","1","4533219","","2010-12-26 08:29:41","0","391","<p>i am trying to login and want to validate username and password against the records in the database. I am not sure how to pass two Where clause</p><pre><code>public Boolean login(String username, String password) throws SQLException {    Cursor mCursor = db.query(TABLE_USERS, new String[] { ID,            KEY_NAME, KEY_USERNAME}, KEY_USERNAME + ""=""            + ""'""+username+""'"", KEY_PASSWORD + ""=""            + ""'""+password+""'"", null, null, null, null, null);    if (mCursor.moveToFirst()) {        return true;    }    return false;}</code></pre><p>Am getting a Syntax Error.</p>","155196","","135152","","2011-05-25 03:02:57","2011-05-25 03:02:57","Query having 2 Where Clause","<java><android><sqlite>","1","0","","",""
"4533206","1","4533454","","2010-12-26 08:32:47","3","3260","<p>I've been having some odd problems with permission in Android. I am trying to just get a list of the google calendars a particular user has, but first I need to let them pick the account.</p><p>I included this line in my manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.GET_ACCOUNTS""&gt;&lt;/uses-permission&gt;</code></pre><p>However I get this error:</p><pre><code>12-26 03:26:31.004 13841 13841 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{....}: java.lang.SecurityException: caller uid 10105 lacks any of android.permission.GET_ACCOUNTS</code></pre><p>I had tried something similar with gaining access to the undocumented Calendar API with <code>READ_CALENDAR</code> and <code>WRITE_CALENDAR</code>, but I had similar exceptions (although probably for different reasons - I thought it might be worth mentioning in case it wasn't).</p><p>Please clue me in on what I'm doing wrong!</p><p>Thanks! </p>","210920","","","","","2013-12-07 22:37:15","Permissions Not Working","<android><permissions><accounts>","2","0","","",""
"4533218","1","4533266","","2010-12-26 08:37:59","3","5108","<p>I'd like to make a MapView, but extending the MapActivity throws a classNotFoundException:</p><pre><code>   /AndroidRuntime(  374):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)    E/AndroidRuntime(  374):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)    E/AndroidRuntime(  374):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)    E/AndroidRuntime(  374):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)    E/AndroidRuntime(  374):        at android.os.Handler.dispatchMessage(Handler.java:99)    E/AndroidRuntime(  374):        at android.os.Looper.loop(Looper.java:123)    E/AndroidRuntime(  374):        at android.app.ActivityThread.main(ActivityThread.java:4627)    E/AndroidRuntime(  374):        at java.lang.reflect.Method.invokeNative(Native Method)    E/AndroidRuntime(  374):        at java.lang.reflect.Method.invoke(Method.java:521)    E/AndroidRuntime(  374):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    E/AndroidRuntime(  374):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)    E/AndroidRuntime(  374):        at dalvik.system.NativeStart.main(Native Method)    E/AndroidRuntime(  374): Caused by: java.lang.ClassNotFoundException: com.androidcourse.phonemapper.view.MapShowActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.androidcourse.phonemapper-2.apk]    E/AndroidRuntime(  374):        at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)    E/AndroidRuntime(  374):        at java.lang.ClassLoader.loadClass(ClassLoader.java:573)    E/AndroidRuntime(  374):        at java.lang.ClassLoader.loadClass(ClassLoader.java:532)    E/AndroidRuntime(  374):        at android.app.Instrumentation.newActivity(Instrumentation.java:1021)    E/AndroidRuntime(  374):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)</code></pre><p>I have a Google Maps API key, I had set the project to be for Google APIs, I am using an Android Google API AVD(emulator) and I did include the  tag in 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.androidcourse.phonemapper"" android:versionCode=""1""    android:versionName=""1.0""&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_COARSE_LOCATION""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  &lt;uses-library android:name=""com.google.android.maps"" /&gt;</code></pre><p>.................</p><pre><code>        &lt;activity android:name="".view.WelcomeActivity"" 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;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/mainlayout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/mapview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:clickable=""true""        android:apiKey=""api_key_is_here_just_wont_show_it_to_everybody""    /&gt;&lt;/RelativeLayout&gt;</code></pre>","346583","","881229","","2013-12-07 20:28:00","2013-12-07 20:28:00","Android::Extending MapActivity => classNotFound Exception","<android><google-maps><android-mapview><mapactivity>","4","1","","",""
"4533300","1","5659393","","2010-12-26 09:07:43","12","9288","<p>How do you calculate the Abstracted LCD Density for an AVD ?</p>","4857","","213269","","2011-03-22 08:35:53","2012-05-09 08:35:12","Abstracted LCD Density","<android><android-emulator><avd>","3","0","4","",""
"4533308","1","4533344","","2010-12-26 09:10:52","0","5761","<p>I am trying to show a spinning progress while I load some data, but it isn't showing until after the data is loaded?</p><p>Here is how I am trying to do this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.screen1);    //Show spinner while data is being loaded    ProgressDialog dialog = ProgressDialog.show(this, """", ""Loading. Please wait..."", true);    LoadPreferences();    LoadData();    //Remove the spinner once all the data has been loaded    dialog.dismiss();}</code></pre><p>What am I doing wrong?      </p><p>Updated code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.screen1);//Show spinner while data is being loadedfinal ProgressDialog dialog = ProgressDialog.show(this, """", ""Loading. Please wait..."", true);// define and run background threadThread backgroundThread = new Thread(new Runnable() {                public void run()     {        // keep sure that this operations        // are thread-safe!        Looper.prepare(); //I had to include this to prevent force close error        LoadPreferences();        LoadData();        runOnUiThread(new Runnable()         {                                public void run()             {                dialog.dismiss();            }        });    } });        backgroundThread.start();}</code></pre><p>This now loads the app and shows the spinner. But my LoadData() function is crashing it when trying to update the UI:</p><pre><code>12-27 21:58:12.575: ERROR/AndroidRuntime(357): Uncaught handler: thread Thread-8 exiting due to uncaught exception12-27 21:58:12.575: ERROR/AndroidRuntime(357): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.ViewRoot.checkThread(ViewRoot.java:2683)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.ViewRoot.requestLayout(ViewRoot.java:557)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.widget.TableLayout.requestLayout(TableLayout.java:223)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.widget.ScrollView.requestLayout(ScrollView.java:1103)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.view.View.requestLayout(View.java:7918)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.widget.TextView.checkForRelayout(TextView.java:5373)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.widget.TextView.setText(TextView.java:2684)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.widget.TextView.setText(TextView.java:2552)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at android.widget.TextView.setText(TextView.java:2527)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at com.bebetech.helloWorld.helloWorld.UpdateGUI(helloWorld.java:346)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at com.bebetech.helloWorld.helloWorld.LoadData(helloWorld.java:191)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at com.bebetech.helloWorld.helloWorld.$1.run(helloWorld.java:106)12-27 21:58:12.575: ERROR/AndroidRuntime(357):     at java.lang.Thread.run(Thread.java:1096)</code></pre>","330368","","330368","","2010-12-27 12:10:50","2012-12-04 07:59:59","ProgressDialog not showing until after function finishes","<android>","3","1","0","",""
"4533320","1","4534092","","2010-12-26 09:15:34","5","14302","<p>I've got a linear layout that i have set true to be clikable + focus, But the problem is there is no focus displayed when clicked. How can i get the focus to be displayed.</p><p>Heres my code</p><pre><code>&lt;LinearLayout     android:id=""@+id/linear_tv_layout""  android:orientation=""horizontal""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:layout_weight=""1""  android:clickable=""true""  android:focusable=""true""  android:paddingBottom=""7px""&gt;</code></pre>","554215","","","","","2013-08-22 19:46:20","Android clickable layout","<android>","5","3","4","",""
"4533347","1","4533415","","2010-12-26 09:29:16","1","3336","<p>I'm using Eclipse.</p><p><strong>Problem</strong>: Code that references colors in my resource folder can't be launched.</p><p><strong>Example</strong>:</p><pre><code>--&gt;&lt;LinearLayout `android:background=""@color/background""` // I don't have the color directory. How do I get it. (that code refers to color in my project/res folder)  android:layout_height=""fill_parent"" &lt;/LinearLayout&gt;</code></pre>","554217","","7918","","2014-01-14 20:00:55","2014-01-14 20:00:55","Unable to reference the res/colors file - Eclipse","<android>","3","0","","",""
"4533427","1","4533443","","2010-12-26 09:59:39","1","403","<p>If I'm attempting to define a default constructor for the class which is extending an Activity I'm getting force close on application execution. Why is it so?</p><pre><code>public class App extends Activity {    App() {              // FORCE CLOSE    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);}}</code></pre>","397991","","","","","2010-12-26 10:05:29","Force close on trying to use default constructor","<android>","1","0","0","",""
"4533440","1","4533488","","2010-12-26 10:04:15","23","70489","<p>i am trying to set the ListView TextColor to Black. Since i am using a White Background.</p><p>Here is my MailActivity</p><pre><code>public class MailActivity extends ListActivity {    String[] listItems = { ""Compose"", ""Inbox"", ""Drafts"", ""Sent"" };    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.mails);        setListAdapter(new ArrayAdapter(this,                android.R.layout.simple_list_item_1, listItems));    }}</code></pre><p>and my XML</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""#FFFFFF""&gt;    &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content""/&gt;    &lt;TextView android:id=""@android:id/empty"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:text=""Empty set"" android:textColor=""#000000"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>i get the background as white. but am not sure where to set foreground to black. tried in the xml and looks like its not helping</p>","155196","","","","","2011-12-16 05:39:09","Android ListView Text Color","<android><listview>","3","0","7","",""
"4533473","1","4533522","","2010-12-26 10:18:53","0","5383","<p>I am not having much success finding how to set the textSize for a ListView in the xml code - do I have to create a style?  any suggestions?Ron</p>","538847","","3274830","","2014-03-27 08:01:03","2014-03-27 08:01:03","ListView text size","<android>","1","0","","",""
"4533476","1","4533519","","2010-12-26 10:20:34","1","1784","<p>In my app, when the user is editting a certain MultiAutoCompleteTextView with a virtual keyboard, I want to present him the default android keyboard, but change two of the buttons on it - not their locations, but the drawings on them (the voice input and the smiley buttons), and their functionality.is there a way of doing so without creating a new InputMethod or a new keyboard class?</p>","554233","","","","","2011-08-22 13:03:20","overriding the default android keyboard","<android><keyboard><virtual>","1","0","","",""
"4533556","1","4533591","","2010-12-26 10:52:24","0","45","<p>In my country accessing to android website in order to download the SDK is denied. There are several programmers that can't download SDK. I'm not in my country, so I can download and update SDK.</p><p>My question is, can they use my SDK if I compress (zip) that folder and share it for them?</p>","513413","","","","","2010-12-26 11:03:13","Android, Can I share my updated SDK with other programmers?","<android><sdk><download>","1","1","","",""
"4533558","1","","","2010-12-26 10:53:02","0","1864","<p>Ok, so I have this problem. I have a service that plays a mp3 file. I can also pause and stop the mp3 by AIDL functions. That works perfect. I can press the homebutton an then restart the activity and I have still control over the service.</p><p>However, if I press the back key and then opens the activity I can't control the service anymore.</p><p>I think it should be possible to rebind to the control when restarting the activiy. But what's happening is that new instance of the service is started and I can't stop the mp3 that is playing. I can play a new mp3 however. What am I doing wrong?</p>","554243","","492624","","2011-11-29 10:55:13","2012-12-02 09:57:48","Service, Rebind or not bound at all?","<android><service>","3","3","","",""
"4533583","1","4533602","","2010-12-26 11:00:31","0","672","<p>I'm using the java Date Class in eclipse for Android as getYear is soon to be deprecated and replaced with getFullYear but the Class doesn't have the getFullYear function... What do I need to do to get it??</p>","548552","","","","","2010-12-26 11:35:39","Android: I can't find getFullYear()","<android>","2","4","","",""
"4533633","1","4533645","","2010-12-26 11:17:14","0","1177","<p>I am trying use a switch case. But it says i cant pass a string :(</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    // super.onListItemClick(l, v, position, id);    String selection = l.getItemAtPosition(position).toString();    Log.i(""Harsha"", selection);    switch (selection) {    case ""Compose"":        break;    case ""Inbox"":        break;    case ""Drafts"":        break;    case ""Sent"":        break;    default:        break;    }}</code></pre><p>The error is</p><pre><code>Cannot switch on a value of type String. Only convertible int values or enum constants are permitted</code></pre>","155196","","","","","2010-12-26 12:11:09","Android SwitchCase inside onListItemClick","<android><listview><switch-statement>","2","0","","",""
"4533684","1","4533699","","2010-12-26 11:41:20","3","5474","<p>I have a ListView specified by list_item.xml Now I need to change the Image in my list inside onListItemClick. How to achieve this?</p><pre><code>//list_item.xml&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;ImageViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/play"" android:id=""@+id/img""/&gt; &lt;TextView android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:gravity=""center_vertical""android:id=""@+id/txt""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I have a Custom Adapter to populate my list. Code below is the adapter.</p><pre><code>    public class MyCustomAdapter extends ArrayAdapter&lt;String&gt; {public MyCustomAdapter(Context context, int textViewResourceId,  String[] objects) { super(context, textViewResourceId, objects); // TODO Auto-generated constructor stub}@Overridepublic View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub LayoutInflater inflater=getLayoutInflater(); View row=inflater.inflate(R.layout.list_item, parent, false); TextView label=(TextView)row.findViewById(R.id.txt); label.setText(Sounds[position]); ImageView icon=(ImageView)row.findViewById(R.id.img);     icon.setMaxHeight(32);     icon.setMaxWidth(32); icon.setPadding(2, 1, 5, 1); icon.setImageResource(R.drawable.play); return row;}}    </code></pre><p>And in onCreate I do the following</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    try    {            setListAdapter(new MyCustomAdapter(this, R.layout.list_item, Sounds));            //Sounds --&gt; String array     }    catch(Exception e)    {        e.printStackTrace();    }  }</code></pre><p><strong>Now when any row is selected, I need to change the image associated with the selected view. Your help is appreciated. Thanks.</strong></p>","527053","","","","","2010-12-30 13:38:54","Android: Change the source of ImageView present in ListView","<android><image><listview>","1","1","0","",""
"4533728","1","4533750","","2010-12-26 11:57:58","2","15779","<p>I'm using several buttons in my app, but both layout_width/height ""wrap_content"" and ""fill_parent"" looks weird. The former being to small and the latter too large - both looks weird, and the former is not easy to hit with your finger.</p><p>How should I size buttons? Is it typical to define their sizes in dip? Or should I use ""fill_parent"" with a padding? Buttons looks weird in my app, not so in others.</p>","499795","","","","","2010-12-26 12:03:57","Android: How to size buttons?","<android><layout><button>","2","0","1","",""
"4533731","1","4533786","","2010-12-26 11:59:04","5","7664","<p>As by object, I would reproduce fade effect between two layout.Now I've this situation:</p><pre><code>LinearLayout l;LinearLayout l2;</code></pre><p>To switch between them I've used </p><pre><code>l.setVisibility(View.GONE);l2.setVisibility(View.VISIBLE);</code></pre><p>I want add fade effect between this transiction, how I can do it?</p>","353030","","","","","2012-07-29 21:06:06","Fade effect between layouts","<java><android><layout><fade>","2","0","3","",""
"4533762","1","","","2010-12-26 12:09:31","0","277","<p>I find that sometimes the layout of LockScreen is error in Froyo 2.2 when the screen size of emulator sets large resolution likes 1024x600. It looks like this:</p><p><img src=""http://img90.imageshack.us/img90/8554/lockscreen.png"" alt=""lockscreen.png""></p><p>Does anyone know how to solve this problem or what’s the problem causes this layout error?</p>","554270","","995926","","2012-05-22 08:12:53","2013-06-17 06:18:01","LockScreen layout error in large resolution emulator","<android><lockscreen><android-2.2-froyo>","0","2","","",""
"4533769","1","4563214","","2010-12-26 12:12:15","2","4004","<p>I'm try to write a little application and the releated unit tests.I have a ListView binded to a SimpleCursorAdapter reading data from an SQL table.</p><p>The <code>Activity#onCreate()</code> method is:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    dbHelper = new DatabaseHelper(this);    SQLiteDatabase dbRead = dbHelper.getReadableDatabase();    String[] columns={BaseColumns._ID, ENTRY_VALUE};    cursor = dbRead.query(ENTRIES_TABLENAME, columns, null, null, null, null, null);    String[] from = {""value""};    int[] to = {R.id.value};    adapter = new SimpleCursorAdapter(this, R.layout.list_entry, cursor, from, to);    setListAdapter(adapter);}</code></pre><p>My test inside the unit-test is:</p><pre><code>     @UiThreadTest     public void testTheElementInsideTheDBisDisplayedInTheList() {          String entryValue = ""clipboard entry 1"";          DatabaseHelper dbHelper = new DatabaseHelper(cmActivity);          Cursor beforeCursor = selectAllEntries(dbHelper);          // The table, at the begining of the test, is empty, I control that          assertEquals(0, beforeCursor.getCount());          // I insert the new value in the table            insertEntry(dbHelper, entryValue);          // and I control that is really inside the table now            Cursor afterCursor = selectAllEntries(dbHelper);          assertEquals(1, afterCursor.getCount());          // This method calls the method ""requery()"" on the cursor associate          // to the listView's adapter to update the list view            cmActivity.updateList();          // I control that the listView is updated          assertEquals(1, entryList.getCount());          // Now I try to retrive the only child inside the list view          // to extract the text inside it and to compare this text with          // the value inserted into the DB table.          TextView entryView = (TextView) entryList.getChildAt(0);          String viewText = entryView.getText().toString();          assertEquals(entryValue, viewText);     }</code></pre><p>My problem is in the third-last row: </p><pre><code>  TextView entryView = (TextView) entryList.getChildAt(0);</code></pre><p>I sude getChildAt() to get the first TextView child of the ListView. But this method returns null, so the test gets a NullPointerException. </p><p>Maybe getChildAt() is not the right method to get the View child from a ListView, so which is the correct one?</p><p>I see from the documenation that the method works with GroupView, I didn't use them, do I need to configure a default GroupView and put all the entry inside it? In this way, will getChildAt(0) work? Is this the correct way to setup a ListView?</p><p>thank you, byeAndrea</p><p>As asked by Vivek, I post here the main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ListView          android:id=""@android:id/list""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         /&gt;    &lt;TextView android:id=""@android:id/empty""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:text=""Empty set""         /&gt;&lt;/LinearLayout&gt;</code></pre><p>As you can see is very very basic. Also le list entry is very simple:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/value""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:textSize=""16sp"" &gt;&lt;/TextView&gt;</code></pre>","554272","","501696","","2012-05-17 10:23:16","2012-05-17 10:23:16","Android: get the i-th TextView inside a ListView","<android><unit-testing><listview>","1","2","2","",""
"4533780","1","","","2010-12-26 12:15:06","0","42","<p>I would like to know how works a turn of Android device (from the point of view of the OS). I'm interested in this action, because my Android program can not save and RIGHT restore its state after any turn of device (I use it with OnSave... and OnRestore... methods), I've learned almost all tutorials, but in spite of that, I can't find the mistake. Thank you.</p>","1314931","","","","","2010-12-26 13:08:36","How works a deviceturn in Android","<android>","1","0","","",""
"4533830","1","4534359","","2010-12-26 12:36:56","4","13001","<p>In my tablayout example, i have created 3 tabs, as usually i set 3 activities for each tab. I can set image to title bar of activity, which adds the intent to each tab. Due to this, the image in the title bar is visible in all 3 tabs. My requirement is to set a different image to title bar for each activity. I followed <a href=""http://stackoverflow.com/questions/3157522"">this</a> to set image to title bar. But when i am going to do the same thing to each activity, getting <code>android.util.AndroidRuntimeException: You cannot combine custom titles with other title features</code> this error and application is terminated.</p><p>manifest.xml</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.aptitsolution.tablayout""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:theme=""@style/MyTheme""&gt;    &lt;activity android:name="".TabLayoutDemo""              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=""AlbumsActivity""&gt;&lt;/activity&gt;</code></pre><p>  </p><p>TabLayoutDemo.java</p><pre><code>public class TabLayoutDemo extends TabActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);    setContentView(R.layout.main);    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_title);    Resources res = getResources();     TabHost tabHost = getTabHost();     TabHost.TabSpec spec;      Intent intent;      intent = new Intent().setClass(this, ArtistsActivity.class);    spec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"",                      res.getDrawable(R.drawable.ic_tab_artists))                  .setContent(intent);    tabHost.addTab(spec);    ....    ....</code></pre><p>ArtistsActivity.java</p><pre><code>public class ArtistsActivity extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);//i am getting the error here         setContentView(R.layout.artists);    setFeatureDrawableResource(Window.FEATURE_CUSTOM_TITLE, R.layout.my_title);     }</code></pre><p>}</p><p>my_title.xml</p><pre><code>&lt;RelativeLayout android:id=""@+id/header""xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;&lt;ImageView android:src=""@drawable/nowplaying""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;TextView android:id=""@+id/title"" android:layout_width=""wrap_content""    android:text=""New Title"" android:layout_height=""wrap_content""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>thanks<br>venu</p>","461975","","461975","","2010-12-26 13:10:37","2013-02-25 07:01:07","How to set icon to title bar for each Activity in TabLayout","<android>","3","0","3","",""
"4534043","1","","","2010-12-26 13:50:31","4","12091","<p>I'd like something:</p><pre><code>s=""&lt;body&gt;&lt;img src='""+R.drawable.picture+""'&gt;&lt;/body&gt;"";</code></pre><p>How can I do this?</p>","472537","","1114055","","2012-06-20 19:19:37","2012-06-20 19:19:37","Android add image to webview from a drawable","<android><html>","2","1","4","",""
"4534081","1","4534135","","2010-12-26 14:05:32","5","9957","<p>I have a login in my application. I want to know the best way to set a global session or equivalent that I can refer to from any activity so that they will know if a user is logged in. Also, so that other activities can get the user id to do database transactions.</p><p>I don't want to use putExtra() as I will have to do it for every Intent I build across the application.</p>","155196","","1196517","","2012-04-23 06:23:42","2013-08-21 08:55:53","Login Session - Activities","<android><session>","1","0","9","",""
"4534096","1","","","2010-12-26 14:10:38","2","1328","<p>can i register a BroadcastReceiver from my activity but keep it active while the app is not running? (obviously if the user sets that wants this on my app settings)</p><p>This way i think to reduce cpu load if user decide of deactivate my app without uninstall it, it's possible?</p><p>Thank's</p><p>Valerio</p>","314554","","402253","","2010-12-26 14:13:57","2010-12-26 14:21:44","Android: Register a BroadcastReceiver from my activity and keep it active while my app is not running","<android><broadcastreceiver>","1","0","","",""
"4534126","1","4795996","","2010-12-26 14:18:34","2","3390","<p>I have a problem about streaming my video to server in real-time from my phone.that is , let my phone be a IP Camera , and server can watch the live video from my phone</p><p>I have googled many many solutions, but there is no one can solve my problem.I use MediaRecorder to record . it can save video file in the SD card correctly.then , I refered <a href=""http://www.mattakis.com/blog/kisg/20090708/broadcasting-video-with-android-without-writing-to-the-file-system"" rel=""nofollow"">this page</a> and used some method as followings</p><pre><code> skt = new Socket(InetAddress.getByName(hostname),port); pfd =ParcelFileDescriptor.fromSocket(skt); mediaRecorder.setOutputFile(pfd.getFileDescriptor());</code></pre><p>now it seems I can send the video stream while recording</p><p>however, I wrote a receiver-side program to receive the video stream from Android , but it doesn't work . is there any error?I can receive file , but I can not open the video file .I guess the problem may caused by  file format ?</p><p>there are outline of my code.</p><p>in android side</p><pre><code>    Socket skt = new Socket(hostIP,port);ParcelFileDescriptor pfd =ParcelFileDescriptor.fromSocket(skt);........mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);mediaRecorder.setOutputFile(pfd.getFileDescriptor());.....mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);.....mediaRecorder.start();</code></pre><p>in receiver side (my ACER notebook)</p><pre><code>// anyway , I don't think the file extentions will do any effect                File video = new File (strDate+"".3gpp"");FileOutputStream fos;try {fos = new FileOutputStream(video);byte[] data = new byte[1024];int count =-1;while( (count = fin.read(data,0,1024) ) !=-1){    fos.write(data,0,count);                                    fos.flush();    }                                       fos.close();fin.close();</code></pre><p>I confused  a long time....thanks in advance</p>","551273","","546999","","2011-01-25 16:22:26","2014-02-06 01:13:36","How could I send live video stream to remote server from my phone!","<java><android><media>","1","1","1","",""
"4534130","1","4534150","","2010-12-26 14:20:23","0","2009","<p>I tried to record audio in Android. The quality of the sound using the MediaRecorder really sucks. Is there a way to improve quality? The documentation says, there should be something like ""setAudioEncodingBitRate"", but I haven't found a way to implement it. </p><p>Then I tried writing the sound to a stream using the AudioRecord function. Great quality but pcm-files are too large in size as I want to upload them to a remote server.</p><p>Does anybody know how to either</p><ul><li>improve quality of the AudioRecorder file or</li><li>compress the pcm on the fly (like mp3 or else).</li></ul><p>Any help is mostly appreciated. </p>","404675","","1228","","2013-11-14 21:30:41","2014-01-21 17:55:43","Android MediaRecorder - SetAudioEncodingBitRate - HowTo","<android><audio><mediarecorder>","2","1","","",""
"4534156","1","4543070","","2010-12-26 14:30:57","3","1174","<p>In my application, Activity A will start a TabActivity, and the TabActivity has some Activity in its content.  </p><pre><code>tabHost.newTabSpec(""tab1"").setContent( new Intent(this, ActivityB.class ) ) ...</code></pre><p>And ActivityB will get some data from user(i.e pick a contact), and i want ActivityA will get these data. But as you see, it seems I cannot startyActivityForResult and onActivityResult to get result. </p><p>So, how can i get data in ActivityA from ActivityB ? Thanks. </p>","459062","","","","","2011-01-04 08:41:23","How to get activity result from an Activity in a TabHost?","<android>","2","0","0","",""
"4534239","1","","","2010-12-26 15:00:16","1","542","<p>RatingBar with ratingBarStyleIndicator theme applied doesn't want to show values less than 0.5, it shows them as 0.5. But all is ok with greater values like 0.6..1. When style is default behavior is right. Do you know the reason?</p>","554336","","","","","2011-11-06 01:08:15","Android RatingBar with ratingBarStyleIndicator theme and rating less 0.5","<android><coding-style><rating>","1","0","1","",""
"4534306","1","","","2010-12-26 15:16:46","0","721","<p>I would like to get the number call when i receive a call in my app.I would like to retrieve it and store it  somewhere.</p><pre><code>public void onCallStateChanged(int state, String incomingNumber) {    super.onCallStateChanged(state, incomingNumber);</code></pre><p>.........</p><p>incomingNumber contains nothing.</p>","199826","","","","","2010-12-27 15:40:53","retrieve the call number in my android APP","<android><android-emulator>","3","0","","",""
"4534326","1","","","2010-12-26 15:22:45","0","243","<p>I have written this function to get all the images in a generic list but this gives error at the first line. I am not sure what is wrong.</p><pre><code>public void getPictures(File file) {        String state = Environment.getExternalStorageState();        if (Environment.MEDIA_MOUNTED.equals(state)) { // we can read            file = file == null ? getExternalFilesDir(Environment.DIRECTORY_PICTURES)                    : file;            File files[] = file.listFiles();            for (File f : files) {                if (f.isDirectory()) {                    getPictures(f);                } else if (f.isFile()) {                    String path = f.getPath();                    if (path.endsWith("".jpg"")) {                        pictures.add(path);                    } else if (path.endsWith("".png"")) {                        pictures.add(path);                    } else if (path.endsWith("".gif"")) {                        pictures.add(path);                    } else if (path.endsWith("".bmp"")) {                        pictures.add(path);                    }                }            }        }    }</code></pre>","355507","","","","","2010-12-26 15:22:45","Android Function to Search for Images in the Device","<java><android><android-image>","0","6","","",""
"4534370","1","4534430","","2010-12-26 15:35:51","5","7430","<p>The time I used to develop applications on iPhone I was converting String to SHA1 with two combination:</p><ul><li>Data</li><li>Key</li></ul><p>Now I am developing an Android application and I did not any example for how to calculate SHA1 With key.</p><p>I am greatly appreciative of any guidance or help.</p><p><hr><em>[The code that I currently  use]</em></p><pre><code>private void convertStringToSHA1(){        String sTimeStamp  = new SimpleDateFormat(""MM/dd/yyyy HH:MM:SS"").format(new java.util.Date());        String sStringToHash = String.format(""%1$s\n%2$s"", ""Username"",sTimeStamp);        MessageDigest cript = MessageDigest.getInstance(""SHA-1"");        cript.reset();        cript.update(sStringToHash.getBytes(""utf-8""));        sStringToHash = new BigInteger(1, cript.digest()).toString(16);}</code></pre>","488434","","488434","","2013-07-08 13:18:10","2014-03-14 09:28:45","How to Hash String using SHA-1 with key?","<java><android><security><hash><sha1>","1","3","4","","2011-11-20 11:07:02"
"4534389","1","4534403","","2010-12-26 15:40:11","0","270","<p>i m getting a photo from the web,but i see it very large..how could i see it with zoom out?this is my code for webView:</p><pre><code>public class gavros extends Activity {    WebView browser;        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.efimerides);            browser =(WebView)findViewById(R.id.webview);            browser.loadUrl(""http://..."");        }}</code></pre>","519526","","519526","","2011-07-03 23:19:11","2011-07-03 23:19:11","Image from WebView","<android>","1","1","","",""
"4534487","1","","","2010-12-26 16:11:47","1","285","<p>What I am looking for is better coding with parameters such as memory management, faster processing and cleaner coding. Is there any set of Good Coding Guide for Android using which we can make better applications. For example;</p><p>Which of the following convention is better among them:</p><h1>EXAMPLE - 1</h1><pre><code>TextView tv = (TextView) findViewById(R.id.sampleTextView);tv.setText(""Hello World"");</code></pre><p>-- OR --</p><pre><code>((TextView)  findViewById(R.id.sampleTextView)).setText(""Hello World"");</code></pre><h1>EXAMPLE - 2</h1><pre><code>BroadcastReceiver br = new BroadcastReceiver() {      ...      ...}IntentFilter filter = new IntentFilter(...);registerReceiver(filter, br);</code></pre><p>-- OR --</p><pre><code>registerReceiver(new IntentFilter(), br);</code></pre><p>-- OR --</p><pre><code>registerReceiver(new IntentFilter(), new BroadcastReceiver());</code></pre><p>Which will result in lesser memory usage and help in quicker garbage collection. I have seen both type of coding in Android Framework (in Gingerbread as well as Froyo).</p><p>I have been developing for more than a year on Android now and I think anyone can code but to code clean and proper is what makes the difference. Can someone suggest or help out from their experience and knowledge.</p>","554377","","473070","","2010-12-26 16:25:24","2010-12-27 06:11:57","Better Android Coding","<android><coding-style>","5","2","","",""
"4534586","1","","","2010-12-26 16:40:08","0","494","<p>While dowloading data i display a progressdialog with a cancel button. If pressed an alertDialog pops open for verification. If ascertained, the download is cancelled and both dialog disappear. But if the user negates the cancel, ALSO both dialogs diappear. Which is very bad, because it misleads the user into assuming the download is finished. What I want, is that the progressDialog remains on the screen until the download really is finished. Any ideas?</p><p>Here is the code I used:</p><pre><code>ProgressDialog makeProgressDialog() {    ProgressDialog progressDialog = new ProgressDialog(this);    progressDialog.setMessage(""downloading, please wait..."");    progressDialog.setCancelable(false);    progressDialog.setButton(DialogInterface.BUTTON_NEUTRAL, ""Cancel"", new DialogInterface.OnClickListener()          {         public void onClick(DialogInterface dialog, int which)          {             new AlertDialog.Builder(TUIActivity.this)            .setMessage(""Sure?"")            .setPositiveButton(""Yes"",                     new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int which) {                            // cancel the download                        }                    }            )            .setNegativeButton(""No"", new EmptyListener())            .show();        }     });     return progressDialog;}</code></pre>","540935","","","","","2010-12-26 17:42:54","Problem with dialog within another dialog","<android><recursion><dialog><progressdialog>","1","0","","",""
"4534596","1","4534796","","2010-12-26 16:43:33","1","2113","<p>I've created an AVD (version 2.2) using preferences set as default.</p><p>However everytime I start it I got error messages list below:</p><pre><code>12-26 16:19:07.566: ERROR/Zygote(33): setreuid() failed. errno: 212-26 16:19:15.707: ERROR/Zygote(33): setreuid() failed. errno: 1712-26 16:19:17.635: ERROR/BatteryService(87): usbOnlinePath not found12-26 16:19:17.635: ERROR/BatteryService(87): batteryVoltagePath not found12-26 16:19:17.645: ERROR/BatteryService(87): batteryTemperaturePath not found12-26 16:19:17.695: ERROR/SurfaceFlinger(87): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake12-26 16:19:48.305: ERROR/EventHub(87): could not get driver version for /dev/input/mouse0, Not a typewriter12-26 16:19:48.305: ERROR/EventHub(87): could not get driver version for /dev/input/mice, Not a typewriter12-26 16:19:48.495: ERROR/System(87): Failure starting core service12-26 16:19:48.495: ERROR/System(87): java.lang.SecurityException12-26 16:19:48.495: ERROR/System(87):     at android.os.BinderProxy.transact(Native Method)12-26 16:19:48.495: ERROR/System(87):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)12-26 16:19:48.495: ERROR/System(87):     at android.os.ServiceManager.addService(ServiceManager.java:72)12-26 16:19:48.495: ERROR/System(87):     at com.android.server.ServerThread.run(SystemServer.java:184)12-26 16:19:49.675: ERROR/SoundPool(87): error loading /system/media/audio/ui/Effect_Tick.ogg12-26 16:19:49.685: ERROR/SoundPool(87): error loading /system/media/audio/ui/KeypressStandard.ogg12-26 16:19:49.705: ERROR/SoundPool(87): error loading /system/media/audio/ui/KeypressSpacebar.ogg12-26 16:19:49.716: ERROR/SoundPool(87): error loading /system/media/audio/ui/KeypressDelete.ogg12-26 16:19:49.725: ERROR/SoundPool(87): error loading /system/media/audio/ui/KeypressReturn.ogg12-26 16:19:54.736: ERROR/ThrottleService(87): Could not open GPS configuration file /etc/gps.conf12-26 16:19:54.836: ERROR/ThrottleService(87): Error reading data file12-26 16:19:55.816: ERROR/logwrapper(186): executing /system/bin/tc failed: No such file or directory12-26 16:19:55.916: ERROR/logwrapper(188): executing /system/bin/tc failed: No such file or directory12-26 16:19:55.995: ERROR/logwrapper(190): executing /system/bin/tc failed: No such file or directory12-26 16:20:02.135: ERROR/logwrapper(202): executing /system/bin/tc failed: No such file or directory12-26 16:20:02.245: ERROR/logwrapper(203): executing /system/bin/tc failed: No such file or directory12-26 16:20:02.295: ERROR/logwrapper(204): executing /system/bin/tc failed: No such file or directory12-27 00:20:16.924: ERROR/HierarchicalStateMachine(87): TetherMaster - unhandledMessage: msg.what=312-27 00:20:17.174: ERROR/HierarchicalStateMachine(87): TetherMaster - unhandledMessage: msg.what=312-27 00:20:21.224: ERROR/HierarchicalStateMachine(87): TetherMaster - unhandledMessage: msg.what=312-27 00:20:47.534: ERROR/MetadataRetrieverClient(34): failed to extract an album art12-27 00:21:24.814: ERROR/ThrottleService(87): Error reading data file</code></pre><p>Please let me know how can I fix these errors. Thanks a lot!</p>","350555","","","","","2010-12-26 17:43:46","Error message during the AVD starting process","<android><android-emulator>","1","0","","",""
"4534597","1","4534800","","2010-12-26 16:43:33","2","640","<p>I have database application on Android device. I would like to have a possibility to read data from this database from Windows computer. </p><p>I have found <a href=""http://sqlite.phxsoftware.com/"" rel=""nofollow"">here</a> a .NET library for reading SQLite DB files. So now I need to have access from .NET application to private application database file, which is placed on Android device.</p><p>Is it possible? It will be beautiful to know also how to repeat and test such situation using android-emulator</p>","554392","","","","","2010-12-26 17:45:29","Read Android database file from computer","<.net><android><android-emulator>","2","0","","",""
"4534727","1","","","2010-12-26 17:23:16","0","577","<ol><li>I am in X activity. X has listview.</li><li>On onclick on listview I am showing ContextMenu.</li><li>When I select MenuItem, I handle the event onContextItemSelected and start new activity with startactivity(intent).</li><li>After this I get NumberFormatException in ActivityThread class.Is it a bug or I am doing something wrong.</li></ol><p>I am doing following</p><ol><li>registerForContextMenu(findViewById(android.R.id.list));</li><li>onCreateContextMenu</li><li>onContextItemSelected</li></ol>","547515","","","","","2010-12-26 17:23:16","android contextmenu onContextItemSelected startactivity exception","<android><activity><contextmenu>","0","4","","",""
"4534745","1","4535894","","2010-12-26 17:27:07","0","494","<p>I have created a button that onClick plays a mp3 file.I have also create a context menu that when you press the button for 2 secs it prompts you to save it as ringtone.How can i save it somewhere in my sd?this is my code:</p><pre><code> public void onCreate(Bundle icicle)      {        super.onCreate(icicle);        setContentView(R.layout.main);          Toast.makeText(a.this, ""Touch and listen"", Toast.LENGTH_SHORT).show();         Button button = (Button) findViewById(R.id.btn1);           registerForContextMenu(button);        button.setOnClickListener(new View.OnClickListener() {             public void onClick(View v){               MediaPlayer mp = MediaPlayer.create(a.this, R.raw.myalo);               mp.start();                Toast.makeText(a.this, ""Eisai sto myalo"", Toast.LENGTH_SHORT).show();           }              });             @Override      public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {   super.onCreateContextMenu(menu, v, menuInfo);       menu.setHeaderTitle(""Save As:"");       menu.add(0, v.getId(), 0, ""Ringtone"");   }      @Override      public boolean onContextItemSelected(MenuItem item) {          if(item.getTitle()==""Ringtone""){function1(item.getItemId());}          else {return false;}      return true;      }      public void function1(int id){          Toast.makeText(this, ""Ringtone Saved"", Toast.LENGTH_SHORT).show();      }  }  </code></pre>","519526","","","","","2010-12-26 23:43:17","Save as Ringtone from ContextMenu","<android>","1","0","","",""
"4534882","1","4537368","","2010-12-26 18:11:34","0","226","<p>I am looking to update a contact's birthday. I have, previously, got contacts using:</p><pre><code>ContentResolver cr = getContentResolver();Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);</code></pre><p>However, it seems to only be Google contacts that have the birthday field. How can I ascertain whether a contact row is a Google-account related contact and change the birthday field?</p>","349003","","","","","2010-12-27 08:02:58","In Android, how can I specifically access a GMail contact?","<java><android><contactscontract>","1","1","","",""
"4534909","1","4535087","","2010-12-26 18:19:05","0","1990","<p>I want to implement XML-RPC web service in Android.</p><p>Server I will create in PHP, but I need XML-RPC Android client.</p><p>Can someone recommend me any source code, tutorial or example?</p><p>I try with <a href=""http://www.anddev.org/advanced-tutorials-f21/web-services-an-xml-rpc-client-for-android-t646.html"" rel=""nofollow"">http://www.anddev.org/advanced-tutorials-f21/web-services-an-xml-rpc-client-for-android-t646.html</a> but I receive error when importing jar files.</p>","432848","","2153784","","2011-08-31 23:22:55","2011-08-31 23:22:55","Android web services -  XML-RPC Client","<android><web-services>","1","0","1","",""
"4534914","1","4535155","","2010-12-26 18:19:51","0","4108","<p>First question here in stackoverflow :)</p><p>I'm running a little android 2.2 app to log cpu frequency usage. It is set up as a service that will write the data every 10 seconds using a new thread. The code for that part is very basic (see below).</p><p>It works fine, except that it would not keep track of time while the phone is asleep (which, I know, is the expected behavior). Thus, I changed the code to use SystemClock.elapsedRealTime() instead. Problem is, in emulator both commands are equivalent, but in the phone the app will start the thread but it will never execute the mHandler.postAtTime command. Any advice regarding why this is happening or how to overcome the issue is greatly appreciated.</p><p>PS: stopLog() is not being called. That's not the problem.</p><pre><code>    mUpdateTimeTask = new Runnable() {        public void run() {            long millis = SystemClock.uptimeMillis() - mStartTime;            int seconds = (int) (millis / 1000);            int minutes = seconds / 60;            seconds     = seconds % 60;            String freq = readCPU ();            if (freq == null)                Toast.makeText(CPU_log_Service.this, ""CPU frequency is unreadable.\nPlease make sure the file has read rights."", Toast.LENGTH_LONG).show();            String str = new String ((minutes*60 + seconds) + "", "" + freq + ""\n"");            if (!writeLog (str)) stopLog();            mHandler.postAtTime(this, mStartTime + (((minutes * 60) + seconds + 10) * 1000));    }};    mStartTime = SystemClock.uptimeMillis();    mHandler.removeCallbacks(mUpdateTimeTask);    mHandler.postDelayed(mUpdateTimeTask, 100);</code></pre>","542701","","","","","2010-12-26 19:41:34","android service using SystemClock.elapsedRealTime() instead of SystemClock.uptimeMillis() works in emulator but not in samsung captivate?","<android><android-emulator>","1","0","","",""
"4535009","1","4535214","","2010-12-26 18:59:21","0","82","<p>Is there a way to do this? Is there a way to use a tabhost and activities for each tabs content and pass values via extras. If so can someone post a link how to?</p>","408112","","","","","2010-12-26 20:04:22","Is there a tutorial that shows how to use tabs and activities to pass values","<android><tabs><extras>","1","0","1","",""
"4535052","1","4535143","","2010-12-26 19:11:13","0","197","<p>I am trying to pass a Cursor to a method. But i am getting this error.</p><pre><code>Cannot refer to a non-final variable c inside an inner class defined in a different method</code></pre><p>the code.</p><pre><code>public void loggedin(String title, String message, String positive, Cursor c) {    AlertDialog.Builder alertbox = new AlertDialog.Builder(            HomeActivity.this);    alertbox.setTitle(title);    alertbox.setMessage(message);    alertbox.setPositiveButton(positive,            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    String username = c.getString(0);                    MessagingApplication.setUsername("""");                    String currentUserName=MessagingApplication.getUsername();                    Toast.makeText(HomeActivity.this, currentUserName, 5);                    alertbox(""Error"", currentUserName,                            ""Back"", null);                    Intent i = new Intent(HomeActivity.this,                            MailActivity.class);                    //startActivity(i);                }            });    alertbox.show();}</code></pre>","155196","","","","","2010-12-26 19:37:12","Problem with Cursor","<java><android><cursor>","1","0","","",""
"4535109","1","","","2010-12-26 19:27:55","4","5634","<p>I have searching and testing to set my own image/icon in a Spinner but i get error.</p><p>I have alrady with styling set background image but then the spinner icon on the right side not shows anymore.</p><p>When i do like i find a example of like this:</p><pre><code>&lt;Spinner style=""@style/Spinner"" android:spinnerSelector=""@drawable/myspinner_selector"" /&gt;</code></pre><p>And here is the myspinner_selector.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_first=""true""   android:drawable=""@drawable/arrowdown""   /&gt;    &lt;item android:state_middle=""true""    android:drawable=""@drawable/arrowdown""   /&gt;       &lt;item android:state_last=""true""   android:drawable=""@drawable/arrowdown""   /&gt;   &lt;item android:state_single=""true""   android:drawable=""@drawable/arrowdown""   /&gt;</code></pre><p></p><p>But it is in the first <code>XML</code>for spinner I get this error:</p><pre><code>No resource identifier found for attribute 'spinnerSelector' in package 'android' `main.xml`</code></pre><p>All example i can find on internet using the styling of spinner selector like this but i can not get it to work and can not find <code>spinnerSelector</code> in the reference guide on <a href=""http://developer.android.com"" rel=""nofollow"">developer.android.com</a> either.</p>","553770","","711273","","2013-03-07 11:06:30","2013-10-31 01:49:45","Android: How to set spinner selector to own image/icon?","<android><coding-style><spinner>","3","0","2","",""
"4535135","1","","","2010-12-26 19:34:35","3","267","<p>In a custom <code>ContentProvider</code> I need to filter out some columns specified in the inputs. Given the text-oriented Android interfaces this is giving me a hard time.</p><p>For example the input on <code>MyContentProvider.query()</code> would effectively ask something like:</p><pre><code>SELECT column_a, column_b FROM my_table WHERE column_a=1 AND column_b=red;</code></pre><p>The problem is that at this particular <code>MyContentProvider</code> _column_b_ might not make any sense and would not be present in the table. Filtering the projection so that only relevant columns remain can be easily done since it's a String[]. However, filtering the String ""<code>where</code>"" (selection) and ""<code>selectionArgs</code>"" inputs for these columns is not trivial. If done properly it would become:</p><pre><code>SELECT column_a FROM my_table WHERE column_a=1;</code></pre><p>Otherwise one would get a <code>SQLiteException ""no such column""</code>.</p><p>So, is there any <strong>easy way to ignore or filter columns</strong> from such an sql statement or do I need to go and write some smart albeit very limited regexp parsing code for the selection part?</p><p>The reason I'm not getting the right inputs is because I maintain a custom <code>ContentProvider</code> as an interface to address, but I talk to multiple custom <code>ContentProvider</code>s herein (in the background). One way or another, I would need to filter the selection somewhere.</p><p>Please note that I am not asking simply how to do a query or use the <code>SELECT ... WHERE</code> statement. However it concerns my implementation of the <code>query()</code> function.</p>","458813","","","","","2011-07-20 13:34:24","Filter inputs in custom ContentProvider functions","<sql><android><android-contentprovider>","1","0","","",""
"4535235","1","4535723","","2010-12-26 20:12:46","6","6936","<p>I have a web page stored in my res/raw folder in android app. I want to access it and load it in the webview in my activity. Can anyone please tell me how am I supposed to do that. I have tried</p><pre><code>webView.loadUrl(getResources().openRawResource(R.raw.myHtmlPage).toString());</code></pre><p>but it dint work rather it gives a broken page.</p><p>kindly help me out.</p><p>regardsFAS</p>","554373","","","","","2011-05-31 09:16:14","How to display an HTML page from raw folder in res with android Webview?","<android><resources><webview>","1","1","1","",""
"4535259","1","4540206","","2010-12-26 20:21:22","2","3935","<p>I am implementing pagination for ListView in Android . I am extending the BaseAdapater class for customising the ListView.</p><p>Already I have the code working fine for the Customised ListView.Below is the new requirement.</p><p>1>I am fetching 6 items from server &amp; displaying them . Now when the user scrolls to the 6th item(end of list) , I need to call the server to fetch the next 6 items &amp; update the Listview</p><p>I have overriden the methods </p><p>i>public void onScroll(AbsListView view, int firstVisibleItem,int visibleItemCount, int totalItemCount) </p><p>ii>public void onScrollStateChanged(AbsListView view, int scrollState) </p><p>In the first response from the server, I get the total no of pages from the server &amp; for each time I call the server , I get the current page value .</p><p>Kindly provide me the steps/sample code on how to check the last item of the list &amp; update the list . The code should be iterative since I may need to call multiple times &amp; fetch from server.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-12-27 16:49:59","Stuck in implementing Pagination in Android","<android>","2","0","4","",""
"4535298","1","4535315","","2010-12-26 20:32:39","558","133055","<p>How can I rotate the Android emulator display to see it in landscape mode?</p>","377983","","146622","","2012-11-29 14:44:02","2014-04-08 12:00:53","How to rotate the Android emulator display?","<android><android-emulator><emulator>","23","0","93","",""
"4535368","1","4535547","","2010-12-26 20:51:25","0","142","<pre><code>   button.setOnClickListener(new View.OnClickListener() {      public void onClick(View v){               if(mp2.isPlaying()==true)                       {mp2.stop();                        mp.start();                       }               else               mp.start();            }              });                 button2.setOnClickListener(new View.OnClickListener() {               public void onClick(View v){                if(mp.isPlaying()==true)                {mp.stop();mp2.start();}                else               mp2.start();            }          });   </code></pre><p>I press the first btn and the 1st song is playing.i press the second,the first stops and the second begins.But then, as i press the first btn, the second song  stops but the first song is not playing...please help!!:)</p>","519526","","","","","2010-12-26 21:48:55","Media Player Problem","<android>","1","0","","",""
"4535421","1","4535706","","2010-12-26 21:06:59","0","305","<p>I am trying to modify the NotePad sample code from the Android developer resources. The date is stored in a SQLite database as a Long and retrieved using the SimpleCursorAdapter.</p><p><a href=""http://developer.android.com/resources/samples/NotePad/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/NotePad/index.html</a></p><p>When I call the MODIFIED_DATE with the Notes ListView, it returns as an milliseconds/Unix format. (Below) Ideally I would like to show ""12-15-2010"".</p><p>Any suggestions would be appreciated. I have tried a bunch of things (e.g. creating a new column in the database) and ended up with a lot of Force Closes.</p><p>Thank you.</p>","481484","","","","","2010-12-26 22:41:42","Adding Modified Date to ListView in NotePad Sample Code","<java><android><sqlite>","1","0","","",""
"4535664","1","4536727","","2010-12-26 22:24:58","2","583","<p>I have a few objects I want to pass to other activities through intents.  However, they only need to be shallow copies of the other object, as they are only going to be read (and even if they were going to be modified, I would want them modified in the original activity too), so there's no point in making the object a serializable, also because not all of the fields in the object are serializable, I can't even do it.</p><p>Also, it seems like making it parcelable would run into the same problems.  Sure, it seems like I can add some of the fields in it as active objects, but I can't make the whole thing just a shallow copy.</p><p>So is there any way I can make a shallow copy of an object in an intent, or any other way of passing a shallow copy of data to another activity, like you would normally pass a parameter in java?  Thank you.</p>","288439","","","","","2010-12-27 05:14:34","Shallow copy of an object in an intent in android","<java><android><activity><parcelable><shallow-copy>","2","0","","",""
"4535673","1","4540813","","2010-12-26 22:27:37","3","1100","<p>When I start an activitiy from a widget I want the back button to go to the home screen but instead it goes to the app's main activity. After toying around I found that if I somehow close the main app activity, this problem doesn't occur. Strange.</p><p>I found a solution <a href=""http://stackoverflow.com/questions/2761673/widget-starting-a-service-also-starts-main-activity"">here</a> that said to call finish(); in my main activity's onPause(). Obviously this is the wrong solution e.g. reorientation of the screen causes an onPause() so the will activity will die whenever the phone is rotated.</p><p>This is how I start my activity:</p><pre><code>@Overridepublic void onReceive(Context context, Intent intent) {    [...]        //new Emergency().emDialog(context).show();        Intent myIntent = new Intent(context, EmergencyActivity.class);        // FLAG_ACTIVITY_NEW_TASK is needed because we're not in an activity        // already, without it we crash.        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        context.startActivity(myIntent);</code></pre><p>You can see the rest of the code at <a href=""http://code.google.com/p/emergencybutton/source/browse"" rel=""nofollow"">http://code.google.com/p/emergencybutton/source/browse</a></p><p>edit: I tried running the activity differently, but still it doesn't work correctly:</p><pre><code>Intent myIntent = new Intent();myIntent.setClassName(""com.emergency.button"", ""com.emergency.button.EmergencyActivity"");</code></pre>","177498","","177498","","2010-12-27 17:56:09","2011-08-18 13:57:38","Why does starting an activity from a widget cause my main activity to start as well?","<android><activity>","3","4","2","",""
"4535770","1","4589430","","2010-12-26 23:01:37","1","259","<p><strong>REVISED 1/3/11</strong></p><p><strong>SOLVED!</strong></p><p>I've read a ton of posts across the net and see many others want to do the same thing and all posts refer to needing to do something like a Singleton or use cumbersome context routines.</p><p>Well, while different than calling another activity in the usual fashion, calling an Database Helper and Edit Activity turns out to be very simple.</p><p>After many days of struggling with this, I bought a book - Android for Dummies and, <strong><em>Bingo</em></strong>, the how to do it buried in the book. For those interested in how to do it, read the relevant sections of the book.</p><p>Thanks</p>","382200","","382200","","2011-01-03 23:40:07","2011-01-03 23:41:51","Method Calls (static to non-static) for SQL and ListActivity","<android><sqlite>","3","2","","",""
"4535916","1","4536099","","2010-12-26 23:50:44","2","445","<p>I'm making a music player.  When you press play, it loads a notification into the OnGoing section.  When you go anywhere else in the system, I want the music to keep playing.  All of this is fine.</p><p>The problem is that when I relaunch my activity from the Notification, it adds a task to the history stack each time, so if I hit back, I have to see the instance of Activity B from where I pressed play, and from every time I clicked on the notification to go back to Activity B.</p><p>I want the instance of Activity B that I launch from the notification (via the service) to be the only copy of that Activity in the history.  I've been playing around with various Intent flags and Activity attributes in the manifest, but I haven't found the proper combination.</p>","302118","","","","","2012-02-09 10:22:48","Android service puts multiple instances of an activity in the history","<android><service><activity><android-intent>","1","0","2","",""
"4536060","1","","","2010-12-27 00:44:06","3","502","<p>Since Google started giving a very nice <a href=""http://www.google.ie/movies?hl=en&amp;near=san+francisco&amp;dq=san+francisco+cinema&amp;sa=X&amp;ei=_98XTY-LGMOFhQe507G4Dg&amp;ved=0CBkQxQMoAQ"" rel=""nofollow"">cinema listings</a> layout, I would like to make an android app that the user could take the information from this page and display it for the area they input.</p><p>I'm not asking how to make the app, but using Java how would I go about dynamically taking the information from this webpage? Could I parse it as XML? It seems a little tricky this way.</p>","451575","","20578","","2010-12-27 01:18:18","2010-12-27 01:18:18","If I wanted to take the data from the webpage using Java, where would I start?","<java><android><html><xml><parsing>","2","2","2","",""
"4536062","1","","","2010-12-27 00:45:13","0","274","<p>I'd like to add a list of reviews of books to my Android app. Basically what I'm after is a fixed rating using the RatingBar and a ListView containing the snippet of the review for each review. Once clicked I want the list item to expand and fill with the text of the full review. </p><p>I have the content of the snippet, full text, and rating, but don't know how best to go about the layout. Any ideas are ok, I don't need full code, but I would much prefer to keep it to XML layout. </p>","425459","","","","","2010-12-27 02:46:27","Android ratings and listviews","<android><android-listview>","1","0","","",""
"4536181","1","4537579","","2010-12-27 01:27:17","1","199","<p>What I am trying to do is basically re-work the HorizontalScrollView layout a little to meet my needs, but I'm pretty new at this and can't quite figure out how to go about it.  I think what I need to do is remove the normal scrolling functionality and then wait for the user to drag a certain amount in the X axis, and then call the smoothScrollBy method to get the effect I want. </p><p>This sounds easy enough, but how exactly do I get these changes to apply to the HorizontalScrollView I have in my activity?  There's a fairly complex hierarchy of layouts and views around it, but it almost seems like I'd have to code the entire activity in Java (rather than simple XML) to get this working right.</p><p>I'm sure there is an easy way to do this, but I can't for the life of me find the answer.  Any help would be greatly appreciated.</p>","554569","","","","","2010-12-27 09:00:10","Overriding layouts?","<android><layout><view><activity><scroll>","1","0","","",""
"4536222","1","","","2010-12-27 01:47:50","5","5879","<p>I'm still a bit of an Android noob, forgive me if this is simple and I'm just not seeing it.</p><p>There are two portions of text in a view that spans the entire width horizontally, but is only as high as one line of text.  The left side must always be displayed in full, but should take no more horizontal space than it needs.  The right side should be pushed over by the left side and fill up the remainder of the screen width.  If the right side text is smaller than this width, the text should be right-aligned horizontally.  If the text is greater than the width, it should scroll horizontally.</p><p>The text on the right side will be updated frequently and should slide up with new text when the app tells it (explaining the TextSwitcher in the layout).</p><p>I have tried two different layout styles.  In both situations, I can get the left side to ""push"" the layout, the right side to scroll, but I can't figure out how to get the right side to right align.  It is always left aligned.  Here is a picture showing what is happening...</p><p><a href=""http://img10.imageshack.us/img10/5599/androidlayout.png"" rel=""nofollow"">http://img10.imageshack.us/img10/5599/androidlayout.png</a></p><p>In addition (but less important), in my layout code I have android:fadingEdge=""none"" on the TextViews, but it still has a faded edge on the left and right side when it scrolls.  Why is that?</p><p>Here are the two layouts I created, which yield the results shown, but not the results I want.</p><p>Using a horizontal LinearLayout...</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/LinearLayoutStatusBar""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_margin=""2px""    android:background=""#555555""&gt;    &lt;TextView        android:id=""@+id/TextViewTimer""        android:textSize=""18px""        android:textColor=""#FFFFFF""        android:layout_gravity=""left""        android:layout_weight=""0""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginLeft=""0px""        android:layout_marginRight=""3px""        android:text=""Left Side""    &gt;    &lt;/TextView&gt;    &lt;TextSwitcher        android:id=""@+id/TextSwitcherDetails""        android:inAnimation=""@anim/push_up_in""        android:outAnimation=""@anim/push_up_out""        android:layout_weight=""1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""right""        android:layout_marginLeft=""3px""        android:layout_marginRight=""0px""    &gt;        &lt;TextView            android:id=""@+id/TextViewDetails1""            android:textSize=""18px""            android:layout_width=""match_parent""            android:layout_height=""match_parent""            android:layout_gravity=""right""            android:singleLine=""true""            android:ellipsize=""marquee""            android:marqueeRepeatLimit=""marquee_forever""            android:scrollHorizontally=""true""            android:focusable=""true""            android:focusableInTouchMode=""true""            android:fadingEdge=""none""            android:text=""Right Side 1""        &gt;        &lt;/TextView&gt;        &lt;TextView            android:id=""@+id/TextViewDetails2""            android:textSize=""18px""            android:layout_width=""match_parent""            android:layout_height=""match_parent""            android:layout_gravity=""right""            android:singleLine=""true""            android:ellipsize=""marquee""            android:marqueeRepeatLimit=""marquee_forever""            android:scrollHorizontally=""true""            android:focusable=""true""            android:focusableInTouchMode=""true""            android:fadingEdge=""none""            android:text=""Right Side 2 - This is a really long text this is long and fun and fun and long""        &gt;        &lt;/TextView&gt;    &lt;/TextSwitcher&gt;&lt;/LinearLayout&gt;</code></pre><p>So how do I get that text on the right side to right-align.  Thanks!</p><hr><p>EDIT: </p><p>I found the problem...  There were a few things wrong.  First, I discovered the difference between gravity and layout_gravity.  I needed to use gravity to right-align the text.</p><p>I can't add any more links, so copy and paste the link below</p><p>thinkandroid.wordpress.com/2010/01/14/how-to-position-views-properly-in-layouts/</p><p>However, that didn't give me exactly the layout I wanted, because long lines of text will be right-aligned before scrolling and the front part of the message cannot be read until it loops around.  What I needed to do was use three ""columns"" of views, with the weight on the middle (empty) view to be ""1"" while the others ""0"" so that it pushes the right-most text as far as possible to the right, while still maintaining left-alignment.</p><p>Next, I discovered that the width of a TextSwitcher is the same as the largest child TextView.  This is a problem when switching from a long line to a short line using setText() because the middle column won't push the small text over to the edge.  The solution is to use two setText()s.  One to cause the fade-out animation, then push a runnable to run after the animation to set the text again to cause the fade-in animation of the new line.</p><p><strong>Now my only problem is that when the fade-out animation runs on a long line of text, if it is in mid-scroll, it resets to the X=0 position before fading, so the effect is that it scrolls, jumps to the origin position, then fades out.  Anybody know how to fix that?</strong></p><p>(I removed the RelativeLayout code above since that was wrong, since this post is really long.)</p><p>Here is the working layout code...</p><pre><code>&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayoutStatusBar""    android:orientation=""horizontal""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_margin=""2px""    android:background=""#333333""&gt;    &lt;TextView        android:id=""@+id/TextViewTimer""        android:textSize=""18px""        android:textColor=""#FFFFFF""        android:layout_gravity=""top""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""0""        android:layout_marginLeft=""1px""        android:layout_marginRight=""4px""         android:text=""Left Side""    &gt;    &lt;/TextView&gt;    &lt;View        android:id=""@+id/ViewSpacer""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""1""    &gt;&lt;/View&gt;    &lt;TextSwitcher        android:id=""@+id/TextSwitcherDetails""        android:inAnimation=""@anim/push_up_in""        android:outAnimation=""@anim/push_up_out""        android:layout_gravity=""top""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""0""        android:layout_marginRight=""1px""    &gt;        &lt;TextView            android:id=""@+id/TextViewDetails1""            android:textSize=""18px""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:singleLine=""true""            android:ellipsize=""marquee""            android:marqueeRepeatLimit=""marquee_forever""            android:scrollHorizontally=""true""            android:focusable=""true""            android:focusableInTouchMode=""true""            android:fadingEdge=""none""        &gt;        &lt;/TextView&gt;        &lt;TextView            android:id=""@+id/TextViewDetails2""            android:textSize=""18px""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:singleLine=""true""            android:ellipsize=""marquee""            android:marqueeRepeatLimit=""marquee_forever""            android:scrollHorizontally=""true""            android:focusable=""true""            android:focusableInTouchMode=""true""            android:fadingEdge=""none""        &gt;        &lt;/TextView&gt;    &lt;/TextSwitcher&gt;&lt;/LinearLayout&gt;</code></pre>","554570","","554570","","2010-12-27 16:53:55","2012-03-17 00:36:22","Android text layout question: two textviews, side-by-side, with different layout alignments and weights","<android><android-layout>","1","1","0","",""
"4536241","1","4892054","","2010-12-27 01:58:50","3","1511","<p><a href=""http://android.voxisland.com/code_examples/How_to_encrypt_and_decrypt_strings.rhtml"" rel=""nofollow"">This</a> is my code for AES.</p><p>Under Gingerbread I get following error after encrypting the data on 2.2 then trying to decrypt on 2.3:</p><pre><code> Caused by: javax.crypto.BadPaddingException: pad block corrupted        at org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(JCEBlockCipher.java:715)        at javax.crypto.Cipher.doFinal(Cipher.java:1090)        at com.citc.wallet.util.security.SimpleCrypto.decrypt(SimpleCrypto.java:63)        ... 21 more</code></pre><p>I have found some posts saying that <code>SecureRandom</code> is producing different results under different systems:</p><p><a href=""http://stackoverflow.com/questions/4405334/bouncycastle-aes-error-when-upgrading-to-1-45/4413716#4413716"">BouncyCastle AES error when upgrading to 1.45</a></p><p>How do I avoid this problem on 2.3?<br>Can I somehow force 2.3 to use the same SecureRandom class?<br>Do I need to use some portable encryption method and if so what?</p>","396106","","418183","","2011-02-03 21:45:48","2011-03-01 22:04:22","AES Gingerbread","<android><aes>","1","0","2","",""
"4536332","1","","","2010-12-27 02:40:31","1","694","<p>In order to migrate my application to a tablet form-factor (xlarge screen), I was forced to move to Android SDK 2.3 (gingerbread).  The application compiles without warnings with the new SDK.  When I try to run the application on an emulator (as I do not own an xlarge device), it crashes when it tries to register my accelerometer listener with SensorManager.  Debugging revealed the call is returning false when it should return true (which it did before moving to SDK 2.3).</p><p>When I run the application on my phone, which is running Froyo, no crash... registerListener returns true.  The following is the code which misbehaves in the 2.3 emulator.</p><pre><code>boolean supported = mSensorMgr.registerListener(this, mSensorMgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),      SensorManager.SENSOR_DELAY_GAME</code></pre><p>I've tried both custom and stock skins, playing with the accelerometer present flag... no luck.  Any advice would be much appreciated!</p>","554604","","","","","2010-12-27 02:40:31","Android SensorManager.registerListener for accelerometer returns FALSE with SDK 2.3 when emulating","<android><accelerometer><sensor><android-sdk-2.3>","0","1","","",""
"4536530","1","","","2010-12-27 03:52:53","6","2319","<p>I use WebView for my Androind App. I got a problem and request a solution for help.</p><p>There is a textfield in the HTML page. When it gets 'focus' and then I call </p><pre><code>          mWebView.setFocusableInTouchMode(true);</code></pre><p>in Java code so that the Android soft-keyboard will pop-up to let me key in.</p><p>The problem is I need using multi-thread for some processes in Java and call</p><pre><code>          mWebView.loadUrl(strJSCall); </code></pre><p>as callback to execute JavaScript function, but the keyboard gets hidden!</p><p>The way I try is to force the keyboard to show again. But how can the keyboard always show when 'loadUrl' is called?Dose anyone meet the same issue and solve it already?</p><p>Sincerely,Jr.</p>","554631","","","","","2013-08-28 12:56:01","Keyboard in HTML text-input disappear when WebView call 'loadUrl' again","<android>","3","1","5","",""
"4536680","1","4536714","","2010-12-27 04:53:04","7","15945","<pre><code>packages/apps/Myfolder/src/com/android/myfolder/MyFile.java:196: package R does not exist                  addPreferencesFromResource(R.xml.myfile);                                              ^packages/apps/Myfolder/src/com/android/myfolder/MyFile.java:344: package R does not exist        menu.add(0, MENU_SAVE, 0, R.string.menu_save)                                   ^packages/apps/Myfolder/src/com/android/myfolder/MyFile.java:346: package R does not exist        menu.add(0, MENU_CANCEL, 0, R.string.menu_cancel)                                     ^packages/apps/Myfolder/src/com/android/myfolder/MyFile.java:454: package R does not exist                     errorMsg = mRes.getString(R.string.error_empty);                                                ^packages/apps/Myfolder/src/com/android/myfolder/MyFile.java:458: package R does not exist                     errorMsg = mRes.getString(R.string.error_empty);</code></pre>","507466","","467090","","2011-02-21 01:50:32","2014-03-20 01:30:04","why does R does not exist error come in android?","<android><gui><compilation><r.java-file>","7","0","2","",""
"4536689","1","4536774","","2010-12-27 04:56:20","2","2707","<p>I'm trying to develop a simple Forex app for Android.To start off, I need to get the currency exchange rates, say for the past year.</p><p>Could anybody advice how I can go about this?I looked in Google financh API but couldn't find how to retrieve currency rates.Any advice is appreciated.</p><p>Thank you.</p>","455048","","13793","","2010-12-31 02:23:52","2010-12-31 02:23:52","Android - How to retrieve currency exchange rates","<android><currency><finance>","2","1","3","",""
"4536691","1","","","2010-12-27 04:57:02","7","3826","<p>I just finished my first app, it works fine and I've made it a home screen widget. But it doesn't have the name under it. The tutorial i am following says nothing about it, Shouldnt this just be the name of the app and be pulled in automatically?</p><p>If not any help on getting one there is appreciated.</p>","554659","","1268895","","2012-05-01 02:25:09","2013-06-13 20:56:47","How do I give a Android App Widget a Label/Name","<android><widget><label>","2","2","","",""
"4536711","1","","","2010-12-27 05:04:44","3","1932","<p>I'd like my Android application to download an mp3 file from the internet and play it like a stream while downloading it.  Is this even possible?  How would I go about doing it?</p><p>Essentially I want the user to be able to listen to the file instantly, but have it keep downloading to the SD Card even if he stops listening, so the whole mp3 file will end up on the SD Card either way.</p>","131871","","131871","","2010-12-28 23:56:50","2012-07-17 07:32:29","Play mp3 file while downloading?","<android><streaming><mp3><audio-streaming>","3","2","3","",""
"4536717","1","4545865","","2010-12-27 05:10:02","10","1534","<p>How are Rhodes, Phonegap, and Appcelerator able to take Javascript or Ruby, and compile them into binaries for app SDKs that normally require apps to be written in Obj-C, Java, and others?</p>","94154","","94154","","2010-12-27 05:17:56","2012-12-28 15:18:39","How do cross-platform mobile app development frameworks work?","<iphone><android><phonegap><appcelerator><rhodes>","4","1","2","",""
"4536737","1","4536800","","2010-12-27 05:16:55","1","981","<p>I have some piece of code. In that there are chances to get many number of exceptions. My doubt is, to handle all those exceptions do i have to write catch blocks for each type of exception. Is it an efficient way or not. Except using throws keyword, If any other solutions are there please suggest me to do that. Any response will be appreciated.</p><p>Thanks in advance</p>","524937","","17389","","2010-12-27 05:32:44","2012-08-16 17:08:08","How to handle a great number of exceptions in java?","<android>","2","0","","",""
"4536762","1","4536970","","2010-12-27 05:26:12","0","473","<p>I'm new to development on Eclipse (for Android). I have been a .Net developer using Visual Studio for YEARS now. I'm excited to now try something new.</p><p>I have just started working on Eclipse and managed to develop a small database application. I want to build reusable components which I can use across multiple projects. In Visual Studio, I build a new project and ""reference"" them in other projects. This way changes to the components get reflected in all referencing projects.</p><p>Is there a way to do a similar thing in Eclipse? I don't want to include the .java files in my project, rather I want them to be in a separate project. I'm also looking for the best practices to do this in the Eclipse/Java world.</p><p>Thanks</p>","161633","","50776","","2012-12-04 16:52:55","2013-09-14 10:26:58","Reusable Projects in Eclipse/Android","<android><eclipse><components><reusability>","2","0","","",""
"4536819","1","","","2010-12-27 05:45:08","2","798","<p>I was wondering if there is any way to progammatically determine if the android app has been paid for?</p><p>I am going to implement the Android LVL library code in my app. But I also want to let the users first try out the app and then buy it if they like it. So how can I determine if the app has been bought and hence fully licensed.</p><p>Thanks for your help.</p>","355614","","","","","2011-02-22 23:07:51","programmatically determine if android app has been paid","<android><google-play><android-lvl>","2","0","0","",""
"4536823","1","","","2010-12-27 05:47:52","0","709","<p>I have decided to create my own Java's Robot class in android to take screen capture..i have written the source code of the robot class by my own but the problem is here, the following line in the code is throwing compilation error..saying ""<strong>The method createRobot(Robot, GraphicsDevice) in the type ComponentFactory is not applicable for the arguments (Robot, GraphicsDevice)""</strong> </p><p>peer = ((ComponentFactory)toolkit).createRobot(this, screen);</p><p>Can anyone suggest me what would be the solution....</p><p>thanks..</p>","505580","","","","","2010-12-27 06:32:59","error in creating my own Robot class in android","<java><android>","1","2","","",""
"4536870","1","","","2010-12-27 06:03:14","-4","79","<p>can we design a plug-in in android?</p>","602629","","","","","2010-12-27 06:09:31","Android Question","<android>","1","1","","2011-08-29 18:25:53",""
"4536889","1","","","2010-12-27 06:07:35","0","1807","<p>how can i display two columns values in listview from sqlite database in first column values are TextView and the second column values are displayed in EditText Field. </p><p>Thank you.</p>","552978","","","","","2010-12-27 08:33:27","how can i display values in listview from SQLite Database?","<android><listview><edittext>","1","0","1","",""
"4536890","1","4542873","","2010-12-27 06:07:39","1","331","<p>i want to create screen in android like the image below(click on the hyperlink) but i am not getting the idea that how to create this screen just provide me solution for my problem.<a href=""http://cdn2.staztic.com/screenshots/219871-2.jpg"" rel=""nofollow"">click to see image</a></p>","537819","","537819","","2010-12-27 06:14:08","2010-12-28 00:27:51","Layout styles in android","<android><android-layout>","2","0","","",""
"4536941","1","4577299","","2010-12-27 06:22:55","0","163","<p>I have a ListActivity that's populated with a SimpleCursorAdapter which pulls the data from a database.  I want to set images on the rows at runtime based on the data in the database.  If the data is a one, I want a filled-in icon, and if it is 0, I want it to be hollow.</p><p>In order to do this, I figured it would be easiest to access the layout of each row individually, and change the image, but I can't figure out how to access the individual rows without clicking on them.</p><p>I also eventually want the image itself to have a separate click event from the row it's on, but I'll probably ask another question for that.</p>","302118","","","","","2011-01-02 05:36:37","Accessing the view for a row in an Android ListActivity with a SimpleCursorAdapter","<android><listactivity><listadapter>","2","0","","",""
"4537004","1","","","2010-12-27 06:35:53","3","614","<p>I have a game that requires continuous touch to track user movementand draws in SurfaceView. I've noticed that at about 30sec intervalssystem_server will kick in with a GC and cause the game to stutter. IfI don't touch the screen at all system_server will be not GC. I'mwondering if anyone else has encountered this problem before. I'musing Canvas to draw around 30+ objects on screen at once and it runspretty smoothly (56fps) until system_server steps in... Is thissomething inherit to SurfaceView? It looks like 3D games (usingGLSurfaceView) don't have this problem.</p><p>I'm developing on a Samsung Vibrant.</p><p>Thanks!</p>","531030","","","","","2011-01-07 23:32:16","Android onTouchEvent() continuous touch causes system_server GC","<android><touch><game-engine>","1","3","","",""
"4537068","1","","","2010-12-27 06:48:50","1","2222","<p>Currently I have a View which has a AsyncTask class used for decoding.But eventhough AsyncTask.cancel() is not called within my class, onCancelled() has been called which resulted to some abnormal process in my application.</p><p>I would like to ask if what are any instances that AsyncTask.onCancelled() will be calledbesides when calling the AsyncTask.cancel()</p><p>Any help would be appreciated.Thanks alot in advance</p>","554737","","","","","2011-08-09 12:45:53","AsyncTask when is onCancelled() is called besides calling AsyncTask.cancel?","<android><android-asynctask>","2","1","1","",""
"4537081","1","4537608","","2010-12-27 06:51:46","0","354","<p>I want to create the activity which will load the images from Web by using urls and i want to load that images in list view and i want some specific text and properties of that image in front of that image like the image below <a href=""http://cdn2.staztic.com/screenshots/219871-2.jpg"" rel=""nofollow"">Click to see Image</a>.Is there any way to store that images temporarily in phones memory.So how can i do this activity please give me perfect solution so that i can complete my application.How can i load the images from web.</p>","537819","","","","","2010-12-27 09:06:09","Android List view","<android><android-layout>","1","2","","",""
"4537100","1","4537139","","2010-12-27 06:57:46","0","764","<pre><code>public void onClick(DialogInterface dialog, int which) {                setContentView (R.layout.choose);                       lv1 = (ListView) findViewById(R.id.options);                     String[] lv_arr= new String [] {""Book a Classified Ad"",""Book a Classified display Ad"",""Book a display Ad"",""Page Position Availability"", ""MIS"", ""Market Share"", ""Approval"", ""Upload Material"" };                    ArrayList&lt;String&gt; Options = new ArrayList&lt;String&gt;();                      Options.addAll(Arrays.asList(lv_arr));                    listAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.choose, R.id.options);                      lv1.setAdapter( listAdapter );                                            }           });    </code></pre><p>The Error it is giving is ""The constructor ArrayAdapter(new DialogInterface.OnClickListener(){}, int, int) is undefined""</p><p>I am complete new in programing so please tell me how to change to the list view from Onclicklistner here ?</p>","542936","","","","","2010-12-27 07:08:57","Is this usage for ArrayAdapter in android is right?","<android><onclick>","1","0","","",""
"4537142","1","4537379","","2010-12-27 07:09:57","0","194","<p>I have the following scenario, please help me to find possible solution...</p><ol><li>I am logging into my application.</li><li>Then I navigate to different screens of my application.</li><li>Application crash in One scenario that i could not handle..That is while uploading the Video of large size.</li><li>Then it will give me Force close POP UP and then redirects to LOGIN Screen. There i  need to clear my password for the security reason.....</li></ol><p>Anyone can help me to clear password when application crashes....</p>","1386533","","104117","","2010-12-27 08:17:30","2010-12-27 08:17:30","Android : Upon Force close clear password in login screen","<android>","2","0","","",""
"4537234","1","5433550","","2010-12-27 07:34:06","0","515","<p>I am attempting to use JMDNS to resolve a local network host's IP address. It works fine on simulator but not on phone. Anybody has any idea what the reason may be?</p><p>thanks a lot.</p>","397901","","887885","","2011-08-25 10:47:23","2011-08-25 10:47:23","JMDNS works on simulator but not on device","<android><jmdns>","1","0","","",""
"4537322","1","4537342","","2010-12-27 07:52:59","2","1524","<p>Can anybody tell me why my android emulator gives the following error:</p><pre><code>Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGEPlease check logcat output for more details.Launch canceled!</code></pre>","552027","","35060","","2010-12-27 07:58:17","2010-12-27 08:02:51","android emulator error","<android><android-emulator>","2","0","","",""
"4537394","1","","","2010-12-27 08:10:17","1","447","<p>I create a application, &amp; I have many features in this application. So, i wanna this application shows these features to other applications. How can i do. Please answer me. thanks much much</p>","554792","","21234","","2010-12-27 12:12:50","2010-12-27 13:59:13","how to create a permission in application","<android>","2","1","","",""
"4537438","1","","","2010-12-27 08:22:13","1","4306","<p>I'm looking for a method of counting Frames Per Second in game applications, the problem is that i dont have the source code for any of those apps, they dont have such functionality implemented inside. To be honest i dont really expect this to be possible but it was worth to ask. </p><p>And to be perfectly clear i understand that i need a basic knowledge and code of the main painting loop to count FPS.</p><p>Best Regards</p>","469101","","","","","2012-01-09 07:43:43","Frame per second counting in Android game","<java><android>","3","0","","",""
"4537440","1","","","2010-12-27 08:23:02","1","406","<p>I want to launch my own media player application when I want to watch a video from Youtube. When I write <code>android:scheme=""http""</code> and <code>android:host=""m.youtube.com""</code> it is OK. But, it asks everywhere in m.youtube.com to open my app. So, it gets annoying. I tried to use pathPattern, pathPrefix and path to solve this but I didn't get ahead. All I want is clearly this:</p><ul><li><p>When the link is like <code>""http://m.youtube.com/index?desktop_uri=%2F%gl=US#""</code> the intent filter shouldn't launch my app.</p></li><li><p>When the link is like <code>""http://m.youtube.com/index?desktop_uri=%2F&amp;gl=US#/watch?xl=xl_blazer&amp;v=k3Cdqx1qFX8""</code> my application should be launched.</p></li></ul><p>Is there anyone that can help me?</p>","511853","","473070","","2010-12-27 08:50:44","2010-12-27 09:31:51","Launch Activity with Intent Filter on Right Time","<java><android><youtube><android-intent><android-manifest>","1","2","1","",""
"4537449","1","4537762","","2010-12-27 08:25:01","5","1174","<p>In the source code of Activity.java, I see some methods bellow :</p><pre><code>public View findViewById(int id) {    return getWindow().findViewById(id);}</code></pre><p>and the definition of getWindow method:</p><pre><code>public Window getWindow() {    return mWindow;}</code></pre><p>But as the following rules:</p><blockquote>  <p><strong>Avoid Internal Getters/Setters</strong></p>    <p>In native languages like C++ it's  common practice to use getters (e.g. i  = getCount()) instead of accessing the field directly (i = mCount). This is  an excellent habit for C++, because  the compiler can usually inline the  access, and if you need to restrict or  debug field access you can add the  code at any time.</p>    <p>On Android, this is a bad idea.  Virtual method calls are expensive,  much more so than instance field  lookups. It's reasonable to follow  common object-oriented programming  practices and have getters and setters  in the public interface, but within a  class you should always access fields  directly.</p>    <p>Without a JIT, direct field access is  about 3x faster than invoking a  trivial getter. With the JIT (where  direct field access is as cheap as  accessing a local), direct field  access is about 7x faster than  invoking a trivial getter. This is  true in Froyo, but will improve in the  future when the JIT inlines getter  methods.</p></blockquote><p>so I want to know why android developers not access this mWindow object directly? If the JIT of the current android versions cannot inline the access, getWindow().findViewById(id) will costs more time than mWindow.findViewById(id), and findViewById is a rather frequently used method.</p>","554788","","","","","2012-04-26 10:16:08","Avoid Internal Getters/Setters","<android><mobile>","3","0","1","",""
"4537568","1","4543829","","2010-12-27 08:57:47","2","401","<p>I am going to start a project on video-on-demand application on Android. Basically I want the Android device to require video from a streamer (vlc or others, not limited) and the streamer could respond. However, I don't know where to start this project and which knowledge are needed. So anyone please advice.</p><p>Thanks a lot.</p><p>Charlie</p>","513374","","","","","2010-12-28 05:15:04","Android video on demand and remote control","<android><communication>","2","2","1","",""
"4537674","1","","","2010-12-27 09:19:43","4","6003","<p>Iam New to Android.My Requirement is to implement ExpandableListview with two Levals.</p><p>Means</p><pre><code>   * Parent     * Child         * Subchild1         * Subchild2</code></pre><p>Like Above. Can any one Help me. Thanks in advance.</p>","554827","","272824","","2010-12-27 09:57:33","2014-01-06 08:10:59","How to implement multilevel ExpandableListview in Android?","<android><listview>","2","1","1","",""
"4537704","1","","","2010-12-27 09:24:19","1","1051","<p>hello sir my emmulator gives an error while running aoppliaction.</p><pre><code>    at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)    at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)    at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)[2010-12-27 14:40:24 - ddms]nulljava.lang.NullPointerException    at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)    at com.android.ddmlib.Client.sendAndConsume(Client.java:573)    at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)    at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)    at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)    at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)    at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)</code></pre>","552027","","345717","","2010-12-27 09:28:44","2010-12-27 09:28:44","error while running android application","<android>","1","0","","",""
"4537818","1","4538074","","2010-12-27 09:47:47","0","1183","<p>Is there any three20 framework (Or something like it) for android?</p>","122456","","","","","2010-12-28 10:56:17","Is there any three20 framework for android?","<android>","1","1","2","",""
"4537841","1","","","2010-12-27 09:50:46","13","681","<p>Is there any working example for PayPal preapproval API operation. I went through some tutorials,. But they are specifying some preapproval key for the transaction. How will we get this key? </p>","523058","","1246870","","2013-12-12 21:28:55","2013-12-12 21:28:55","Android : Paypal Preapproval API operation (Example needed)","<android><paypal-subscriptions>","1","0","3","",""
"4537863","1","","","2010-12-27 09:53:42","1","929","<p>I made a screen with rating bar and i want to give the ratings of application that will reflect direct on the Android Market, please let me know if there is any way to do this.</p>","554837","","","","","2010-12-28 16:17:24","how can i give ratings of android application through RatingBar in Android","<android>","2","1","","",""
"4537924","1","","","2010-12-27 10:05:02","2","1348","<p>I want to log voice call and video call. I must distinguish them.Where is the difference between the intent for ACTION_NEW_OUTGOING_CALL of video call and the intent for ACTION_NEW_OUTGOING_CALL of voice call?</p>","554861","","","","","2011-08-02 15:44:12","How to distinguish between voice call and video call on Android?","<android><video><voice>","1","1","3","",""
"4537980","1","4538035","","2010-12-27 10:15:06","16","60446","<p>I am trying to add, remove and reference items from an array I create in my main java file, but I am having trouble figuring out the correct syntax.  In actionscript they have push() and pop() for adding and removing items in an array, is there an equivalent in android?</p>","486086","","486086","","2013-11-13 23:37:05","2013-11-13 23:37:05","equivalent to push() or pop() for arrays?","<java><android>","4","2","3","",""
"4538102","1","","","2010-12-27 10:33:32","0","157","<p>I am new to Android. I want to use database with Android. Is there any way to use floggy with Android?</p>","554885","","1128737","","2012-01-15 12:58:40","2012-01-15 12:58:40","How to use floggy with Android?","<android>","1","0","","",""
"4538179","1","","","2010-12-27 10:51:33","1","1231","<p>I have a terrible issues with texure sphere mapping.</p><p>This is my code:</p><pre><code>public void onSurfaceCreated(GL10 gl10, EGLConfig config) {    GL11 gl = (GL11) gl10;  gl.glDisable(GL10.GL_DEPTH_TEST);    //Disable Depth Testing  gl.glEnable(GL11.GL_TEXTURE_2D);  gl.glEnable(GL11.GL_CULL_FACE);  gl.glCullFace(GL11.GL_FRONT);  gl.glFrontFace(GL11.GL_CCW);  sphere.loadGLTexture(gl10, context);}public void onDrawFrame(GL10 gl10) {  GL11ExtensionPack gl= (GL11ExtensionPack) gl10;  gl10.glMatrixMode(GL10.GL_PROJECTION);  gl10.glLoadIdentity();  gl10.glFrustumf(-5.0f, 5.0f, -5.0f, 5.0f, 1.0f, 100.0f); //Mio   gl10.glMatrixMode(GL10.GL_MODELVIEW);  gl10.glLoadIdentity();  GLU.gluLookAt(gl10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -10.0f, 0.0f, 1.0f,0.0f);  sphere.draw(gl10);}public void onSurfaceChanged(GL10 gl, int width_, int height_) {  gl.glViewport(0, 0, width, height);  }public void draw(GL10 gl10) {  GL11ExtensionPack gl = (GL11ExtensionPack) gl10;  GL11 gl11 = (GL11) gl10;  gl.glBindTexture(GL10.GL_TEXTURE_2D, textures_ids.get(0));  gl10.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, totalVertexCount);}public void loadGLTexture(GL10 gl10, Context context) {  GL11 gl = (GL11) gl10;  gl.glGenTextures(2, textures_ids);  gl.glBindTexture(GL10.GL_TEXTURE_2D, textures_ids.get(0));  gl.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);  gl.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);  gl.glTexParameterf( GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE );  gl.glTexParameterf( GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE );  GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, this.image, 0);  gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);  gl.glVertexPointer(3, GL11.GL_FLOAT, 0, vertexBuffer);  gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);  gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0,textureBuffer);  }</code></pre><p>The vertexbuffer contains a points for a sphere and the texturebuffer contains the normals for that, I meet an horrible result and I don't understand what's wrong...</p><p>This is the result img:</p><p><a href=""http://img198.imageshack.us/img198/6370/failfs.png"" rel=""nofollow"">http://img198.imageshack.us/img198/6370/failfs.png</a></p><p>I am working with android OpenGL ES but I think error isn't correlated with my platform but is correlated with my use of OpenGL API, I am a newbye with this library.</p>","554892","","44729","","2010-12-27 13:54:09","2011-02-23 10:20:23","Android OpenGL ES 1.1 Sphere texture mapping problem","<android><opengl-es><sphere>","0","2","1","",""
"4538257","1","4538308","","2010-12-27 11:09:32","0","596","<p>I'm working on application that retrieve messages from some website and i want to cache these messages to not load messages every time ?</p><p>what is the best choice for storing messages locally??  </p>","508377","","","","","2010-12-27 11:17:24","what it the best choice for local caching in android?","<android>","2","1","","",""
"4538329","1","","","2010-12-27 11:20:36","1","773","<p>i'm trying to implement xmpp client in android it works finr in desktop systems means where the openfire kept....but when i'm trying to connect remote systems it showa sslhandshake failure  failure ssl library protocol error </p><p>please help me to resolve this issue</p><p>thanks regards renuka</p>","519991","","89806","","2010-12-27 11:23:15","2010-12-29 00:32:16","SSL handshake failure in android","<android><ssl><xmpp>","1","1","","",""
"4538338","1","4538935","","2010-12-27 11:22:45","35","57272","<p>I'm trying to display a custom progressdialog while loading rss feed from http server, I made a hard search, but nothing helped me to do this, the only thing i know is that the solution should use AsyncTask, but i'm confusing about the params to pass to this AsyncTask.Here's my activity :</p><pre><code>    import java.util.ArrayList;import java.util.List;import com.cyberesa.info.BaseFeedParser;import com.cyberesa.info.Message;import com.cyberesa.info.MessageListAdapter;import com.cyberesa.info.R;import android.app.ListActivity;import android.os.Bundle;import android.util.Log;import android.widget.TextView;public class Soirees extends ListActivity {    private List&lt;Message&gt; messages;    private TextView tvSorties;    private MyProgressDialog dialog;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.sorties);        tvSorties=(TextView)findViewById(R.id.TVTitle);        tvSorties.setText(""Programme des soirées"");        loadFeed();   }    private void loadFeed(){        try{            BaseFeedParser parser = new BaseFeedParser();            messages = parser.parse();            List&lt;Message&gt; titles = new ArrayList&lt;Message&gt;(messages.size());            for (Message msg : messages){                titles.add(msg);            }            MessageListAdapter adapter = new MessageListAdapter(this,titles);            this.setListAdapter(adapter);            adapter.notifyDataSetChanged();        } catch (Throwable t){            Log.e(""ImageLoader"",t.getMessage(),t);        }    }}</code></pre><p>Can you please help me add AsyncTask to this ?</p><p>Thank you,Houssem</p>","552264","","","","","2013-02-02 12:20:28","progressDialog in AsyncTask","<android><android-asynctask><progressdialog>","4","0","16","",""
"4538362","1","4538679","","2010-12-27 11:28:05","5","1046","<p>I am developing an application on Android. It is a long running application that continuously processes sensor data. While running the application I see a lot of GC messages in the logcat; about one every second.</p><p>This is most probably because of objects being created and immediately de-referenced in a loop.</p><p><strong>How do I find which objects are being created and released immediately?</strong></p><p>All the java heap analysis tools that I have tried(*) are bothered with the counts and sizes of objects on the heap. While they are useful, I am more interested in finding out the site where <strike>temporary</strike> short-lived objects get created the most.</p><p>(*) I tried <code>jcat</code> and <code>Eclipse MAT</code>. I couldn't get <code>hat</code> to work on the Android heap-dumps; it complained of an unsupported dump file version.</p>","161257","","161257","","2010-12-27 12:46:25","2010-12-27 12:49:35","How to analyse Dalvik GC behaviour?","<java><android><memory-management><dalvik><heap-dump>","2","0","2","",""
"4538429","1","5493651","","2010-12-27 11:45:30","4","3352","<p>Is it possible to listen for WebView page load full completed and then capture screenshot of loaded page?</p><p>I tried two ways, but they both not working:</p><ul><li><p>using <code>WebViewClient</code> and <code>onPageFinished(WebView view, String url)</code>.<br>It doesn't work (and it described in docs) because Picture may be not ready it this moment</p></li><li><p>using <code>WebView.PictureListener</code> and <code>onNewPicture(WebView view, Picture picture)</code><br>It also doesn't solve problem, because this method calls undetermined times. At first time, picture often contains only part of page content. And I don't know way how determine, that the current call is last for the page.</li></p></li></ul><p>I want to notice, that the problem is to find right moment to make screenshot, and not how it can be done. </p>","438843","","71421","","2011-07-12 22:11:39","2011-12-12 21:31:25","Capture picture from WebView","<android><android-webview>","1","0","1","",""
"4538481","1","4538527","","2010-12-27 11:55:31","0","417","<p>Hy!!</p><p>I have a login form in my app, but i want to save/restore the textfile internal in the app not on the internal phone memory.</p><p>Are there some code snippets?</p><p>I made a internal file saving/restoring but it don't work.</p><pre><code>if (cb.isChecked())                {                    File file = new File(""/mmt/sdcard/login.skip"");                    Writer output = null;                    try                    {                         output = new BufferedWriter(new FileWriter(file));                            output.write(etuser.getText().toString()+ "";"" + etpw.getText().toString());                            output.close();                    }                    catch (Exception e) {                        // TODO: handle exception                    }                }</code></pre><hr><pre><code>File file = new File(""/mmt/sdcard/login.skip"");    if(file.exists())    {   try        {          BufferedReader input =  new BufferedReader(new FileReader(file));          while (( line = input.readLine()) != null){             line2 = line;            }          etuser.setText(line2.split("";"")[0]);          etpw.setText(line2.split("";"")[1]);          input.close();        }        catch (Exception e) {            // TODO: handle exception        }    }</code></pre>","547995","","","","","2010-12-27 12:06:55","Save Internal File for Login","<android>","1","3","","",""
"4538505","1","","","2010-12-27 12:01:40","0","146","<p>I am able to open an URL from Android web browser, desktop browsers, blackberry application.</p><p>But in my android application I am getting this error sporadically. (There is no specific pattern to explain why I am getting this error) Can somebody let me know what could be reason for this?</p><p>Thanks &amp; Best Regards<br>Sudhakar Chavali </p>","512025","","","","","2011-01-13 18:10:30","UnknownHost exception for Android application","<java><android><java-ee><android-emulator>","1","1","","",""
"4538518","1","4538764","","2010-12-27 12:03:57","1","380","<p>I am creating a android application where I need to create the database in which data comes from excel file on first run when the application starts.</p><p>The problem is where should I keep the file and how do I access it in my android application or there is another method to create the database from excel sheet.</p>","418271","","473070","","2010-12-27 12:49:39","2010-12-27 12:51:31","Android database creation","<java><android><database><sqlite>","1","0","","",""
"4538606","1","4538621","","2010-12-27 12:24:28","0","530","<p>I am trying to show toast on inserting content into the database. and then it finishes the activity.</p><ol><li>Send Mail</li><li>Store Mail in Db</li><li>If Successfull show Toast for 10sec</li><li>finish(); Activity and return to the previous one.</li></ol><p>code: <a href=""http://pastebin.com/6aBjwCFh"" rel=""nofollow"">http://pastebin.com/6aBjwCFh</a></p>","155196","","","","","2011-04-19 18:38:51","Android Toast doesnt show up","<android><toast>","1","0","","",""
"4538662","1","4538676","","2010-12-27 12:35:00","1","1015","<p>I have created a SQLite database &amp; table in Android.After performing all the necessary calculations , I have deleted the data from the table of the database by calling the below code.</p><p><strong>sampleDB.execSQL(""DELETE FROM "" + Constants.TABLE_NAME);</strong></p><p>Now , I need to write a condition to check that if no data is there for that particular table , I need to show an Alert .</p><p>I am unable to find the code to check the condition whether data is there or not for the TABLE , maybe how to check the size of the data within the TABLE.</p><p>Kindly provide hints/sample code.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-12-27 12:37:21","How to find whether a Table in SQLite contains data or not","<android>","1","1","","",""
"4538682","1","4538772","","2010-12-27 12:38:35","2","1283","<p>Fairly simple question :</p><p>Is there a way to replace the phone lock application of an Android phone ?<br>I would like to customize my screen lock, and perhaps, if the result is nice, publish it on the market. Would that be possible ? Any tips ?thx !</p>","263521","","","","","2010-12-27 12:53:01","Android - Create a phone lock application","<android><locking><phone>","1","0","","",""
"4538719","1","4538748","","2010-12-27 12:43:22","0","404","<p>Code for restore:</p><pre><code>final SharedPreferences settings = getSharedPreferences(""pref"", 0);        settings.getString(""user"", """");        settings.getString(""pw"", """");</code></pre><p>Code for store:</p><pre><code>SharedPreferences.Editor editor = settings.edit();                      editor.putString(""user"", etuser.getText().toString());                      editor.putString(""pw"", etpw.getText().toString());                      editor.commit();</code></pre><p>This code don't work, and no error occur</p>","547995","","473070","","2010-12-27 12:46:44","2012-08-19 23:21:37","Problem with SharedPreferences","<android><sharedpreferences>","2","1","","",""
"4538740","1","","","2010-12-27 12:48:14","0","416","<p>I want to create a dashboard like the twitters application.but i am unable to set the buttons location and i dont know how to change the image of the button on click or move.I want the dash board like this Image:</p><p><img src=""http://i.stack.imgur.com/Tg2E4.png"" alt=""enter image description here"">So please provide me the solution.</p>","537819","","664177","","2013-04-18 09:36:33","2013-04-18 09:36:33","Android Dash Board","<android><layout>","1","3","","",""
"4538758","1","","","2010-12-27 12:50:19","3","2445","<p>I tried to record audio in Android. The quality of the sound using the MediaRecorder really sucks.</p><p>So I tried writing the sound to a stream using the AudioRecord function. Great quality but pcm-files are too large in size as I want to upload them to a remote server.</p><p>Does anybody know how to compress the pcm (like mp3 or else)?Any help is mostly appreciated.</p><p>Tom</p>","403051","","","","","2010-12-27 13:37:16","Android convert pcm file from AudioRecord to smaller file","<android><compression><audio><pcm>","1","0","0","",""
"4538773","1","","","2010-12-27 12:53:08","3","872","<p>I am working on an Alarm Clock project and i want to edit my already set Alarm.when I edit alarm then alarm time is updated but values that I send by using <code>putExtra()</code> are not changing. I am using <code>PendingIntent.FLAG_ONE_SHOT</code> flag.</p><p>But when I set flag <code>PendingIntent.FLAG_UPDATE_CURRENT</code> all <code>putExtra()</code> values are also change but now problem is that, when i click on stop button and <code>finish()</code> the current activity it calls again. </p><p>means when I go to finish the activity it calls again on button click while I am finishing current activity.please help me.Thanks in advance.</p>","361288","","361288","","2010-12-27 12:57:43","2014-02-26 15:17:10","updating alarm from pending intent in android","<android><android-alarms>","2","0","2","",""
"4538828","1","4539145","","2010-12-27 13:02:59","0","637","<p>So far I have this layout 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:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""48dip""        android:background=""#FFFFFF"" &gt;        &lt;ImageView            android:layout_weight=""1""            android:layout_width=""40dip""            android:layout_height=""40dip""            android:layout_gravity=""center_vertical""            android:src=""@drawable/icon"" /&gt;        &lt;TextView            android:layout_weight=""1""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_gravity=""center_vertical""            android:text=""text"" /&gt;        &lt;TextView            android:layout_weight=""1""            android:layout_width=""40dip""            android:layout_height=""wrap_content""            android:layout_gravity=""center_vertical""            android:text=""text"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>What do people do when they have a layout like this where the middle TextView should fill what's left of the layout?  Here I have an ImageView that is 40dip wide and a TextView that also is 40dip wide.  So I'm trying to get the middle TextView to fill up what's left.  The code above is as far as I get.  I got the middle TextView to fill up what's left and some extra - leaving the left ImageView to be smaller than the 40dip I've set it to be.</p><p>What do I do here?  Layouting in Android is not easy.</p><p>What I'm trying to do is create a list looking like the lists in Market.  With an icon to the left, two lines of text in the middle, and som extra information to the right.  Are there any examples of how to do this?</p>","324943","","","","","2010-12-27 14:09:45","Howto make an element fill what's left of a layout","<android><layout><coding-style>","1","0","1","",""
"4538840","1","","","2010-12-27 13:04:57","2","537","<p>Hi I have post some value using <code>HttpPost</code> and convert response into string using</p><pre><code>HttpEntity entity = response.getEntity();String rrr=EntityUtils.toString(entity);</code></pre><p>rrr contain some xml tags</p><pre><code>&lt;root&gt;    &lt;mytag&gt;its my tag&lt;/mytag&gt;&lt;/root&gt;</code></pre><p>Now I have to extract string ""its my tag""I have try to do it with SAX Parser but it give out put null.Plz, help me in solving this problem. </p>","554976","","473070","","2010-12-27 13:42:51","2011-03-15 00:08:12","Extracting xml data from string var in android","<android><parsing><sax>","2","0","","",""
"4538896","1","4542785","","2010-12-27 13:12:57","1","7213","<p>I've been looking for over a day for a solution to this problem but nothing helps, even the answers here dont help me....ma problem is ma image is rotating but not bitmap size is varing while rotating .....</p><p>here is ma code </p><pre><code>package dharam.rotate;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.provider.ContactsContract.CommonDataKinds.Event;import android.util.Log;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.View;import android.view.Window;import android.widget.ImageView;import android.widget.TextView;public class Rotate extends Activity {    View baseView ;    ImageView turntable;    TextView bottomText;    GestureDetector   gestureDetector;    private float x , y;@Overridepublic 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);    baseView.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);        Log.i(""R is "", """"+r);        if (evt.getAction() == MotionEvent.ACTION_DOWN) {        }        if (evt.getAction() == MotionEvent.ACTION_MOVE) {            x= evt.getX();            y= evt.getY();            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.orsl_circle_transparent);    Matrix matrix = new Matrix();//        matrix.setTranslate(getWindowManager().getDefaultDisplay().getWidth()/2, getWindowManager().getDefaultDisplay().getHeight());        matrix.postRotate(newRot,bitmap.getWidth()/2,bitmap.getHeight()/2);//      matrix.setSinCos(newRot, newRot/2, 100, 100);//      matrix.postRotate(newRot);        Log.i(""THE ROATTION "", ""  ""+    newRot);    if(y&gt;250)    {        Bitmap redrawnBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap                .getWidth(), bitmap.getHeight(), matrix, true);        turntable.setImageBitmap(redrawnBitmap);    }else    {        Bitmap  redrawnBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap                .getWidth(), bitmap.getHeight(), matrix, true);         turntable.setImageBitmap(redrawnBitmap);         Log.i(""GUITAR _IMAGE"", """");    }}</code></pre><p>}</p>","501483","","135152","","2011-06-18 06:00:34","2014-04-07 10:30:59","How to rotate image with fix point along with touch in android","<android>","2","6","2","",""
"4538957","1","","","2010-12-27 13:21:36","0","488","<p>I am a newbie to Android world and started learning it few days back. I developed a sample application Using Eclipse and ADT pluggin. Checked it on Emulator, it's working. But when I exported that App as *.apk and tried to install it in my phone (Samsung Galaxy S running 2.2) ... it gives error that ""Application not installed""</p><p>Can somebody throw some light on this ?</p>","554630","","","","","2011-03-31 08:52:37","Unable to install newly created Android App","<android><eclipse><new-operator><adt>","2","0","","",""
"4538959","1","4539084","","2010-12-27 13:21:56","0","251","<p>I am trying to fetch rows from the database and make a list view from it. </p><p>This is by Query method inside the DbAdapter</p><pre><code>public Cursor readInbox(long toId) throws SQLException {    return db.query(TABLE_MAILS, new String[] { ID, KEY_FROM, KEY_TO,            KEY_SUB, KEY_BODY, KEY_DATETIME, KEY_READ }, KEY_TO + ""=""            + toId, null, null, null, null, null);}</code></pre><p>This is the code i am trying to write. but its giving error</p><pre><code>public class InboxActivity extends ListActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.inbox);        DBAdapter db = new DBAdapter(InboxActivity.this);        db.open();        long userID = Long.parseLong(MessagingApplication.getUserID());        Cursor inbox = db.readInbox(userID);        startManagingCursor(inbox);        String[] Id = new String[] { DBAdapter.ID };        SimpleCursorAdapter inboxmail = new SimpleCursorAdapter(this, R.layout.list_view, db, Id, null);        setListAdapter(inboxmail);        db.close();    }}</code></pre><p>the Error:</p><pre><code>The constructor SimpleCursorAdapter(InboxActivity, int, DBAdapter, String[], null) is undefined</code></pre>","155196","","155196","","2010-12-27 13:28:42","2010-12-27 13:40:22","List View Problem","<android><listview><listviewitem>","1","2","","",""
"4539130","1","4539157","","2010-12-27 13:48:29","6","1823","<p>I want to store sample images. what is the best efficient way weather to store on SD card or in DB?</p>","185022","","964741","","2012-03-15 12:22:57","2012-03-15 12:22:57","what is the best practice store images in android in SD card or in SQL lite DB?","<android><image><performance><store>","1","0","2","",""
"4539152","1","","","2010-12-27 13:51:54","1","1366","<p>I'am working with android and the google maps API.</p><p>The Location-class in the android framework uses degrees while the maps GeoPoint-class uses microdegrees.</p><p>My question: Why is that the case? I have to make a presentation and it would be nice to have a reason for it.</p><p>GeoPoint description: <a href=""http://code.google.com/android/add-ons/google-apis/reference/index.html"" rel=""nofollow"">http://code.google.com/android/add-ons/google-apis/reference/index.html</a>Location description: (cant post it cause of spam prevention, sorry)</p><p>Thanks!</p>","499229","","","","","2013-01-18 07:44:34","Android: Google maps API GeoPoint vs. android's Location, why microdegrees","<android><google-maps>","2","0","","",""
"4539211","1","4539219","","2010-12-27 14:02:47","2","3013","<p>Hy!</p><p>My code:</p><pre><code>if(keyCode == KeyEvent.KEYCODE_BACK)    {        if (menuestate == 1)            Main.this.onCreate(null);        }        }</code></pre><p>if i press the backbutton i see the oncreate for a half second an then the homescreen occur</p><p>Whats wrong?</p>","547995","","","","","2010-12-27 14:04:14","Call OnCreate by pressing the backbutton","<android>","1","1","1","",""
"4539234","1","","","2010-12-27 14:07:54","0","396","<p>I have an AVD with custom resolution 480x800 and it seems like auto-scaling fails even with  . Bitmaps remains small, attached to left top corner of Canvas. Auto-scaling perfectly works with any build-in skins on emulator. I using  Somebody, please tell me, Why could this happen ?</p><p>Thank you</p>","555026","","","","","2010-12-28 08:47:08","Android auto-scaling doesn't work on emulator with custom resolution","<android><manifest>","1","2","","",""
"4539248","1","","","2010-12-27 14:10:31","4","945","<p>I use <code>WallpaperManager.getDrawable()</code> to get the current wallpaper and then convert it to bitmap to do something else. I find that sometimes I will get the wrong data of wallpaper when the device rotates continuously. For example, the width and height of wallpaper is about portrait when the device is in the landscape mode.</p><p>Does anyone know how to detect the current orientation of wallpaper or any related data about wallpaper orientation?</p>","554270","","500584","","2011-08-11 17:28:40","2011-08-11 17:28:40","How to detect the orientation of wallpaper in android","<android><orientation><wallpaper>","2","1","1","",""
"4539262","1","","","2010-12-27 14:13:51","1","957","<p>Hi friends i wanna to store the captured image from camera in location DCIM/Camera..If i store it inside SDcard (at any location)the copy of image stored in DCIM/Camera, but if i dont save inside SDcard (at any location)copy of image not getting saved in DCIM/Camera... I wanna to store only in DCIM/Camera.. Pls give me a solution</p><p>Here is my code...</p><pre><code>    protected void startCameraActivity()    {            Date date = new Date();              date.getDate();                    SimpleDateFormat sdf = new SimpleDateFormat (""ddMMyy"");            filename =  sdf.format(date);           // mPath = Environment.getExternalStorageDirectory() + ""/Wallpaper/""+filename+""-""+  String.format(""%05d"", imageCount)+"".jpg"";            imageCount++;            mPath = Environment.getExternalStorageDirectory() + File.separator +  ""make_machine_example.jpg"";            File file = new File( mPath );            Uri outputFileUri = Uri.fromFile( file );             Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );                 startActivityForResult(intent, 0 );    }    private void saveOnMedia(Bitmap bm) {  // TODO Auto-generated method stub     ContentValues values = new ContentValues(3);     values.put(Media.DISPLAY_NAME, ""rj"" + filename + "".PNG"");     values.put(Media.MIME_TYPE, ""image/png"");     Uri uri = getContentResolver().insert(     Media.EXTERNAL_CONTENT_URI, values);     OutputStream outStream = null;  try {   outStream = getContentResolver().openOutputStream(uri);  } catch (FileNotFoundException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }     bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);     try {   outStream.close();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } }</code></pre>","554982","","473070","","2010-12-27 14:18:36","2010-12-27 14:18:36","Android Camera Image Store","<android><sd-card><android-camera>","0","0","","",""
"4539321","1","4539332","","2010-12-27 14:26:24","2","405","<pre><code>protected void showCurrentLocation(){ Location lc = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if(lc != null){  String msg = String.format(""Current Location \n Logitude: %1$s \n Latitude: %2$s"",lc.getLongitude(),lc.getLatitude());  Toast.makeText(Test1.this,msg,3000).show(); } Toast.makeText(Test1.this,""location is null"",3000).show();} </code></pre><p>from code above, when I run on android phone. It can run but its only show location is null.I don't know why its can't get location from getLastKnownLocation()</p><p><a href=""http://www.javacodegeeks.com/2010/09/android-location-based-services.html"" rel=""nofollow"">http://www.javacodegeeks.com/2010/09/android-location-based-services.html</a></p><p>This is a source code which I got to tried. Please help me. Thanks ka :))</p><p>Ps. I already have I already have ACCESS_FINE_LOCATION,ACCESS_MOCK_LOCATION, and ACCESS_COARSE_LOCATION   </p>","538788","","538788","","2010-12-27 14:34:31","2010-12-27 18:23:01","I cannot run application on android, but emulator can","<android><android-emulator><gps>","2","0","","",""
"4539329","1","4539402","","2010-12-27 14:27:48","7","1616","<p>I'm wanting to use <code>android:configChanges=""orientation|keyboardHidden""</code> for a few of my activities so that my onCreate doesn't get called again, but I thought I'd see if anyone had a list of pros and cons first because <a href=""http://developer.android.com/guide/topics/manifest/activity-element.html#config"">this link</a> says that it should only be used as a last resort.</p>","375490","","473070","","2010-12-27 14:31:05","2010-12-27 16:08:05","What are the pros and cons of using configChanges=""orientation"" for android devices?","<android><configuration><orientation>","2","0","","",""
"4539391","1","4539961","","2010-12-27 14:39:58","4","504","<p>Is there a way to describe tabs of a TabHost in XML instead of creating them with Java code?</p>","6533","","","","","2010-12-27 16:06:38","How to describe TabSpec in XML?","<android>","1","0","0","",""
"4539426","1","","","2010-12-27 14:45:55","6","2727","<p>I'd like to use myBatis (iBatis 3) in an Android application.  Has anyone tried such a thing or know of any resources for this?</p>","357799","","","","","2013-09-19 04:50:53","Android application and myBatis","<android><sqlite><ibatis><mybatis>","3","0","1","",""
"4539451","1","","","2010-12-27 14:51:17","0","2655","<p>I'm writing an application for android and I would like to insert an options menu, that would have only one function and that is to quit an application.</p><p>My options_menu.xml looks like this (I created a new folder under res called menu - just like the instructions said):</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/quit""          android:icon=""@drawable/ic_quit""          android:title=""@string/quit"" /&gt;          &lt;/menu&gt;</code></pre><p>Than I added the following code to my java class file:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.options_menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    // Handle item selection    switch (item.getItemId()) {    case R.id.quit:        finish();        return true;    default:        return super.onOptionsItemSelected(item);    }}</code></pre><p>I also defined the @string/quit in values - strings.xml file, but it still says that there is an error:</p><pre><code>C:\Users\Domen\workspace\Lovne Dobe1.1\res\menu\options_menu.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/quit')</code></pre><p>So if anybody can help I would be very grateful.</p>","555058","","390177","","2012-01-31 16:53:12","2012-01-31 16:53:12","creating an options menu with quit application function","<java><android>","2","2","","",""
"4539475","1","","","2010-12-27 14:55:35","0","164","<p>developers. Is anybody know, what functions can I use to display an ImageView in a correct place on it`s parent Layout?</p>","521047","","","","","2010-12-27 23:54:30","Displaying ImageView in a definite place on layout","<android>","2","0","","",""
"4539490","1","","","2010-12-27 14:57:44","1","6221","<p>is it possible to convert Sms table date value  e.g. 1293457709636 (miliseconds) to meaningful Date time value.</p>","555066","","","","","2010-12-27 15:19:20","Android - get date time from SMS timestamp in miliseconds","<android><sms><timestamp><android-contentprovider>","2","0","","",""
"4539630","1","4539841","","2010-12-27 15:19:10","15","5224","<p>Is there a built in way to check to see if a resource exists or am I left doing something like the following:</p><pre><code>boolean result;try {    int test = mContext.getResources().getIdentifier(""my_resource_name"", ""drawable"", mContext.getPackageName());    if (test != 0)         result = true;}finally {    result = false;}</code></pre><p>Also, do I even need the <code>try-finally</code> block?</p>","432209","","1618135","","2013-07-30 12:21:32","2013-09-25 10:33:00","How do I check to see if a resource exists in Android","<java><android>","3","3","3","",""
"4539683","1","4540034","","2010-12-27 15:26:33","0","450","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3442462/how-to-capture-an-image-and-store-it-with-the-native-android-camera"">How to capture an image and store it with the native Android Camera</a>  </p></blockquote><p>How can i store captured image from camera into DCIM/Camera folder...By default</p>","555084","","","","","2010-12-27 16:16:56","Android Image Store","<android>","1","1","","2012-04-17 12:12:16",""
"4539722","1","4539903","","2010-12-27 15:31:03","0","549","<p>I'm developing a multiplayer game that is going to work by transmitting data over XMPP chats (speed is not an issue, it's a turn-based game). Right now I'm planning on using the asmack library.</p><p>Is there a way to use the gtalk credentials from android without explicitly asking the user with a login/password dialog? Any permissions I should set in the android manifest file?</p><p>Thanks</p><p>Best regards,Nicola</p>","95158","","","","","2010-12-27 15:57:33","using google/gtalk account from android","<android><xmpp><google-talk>","1","0","0","",""
"4539778","1","4540731","","2010-12-27 15:37:25","2","3952","<p>I want my app to open a plain text file with any of the file editors installed on my terminal, but I keep getting this exception:</p><pre><code>ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.EDIT dat=file:///sdcard/folder/file.txt } </code></pre><p>First I thought that I have no File editor installed, but if I use ASTRO file manager, I can get to open the file both with ""File Editor"" and ""QuickOffice"", so I think the problem is that I'm not using the right code...</p><p>Here is the code</p><pre><code>Intent intent = new Intent(Intent.ACTION_EDIT); Uri uri = Uri.parse(""file:///sdcard/folder/file.txt""); intent.setDataAndType(uri, ""plain/text""); startActivity(intent);</code></pre><p>What is more surprising is that if I use the path of a file that doesn't exist, it keeps raising the same exception... </p><p>Thanks</p>","483362","","","","","2010-12-27 18:07:06","Intent for editing plain text file with the installed file editor (if any)","<android><android-intent><plaintext>","1","2","","",""
"4539899","1","5188318","","2010-12-27 15:56:56","1","819","<p>I'm trying to use NPR approach of streaming audio using the StreamProxy and PlaybackService classThe stream is an audio/aac file.</p><p><a href=""http://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/PlaybackService.java"" rel=""nofollow"">http://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/PlaybackService.java</a></p><p>(The streamProxy.Java is in the same path as above, could not include two links in the post)</p><p>But am getting an error. The log I'm getting is</p><pre><code>12-27 20:37:29.170 D/org.npr.android.news.PlaybackService(21817): downloading http://provisioning.streamtheworld.com/pls/KVKIFMAAC.pls12-27 20:37:29.647 D/LocationMasfClient( 1089): getNetworkLocation(): Location not found in cache, making network request12-27 20:37:30.436 D/LocationMasfClient( 1089): getNetworkLocation(): Number of prefetched entries 512-27 20:37:30.499 D/LocationMasfClient( 1089): getNetworkLocation(): Returning network location with accuracy 70.012-27 20:37:30.514 D/libgps  ( 1089): GpsInterface_inject_location( 12.969496, 77.632734, 70.000 )12-27 20:37:30.866 I/BATTD   ( 1016): set_charge_current=012-27 20:37:30.866 I/BATTD   ( 1016): set_charge_voltage=380012-27 20:37:30.881 D/org.npr.android.news.PlaybackService(21817): listening to http://2173.live.streamtheworld.com:80/KVKIFMAACCMP3 stream=true12-27 20:37:30.889 D/org.npr.android.news.PlaybackService(21817): SDK Version 812-27 20:37:30.889 D/org.npr.android.news.PlaybackService(21817): reset: http://2173.live.streamtheworld.com:80/KVKIFMAACCMP312-27 20:37:30.913 I/StagefrightPlayer( 1010): setDataSource('http://2173.live.streamtheworld.com:80/KVKIFMAACCMP3')12-27 20:37:30.913 D/org.npr.android.news.PlaybackService(21817): Preparing: http://2173.live.streamtheworld.com:80/KVKIFMAACCMP312-27 20:37:31.100 D/org.npr.android.news.PlaybackService(21817): Waiting for prepare12-27 20:37:31.108 D/org.npr.android.news.PlaybackService(21817): downloading http://provisioning.streamtheworld.com/pls/KVKIFMAAC.pls12-27 20:37:31.725 D/org.npr.android.news.PlaybackService(21817): listening to http://2173.live.streamtheworld.com:80/KVKIFMAACCMP3 stream=true12-27 20:37:31.725 D/org.npr.android.news.PlaybackService(21817): SDK Version 812-27 20:37:31.725 D/org.npr.android.news.PlaybackService(21817): reset: http://2173.live.streamtheworld.com:80/KVKIFMAACCMP312-27 20:37:31.725 I/AwesomePlayer( 1010): interrupting the connection process12-27 20:37:31.834 I/AwesomePlayer( 1010): mConnectingDataSource-&gt;connect() returned -214748364812-27 20:37:31.834 E/MediaPlayer(21817): error (1, -2147483648)</code></pre><p>Can someone tell me where I'm going wrong here.</p><p>Regards,Hari</p>","320293","","","","","2011-03-04 00:26:32","MediaPlayer error when using NPR StreamProxy implementation","<android><audio><stream><npr>","1","0","1","",""
"4539946","1","","","2010-12-27 16:03:37","5","4825","<p>I am using this codes to set my own group indicator icon and set it to right side of the list</p><pre><code>ExpandableListView list = (ExpandableListView) findViewById(R.id.SCHEDULE);Drawable icon = StationInfo2.this.getResources().getDrawable(R.drawable.expander_group);list.setGroupIndicator(icon);list.setIndicatorBounds(list.getWidth() - 80, list.getWidth() - 40);</code></pre><p>Its works to show my own icon but the icon shows in wrong size.</p><p>Becouse i am new here i can not post links or image to show how its looks like but i hope someone has a good idea how i can do?</p>","553770","","","","","2012-08-09 17:47:44","Android: ExpandableListView drawable group indicator being big when i using my own icon","<android><expandablelistview>","1","3","1","",""
"4539968","1","4540303","","2010-12-27 16:07:13","8","14390","<p>I have a listview defined by the following xml. I need to <strong>toggle the image</strong> in the list during runtime when the user clicks on any row. How can I achieve this? Any help is highly appreciated. Thanks</p><pre><code>//list_item.xml&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;ImageViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/play"" android:id=""@+id/img""/&gt; &lt;TextView android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:gravity=""center_vertical""android:id=""@+id/txt""/&gt;&lt;/LinearLayout&gt;</code></pre>","527053","","","","","2014-02-14 13:54:38","Android: Dynamically change Image in Listview","<android><listview>","5","0","5","",""
"4540337","1","4574781","","2010-12-27 17:02:06","1","532","<p>In one of my projects i want to collect something like a click heatmap.Is there any way to do this in Android?</p><p>I was thinking about adding a transparent layout above the original layout and ""hijack"" clicks there and then pass it to the underlying layout. But I can't figure it out.</p><p>So, any ideas on how to do this?</p>","373138","","1288","","2012-08-04 17:26:58","2012-08-04 17:26:58","Android - Hijack clicks","<android><click><heatmap><hijack>","2","4","1","",""
"4540396","1","4917850","","2010-12-27 17:11:10","4","5540","<p><br/> I'm having problems with seeking video. My application should resume video from place where it was stopped last time. So I do this:<pre><code>videoView.seekTo(bookmark);videoView.start();</code></pre> However when it plays I hear sounds form beginning of video for about 1-2 sec. And only after that video seeks to the right position. This behavior is reproducible on HTC Nexus One, HTC G1, HTC evo. But on Samsung galaxy tab all plays normally. <br/><br/>Anybody had similar problems? Is this bug HTC-specific? Thanks in advance.</p>","555158","","555158","","2010-12-29 09:11:20","2011-04-22 01:27:45","seekTo in VideoView","<android><videoview><seek>","2","0","","",""
"4540496","1","","","2010-12-27 17:26:43","0","484","<p>Hey,I want to update the date to a year before 1970.the updateDate function wants a date since 1970.</p><p>the widget itself allow you to select 1900-2100 (from what i read you can change it also using an xml to describe the control)</p><p>any solutions?if not, what widget do you use to select date (e.g. birth date...)</p><p>Thanks.</p>","555188","","","","","2011-02-26 11:43:51","how to update the date in android DatePicker widget","<android><datepicker><widget><updatedate>","1","0","","",""
"4540589","1","4540709","","2010-12-27 17:41:08","2","763","<p>I am downloading files and saving them to SDCard and want to capture a event when SDCard is full. Right now it throws IOException if no memory is left on SDCard.</p><p>How to distinguish the memory full exception then the other IOExceptions?</p><p>Cheers,Prateek</p>","481314","","481314","","2010-12-27 18:00:52","2013-09-10 10:06:07","IOException is thrown when SDCard is full","<android><android-sdcard>","3","0","1","",""
"4540590","1","4540738","","2010-12-27 17:41:10","0","2603","<p>I have a listview with a custom adapter in which I have 3 textviews, two are next to each other and one is below the others.  The problem I am running into though, is when the first textview extends, it pushes the other textview off the screen.  I have not been able to successfully get this to work, here is an example of whats happening:</p><p><img src=""http://i.stack.imgur.com/StLlP.png"" alt=""alt text""></p><p>As you can see when the first textview gets too long, it then pushes the other text off the screen.  I would like it so it wraps but the date textview is also showing.  It should also be functional in horizontal view.</p><p>Here's the listview adapter code:</p><pre><code>&lt;RelativeLayout android:id=""@+id/vw1"" android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:orientation=""horizontal""android:descendantFocusability=""blocksDescendants"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView android:id=""@+id/liName"" android:textSize=""17sp""    android:textColor=""#333"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:gravity=""left""    android:layout_gravity=""left"" /&gt;&lt;TextView android:id=""@+id/liDate"" android:textSize=""12sp""    android:textColor=""#666"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:gravity=""right""    android:layout_gravity=""right"" android:width=""60sp"" android:layout_toRightOf=""@+id/liName"" /&gt;&lt;TextView android:id=""@+id/liNum"" android:textSize=""12sp""    android:textColor=""#666"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:layout_below=""@+id/liName"" /&gt;</code></pre><p></p>","408079","","","","","2012-01-13 21:18:10","How to get Side by Side textviews with one that wraps","<android><textview><wrap><textwrapping>","2","0","","",""
"4540595","1","4540617","","2010-12-27 17:42:03","3","873","<p>I have the following application flow in my android app,</p><p>Login->Home->screen1->screen2->screen3->screen4-> logout</p><p>In the screen4 I have a log out button, which allows the user to logout from the application and re-login. When I re-login to the app, the previous data is still shown. Is there a way to start the application fresh when the user logs out from the app?</p><p>NOTE: all the above activities launch mode set to ""single task"",</p><p>regards,Sam.</p>","322111","","535664","","2011-04-22 19:16:49","2011-04-22 19:16:49","how to clear the the activity stack in android","<android>","4","0","1","",""
"4540718","1","","","2010-12-27 18:05:33","1","641","<p>I am storing the captured image from camera into the DCIM/Camera folder.. I wanna to change the name of the image stored.. Here is my code...</p><p>ContentValues values = new ContentValues();</p><pre><code>        Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI,values);        Log.v(""uri"", uri+"""");        startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT,uri), 0);</code></pre>","555221","","","","","2010-12-27 18:05:33","Android Image name change","<android>","0","0","","",""
"4540754","1","","","2010-12-27 18:10:33","104","124513","<p>Can anyone explain or suggest a tutorial to create a listView in android? </p><p>Here are my requirements:</p><ul><li>I should be able to dynamically add new elements by pressing a button.<br /></li><li>Should be simple enough to understand (possibly without any performance improvements or convertview, for instance)</li></ul><p>I know there are quite a few questions on this topic, posted here on StackOverflow, but couldn't find any that would answer my question. Thanks!</p>","555217","","495184","","2013-05-27 16:42:27","2014-01-24 02:43:24","Add dynamically elements to a listView Android","<android><listview><dynamic>","1","0","52","",""
"4540815","1","4540853","","2010-12-27 18:20:16","0","112","<p>I'm just starting into Java/Android apps... I've got a few sample things up and running... but I want to organize my code in a proper manner.  Are all .java files loaded when the app is opened, or do I need to tell it to load other .java files within my code...</p>","197606","","","","","2010-12-27 18:28:55","Do all .java files load when the app is opened?","<java><android>","2","0","1","",""
"4540878","1","","","2010-12-27 18:28:42","0","1001","<p>Hey I am trying to find a way to create a golf cart map for android devices using the Google API's and Google Maps. I have an API key from google and did the basic tutorial already. I create a custom Google map that I want to implement in the application (all i really had to do was turn the bicycle map on). So what I am trying to do is program my custom map into an android application so people can use it as a GPS while driving on Golf Carts. I would greatly appreciate any advice to get me started because I haven't been able to find out how to do this in the Google API reference.</p>","555241","","","","","2010-12-27 23:37:03","Adding a custom Google map in Android development","<android><google-maps>","2","0","","",""
"4540883","1","4541062","","2010-12-27 18:29:00","5","3696","<p>Could you please advice a Server against which I can test my Class which sends and receives a response to httpPost() method?</p>","397991","","","","","2010-12-27 19:06:53","Where can I test my httpPost method?","<java><android><httpclient>","1","0","1","",""
"4540906","1","4540958","","2010-12-27 18:32:43","4","6783","<p>I have two questions</p><p>1) Does anyone know, how to apply styles or formatting to alert dialog. I currently use <code>Builder builder = new AlertDialog.Builder(this);</code> And use <code>setMessage()</code> method to set the content. </p><p>2) Also I would like to know how to change the color of the links created by linkify. I don't want the default blue color.</p>","527053","","527053","","2010-12-27 18:59:27","2012-11-12 12:27:53","Android: Format Font in Alert Dialog","<android><dialog><alertdialog><linkify>","2","0","2","",""
"4540972","1","","","2010-12-27 18:42:15","8","8551","<p>I would like to create an Android Webview that connects to a website via a secured <code>HTTPS</code> connection with the use of credentials.</p><p>First difficulty was to accept the certificate (private), it was solved with <a href=""http://damianflannery.wordpress.com/2010/09/28/android-webview-with-https-loadurl-shows-blankempty-page/"" rel=""nofollow"">this</a> very useful post.</p><p>Second difficulty is to use credentials, I found <a href=""http://stackoverflow.com/questions/2585055/using-webview-sethttpauthusernamepassword"">this</a> post.</p><p>(first answer from dparnas) which seems to deal pretty well with it, but it talks about <code>HTTP</code> connection and not <code>HTTPS</code>. I ve tried it, but it doesnt work, I just reach the sign-in form page without any error message, just the normal blank form.</p><p>Here is my code:</p><pre><code>import android.app.Activity;import android.net.http.SslError;import android.os.Bundle;import android.webkit.HttpAuthHandler;import android.webkit.SslErrorHandler;import android.webkit.WebView;import android.webkit.WebViewClient;public class ConnectorWebView extends Activity {  WebView mWebView;  String mUsrName;  String mPassC;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.connwebview);    // Getting info from Intent extras    // Get it if it s different from null    Bundle extras = getIntent().getExtras();                mUsrName = extras != null ? extras.getString(""username"") : null;    mPassC = extras != null ? extras.getString(""passcode"") : null;    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.setHttpAuthUsernamePassword(""myhost.com"", ""myrealm"", mUsrName, mPassC);    mWebView.setWebViewClient(new WebViewClient() {        @Override         public void onReceivedHttpAuthRequest  (WebView view, HttpAuthHandler handler, String host, String realm){           handler.proceed(mUsrName, mPassC);        }         public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {          handler.proceed() ;        }      });    mWebView.loadUrl(""https://myhost.com/secured_area"");  }}</code></pre>","488008","","1101070","","2012-01-14 15:58:34","2014-04-03 21:51:36","Set credentials on an Android Webview using secured HTTPS connection","<java><android><https><webview><credentials>","3","0","7","",""
"4540983","1","","","2010-12-27 18:43:09","0","257","<p>I'm new to Android and I'm not sure how to find a current GPS location using services.  How would I do this?</p>","555256","","19679","","2010-12-28 15:21:36","2012-12-08 23:39:12","How can I find a GPS location using services?","<android>","2","0","","",""
"4541111","1","4541132","","2010-12-27 19:06:36","0","1467","<p>I would like to leverage the goggle account credentials belonging to the synced user on android to send emails in the background, it is possible to achieve that ?</p><p>If not, is it possible to ask the user to send an email (with an intent) AND get the receiver's email ? maybe by calling startActivityForResult ?</p><p>Cheers,Ze</p>","361526","","","","","2011-11-29 10:12:54","How to send email from android (using the default account)?","<android><email><email-integration>","1","0","","",""
"4541137","1","6589476","","2010-12-27 19:12:12","0","3000","<p>For more than two days now, I'm trying to grab a list of all contacts, from the internal addressbook (no facebook-, gmail- or twittercontacts) with their family- and givenname.</p><p>I managed to get a list with all contacts, socialcontacts included. So I looked at the account_types and saw that on my HTC Desire all the internal addressbook-contacts were from  ""com.htc.android.pcsc"" and I was like ""Great, I just have to filter the whole list"". But then all people with non-htc android cellphones would be unable to use my app, if I would hardcode this filter.</p><p>Next idea was to let the user choose which account he wants to use, but unfortunately the ""com.htc.android.pcsc"" didn't appear in the list I got from the AccountManager?!?</p><p>So my question is:Is there any standardized way to access the internal adressbook? I'm really stuck with that and any hint is highly appreciated!</p><p><strong>/edit:</strong> Maybe i didn't make my self clear enough.I <em>can</em> grab a contactlist, via the ContactsContract API:</p><pre><code>ArrayList phoneContacts = new ArrayList();   String[] projection = new String[] {    Data.MIMETYPE,    ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,    ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME   };String selection =  Data.MIMETYPE+"" = '""+ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE+""'"";Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, projection, selection, null, null);while (cursor.moveToNext()) {phoneContacts.add(...);} cursor.close();</code></pre><p>But then I have contacts from all the different accounttypes, like com.google / com.htc.socialnetwoork.facebook, etc.</p><p>And my question is: How can I filter all these socialnetwork- and gmailcontacts out, so I have a list with contacts, which are only from my internal addressbook?</p><p><strong>/edit2:</strong> I found an example which describe the same difficulty I have:<a href=""http://forum.synthesis.ch/showthread.php?t=2057"" rel=""nofollow"">http://forum.synthesis.ch/showthread.php?t=2057</a>Synthesis AG had the same problem with their SyncML, that people complaining that they can't sync with their internal addressbook/phonebook only with gmail, facebook, etc.But they managed to seperate the internal addressbook from all these other accounttypes. So there must be a way to solve this problem, but I can't figure out how. Please help!</p>","539884","","539884","","2010-12-27 21:41:19","2011-07-05 22:15:50","Access the internal addressbook","<android><contactscontract>","3","0","","",""
"4541163","1","4541239","","2010-12-27 19:16:17","2","409","<p>I ran into this post: <a href=""http://stackoverflow.com/questions/866769/how-to-call-android-contacts-list"">How to call Android contacts list?</a></p><p>Unfortunately I'm reading that it's old and Android 2.0 changed how this works, but this post fails to link to a new method of accomplishing this.  Google also appears to either lack results, or I'm not searching for the right thing.  I'd like for a user to be able to select a contact on my app... how do I give them a prompt to select 1 user, then for a task to be executed when that user is selected.</p>","197606","","","","","2010-12-27 19:29:25","Select contact for app","<java><android><contacts>","1","0","","",""
"4541283","1","","","2010-12-27 19:38:56","0","1027","<p>I wanted to create a list of all songs which are present in android phone so that user can select one song from the list. How to do this???</p>","478535","","","","","2010-12-27 20:46:47","Display list of all songs in android music folder in a list","<android>","1","0","","",""
"4541287","1","","","2010-12-27 19:39:19","12","6060","<p>I'm trying to animate my child views in an expandablelistview. I would like the child view to slide down from top to bottom when expanding a group and sliding from bottom to top when collapsing a group. I've looked at several methods (animating the viewgroup or the child views) but none seem to work very well or I'm not doing it right.</p><p>I've extended a class from BaseExpandableListAdapter to create my own custom adapter. I also have custom (xml) views for the groups/childs which I inflate in the getChildView and getGroupView methods.</p><p>I would only like the current collapsed/expanded group to animate it's child. Can anyone point me in the right direction? If you need more information or code please let me know!</p><p>Regards,Ivo</p>","555302","","","","","2012-06-23 12:51:21","animating the childs of an expandablelistview when collapsing/expanding","<android><animation><expandablelistview>","3","3","4","",""
"4541365","1","4541624","","2010-12-27 19:53:19","1","285","<p>Don't you know why it is possible to invoke onClickListener only once, on second attempt I should turn on and turn off the Wifi connection on my device. After first click I can't browse web and read email - so internet connection is blocked.</p><pre><code>Code:package je.net.ua;import java.io.BufferedReader;import java.io.InputStreamReader;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.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.TextView;public class App extends Activity {    Button button;    TextView tv;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button = (Button) findViewById(R.id.Button01);        tv = (TextView) findViewById(R.id.TextView01);        Log.d(""Dev"", ""Application started"");        button.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                try {                    BufferedReader in;                    HttpClient client = new DefaultHttpClient();                    HttpPost request = new HttpPost(""http://www.snee.com/xml/crud/posttest.cgi"");                    List&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();                    postParameters.add(new BasicNameValuePair(""fname"", ""First name""));                    postParameters.add(new BasicNameValuePair(""lname"", ""Last name""));                    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) {                        Log.d(""Dev"", ""Line = "" + line);                        sb.append(line + NL);                    }                    in.close();                    tv.setText(line);                } catch (Exception ex) {                }            }        });    }}</code></pre><p>Debug:</p><pre><code>12-27 21:39:16.936: DEBUG/Dev(6568): Line = &lt;html&gt;&lt;head&gt;&lt;title&gt;posted data&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;posted data&lt;/h1&gt;&lt;p&gt;First name: ""First+name""&lt;/p&gt;&lt;p&gt;Last name: ""Last+name""&lt;/p&gt;&lt;p&gt;REQUEST_URI: ""/xml/crud/posttest.cgi""&lt;/p&gt;&lt;p&gt;QUERY_STRING: """"&lt;/p&gt;&lt;p&gt;CONTENT_LENGTH: ""32""&lt;/p&gt;&lt;p&gt;content passed via STDIN: ""fname=First+name&amp;lname=Last+name""&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;12-27 21:39:25.566: DEBUG/dalvikvm(85): GC_FOR_MALLOC freed 28784 objects / 1536696 bytes in 109ms12-27 21:39:34.106: DEBUG/dalvikvm(6072): GC_EXPLICIT freed 1097 objects / 213648 bytes in 67ms12-27 21:39:42.476: DEBUG/dalvikvm(5056): GC_EXPLICIT freed 1749 objects / 72040 bytes in 53ms12-27 21:39:47.516: DEBUG/dalvikvm(29993): GC_EXPLICIT freed 1378 objects / 67232 bytes in 91ms12-27 21:39:50.136: WARN/GTalkService(21165): [GTalkConnection.11] doConnect: caught XMPPError connecting to mtalk.google.com:5228.: (502)12-27 21:39:50.136: WARN/GTalkService(21165):   -- caused by: java.net.SocketException: The operation timed out</code></pre>","397991","","397991","","2010-12-27 21:09:31","2010-12-27 23:00:10","Why should I reboot Wifi after httpPost()","<java><android><httpclient>","1","0","0","",""
"4541426","1","4541436","","2010-12-27 20:03:24","0","185","<p>I am writing some test Android apps using Eclipse.  I created my 1st project, a simple hello app, built the apk (app1.apk), and was able to install and run that on an Android tablet.</p><p>I then created a new project in eclipse, for a 2nd app.  I exported the apk (app2.apk).  But, when I try to install this 2nd apk (app2.apk) on the tablet, it warns me that it wants to REPLACE the 1st app.</p><p>When I built the apks, I used a different key for app1 vs. app2, and the project and class names are different, so what is it that the Android installer is using that makes it think that both apks are the same app?</p><p>Thanks,Jim</p>","555303","","","","","2010-12-27 20:04:48","New to Android Dev - Problem installing SECOND App/APK","<android><sdk>","1","0","","",""
"4541531","1","6106349","","2010-12-27 20:19:06","3","1522","<p>basically, what am doing is that am running a flash file (playing music) in the background of the app using webview, and when I want to stop the music , I just load ""about:blank""</p><p>I want to keep the flash file running (music) when my app gets paused (which works fine so far) the problem is when the app resumes, pressing on pause button launches a new webview instead of changing the link in the previous one and the sound doesn't stop</p><p>the only solution I found was to kill the process and restart the app, but that's not practical, any idea of how to still be able to use the same webview when resuming the app ?</p><p>Update: guess I wasn't clear enough, I have a webview widget stated as ""gone"" , I only need the audio form the flash file I'm running in the webview so the ""play"" button loads a URL that contains the flash file (so the user only hears music, and doesn't notice that I'm using a webview), when I press the back/home button the music doesn't stop (I like it that way) but when I go back and press on play again it loads another url in a new page, you get double music</p>","546634","","546634","","2011-01-01 19:02:59","2011-05-24 06:06:13","I lose control Android's Webview when resuming the application","<android><flash><webview><onresume>","1","2","2","",""
"4541548","1","4612837","","2010-12-27 20:20:37","3","2005","<p>I have a form with lots of fields and when I press the ""submit"" button, I'd like the scrollview to jump to the position where the unanswered field is located. Is there a method other than scrollto(x,y) to do this or such coordinates must always be mapped to the form's elements somehow ( something like (form element).getCoordinates() )?</p><p>Thanks</p>","253944","","253944","","2010-12-27 20:41:45","2011-01-06 07:43:58","Scroll to form element","<android><forms><scroll>","2","4","0","",""
"4541625","1","4542998","","2010-12-27 20:33:39","2","1247","<p>Hi guys :)<br>I'm trying to run a simple ""Hello World"" program with a button and a textview.This is the layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/layout""              xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""match_parent""              android:layout_height=""match_parent""              android:orientation=""vertical"" &gt;    &lt;TextView android:id=""@+id/text""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:text=""text""              android:layout_gravity=""center_horizontal"" /&gt;    &lt;Button android:id=""@+id/button""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""button""            android:layout_gravity=""center_horizontal"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is that it doesn't look good on the simulator with Samsung Galaxy Tab's resolution. The view doesn't take all available space as I wish but only a portion. Is ""match_parent"" correct in layout's width and height?</p>","555336","","555336","","2010-12-28 01:04:55","2012-01-24 14:38:32","Android ""Hello World"" Layout Problem on Galaxy Tab Screen","<android><layout><netbeans><tabs>","3","5","1","",""
"4541695","1","5195986","","2010-12-27 20:43:23","0","445","<p>What are the best practices of changing widget layout in new (updated) version of application? How to deal with existing widgets, when new version provides updated, better ones?</p>","7162","","508666","","2012-01-29 13:09:37","2012-01-29 13:09:37","Android: change layout/content of widget in new app version","<android><layout><widget>","1","0","","",""
"4541858","1","","","2010-12-27 21:09:16","3","1735","<p>When importing the Wiktionary project into Eclipse, I immediately get error messages related to my <code>strings.xml</code> file. The same errors occur whether I download the project through subversion or from the SDK sample files.</p><p>Console errors:</p><pre><code>[2010-12-27 15:25:33 - Wiktionary] W/ResourceType( 2752): Bad XML block: header size 62 or total size 0 is larger than data size 0[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\values\strings.xml:22: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted=""false"" attribute?[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\values\strings.xml:22: error: Unexpected end tag string[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\layout\widget_message.xml:24: error: Error: No resource found that matches the given name (at 'text' with value '@string/widget_loading').[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\xml\searchable.xml:17: error: Error: No resource found that matches the given name (at 'label' with value '@string/search_label').[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\xml\searchable.xml:17: error: Error: No resource found that matches the given name (at 'hint' with value '@string/search_hint').[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\menu\lookup.xml:19: error: Error: No resource found that matches the given name (at 'title' with value '@string/lookup_search').[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\menu\lookup.xml:24: error: Error: No resource found that matches the given name (at 'title' with value '@string/lookup_random').[2010-12-27 15:25:33 - Wiktionary] C:\Trunk\Wiktionary\res\menu\lookup.xml:29: error: Error: No resource found that matches the given name (at 'title' with value '@string/lookup_about').</code></pre>","555361","","493749","","2011-11-30 17:41:58","2011-11-30 17:41:58","Build Errors When Importing Wiktionary","<android><wiktionary>","3","0","1","",""
"4541934","1","4545689","","2010-12-27 21:23:53","0","473","<p>I have this layout code which I thought was correct:</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=""64dip""    android:background=""@drawable/title_background""&gt;    &lt;ImageView        android:layout_width=""48dip""        android:layout_height=""48dip""        android:layout_margin=""8dip""        android:src=""@drawable/title_icon"" /&gt;    &lt;ImageView        android:layout_width=""128dip""        android:layout_height=""32dip""        android:layout_margin=""16dip""        android:src=""@drawable/title_text"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The LinearLayout has a height of 64dip and the first ImageView has a height of 48dip.  From the math I learned a long time ago a margin of 8dip would match perfectly.  But it doesn't as my ImageViews are clipped at the bottom.  This is for a custom titlebar and I have set the android:windowTitleSize to match 64dip in the theme.</p><p>Is there some sort of hidden padding on the titlebar?  And if so, what's it size?</p>","324943","","324943","","2010-12-27 23:16:09","2010-12-28 15:15:08","How to set correct margins","<android><layout><coding-style><custom-titlebar>","2","2","0","",""
"4541988","1","4542004","","2010-12-27 21:33:20","5","586","<p>I realize this issue is somewhat trivial, but I'm interested in knowing the ""correct"" answer. </p><p>I'm trying to extend <code>android.os.AsyncTask<code>&lt;</code>Params, Progress, Result<code>&gt;</code></code>,<br>but my task doesn't require any parameters.</p><p>Given that I have to overload <code>protected Result doInBackground(Params... params)</code>,<br>what is the ""best"" way to pass in no parameters?</p><p>Currently, I'm using <code>Object</code> as the <code>Params</code> type and starting the task with:<br><code>new MyAsyncTask().execute( (Object)null );</code><br>This is totally functional, but I'm new to Java and don't know if this is a good way of accomplishing what I'm trying to do.</p><p>Obviously I can't put something like <code>void</code> or <code>null</code> in for the <code>Params</code> field, but if I use a wildcard I'm unsure of what to do about the arguments to <code>doInBackground(Params... params)</code>.</p><p>Any suggestions?</p>","555375","","","","","2010-12-27 21:42:36","Empty Java generics","<java><android><generics><android-asynctask><varargs>","4","1","1","",""
"4542070","1","","","2010-12-27 21:48:50","0","714","<p>I have a C function, I simply returns an integer, as follows:</p><pre><code> JNIEXPORT jint JNICALL Java_org_project_ScreenPosition(JNIEnv* env, jobject thiz){   int i=1;   return i; } </code></pre><p>I call this function in the way of an Activity onCreateContextMenu Android, as follows:</p><pre><code>public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){ menu.setHeaderTitle(""TryMenu""); int a=ScreenPosition(); return;}</code></pre><p>But all crash</p>","555408","","142162","","2010-12-27 21:50:53","2013-08-28 11:53:21","JNI on Android, how to pass int from c to java","<java><android><c><jni>","1","2","","",""
"4542172","1","4566923","","2010-12-27 22:10:20","0","2724","<p>I'm trying to setup a servlet so that users on Android handsets/tablets (using the default browser) can fill out a form and post a few parameters to a servlet, then the servlet applies some logic to pick a pre-existing epub file to stream back in response.  Seems simple enough, but it's giving me all kinds of fits.</p><p>The setup: the Android user visits my site and submits the form, the servlet in Weblogic 10.3 picks my one test epub file to stream back in response, sets a Content-Type of <code>application/epub+zip</code>, sets a Content-Disposition of <code>attachment; filename=TestPartsManual.epub</code>, streams the bytes back to the device.  </p><p>It works just fine in Chrome, where I'm doing all primary development because of theoretical WebKit sameness and its cool developer tools.  </p><p>But when I try things on my Android handset (<em>Tmobile Vibrant Galaxy S</em>) using the default browser (<em>User-Agent: Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us; SGH-T959 Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17</em>) with Aldiko installed (and working), it always fails, no contents in the response, Weblogic reporting a socket write error.  So I turned on Wireshark and saw some odd things going on:  </p><ol><li>As soon as the form is POSTed to '/demoapp/partsmanual', the handset promptly closes the connection.  Weblogic reports the socket write error.</li><li>The browser screen flips over to the download list and says it is trying to download 'partsmanual.bin'</li><li>The handset sends in a new request to GET '/demoapp/partsmanual', but without any of the form parameters the servlet doesn't know what file to send back, and nothing gets sent back.</li></ol><p>So, <strong>any idea why it suddenly doesn't like the form POST and unilaterally decides a parameterless GET to the same URI should suffice???</strong></p><p>So I simplify things for testing and just provide a link to TestPartsManual.epub, and setup a mime-mapping in web.xml giving the <code>epub</code> extension a mime-type of <code>application/epub+zip</code>.  I click on the link, verify via Wireshark the Content-Type is being sent, and things are <em>looking</em> ok:</p><ol><li>The browser screen flips over to the download list, it says it's downloading TestPartsManual.epub.  This is good.<li>The download completes, says it downloaded 216k, Wireshark concurs, and it must have liked the Content-Type because the Aldiko icon is to the left.  This is also good.<li>But then when you tap it, it pops up a notice saying 'Your book will be downloaded'.  Huh?  My book already is downloaded, right?<li>The download status in the status bar then immediately reports the download has failed.  It never sent in another GET to the server.</ol><p>So, <strong>any idea why it disregards what's already been downloaded, then reports a download failure without having retried???</strong>  The epub file itself, btw, has been validated, copied to my sd card, imported into Aldiko, and it reads it just fine, so I'm not suspicious of the file itself.</p><blockquote>**Update** I believe the issue I'm seeing with simply clicking on an epub link can be chalked up to whatever finicky Android epub reader(s) you have installed.  Though Google Books 1.0.16, for example, shows epubs, it wants nothing to do with anything you download other than through their service.  Aldiko 1.2.14 registers its intent handle the epub mime-type, but then blows up on anything launched from the browser downloads.  FBReaderJ seems to have registered its intent to handle links ending in .epub, and it does handle the download and showing them (yay FBReaderJ!), but I can't tell yet if it would handle a form POST solely by mime-type (my original requirement), as I'm growing more convinced my first question above is a browser problem.  I'm looking at you, Content-Disposition, even with <a href=""http://code.google.com/p/android/issues/detail?id=11422"" rel=""nofollow"">quoted filenames</a>...</blockquote><p>Lastly, (I admit, this is just a tangent) I turn on debugging in Eclipse hooked up to my Weblogic VM to intercept the form post.  Maybe I can see something stepping through it.  After about 5 seconds or so, it's like the handset browser gets impatient and <em>resubmits the form!</em>  Another request comes in to the servlet, and it's picked up by another weblogic thread.  What the heck kind of behaviour is that???  Makes me glad I'm not writing a stock trading app....</p>","545195","","545195","","2010-12-29 21:10:11","2010-12-30 22:57:19","epub download failure on Android/WebKit browser, and general browser weirdness","<android><webkit><epub>","1","2","","",""
"4542210","1","4542539","","2010-12-27 22:16:18","2","1868","<p>Normaly this behavior isn't dramatic but on a Samsung Galaxy S the default AlertDialog background is blue and a normal formatted link (blue) disappears. Unfortunately the below code does not change the color of the link.</p><p>Has anyone a idea?</p><pre><code>public void showClickableDialog(String title, String msg) {    final SpannableString s = new SpannableString(msg);    Linkify.addLinks(s, Linkify.ALL);    final AlertDialog d = new AlertDialog.Builder(mContext)            .setPositiveButton(android.R.string.ok, null).setIcon(                    R.drawable.logo).setTitle(title).setMessage(s).create();    d.show();    // Make the textview clickable. Must be called after show()    TextView textView = ((TextView) d.findViewById(android.R.id.message));    // Next Line unfortunately does nothing    textView.setTextColor(Color.MAGENTA);    textView.setBackgroundColor(Color.BLACK);    textView.setMovementMethod(LinkMovementMethod.getInstance());}</code></pre>","255864","","","","","2010-12-27 23:17:12","Change color of Hyperlink in AlertDialog","<android>","1","0","2","",""
"4542288","1","","","2010-12-27 22:31:07","0","404","<p>I am learning android and I figured I'd start with a basic calculator app that takes 2 input, and calculate the multiplication of them.</p><p>I have two activity defined. The first activity is to take the 2 inputs, and a button that directs it to the 2nd activity.</p><p>When it is up on the simulator, the first activity pops out fine, but once the button is clicked, the ""process stopped unexpectedly"" error pops up.</p><p>I've check the function that implements OnClickListener, and made sure that it is pointing to the right activity</p><p>in Activity03.java (input page)</p><p>calculateButton.setOnClickListener(new CalculatorListener() );</p><p>...</p><p>class CalculatorListener implements OnClickListener{public void onClick(View v){.....Intent intent = new Intent();....intent.setClass(Activity03.this, ResultActivity.class);}}</p><p>In ResultActivity class, I also made sure that I define the layout to a new layout ( a new result.xml )</p><p>setContentView(R.layout.result);</p><p>I also defined the new activity (ResultActivity) inside the AndroidManifest file.....</p><p><code>&lt;activity android:name="".ResultActivity"" android:label=""@string/other""/&gt;&lt;/application&gt;</code>...</p><p>Can you please point out any other possible errors that causes the issue ?</p><p>I can post the code for the 2nd activity (ResultActivity.java), but I just want to get some input on difference cases it might crashed, and I dont want to turn this into a big wall of text code :)</p>","555437","","","","","2010-12-27 22:31:07","Help with basic multiplication calculator","<android>","0","4","","",""
"4542318","1","4543188","","2010-12-27 22:35:34","4","18989","<p>I am tring to record the wake time and  sleep time from a dialog picker to a text file like this, but the call to the method commitToFile2 doesn't append the text file ""savedData.txt.""</p><p>I know this code is very very dirty.  I'm new to Java so any other suggestions would be greatly appreciated.</p><pre><code>package com.buttinyourface;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.FileWriter;import java.io.IOException;import java.io.InputStream;import java.io.OutputStreamWriter;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.app.TimePickerDialog;import android.content.Context;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.TimePicker;import android.widget.AdapterView.OnItemClickListener;public class SettingsActivity extends Activity {    public int wakeHour;    public int wakeMinute;    public int sleepHour;    public int sleepMinute;    public String sleepHourText = ""No Data"";    public String sleepMinuteText = ""No Data"";    public String outputTime = ""No Data"";    public String wakeHourText = ""No Data"";    private ListView lv;    Dialog newDialogBox;    Context appContext;    protected Context context;    static final private int WAKE_TIME = 0;    static final private int SLEEP_TIME = 1;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.settings);        final String[] settingsList = getResources().getStringArray(                R.array.settingsStringArray);        lv = (ListView) findViewById(R.id.list);        TextView wakeHourTextView = (TextView) findViewById(R.id.TextView01);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                    int position, long id) {                int settingsPosition = position;                if (settingsPosition == 0) {                    showDialog(WAKE_TIME);                    wakeHourText = Integer.toString(wakeHour);                }                if (settingsPosition == 1) {                    showDialog(SLEEP_TIME);                }            }        });        lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, settingsList));        wakeHourTextView.setText(outputTime);    }    public void onPrepareDialog(int id, Dialog dialog) {        switch (id) {        case WAKE_TIME:            break;        case SLEEP_TIME:            break;        }    }    @Override    public Dialog onCreateDialog(int id) {        switch (id) {        case WAKE_TIME:            return new TimePickerDialog(this, WakeTimeSetListener, wakeHour,                    wakeMinute, false);        case SLEEP_TIME:            return new TimePickerDialog(this, SleepTimeSetListener, sleepHour,                    sleepMinute, false);        }        return null;    }    private TimePickerDialog.OnTimeSetListener WakeTimeSetListener =                          new TimePickerDialog.OnTimeSetListener() {        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {            wakeHour = hourOfDay;            wakeMinute = minute;            String wakeHourText = Integer.toString(hourOfDay);            String wakeMinuteText = Integer.toString(minute);            String preftime = hourOfDay + "":"" + minute;            SimpleDateFormat df = new SimpleDateFormat(""HH:mm"");            SimpleDateFormat dfOut = new SimpleDateFormat(""hh:mma"");            Date date = null;            try {                date = df.parse(preftime);            } catch (ParseException e1) {                // TODO Auto-generated catch block                e1.printStackTrace();            }            String outputWakeTime = dfOut.format(date);            try {                commitToFile(wakeHourText, wakeMinuteText, outputWakeTime);            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    };    private TimePickerDialog.OnTimeSetListener SleepTimeSetListener =                          new TimePickerDialog.OnTimeSetListener() {        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {            sleepHour = hourOfDay;            sleepMinute = minute;            String sleepHourText = Integer.toString(hourOfDay);            String sleepMinuteText = Integer.toString(minute);            String preftime = hourOfDay + "":"" + minute;            SimpleDateFormat df = new SimpleDateFormat(""HH:mm"");            SimpleDateFormat dfOut = new SimpleDateFormat(""hh:mma"");            Date date = null;            try {                date = df.parse(preftime);            } catch (ParseException e1) {                // TODO Auto-generated catch block                e1.printStackTrace();            }            String sleepOutputTime = dfOut.format(date);            try {                commitToFile2(sleepHourText, sleepMinuteText, sleepOutputTime);            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    };    private void commitToFile(String wakeHourText, String wakeMinuteText,            String outputWakeTime) throws IOException {        final String entryString = new String(""wakeHour="" + wakeHourText                + "";wakeMinute="" + wakeMinuteText + "";wakeTime=""                + outputWakeTime + "";"");        FileOutputStream fOut = openFileOutput(""savedData.txt"",                MODE_WORLD_READABLE);        OutputStreamWriter osw = new OutputStreamWriter(fOut);        osw.write(entryString);        osw.flush();        osw.close();    }    private void commitToFile2(String sleepHourText, String sleepMinuteText,            String sleepOutputTime) throws IOException {        final String entryString = new String(""sleepHour="" + sleepHourText                + "";sleepMinute="" + sleepMinuteText + "";sleepTime=""                + sleepOutputTime + "";"");        FileOutputStream fOut = openFileOutput(""savedData.txt"",                MODE_WORLD_READABLE);        OutputStreamWriter osw = new OutputStreamWriter(fOut);        osw.write(entryString);        osw.flush();        osw.close();    }}</code></pre>","239932","","281545","","2013-04-27 13:47:18","2013-12-11 08:26:22","Android append text file","<android><file><text><append>","3","1","1","",""
"4542449","1","4598346","","2010-12-27 22:57:08","0","1601","<p>I've been attempting to work out how to add a child <code>View</code> to a child <code>List</code> in an <code>ExpandableListActivity</code>, but to no avail.</p><p>I can get the <code>ExpandableListView</code> and call <code>addFooterView()</code> on it, but that just adds the new <code>View</code> to the group list.  (The data comes from a <code>Cursor</code>).</p><p>Any suggestions gratefully received.</p><p>Cheers</p><p>James</p>","286160","","","","","2013-09-04 22:09:14","How do I add a footer View to a child List in a ExpandableListActivity?","<android><listview><expandablelistview>","2","4","","",""
"4542576","1","4542685","","2010-12-27 23:25:40","0","259","<p>Im trying to set it in the center instead of the default lower left of my screen. How could i accomplish this? I know it involves setting up the glOrth method but havent been able to figure it out. Thanks.</p>","385051","","44729","","2010-12-28 03:40:59","2010-12-28 03:40:59","setting the origin to the center with an orthographic projection","<iphone><android><opengl-es>","1","0","","",""
"4542627","1","4542650","","2010-12-27 23:33:53","7","5882","<p>Is it possible to attach multiple onClick listeners to buttons in android? Example:</p><pre><code>btn1.setOnClickListener(listener1);btn1.setOnCliclListener(listener2);</code></pre><p>And when the button is clicked onClick event of both <code>listener1</code> and <code>listener2</code> are triggered?</p><p>In normal GUI applications I know that we can attach more than one event handler for an event. Is it possible for android too or is there any restrictions?</p><p>Regards,Lalith</p>","297119","","1318946","","2014-04-17 07:19:55","2014-04-17 07:19:55","Attaching multiple listeners to views in android?","<android><events>","3","0","","",""
"4542648","1","4548477","","2010-12-27 23:38:10","1","744","<p>I can take json object like this :</p><p><code>{""title"":""this i the title"", ""description"":""this is the description""}</code></p><p>or even <code>json array : data[{""title"":""ABCD"",""name"":""Peter""}]</code></p><p>but how can i take :</p><pre><code>  {""meta"":{""total_rows"":1,""uri"":""\/profile\/info\/"",""limit"":150,""limit_type"":""user"",""requests"":2,""reset"":3063,""recorded"":""2010-12-27 22:48:49""}}</code></pre><p>for example i want to take the limit, what should i do ?</p><p>This is the class where i can take json data on internet</p><pre><code>public class Connection2 {      float rating;String name,air_day,network,air_time,description;  public Connection2(String url){        connect_show_info(url);         }    public String returnName(){        return name;    }    private void connect_show_info(String url){      // Create the httpclient      HttpClient httpclient = new DefaultHttpClient();      // Prepare a request object      HttpGet httpget = new HttpGet(url);       // Execute the request      HttpResponse response;      // return string      String returnString = null;      try {          // Open the webpage.          response = httpclient.execute(httpget);          if(response.getStatusLine().getStatusCode() == 200){              // Connection was established. Get the content.               HttpEntity entity = response.getEntity();              // If the response does not enclose an entity, there is no need              // to worry about connection release              if (entity != null) {                  // A Simple JSON Response Read                  InputStream instream = entity.getContent();                  // Load the requested page converted to a string into a JSONObject.                  JSONObject json = new JSONObject(convertStreamToString(instream));                  // Get the query value'                  String query = json.getString(""meta"");                  // Make array of the suggestions                JSONObject series = json.getJSONObject(""series"");                                    // Build the return string.               // Strings                air_day = ""monday"";                name = series.getString(""name"");                //air_day = series.getJSONObject(0).getString(""air_day"").toString() ;                //air_time = series.getJSONObject(0).getString(""air_time"").toString() ;                //network = series.getJSONObject(0).getString(""network"").toString();                //description = series.getJSONObject(0).getString(""description"").toString();                // Int                // Float                //rating = (float) series.getJSONObject(0).optDouble(""rating"");                // Cose the stream.                  instream.close();              }          }          else {              // code here for a response othet than 200.  A response 200 means the webpage was ok              // Other codes include 404 - not found, 301 - redirect etc...              // Display the response line.              returnString = ""Unable to load page - "" + response.getStatusLine();          }      }      catch (IOException  ex) {          // thrown by line 80 - getContent();          // Connection was not established          returnString = ""Connection failed; "" + ex.getMessage();      }      catch (JSONException ex){          // JSON errors          returnString = ""JSON failed; "" + ex.getMessage();      }  }</code></pre><p>And this is the way i want to take it :</p><pre><code>Connection2 serie = new Connection2(url);    name = (TextView)findViewById(R.id.name);    description = (TextView)findViewById(R.id.description);    airday = (TextView)findViewById(R.id.air_day);    airtime = (TextView)findViewById(R.id.air_time);    name.setText(serie.returnName());    description.setText(serie.description);</code></pre>","439058","","1012284","","2013-02-14 08:05:29","2013-02-14 08:05:29","how can i take this json data","<android><arrays><json><data>","3","1","","",""
"4542655","1","","","2010-12-27 23:39:24","1","11552","<p>I need to create a table layout similar to this <a href=""http://sourceforge.net/dbimage.php?id=194965"" rel=""nofollow"">http://sourceforge.net/dbimage.php?id=194965</a>I need some example source code on how to do this.</p>","275674","","","","","2012-03-07 12:26:48","Android table view","<java><android>","3","1","1","",""
"4542662","1","","","2010-12-27 23:40:55","1","553","<p>I would like to be able to start pandora in another application on android.  Is this possible by creating an intent, and launching it?</p><p>Thanks,Steven</p>","555482","","","","","2011-07-28 21:03:28","Is it possible to start pandora from another application?","<android>","3","1","","",""
"4542678","1","4542876","","2010-12-27 23:43:52","14","5668","<p>I'm looking for some site/library/project with advanced custom Android controls? if you know one, are they free and open sourced?</p>","99821","","","","","2014-03-28 19:35:07","Where to find free open sourced android custom controls?","<android><controls>","2","0","4","",""
"4542739","1","","","2010-12-27 23:55:04","0","56","<p>i made an int array with my drawables in it</p><pre><code>_imageResources = new int[] {R.drawable.p001, R.drawable.p002, R.drawable.p003, R.drawable.p004, R.drawable.p005, R.drawable.p006, R.drawable.p007, R.drawable.p008, R.drawable.p009,           R.drawable.p010, R.drawable.p011, R.drawable.p012, R.drawable.p013, R.drawable.p014, R.drawable.p015, R.drawable.p016, R.drawable.p017, R.drawable.p018, R.drawable.p019,           R.drawable.p020, R.drawable.p021, R.drawable.p022, R.drawable.p023, R.drawable.p024, R.drawable.p025, R.drawable.p026, R.drawable.p027, R.drawable.p028, R.drawable.p029, };</code></pre><p>i use this to get the image</p><pre><code>public int GetCurrentImage() {  return _imageResources[_currentImageIndex]; }</code></pre><p>and display it using this</p><pre><code> _imageview.setBackgroundResource(GetCurrentImage());</code></pre><p>now i need to figure out a way to attach the currently displayed image to my ACTION_SEND intentthe code is   </p><pre><code>share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(jpg)); </code></pre><p>but i have absolutely no idea how i would get a Uri from my code for the image, any help is appreciated.</p>","326423","","","","","2010-12-28 00:32:22","android Extra_Steam","<android><android-intent>","1","0","","",""
"4542777","1","7420260","","2010-12-28 00:04:58","0","217","<p>It seems that the Android SDK doesn't compile my android app correctly. After building an app, I sometimes get seemingly random exceptions. The error goes away if I comment out the offending code, rebuild, uncomment the code, then rebuild again.</p><p>For instance, this code gave me a NullPointerException:</p><p>playButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            startActivityForResult(settings, PLAY_GAME);        }        });</p><p>There is <em>nothing</em> wrong this code! Yet adb logcat tells me it's the cause of an exception.Commenting out this code, rebuilding, uncommenting and rebuilding, makes the error go away.</p><p>What is going on?</p><p>This is making developing for android particularly frustrating. </p><p><strong>Update</strong>: As I pointed out before, these are seemingly random errors that go away once I uncomment/recompile/comment/recompile. So I can't reproduce the stacktrace. It was a NullPointerException if I remember correctly.</p><p>However, if it is indeed buggy programming, why is the app running fine now w/o ANY errors at all?</p><p>Whenever I make a significant change to the app (add a new resource, a new class, function, etc), old code that was working fine breaks. Why?</p><p><strong>Update</strong>: Seriously guys, lay off on the hate. I feel like a stumbled on a Atheists vs Christian debate. Sorry to have insunated that android was at fault. Started a new question with the latest errors:</p><p><a href=""http://stackoverflow.com/questions/4547055/app-ran-fine-now-breaking-for-seemingly-unknown-reasons"">App Ran Fine, Now Breaking for Seemingly Unknown Reasons</a></p>","555493","","555493","","2010-12-28 15:22:46","2011-09-14 17:11:50","Android SDK not compiling apps correctly","<java><android><debugging><nullpointerexception>","3","8","0","",""
"4542867","1","","","2010-12-28 00:26:22","2","1111","<p>I am trying to find a set of date functions.  Looks like the Joda </p><p><a href=""http://www.joda.org/joda-time/"" rel=""nofollow"">http://www.joda.org/joda-time/</a></p><p>Does everything I need, but when I call a simple </p><pre><code>DateTime dt = new DateTime();</code></pre><p>it hangs the Eclipse or Emulator for about 15 seconds. </p><p>I must be doing something wrong as I haven't found anyone else complaining about it being slow.</p><p>Short of the Joda jar anyone had a datediff() code sample?</p>","555504","","38896","","2013-08-22 11:32:17","2013-08-22 11:32:17","Android Java - Joda Date is slow in Eclipse/Emulator -","<java><android><jodatime><datediff>","4","0","","",""
"4542901","1","","","2010-12-28 00:39:01","0","502","<p>This is my app:If someone enters ""C6H12O6+O2=CO2+H2O"", then I have already written code to split the equation into terms, so in an ArrayList called rterms I have the strings:C6H12O6CO2and in another ArrayList called pterms, I have:CO2H2O</p><p>I need to count the number of C's in each term of the reactants, so 6 for term 1, 0 for term 2, and then the H's and then O's. How would I do this? Any help is appreciated.</p>","555508","","","","","2010-12-28 18:50:45","For a Chemical Equation Balancer App (Android), how do I count the number of atoms of each element in each term?","<java><android><sdk><chemistry>","1","0","","",""
"4543033","1","","","2010-12-28 01:12:02","1","2172","<p>Specifically, loading the tictactoemain sample.</p><p>I get the following error:</p><p>[2010-12-27 19:48:35 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read D:\Program Files\Android\android-sdk-windows\AndroidManifest.xml: java.io.FileNotFoundException: D:\Program Files\Android\android-sdk-windows\AndroidManifest.xml (The system cannot find the file specified)[2010-12-27 19:48:35 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read D:\Program Files\Android\android-sdk-windows\AndroidManifest.xml: java.io.FileNotFoundException: D:\Program Files\Android\android-sdk-windows\AndroidManifest.xml (The system cannot find the file specified)[2010-12-27 19:49:15 - TicTacToe] Unable to resolve target 'android-8'</p><p>I only have 'android-9' SDK loaded, but the manifest file only sets the min SDK to 8.</p><p>I get this when I try to create a project out of the SDK files.</p><p>What configuration tells Eclipse to look in 'D:\Program Files\Android\android-sdk-windows\'?</p>","552556","","","","","2010-12-28 03:33:38","Error Loading SDK 9 Sample App","<android><android-manifest><android-sdk-2.3>","2","0","","",""
"4543066","1","4543074","","2010-12-28 01:23:41","1","651","<p>According to the docs for this function: <a href=""http://developer.android.com/reference/android/app/Activity.html#startActivityForResult%28android.content.Intent%2C%20int%29"" rel=""nofollow"">startActivityForResult()</a></p><p>I'm seeing that there is a request code that it accepts.  If I understand correctly I'll use this same code to refer to the results of this activity.  Is it common practice to put these resource links in constant variables?</p>","197606","","27536","","2010-12-28 01:51:06","2010-12-28 01:51:06","Java Request Codes in constant variables","<java><android>","1","0","","",""
"4543168","1","4558858","","2010-12-28 01:55:56","0","900","<p>I use a <code>ListView</code> as the child row in a <code>ExpandableListActivity</code> and have defined a custom <code>CursorTreeAdapter</code> for it. The values and the views are being populated by my code just as expected, but each expandable list row (<code>ListView</code> with variable number of items in it) is only partially shown (only the first 2 items are being displayed).</p><ol><li><p>While debugging through the code, I confirmed that all the child rows (<code>ListView</code>) are being populated properly (that is with 10-15 rows in it)</p></li><li><p>Just to confirm further, I changed <code>android:stackFromBottom = ""true""</code> for the <code>ListView</code>, this time only the last 2 items were displayed for each expandable item row.</p></li></ol><p>`</p><pre><code>public class WorkExpandableListAdapter extends CursorTreeAdapter {public WorkExpandableListAdapter(Cursor cursor, Context context) { super(cursor, context, true); } protected Cursor getChildrenCursor(Cursor groupCursor) { ... return childCursor; } @Override protected void bindChildView(View view, Context context, Cursor cursor,   boolean isLastChild) {  if (!noColumnsToDisplay) {   int numColumns = workProjection.length + 1; // to skip the _id   ArrayList&lt;JXTField&gt; jxtFields = new ArrayList&lt;JXTField&gt;();   for (int i = 1; i &lt; numColumns; i++) {    jxtFields.add(new JXTField(workProjection[i - 1],      cursor.getString(cursor        .getColumnIndex(workProjection[i - 1]))));   }//OrderAdapter is simply a customized Array adapter which converts name value pairs into //customized 2 line items   ArrayAdapter&lt;JXTField&gt; adapter = new OrderAdapter(WorkList.this,     R.layout.work_view_row, jxtFields);   ((ListView) view.findViewById(R.id.expandable_child_list))     .setAdapter(adapter);  } } @Overridepublic View newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) {  return getLayoutInflater().inflate(R.layout.expandable_child_list,null); } @Overrideprotected void bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) { ... } @Override protected View newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) {  return ((TextView) getLayoutInflater().inflate(android.R.layout.simple_expandable_list_item_1, null)); }}</code></pre><p>`</p><p><strong>expandable_child_list.xml</strong></p><p>`</p><pre><code>&lt;ListView     android:id=""@+id/expandable_child_listt""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:paddingLeft=""20dp""          android:layout_weight=""2.0""         /&gt;</code></pre><p>`</p><p><strong>work_view_row.xml</strong>   `</p><pre><code>&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""0dip""    android:layout_weight=""1""    android:layout_height=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/work_view_row_top_text""        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""        android:gravity=""center_vertical""    /&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""0dip""        android:layout_weight=""1""         android:id=""@+id/work_view_row_bottom_text""        android:ellipsize=""marquee""        android:textAppearance=""?android:attr/textAppearanceMedium""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>`</p><p>This looked like an easy one to solve when I first encountered it, but after wasting too much time on it I resort to the gurus. Maybe I am missing something very obvious, but please point out. :(</p><p>Thanks in advance.</p>","508496","","180740","","2011-09-03 21:44:10","2011-09-03 21:44:10","Listview embedded in a ExpandableListActivity is only partially displayed on the screen","<android><expandablelistview>","1","0","","",""
"4543292","1","","","2010-12-28 02:41:04","2","1361","<p>I am developing android application.</p><p>How to turn off animation effect like change activity slide effect.</p><p>For only my application.</p>","555567","","881229","","2014-02-14 21:12:04","2014-02-14 21:12:04","How to turn off animation effect like change activity slide effect","<android>","1","0","","",""
"4543311","1","4545571","","2010-12-28 02:46:10","3","474","<p>As known, the gingerbread is going to adopt ext4 to replace the YAFFS.The reason seems to be that YAFFS is <a href=""http://arstechnica.com/open-source/news/2010/12/ext4-filesystem-hits-android-no-need-to-fear-data-loss.ars"" rel=""nofollow"">single-threaded</a>.Will someone explain what does ""single-threaded"" mean in the area of file system?So ext4 is multi-threaded? From what aspect?</p><p>thanks.</p>","488487","","","","","2010-12-28 11:09:40","What is single or multi thread concept in area of file system?","<android><filesystems>","1","1","2","",""
"4543349","1","","","2010-12-28 02:55:59","17","33856","<p>I want to load a local html into a WebView WITHOUT using ""file:///"" because that does not allow cookies. Is there a way to use something like ""localhost"" ?</p><p>Secondly, I could not find a way to enable cookies in the getSettings(). Because cookies are not allowed while using ""file:///"".</p>","488407","","","","","2013-09-06 05:30:28","Load local html in WebView?","<android><webview>","4","1","5","",""
"4543373","1","","","2010-12-28 03:01:05","4","8996","<p>Okay, I'm getting a null pointer exception when I start my third activity. Here is the LogCat message:</p><pre>12-28 04:38:00.350: ERROR/AndroidRuntime(776): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.acithium.main/com.acithium.rss.ShowDescription}: java.lang.NullPointerException12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.os.Handler.dispatchMessage(Handler.java:99)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.os.Looper.loop(Looper.java:123)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.ActivityThread.main(ActivityThread.java:4203)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at java.lang.reflect.Method.invokeNative(Native Method)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at java.lang.reflect.Method.invoke(Method.java:521)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at dalvik.system.NativeStart.main(Native Method)12-28 04:38:00.350: ERROR/AndroidRuntime(776): Caused by: java.lang.NullPointerException12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at com.acithium.rss.ShowDescription.onCreate(ShowDescription.java:48)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)12-28 04:38:00.350: ERROR/AndroidRuntime(776):     ... 11 more</pre><p>Here is the section of code where I call the activity:</p><pre><code>public void onItemClick(AdapterView parent, View v, int position, long id) {     Log.i(tag,""item clicked! ["" + feed.getItem(position).getTitle() + ""]"");     Intent itemintent = new Intent(this,com.acithium.rss.ShowDescription.class);     //Intent itemintent = new Intent();     //itemintent.setClassName(""com.acithium.main"", ""com.acithium.rss.ShowDescription"");     Bundle b = new Bundle();     b.putString(""title"", feed.getItem(position).getTitle());     b.putString(""description"", feed.getItem(position).getDescription());     b.putString(""link"", feed.getItem(position).getLink());     itemintent.putExtra(""android.intent.extra.INTENT"", b);     startActivityForResult(itemintent,0); }</code></pre><p>And here is new activity class that is called:</p><pre><code>public class ShowDescription extends Activity {    public void onCreate(Bundle icicle)     {        super.onCreate(icicle);        setContentView(R.layout.showdescription);        String theStory = null;        Intent startingIntent = getIntent();        if (startingIntent != null)        {            Bundle b = startingIntent.getBundleExtra(""android.intent.extra.INTENT"");            if (b == null)            {                theStory = ""bad bundle?"";            }            else            {                theStory =  b.getString(""title"") + ""\n\n"" + b.getString(""description"") + ""\n\nMore information:\n"" + b.getString(""link"");            }        }        else        {            theStory = ""Information Not Found."";        }        TextView db= (TextView) findViewById(R.id.storybox);        db.setText(theStory);        Button backbutton = (Button) findViewById(R.id.back);        backbutton.setOnClickListener(new Button.OnClickListener()         {            public void onClick(View v)             {                finish();            }        });            }}</code></pre><p>here is the showdescription.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;ScrollView 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;TextView               android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:autoLink=""all""                 android:text=""story goes here ....""             android:id=""@+id/storybox"" /&gt;        &lt;Button                android:layout_height=""wrap_content""                 android:text=""Back""            android:id=""@+id/back""             android:layout_width=""100px""             android:layout_marginLeft=""100px""/&gt;           &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","522983","","488830","","2010-12-28 04:18:50","2013-08-05 09:19:57","null pointer exception when starting new activity","<java><android><nullpointerexception>","3","3","","",""
"4543441","1","","","2010-12-28 03:23:28","8","5661","<p>As I know, we can add our app specific menu entries in iPhone's Settings menu. I want to know how same can be done in Android? I am developing for Android 1.6 using Eclipse Galileo. Please guide me.</p>","476747","","476747","","2011-03-30 11:07:14","2014-02-19 08:40:59","Adding App Specific Entry into the Android Settings Menu","<android>","4","0","2","",""
"4543456","1","","","2010-12-28 03:27:13","0","792","<p>how to prevent our process to be killed by Android System while low memory?</p>","443407","","443407","","2010-12-28 03:32:37","2010-12-28 05:07:39","how to prevent our process to be killed by Android System while low memory in MileStone?","<android>","3","0","","",""
"4543476","1","4543499","","2010-12-28 03:33:39","0","251","<p>I am looking at AndroidTestCase class in android 2.2 source code, ithas a method getTestContext. when i tried to access the same functionusing android.jar packaged in sdk i don't see this methods.</p><p>Not only this i see several methods which are public are not seen wheni use android-sdk-for-windows/platforms/android-8/android.jar packagedwith the sdk. In my project i have set my android api level to 8.</p><p>when i try to right click and look at the class version they arepointing to 1.5 , i would expect they point to 2.2.</p><p>do i need to compile everything manually to get all public methods in2.2 source code.</p>","690924","","","","","2011-04-18 14:40:20","AndroidTestCase class file version mismatch","<android>","1","0","","",""
"4543540","1","4543658","","2010-12-28 03:51:46","1","4551","<p>i am attempting to save an image file using ""openFileOutput"" and then adding that file to my intent with EXTRA_STREAM. but logcat keeps saying that file size is 0, i have the proper permission in my manifest.</p><pre><code>FileOutputStream fos = openFileOutput(""p001.jpg"", Context.MODE_WORLD_READABLE);         File jpg = getFileStreamPath(""p001.jpg"");            fos.close();            Intent share = new Intent(android.content.Intent.ACTION_SEND);         share.setType(""image/jpeg"");            share.putExtra(Intent.EXTRA_SUBJECT, ""Fail picture"");            share.putExtra(Intent.EXTRA_TEXT, ""Epic fail!!!"");            share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(jpg));             startActivity(Intent.createChooser(share, ""Choose share method.""));</code></pre><p>updated code</p><pre><code>private void HandleSMS() throws IOException {         FileOutputStream fos = openFileOutput(R.drawable.p001, Context.MODE_WORLD_READABLE);             File jpg = getFileStreamPath(""p001.jpg"");            fos.close();            Intent share = new Intent(android.content.Intent.ACTION_SEND);         share.setType(""image/jpeg"");            share.putExtra(Intent.EXTRA_SUBJECT, ""Fail picture"");            share.putExtra(Intent.EXTRA_TEXT, ""Epic fail!!!"");            share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(jpg));             startActivity(Intent.createChooser(share, ""Choose share method.""));        }</code></pre>","326423","","326423","","2010-12-28 06:38:05","2010-12-28 06:38:05","Android FileOutputStream","<android><android-intent>","1","2","","",""
"4543559","1","4543709","","2010-12-28 03:58:44","9","6445","<p>I've been pulling out my hair on this for a while now.  The following method is supposed to download a file, and save it to the location specified on the hard drive.</p><pre><code>private static void saveImage(Context context, boolean backgroundUpdate, URL url, File file) {    if (!Tools.checkNetworkState(context, backgroundUpdate))        return;    // Get the image    try {        // Make the file        file.getParentFile().mkdirs();        // Set up the connection        URLConnection uCon = url.openConnection();        InputStream is = uCon.getInputStream();        BufferedInputStream bis = new BufferedInputStream(is);        // Download the data        ByteArrayBuffer baf = new ByteArrayBuffer(50);        int current = 0;        while ((current = bis.read()) != -1) {                baf.append((byte) current);        }        // Write the bits to the file        OutputStream os = new FileOutputStream(file);        os.write(baf.toByteArray());        os.close();    } catch (Exception e) {        // Any exception is probably a newtork faiilure, bail        return;    }}</code></pre><p>Also, if the file doesn't exist, it is supposed to make the directory for the file.  (And if there is another file already in that spot, it should just not do anything).  However, for some reason, the mkdirs() method never makes the directory.  I've tried everything from explicit parentheses, to explicitly making the parent file class, and nothing seems to work.  I'm fairly certain that the drive is writable, as it's only called after that has already been determined, also that is true after running through it while debugging.  So the method fails because the parent directories aren't made.  Can anyone tell me if there is anything wrong with the way I'm calling it?</p><p>Also, if it helps, here is the source for the file I'm calling it in:</p><p><a href=""https://github.com/LeifAndersen/NetCatch/blob/master/src/net/leifandersen/mobile/android/netcatch/services/RSSService.java"">https://github.com/LeifAndersen/NetCatch/blob/master/src/net/leifandersen/mobile/android/netcatch/services/RSSService.java</a></p><p>Thank you</p>","288439","","","","","2013-03-28 08:18:55","File mkdirs() method not working in android/java","<java><android><file>","4","0","","",""
"4543663","1","4545547","","2010-12-28 04:33:02","1","4297","<p>Is there a way to get the HTML in a webview in an Android app? I would prefer this to getting the HTML via a simple resource download, especially if I can get HTML generated by JavaScript. </p><p>For example if I wanted a list of all URLs in a random HTML document accessible to my android application, including web apps such as gmail, how would I go about it?</p><p>The android documentation warns about letting JavaScript access the application, but I was thinking maybe a solution would be, if at all possible, to inject some JavaScript into the webpage which then communicates with my application in a hopefully safe way (via message passing or something through an iframe on a site that I control the javascript on or something similar).</p><p>Any one have any ideas?</p>","66475","","","","","2011-12-06 12:24:55","Is there a way to get the HTML in a webview in an Android app?","<javascript><android><webview><android-webview>","2","0","","",""
"4543678","1","4543724","","2010-12-28 04:37:27","0","611","<p>i know that there must be a simpler way of doing this, i just don't understand how java works well enough, and i am struggling.  could someone perhaps point me in the right direction?</p><pre><code>ImageButton image = (ImageButton) findViewById(R.id.card1);    ImageButton image2 = (ImageButton) findViewById(R.id.card2);    ImageButton image3 = (ImageButton) findViewById(R.id.card3);    ImageButton image4 = (ImageButton) findViewById(R.id.card4);    ImageButton image5 = (ImageButton) findViewById(R.id.card5);    ImageButton image6 = (ImageButton) findViewById(R.id.card6);    ImageButton image7 = (ImageButton) findViewById(R.id.card7);    ImageButton image8 = (ImageButton) findViewById(R.id.card8);    ImageButton image9 = (ImageButton) findViewById(R.id.card9);    ImageButton image10 = (ImageButton) findViewById(R.id.card10);    ImageButton image11 = (ImageButton) findViewById(R.id.card11);    ImageButton image12 = (ImageButton) findViewById(R.id.card12);    ImageButton image13 = (ImageButton) findViewById(R.id.card13);    ImageButton image14 = (ImageButton) findViewById(R.id.card14);    ImageButton image15 = (ImageButton) findViewById(R.id.card15);    //image.setImageResource(R.drawable.test2);    Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled = Bitmap.createScaledBitmap(bMap, buttonSize, buttonSize, true);    Bitmap bMap2 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled2 = Bitmap.createScaledBitmap(bMap2, buttonSize, buttonSize, true);    Bitmap bMap3 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled3 = Bitmap.createScaledBitmap(bMap3, buttonSize, buttonSize, true);    Bitmap bMap4 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled4 = Bitmap.createScaledBitmap(bMap4, buttonSize, buttonSize, true);    Bitmap bMap5 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled5 = Bitmap.createScaledBitmap(bMap5, buttonSize, buttonSize, true);    Bitmap bMap6 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled6 = Bitmap.createScaledBitmap(bMap6, buttonSize, buttonSize, true);    Bitmap bMap7 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled7 = Bitmap.createScaledBitmap(bMap7, buttonSize, buttonSize, true);    Bitmap bMap8 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled8 = Bitmap.createScaledBitmap(bMap8, buttonSize, buttonSize, true);    Bitmap bMap9 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled9 = Bitmap.createScaledBitmap(bMap9, buttonSize, buttonSize, true);    Bitmap bMap10 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled10 = Bitmap.createScaledBitmap(bMap10, buttonSize, buttonSize, true);    Bitmap bMap11 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled11 = Bitmap.createScaledBitmap(bMap11, buttonSize, buttonSize, true);    Bitmap bMap12 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled12 = Bitmap.createScaledBitmap(bMap12, buttonSize, buttonSize, true);    Bitmap bMap13 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled13 = Bitmap.createScaledBitmap(bMap13, buttonSize, buttonSize, true);    Bitmap bMap14 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled14 = Bitmap.createScaledBitmap(bMap14, buttonSize, buttonSize, true);    Bitmap bMap15 = BitmapFactory.decodeResource(getResources(), R.drawable.vraag);    Bitmap bMapScaled15 = Bitmap.createScaledBitmap(bMap15, buttonSize, buttonSize, true);    image.setImageBitmap(bMapScaled);    image2.setImageBitmap(bMapScaled2);    image3.setImageBitmap(bMapScaled3);    image4.setImageBitmap(bMapScaled4);    image5.setImageBitmap(bMapScaled5);    image6.setImageBitmap(bMapScaled6);    image7.setImageBitmap(bMapScaled7);    image8.setImageBitmap(bMapScaled8);    image9.setImageBitmap(bMapScaled9);    image10.setImageBitmap(bMapScaled10);    image11.setImageBitmap(bMapScaled11);    image12.setImageBitmap(bMapScaled12);    image13.setImageBitmap(bMapScaled13);    image14.setImageBitmap(bMapScaled14);    image15.setImageBitmap(bMapScaled15);</code></pre>","486086","","","","","2011-01-04 11:50:24","trying to make this code less messy in android, can anyone help?","<android>","2","1","","",""
"4543700","1","6174212","","2010-12-28 04:43:40","4","2060","<pre><code>final Intent i = new Intent(android.content.Intent.ACTION_SEND);i.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ txt.getText().toString()});    i.putExtra(Intent.EXTRA_SUBJECT, ""Merry Christmas"");            i.setType(""text/html"");    Spanned html =Html.fromHtml(""&lt;html&gt;&lt;body&gt;h&lt;b&gt;ell&lt;/b&gt;o&lt;img src='http://www.pp.rhul.ac.uk/twiki/pub/TWiki/GnuPlotPlugin/RosenbrockFunctionSample.png'&gt;world&lt;/body&gt;&lt;/html&gt;"",    new ImageGetter() {     InputStream s;     public Drawable getDrawable(String url) {      try {       s = (InputStream) (new URL(url)).getContent();      } catch (MalformedURLException e) {       e.printStackTrace();      } catch (IOException e) {     e.printStackTrace();    }    Drawable d = Drawable.createFromStream(s, null);    LogUtil.debug(this, ""Got image: "" + d.getClass() + "", "" + d.getIntrinsicWidth() + ""x"" + d.getIntrinsicHeight());    d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());    return d;    }},null);    i.putExtra(Intent.EXTRA_TEXT, html);    startActivity(Intent.createChooser(i, ""Send email""));*</code></pre>","554830","","302328","","2010-12-28 04:46:38","2011-06-01 13:22:54","How can i add image in email body","<android><android-intent>","1","1","3","",""
"4543826","1","","","2010-12-28 05:14:45","0","623","<p>I have to implement google map in android.Now the problem i am facing is I have to show multiple locations.I have shown single location in google map in android stimulator.Can anyone tell me how to implement it??</p>","475349","","","","","2011-06-11 23:26:34","regarding showing multiple locations in google map in android","<android>","1","0","","",""
"4543833","1","4545584","","2010-12-28 05:15:55","0","614","<p>I have a button whose WidgetProvider kicks off a service with aPendingIntent. That works just fine. How do I similarly attach anevent handler to the button so that when it is pressed a second time,it shuts the service down? Is there an appropriate pattern to followfor something like this?</p><p>Thanks.</p>","555642","","","","","2010-12-28 11:11:48","How to use a homescreen widget button to shutdown a service?","<android><button><service><widget><shutdown>","1","0","","",""
"4543837","1","","","2010-12-28 05:16:28","1","455","<p>i want my images must move from first to last but it only shows the last images i want to add timer to view all the images in animation package com.viewslide;</p><pre><code>import android.app.Activity;import android.database.Cursor;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.provider.MediaStore;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.ImageView;public class slideview extends Activity {    private Animation slideLeftOut;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String[] filePathColumn = {MediaStore.Images.Media.DATA};        Cursor cursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, filePathColumn, null, null, null);        int count= cursor.getCount();        int i;        for(i=0; i&lt;6; i++) {            cursor.moveToPosition(i);            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);            String filePath = cursor.getString(columnIndex);            cursor.close();            Bitmap yourSelectedImage = BitmapFactory.decodeFile(filePath);            ImageView img1= (ImageView)findViewById(R.id.img1);            img1.setImageBitmap(yourSelectedImage);            slideLeftOut = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);            img1.startAnimation(slideLeftOut);        }    }}</code></pre>","545982","","103167","","2010-12-28 05:44:50","2011-10-17 15:05:13","Android timer in slideshow","<android><android-layout>","1","0","","",""
"4543894","1","4544026","","2010-12-28 05:31:01","22","46162","<p>I have to do a http post request to a web-service for authenticating the user with username and password. The Web-service guy gave me following information to construct HTTP Post request.</p><pre><code>POST /login/dologin HTTP/1.1Host: webservice.companyname.comContent-Type: application/x-www-form-urlencodedContent-Length: 48id=username&amp;num=password&amp;remember=on&amp;output=xml</code></pre><p>The XML Response that i will be getting is</p><pre><code>&lt;?xml version=""1.0"" encoding=""ISO-8859-1""?&gt;&lt;login&gt; &lt;message&gt;&lt;![CDATA[]]&gt;&lt;/message&gt; &lt;status&gt;&lt;![CDATA[true]]&gt;&lt;/status&gt; &lt;Rlo&gt;&lt;![CDATA[Username]]&gt;&lt;/Rlo&gt; &lt;Rsc&gt;&lt;![CDATA[9L99PK1KGKSkfMbcsxvkF0S0UoldJ0SU]]&gt;&lt;/Rsc&gt; &lt;Rm&gt;&lt;![CDATA[b59031b85bb127661105765722cd3531==AO1YjN5QDM5ITM]]&gt;&lt;/Rm&gt; &lt;Rl&gt;&lt;![CDATA[username@company.com]]&gt;&lt;/Rl&gt; &lt;uid&gt;&lt;![CDATA[3539145]]&gt;&lt;/uid&gt; &lt;Rmu&gt;&lt;![CDATA[f8e8917f7964d4cc7c4c4226f060e3ea]]&gt;&lt;/Rmu&gt;&lt;/login&gt;</code></pre><p>This is what i am doing    HttpPost postRequest = new HttpPost(urlString); How do i construct the rest of the parameters?</p>","548903","","548903","","2010-12-28 09:32:59","2013-12-14 09:32:59","Android, Java: HTTP POST Request","<java><android><http-post>","7","0","17","",""
"4543943","1","","","2010-12-28 05:46:04","14","21974","<p>I would like to add chat functionality with online user in gmail in android. how to add chat feature in my own application in android?</p><p>I want to show an online user in google maps which is nearest to the area which I have selected and have the ability to chat with that online user</p>","550843","","13523","","2012-08-30 09:08:03","2014-01-07 23:58:26","How to make a chat application in android?","<android><sdk><chat>","3","1","6","",""
"4543954","1","","","2010-12-28 05:47:23","0","209","<p>Hi in my application i need to show all the phone contact including contact image, currently i read all the data in to array and show ,but in some lower end phones it create problem ,like out of memory is there any alternative way to display the all the phone contact</p><p>NB: the default phone contact intent is not my requirment , i need to get all the phone numbers, and also if first name is empty i need to show the organization name</p>","487219","","","","","2010-12-28 06:13:57","Android phone contact 2.1","<android><phone><contact>","1","0","","",""
"4544042","1","4544870","","2010-12-28 06:11:01","0","6761","<p>In android how can my Activity will get to know if a Bluetooth A2DP device is connected to my device.<br>Is there any broadcast receiver for that?<br>How to write this broadcast receiver?</p>","314247","","650492","","2013-10-08 16:58:41","2013-10-29 04:25:01","How to detect if bluetooth device is connected","<android>","5","0","3","",""
"4544058","1","4544113","","2010-12-28 06:14:23","0","285","<p>I am currently working on a program that has two EditText boxes one for a screens Width and one for the screens Height. What I want to be able to do is that when a user knows either the height or width and they enter the measurement they have into the EditText box that corresponds with the measurement that they have and when they press enter it will give them the unknown dimension for a 16:9 screen.</p><p>Here is the user interface:</p><p>    </p><pre><code>&lt;TextView android:layout_height=""wrap_content""     android:text=""Screen Ratio:""     android:id=""@+id/ScreenRatio""     android:layout_width=""100dip""     android:layout_alignTop=""@+id/ratio_spinner""     android:layout_alignBottom=""@+id/ratio_spinner""     android:gravity=""center_vertical"" /&gt;&lt;Spinner android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:layout_toRightOf=""@+id/ScreenRatio""     android:id=""@+id/ratio_spinner""/&gt;&lt;TextView    android:layout_height=""wrap_content""    android:text=""Units:""      android:layout_width=""wrap_content""     android:layout_toLeftOf=""@+id/unit_spinner""    android:layout_alignTop=""@+id/unit_spinner""    android:layout_alignBottom=""@+id/unit_spinner""    android:gravity=""center_vertical""     android:layout_alignParentLeft=""true""     android:id=""@+id/ScreenUnit""/&gt;&lt;Spinner android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:layout_toRightOf=""@+id/ScreenRatio""     android:layout_below=""@+id/ratio_spinner""     android:id=""@+id/unit_spinner""/&gt; &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:paddingTop=""3dip""    android:paddingBottom=""3dip""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_below=""@+id/unit_spinner""     android:id=""@+id/screen_layout""    android:stretchColumns=""1,2""&gt;    &lt;View        android:layout_height=""2dip""        android:background=""#FF909090""/&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""1""            android:paddingTop=""3dip""            android:text=""Screen Width:""/&gt;        &lt;TextView            android:layout_column=""2""            android:padding=""3dip""            android:text=""Screen Height:""/&gt;    &lt;/TableRow&gt;    &lt;TableRow    android:paddingBottom=""3dip"" &gt;        &lt;EditText            android:layout_column=""1""            android:id=""@+id/width_EditText""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""@android:drawable/editbox_background""             android:inputType=""number""            android:textSize=""14px""            android:hint=""Enter a Width""/&gt;        &lt;EditText            android:layout_column=""2""            android:id=""@+id/height_EditText""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""@android:drawable/editbox_background""            android:numeric=""integer""            android:textSize=""14px""            android:hint=""Enter a Height""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;Button    android:id=""@+id/enter""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""     android:text=""Enter""    android:gravity=""fill""    android:paddingBottom=""10dip""    android:paddingRight=""50dip""    android:paddingLeft=""50dip""      android:layout_alignRight=""@+id/screen_layout""     android:layout_below=""@+id/screen_layout""    /&gt;</code></pre><p></p><p>I want the app to be able to give me the value based on the last number entered into the EditText box and so that the user doesn't have to clear both boxes before trying another number. what is the best way of keeping up with which of the two boxes that the user had entered text into last was? I tried a if else statement based on if the boxes were in focus but couldn't manage to get it to work. Any suggestions?</p>","529865","","","","","2011-11-06 00:28:13","Best way to figure out if a EditText was previously selected","<android><if-statement><edittext>","1","0","","",""
"4544068","1","4544130","","2010-12-28 06:16:35","0","638","<p>Ok so i am bulding this application that calculates 3 input boxes. i am getting a NaN when doing some calculations with 0 values.<br>here is the main.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:id=""@+id/ScrollView01"" &gt;&lt;AbsoluteLayout android:orientation=""vertical""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;EditText android:id=""@+id/InputNumber01""        android:numeric=""integer|decimal"" android:imeOptions=""actionNext""        android:textStyle=""bold"" android:hint=""Service Call""        android:layout_x=""5dip"" android:layout_y=""5px"" android:layout_height=""55dip""        android:textSize=""20dip"" android:layout_width=""195dip""        android:selectAllOnFocus=""true"" android:inputType=""numberDecimal""/&gt;    &lt;EditText android:id=""@+id/InputNumber02""        android:numeric=""integer|decimal"" android:inputType=""numberDecimal""        android:textStyle=""bold"" android:hint=""Parts"" android:layout_x=""5dip""        android:layout_y=""90px"" android:layout_height=""55dip""        android:textSize=""20dip"" android:layout_width=""195dip""        android:selectAllOnFocus=""true"" android:imeOptions=""actionNext""/&gt;    &lt;EditText android:id=""@+id/InputNumber03"" android:numeric=""integer|decimal""        android:inputType=""numberDecimal"" android:textStyle=""bold""        android:hint=""Labor"" android:layout_x=""5dip"" android:layout_y=""175px""        android:layout_height=""55dip"" android:textSize=""20dip""        android:layout_width=""195dip"" android:selectAllOnFocus=""true""        android:imeOptions=""actionDone""/&gt;    &lt;Button android:text=""Calculate"" android:id=""@+id/actionButton""        android:textStyle=""bold"" android:layout_height=""50dip""        android:layout_width=""fill_parent"" android:layout_y=""300px""        android:textSize=""15dip"" /&gt;    &lt;TextView android:id=""@+id/TextResult"" android:layout_height=""wrap_content""        android:numeric=""integer|decimal"" android:textStyle=""bold""        android:layout_width=""85dip"" android:layout_x=""225dip""        android:layout_y=""175dip"" android:gravity=""left"" android:textSize=""18dip""        android:textColor=""#1d9ee2"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView04""        android:text=""Total:"" android:textStyle=""bold"" android:gravity=""right""        android:layout_width=""55dip"" android:layout_y=""175dip""        android:layout_x=""165dip"" android:textSize=""18dip"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView05""        android:text=""Total Labor:"" android:layout_y=""260dip""        android:layout_width=""95dip"" android:layout_x=""5dip"" android:gravity=""right"" /&gt;    &lt;TextView android:text=""@+id/TotalLabor""        android:layout_height=""wrap_content"" android:layout_width=""wrap_content""        android:id=""@+id/TotalLabor"" android:layout_y=""260dip""        android:layout_x=""110dip"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView06""        android:layout_x=""5dip"" android:text=""Total Services:""        android:layout_y=""280dip"" android:layout_width=""95dip""        android:gravity=""right"" /&gt;    &lt;TextView android:layout_height=""wrap_content""        android:layout_width=""wrap_content"" android:id=""@+id/TotalServices""        android:text=""@+id/TotalServices"" android:layout_y=""280dip""        android:layout_x=""110dip"" /&gt;    &lt;TextView android:id=""@+id/TextView07"" android:text=""SC Tax %:""        android:layout_y=""300dip"" android:layout_height=""wrap_content""        android:layout_x=""5dip"" android:layout_width=""95dip"" android:gravity=""right"" /&gt;    &lt;TextView android:text=""@+id/TextView08""        android:layout_height=""wrap_content"" android:layout_width=""wrap_content""        android:id=""@+id/SCTaxPercent"" android:layout_y=""300dip""        android:layout_x=""110dip"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView08""        android:text=""Sales Tax:"" android:textStyle=""bold"" android:layout_y=""175dip""        android:layout_x=""5dip"" android:textSize=""18dip""        android:layout_width=""wrap_content"" android:gravity=""right"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/SalesTax""        android:textStyle=""bold"" android:numeric=""integer|decimal""        android:layout_y=""175dip"" android:gravity=""left""        android:layout_width=""65dip"" android:textSize=""18dip""        android:layout_x=""100dip"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView09""        android:text=""SC Taxable:"" android:layout_y=""320dip""        android:layout_x=""5dip"" android:layout_width=""95dip"" android:gravity=""right"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:text=""@+id/TextView10""        android:layout_width=""wrap_content"" android:id=""@+id/ScTaxable""        android:layout_y=""320dip"" android:layout_x=""110dip"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView10""        android:text=""Taxable:"" android:layout_y=""340dip""        android:layout_width=""95dip"" android:layout_x=""5dip"" android:gravity=""right"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:text=""@+id/TextView11""        android:layout_width=""wrap_content"" android:id=""@+id/Taxable""        android:layout_y=""340dip"" android:layout_x=""110dip"" /&gt;    &lt;EditText android:layout_height=""wrap_content"" android:text=""9.50""        android:layout_width=""90dip"" android:id=""@+id/SalesTaxValue""        android:layout_x=""5dip"" android:layout_y=""430dip"" android:numeric=""integer|decimal""        android:selectAllOnFocus=""true"" /&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/TextView01""        android:layout_width=""wrap_content"" android:layout_x=""5dip""        android:text=""Sales Tax Value:"" android:layout_y=""407dip"" /&gt;&lt;/AbsoluteLayout&gt;&lt;/ScrollView&gt;</code></pre><p>and this is the calculator.java </p><pre><code>package com.Eddie.TaxCalculator;import java.text.NumberFormat;import com.Eddie.TaxCalculator.R;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.WindowManager;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;public class Calculator extends Activity {    private Button calculateButton;    private EditText inputField01;    private EditText inputField02;    private EditText inputField03;    private EditText salesTaxValue;    private double serviceCall;    private double parts;    private double labor;    private double salestaxvalue;String zero =""0"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        calculateButton = (Button) findViewById(R.id.actionButton);        calculateButton.setOnClickListener(doSomethingNow);        this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);        }    private OnClickListener doSomethingNow = new OnClickListener() {        public void onClick(View arg0) {            inputField01 = (EditText) findViewById(R.id.InputNumber01);            inputField02 = (EditText) findViewById(R.id.InputNumber02);            inputField03 = (EditText) findViewById(R.id.InputNumber03);            salesTaxValue = (EditText) findViewById(R.id.SalesTaxValue);            if (inputField01.getText().toString().length()==0)                    {                       inputField01.setText(zero);                    Toast toast = Toast.makeText(getApplicationContext(),                             ""Service Call TextBox was empty."",                            Toast.LENGTH_LONG);                    toast.show();                    }                   if(inputField02.getText().toString().length()==0)                    {                       inputField02.setText(zero);                    Toast toast = Toast.makeText(getApplicationContext(),                             ""Parts TextBox was empty."",                            Toast.LENGTH_LONG);                    toast.show();                    }               if(inputField03.getText().toString().length()==0)                    {                       inputField03.setText(zero);                    Toast toast = Toast.makeText(getApplicationContext(),                             ""Labor TextBox was empty."",                            Toast.LENGTH_LONG);                    toast.show();                    }            //service Call is 0            if (inputField01.getText().toString().equals(""0""))            {            Toast toast = Toast.makeText(getApplicationContext(),                     ""Service Call TextBox value is 0."",                    Toast.LENGTH_SHORT);            //toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);            toast.show();            }                   //Parts is 0                if (inputField02.getText().toString().equals(""0""))            {               //inputField01.setText(""10"");            Toast toast = Toast.makeText(getApplicationContext(),                     ""Parts TextBox value is 0."",                    Toast.LENGTH_SHORT);            toast.show();            }               //Labor is 0            if (inputField03.getText().toString().equals(""0""))            {               //inputField01.setText(""10"");            Toast toast = Toast.makeText(getApplicationContext(),                     ""Labor TextBox value is 0."",                    Toast.LENGTH_SHORT);            toast.show();            }               serviceCall = Double.parseDouble(inputField01.getText().toString());            parts = Double.parseDouble(inputField02.getText().toString());            labor = Double.parseDouble(inputField03.getText().toString());            salestaxvalue = Double.parseDouble(salesTaxValue.getText().toString());            NumberFormat numberFormat = NumberFormat.getInstance();            numberFormat.setMaximumFractionDigits(2);                        numberFormat.setGroupingUsed(false);             TextView totalLabor = (TextView)findViewById(R.id.TotalLabor);            Double totalLaborResults =  serviceCall +  labor;            String totalLaborCalcInt = numberFormat.format(totalLaborResults).toString();            totalLabor.setText (totalLaborCalcInt);            TextView totalServices = (TextView)findViewById(R.id.TotalServices);            Double totalServicesResults = (parts + labor);            String totalServicesCalcInt = numberFormat.format(totalServicesResults);            totalServices.setText (totalServicesCalcInt);            TextView servicecallTaxpercent = (TextView)findViewById(R.id.SCTaxPercent);            Double scTaxPercentResults =  (parts / totalServicesResults);            String serviceCallPercentCalcInt =  numberFormat.format(scTaxPercentResults).toString();            servicecallTaxpercent.setText (serviceCallPercentCalcInt);            TextView scTaxable = (TextView)findViewById(R.id.ScTaxable);            Double scTaxableResults = (serviceCall * scTaxPercentResults);            String serviceCallTaxableCalcInt =numberFormat.format (scTaxableResults).toString();            scTaxable.setText (serviceCallTaxableCalcInt);            TextView taxable = (TextView)findViewById(R.id.Taxable);            Double taxableResults = (parts + scTaxableResults);                         String taxableCalcInt =numberFormat.format (taxableResults).toString();            taxable.setText (taxableCalcInt);            TextView salesTax = (TextView)findViewById(R.id.SalesTax);            Double salesTaxResults = (taxableResults * salestaxvalue) /100;            String salesTaxCalcInt = numberFormat.format (salesTaxResults).toString();            salesTax.setText (salesTaxCalcInt);            TextView textResult = (TextView)findViewById(R.id.Total);            Double additionResults = (salesTaxResults + parts+ serviceCall +  labor);            String TotalCalcInt = numberFormat.format(additionResults).toString();            textResult.setText (TotalCalcInt);                }    };};</code></pre><p>when entering a number in input 1 (service Call) and zeros in the two other inputs i get a NaN Total. </p><p>if All input Boxes are zero value i also get a NaN total, NaN sale Tax, NaN scTax % textview (sc is short of Service Call) NaN scTaxable, NaN taxable. </p><p>could anyone help me find this but i've been trying for two weeks now. pls help. </p>","555665","","212275","","2010-12-28 06:39:28","2010-12-28 06:39:28","Can't figure out how to Get rid of NaN","<java><android>","4","1","","",""
"4544082","1","","","2010-12-28 06:18:30","3","1006","<p>I need to get the pressure of touch event. I used event.getPressure() method to get the pressure and i found that pressure is always gives the value as 0.</p><p>I worked on Simulator but haven't tested on device. Is there a way where we can get the pressure of touch event in Simulator?</p><p>Please help me.</p>","528965","","","","","2011-08-11 19:14:03","how to get Touch Event Pressure?","<android>","1","1","","",""
"4544101","1","","","2010-12-28 06:22:19","0","647","<p>I use the code provided by Fedor in the following link, in order to get the latitude and longitude from my simple demo app. I am trying to fetch the latitude and longitude using the MyLocation class provided by him in that link.</p><p><a href=""http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-an/3145655#3145655"">What is the simplest and most robust way to get the user's current location in Android?</a></p><p>I try to fetch the latitude and longitude on a button click. On the button click, I start an async task and delegate the location fetching work to the do in background method of my asynctask.</p><p>pre execute - progressdialog initiated.post execute - progress dialog dismissed.</p><p>This is how, the progress dialog in my code should work and here is the issue which I have. THe progress dialog gets initiated correctly, but even before the latitude and longitude gets printed in the doinbackground method, the progress dialog gets dismissed.</p><p>I do not understand why this happens.</p><p>Here is my front end activity</p><pre><code>public class LocationServices extends Activity {MyLocation myLocation = new MyLocation();LocationResult locationResult;TextView tv1, tv2;Location location;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv1 = (TextView) findViewById(R.id.tv1);    tv2 = (TextView) findViewById(R.id.tv2);    Button btn = (Button) findViewById(R.id.Button01);    btn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            new LocationAsyncTasking().execute();        }    });}public class LocationAsyncTasking extends AsyncTask&lt;String, Void, Void&gt; {    ProgressDialog dialog;    int totalAvail;    protected void onPreExecute() {        // this.dialog.setMessage(""Inserting data..."");        dialog = new ProgressDialog(LocationServices.this);        this.dialog.setMessage(""Fetching data..."");        this.dialog.show();    }    protected Void doInBackground(String... args) {        Looper.prepare();        locationResult = new LocationResult() {            public void gotLocation(Location location) {                // TODO Auto-generated method stub                // LocationServices.this.location = location;                System.out.println(""Progress dialog should be present now - latitude""+location.getLatitude());                System.out.println(""Progress dialog should be present now - longitude""+location.getLongitude());            }        };        myLocation.getLocation(LocationServices.this, locationResult);        return (null);    }    protected void onProgressUpdate(Integer... progress) {    }    protected void onPostExecute(Void unused) {        dialog.dismiss();    }}</code></pre><p>}</p><p>I am quite puzzled, thinking of what makes this progress dialog disappear even before the SOP in doinbackground is finished.</p><p>Experts, please help me understand and resolve this issue.</p><p>Any help in this regard is well appreciated.</p><p>Looking forward,Best Regards,Rony</p>","264953","","264953","","2010-12-28 06:31:04","2011-03-09 16:25:54","Progress dialog getting dismissed before the thread gets finished - Android","<android><android-widget>","2","0","0","",""
"4544133","1","7798409","","2010-12-28 06:31:15","0","184","<p>My application has 4 languages in it. However only one module needs to be localized out of 5, </p><p>This module has 4 layout files and some images, remaining files can be there in default <code>layout</code> folder and <code>drawable</code> folders. </p><p>My question is : is it good practice to put only needed files in localization folders, if I leave other files in its respective folders and don't copy them in translation folders, does my application throw <code>NullPointerException</code> when my application runs in other language?</p><p>and </p><p>Does android market have any size limit? (Also being a BB developer,AFAIK they do not allow OTA, if the application size grows more than 3 mb) [In case i need to copy the layout and image files].</p><p><strong>Note</strong> about <code>NullPointerException</code> :  it throws in string if you omit some string in localization and application runs in that particular locale.</p><p>Thanks</p>","246942","","246942","","2010-12-28 06:49:20","2011-10-17 19:16:12","android localization: Is it a good practice to have only needed resource to put in localized folder?","<android><localization><android-layout>","1","2","","",""
"4544191","1","4544558","","2010-12-28 06:43:34","2","315","<p>I basically am making webrequests and recieving a JSON response.  Depending on the request, I am parsing JSON request into objects I have created.  The parsing is pretty much the same no matter what the object Im parsing into looks like.  So I have a bunch of methods doing the same work only with different objects, I was wondering how I could accomplish this with generics?  Here is an example</p><pre><code>   public static ArrayList&lt;Contact&gt; parseStuff(String responseData) {ArrayList&lt;Person&gt; People = new ArrayList&lt;Person&gt;();try {    JSONArray jsonPeople = new JSONArray(responseData);    if (!jsonPeople.isNull(0)) {        for (int i = 0; i &lt; jsonPeople.length(); i++) {            People.add(new Person(jsonPeople.getJSONObject(i)));        }    }} catch (JSONException e) {    // TODO Auto-generated catch block    e.printStackTrace();} catch (Exception e) {}return People;</code></pre><p>}</p>","408079","","408079","","2011-02-26 07:03:33","2011-02-26 07:03:33","How do I correctly use generics?","<java><android><json><generics>","2","4","","",""
"4544199","1","","","2010-12-28 06:45:03","0","7837","<p>I am having an application in which i have a ListView <strong></strong>.List is populated from an array list <strong></strong>.On selection of each item it show the detail description for that item in a seperate screen populated data from another array list .A single screen is used to display details of all the items.it loads data from  dynamically.</p><p>Can anyone please tell me how can i display all details on same screen using right/left slide gesture.</p><p>Screen with ListView -itemListScreen to display detail -detail listView on next and previous gesture it should dynamic data on screen 2detail list view from arraylist</p>","554770","","","","","2011-11-23 14:08:26","How to show multiple screens with right/left slide Gesture","<android><gesture>","2","0","1","",""
"4544218","1","","","2010-12-28 06:48:44","0","1188","<p>How to make iphone style list in android?</p><p>Especially, dragging on start of the list(or end of the list), isreally hard to implement.</p><p>The listView Samsung Galaxy A Only works like iphone list.</p><p>Is there anyone who know what I should do?</p>","527398","","","","","2010-12-28 08:31:17","how to make iphone style list in android?","<android>","1","3","","",""
"4544232","1","","","2010-12-28 06:52:21","0","674","<p>I am using sqlite in my application.I Check Eclipse DDMS the database is created.How to check wheather the table is created or not in command prompt.pls tell shell command of open database and open table in command prompt..........</p>","533787","","","","","2011-02-09 10:58:24","Which shell command is open android sqlite table in Command prompt","<android>","1","1","","",""
"4544290","1","4544501","","2010-12-28 07:06:24","6","3549","<p>I would like to get some links for getting started with design patterns.My requirement is , (at Initial stage) How to go about developing a particular pattern , say customized ListView which can be shared across applications . </p><p>e.g. Applications will call something like drawCustomizedListView(params...) and my code will draw the listview according to the parameters supplied. This is particularly useful when across the applications I have to draw customized views.</p><p>My intention is,I should not repeat the same code everywhere for doing similar task.</p><p>Any references for the above requirement ?</p>","207646","","","","","2010-12-31 06:08:21","Reference for good Android UI design patterns","<android><android-widget><android-layout>","2","0","2","",""
"4544293","1","","","2010-12-28 07:07:10","2","2898","<p>I have an app with buttons that play various frame-by-frame animations when pressed.  The animations are stored as sequences of .png files.  Some of the animations fill a small area, and they seem to play fine using animationDrawable.  However, some of the animations fill a large part of the screen (even though they are mostly transparent using an alpha channel), and I get an out of memory error when the app loads on my phone (but not the emulator).  I can't play them as video files because they need to overlay the main screen.</p><p>My main question - is there a way to play large png sequence animations (Say 60 frames at 320x480) using animationDrawable?  </p><p>So far in my research there doesn't seem to be any way around the memory limitations... so I have been looking into making my own method that creates an ImageView and populates it with a bitmap, and then successively replaces the bitmap with each frame after a delay.  However, with this technique my animation seems to only play the first and last frames.</p><p>Here is the code of my stab at using animationDrawable - the ""chimp"" plays fine, but when I add the ""bubbles"" (the larger images), the app doesn't load at all - logCat shows: ""ERROR/dalvikvm-heap(3248): 1008000-byte external allocation too large for this process...  ERROR/AndroidRuntime(3248): java.lang.OutOfMemoryError: bitmap size exceeds VM budget""</p><pre><code>public class Babymode_tst extends Activity implements OnClickListener{ /** Called when the activity is first created. */ AnimationDrawable chimpAnimation; AnimationDrawable bubblesAnimation; private MediaPlayer mp; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  setVolumeControlStream(AudioManager.STREAM_MUSIC);  final ImageButton chimpButton = (ImageButton) findViewById(R.id.chimp_button);  chimpButton.setOnClickListener(this);  ImageView chimpImage = (ImageView) findViewById(R.id.chimp_imageview);  chimpImage.setBackgroundResource(R.drawable.chimp_anim);  chimpAnimation = (AnimationDrawable) chimpImage.getBackground();  final ImageButton bubblesButton = (ImageButton) findViewById(R.id.bubbles_button);  bubblesButton.setOnClickListener(this);  ImageView bubblesImage = (ImageView) findViewById(R.id.bubbles_imageview);  bubblesImage.setBackgroundResource(R.drawable.bubbles_anim);  bubblesAnimation = (AnimationDrawable) bubblesImage.getBackground();   } public void onClick(View v) {  if (mp != null) {   mp.release();  }  Random generator = new Random();  int randomIndex;  switch(v.getId()){  case R.id.chimp_button:     randomIndex = (generator.nextInt( 2 ) + 1);    if (randomIndex == 1){    mp = MediaPlayer.create(this, R.raw.chimp_1);    }    if (randomIndex == 2){    mp = MediaPlayer.create(this, R.raw.chimp_2);   }   mp.start();   chimpAnimation.setVisible(true,true);   chimpAnimation.start();   break;  case R.id.bubbles_button:     randomIndex = (generator.nextInt( 3 ) + 1);    if (randomIndex == 1){    mp = MediaPlayer.create(this, R.raw.bubbles_1);    }    if (randomIndex == 2){     mp = MediaPlayer.create(this, R.raw.bubbles_2);   }   if (randomIndex == 3){     mp = MediaPlayer.create(this, R.raw.bubbles_3);   }   mp.start();   bubblesAnimation.setVisible(true,true);   bubblesAnimation.start();   break;  } }}</code></pre><p>And here is my attempt at playing the frames one by one in an ImageView, but it only plays the first and last frames:</p><pre><code>    public void playAnimation(String name){  final ImageView bubblesImageView = (ImageView) findViewById(R.id.bubbles_imageview);  bubblesImageView.setImageResource(R.drawable.bubbles_anim_v5_0003);  mHandler.postDelayed(new Runnable() {   public void run() {    bubblesImageView.setImageResource(R.drawable.bubbles_anim_v5_0015);   }  }, 500);  mHandler.postDelayed(new Runnable() {   public void run() {    bubblesImageView.setImageResource(R.drawable.bubbles_anim_v5_0025);   }  }, 500);  mHandler.postDelayed(new Runnable() {   public void run() {    bubblesImageView.setImageResource(R.drawable.bubbles_anim_v5_0035);   }  }, 500); }</code></pre><p>Any help would be appreciated - thanks</p>","555727","","","","","2012-05-22 17:02:41","Playing large PNG frame animation in android with animationDrawable","<android><animation><png><imageview>","2","0","1","",""
"4544299","1","11951293","","2010-12-28 07:08:10","1","402","<p>In my code i am using VideoView and MediaController for playing my audio/video files. The problem is that I need to place my audio/video files in assets folder but i am not able to play the audio/video files when placed in assets folder and give path as ""file:///android_asset/audio.mp3"". I get this error ""Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported"". But the same code runs when i place my audio/video files in sdcard and give its path(/sdcard/audio.mp3). Does this mean that i cannot play audio/video files when placed in assets folder? Thanks in advance.</p>","544313","","","","","2012-08-14 11:27:35","Problem with Audio/Video","<android>","1","2","","",""
"4544302","1","4545484","","2010-12-28 07:09:00","1","839","<p>I have a login page in my android app. I want to prevent the user after logging in to come back to the login page. Also, when the user reopens the app, if he has logged in before, I want to go directly to the main page without having to go to the login page.</p><p>What the best way of doing that? One idea I thought of is to save the login parameters in a cookie, and then, when the app is reopens, if the cookie contains some login information, I inflate the main page, otherwise, I inflate the login page. Is this the best way of doing it?</p><p>Thanks,</p>","522559","","","","","2013-08-22 20:57:43","Android: prevent user from coming back to login page after logging in","<android><authentication><cookies><login>","2","1","3","",""
"4544316","1","4985020","","2010-12-28 07:11:58","2","2108","<p>I am using a linear layout. That include an progressbar.xml  that show a indicator to user for wait. There are 2 buttons that say ""abc""  and ""xyz"".   When currently ""abc"" button is in pressed state. When the activity start it show progress-bar <strong>(progressbar is in animation by this property android:indeterminate=""true"")</strong>  to user.  User click  ""xyz""  button. I store the reference of progress-bar layout by   findViewById(int id);   And then  INFLATE using LayoutInflater  another   data.xml  form layout.  I remove  mainLinearview.removeAllView();Then add mainLinearview.addView(dataview);And It display other data. Once agin when the user click the ""abc"" button same step are applied to mainLinearview.addView(progressbar).</p><blockquote>  <p><strong>Main problem is this time progressbar is not animating</strong>  Can you please help?  1 more thing I search how to change color of progressbar. But I did not found any thing good. Thanks in advance.</p></blockquote>","486139","","","","","2011-02-13 15:33:53","Why ProgressBar stop animation While Swapping the Layout in Android?","<android><android-widget><android-layout>","3","0","","",""
"4544475","1","4544555","","2010-12-28 07:45:00","2","7808","<p>I need to know the optimal size for the splash screen image. Since different phones support different resoltions, how do I set the size of my splash screen image (PORTRAIT), and how to scale it to fit in different resolutions? Any help is appreciated. Thank you.</p>","527053","","","","","2010-12-28 08:03:03","Android: Help on Optimal Size of the Splash Screen Image","<android><splash-screen>","2","0","1","",""
"4544532","1","","","2010-12-28 07:57:22","2","200","<p>Is there any default function available for alphabetic scrollview in android or we want to implement manually, how can we implement.....Is any other option available in android similar to that?</p>","515616","","515616","","2010-12-28 11:00:35","2011-05-21 18:43:35","alphabetic scrollview in android","<android>","1","0","2","",""
"4544534","1","4544587","","2010-12-28 07:57:34","8","4174","<p><br>I have made two folders, <code>res/layout</code> and <code>res/layout-land</code>   </p><p><strong>The output i got</strong><br>If I start the application in <code>portrait</code> mode, it will always use the xml in <code>layout</code> folder if the application run in <code>portrait</code> mode. And will not use xml in <code>layout-land</code> if i change the device to <code>landscape</code> mode<br>If it start in <code>landscape</code> mode it only use the xml in <code>layout-land</code><br><strong>The xml is not switching when the orientation change</strong>  </p><p><strong>What i expect was</strong><br>It should use the xml in <code>layout</code> folder while it is in portrait mode and use the xml in layout-land while in landscape mode  </p><p>In the Manifest file i have added <code>android:configChanges=""orientation""</code> for the activity and </p><pre><code>&lt;supports-screens         android:resizeable=""true""        android:largeScreens=""true""        android:normalScreens=""true""        android:anyDensity=""true"" /&gt;</code></pre><p>Did i missed any thing here? What changes i need to do here?<br>Thank You</p>","477754","","","","","2013-07-21 19:46:29","The xml is not switching when device orientation change","<android><configuration><android-layout>","4","0","3","",""
"4544567","1","","","2010-12-28 08:01:32","0","401","<p>The fourth task in integrating the LVL with one's application code, as is described by <a href=""http://developer.android.com/guide/publishing/licensing.html"" rel=""nofollow"">http://developer.android.com/guide/publishing/licensing.html</a>, is ""Adding code to check the license in one's application's main Activity"". The document says:</p><blockquote>  <p>Once you've implemented a Policy for  managing access to your application,  the next step is to add a license  check to your application, which  initiates a query to the licensing  server if needed and manages access to  the application based on the license  response. All of the work of adding  the license check and handling the  response takes place in your main  Activity source file.</p></blockquote><p>What happens if the application has no Activity class? In an application consisting only of an Android Service, can we add license check code to a Service source file instead?</p><p>Thanks in advance,</p>","451465","","","","","2011-02-08 04:39:48","Is it possible to add a license check (using License Verification Library) to a Service?","<android><licensing><service>","1","0","","",""
"4544574","1","4545110","","2010-12-28 08:02:22","0","846","<p>i am new at programming and i need some help with that please =/</p><p>web service is already written but not by me. so all i have to do is send xml as document object by post method through web service.</p><p>my code:</p><pre><code>public class send extends application {    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        HttpClient httpclient = new DefaultHttpClient();          HttpPost httppost = new HttpPost(""http://app.local/test/"");        try {            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();              DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();              Document document = documentBuilder.newDocument();              Element rootElement = document.createElement(""packet"");              rootElement.setAttribute(""version"", ""1.2"");              document.appendChild(rootElement);              Element em = document.createElement(""imei"");              em.appendChild(document.createTextNode(""000000000000000""));              rootElement.appendChild(em);              em = document.createElement(""username"");               em.appendChild(document.createTextNode(""5555""));              rootElement.appendChild(em);              HttpResponse response = httpclient.execute(httppost);         } catch (Exception e) {            System.out.println(""XML Pasing Excpetion = "" + e);        }    }</code></pre><p>}</p>","555762","","555762","","2010-12-28 09:37:35","2013-02-10 21:11:07","Android: sending xml as document object, POST method","<java><android>","1","2","","",""
"4544588","1","4544605","","2010-12-28 08:05:30","24","8983","<p>What is the difference between iPhone Simulator and Android emulator? I have heard  people saying that Emulator really emulates the target device which is not true in case of simulator.</p><p>I think Android emulator mimics the processing speed of the target device, the memory usage, but a simulator does not emulate the device.</p>","189006","","106224","","2012-07-15 17:35:56","2012-08-30 20:18:07","Difference between iPhone Simulator and Android Emulator","<android><iphone><android-emulator><ios-simulator>","2","2","10","",""
"4544700","1","4544715","","2010-12-28 08:30:28","0","463","<p>A colleague of mine advice me not to debug android applications instead using Logging in order to see what is going on in application. Is it a common practice? </p>","397991","","","","","2011-06-26 20:48:38","Log instead of debug?","<android>","4","0","","",""
"4544765","1","","","2010-12-28 08:43:02","0","97","<p>i want to use 3-4 tables in a single screen but can't fit them in whole screen beside using ""fill_parent"". it come to only with size of the text in that table only. Can anyone guide me?i used following code.</p><p></p><pre><code>&lt;TableLayout android:orientation=""vertical""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:stretchColumns=""0""                android:id=""@+id/Table1""                &gt;            &lt;TextView android:layout_height=""fill_parent""                         android:id=""@+id/TextView01""                         android:background=""#00bfff""                         android:text=""@string/hello""                         android:layout_width=""fill_parent""&gt;            &lt;/TextView&gt;&lt;/TableLayout&gt;&lt;TableLayout android:orientation=""vertical""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:stretchColumns=""0""                android:layout_below=""@id/Table1""                android:id=""@+id/Table2""                &gt;            &lt;TextView android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        android:id=""@+id/TextView2""                        android:background=""#f4a460""                        android:text=""Text2"" &gt;            &lt;/TextView&gt;&lt;/TableLayout&gt;      &lt;TableLayout android:orientation=""vertical""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:stretchColumns=""0""                android:id=""@+id/Table3""                android:layout_below=""@id/Table1""                android:layout_toRightOf=""@id/Table2""                &gt;            &lt;TextView android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        android:id=""@+id/TextView2""                        android:background=""#b03060""                        android:text=""Text3"" &gt;            &lt;/TextView&gt;&lt;/TableLayout&gt;</code></pre><p></p><p>enter code here</p>","553051","","","","","2010-12-28 09:11:45","how to use different tables in UI which accesses full screen size accordingly?","<android><design-patterns>","1","0","","",""
"4544769","1","4552233","","2010-12-28 08:43:19","4","1001","<p>I am using some custom components in my project for that I am using following code.</p><pre><code> &lt;view  class=""com.android.mypackage.myclass""   id=""@+id/button""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""@android:drawable/button""  android:padding=""10dip""  /&gt;</code></pre><p>Its working perfectly fine, I am using this code near about 35 times in my application. so while creating new clone application from same project, I need to update package name in 35 places. Is there any way to reduce these efforts? I had tried with ""class=""@string/class_name"" but its not working. </p>","555747","","","","","2010-12-29 07:59:30","How to optimize 'class name' in Android XML Layout?","<android><android-layout>","2","0","1","",""
"4544844","1","","","2010-12-28 09:00:48","3","1000","<p>When I'm trying to implement SensorEventListener in my app, I got the following error message repeatedly in the LogCat:</p><pre><code>12-25 17:33:57.210: ERROR/QemuSensors(58): data__poll: len=-1, errno=9: Bad file number</code></pre><p>And this is how I declare the listener inside the activity class:</p><pre><code>private final SensorEventListener mSensorListener = new SensorEventListener() {    public void onSensorChanged(SensorEvent se) {        // do something    }    public void onAccuracyChanged(Sensor sensor, int accuracy) {        // do something    }};</code></pre><p>The strange thing is, the app and the sensor seems to works just fine. Anyone knows how why is this happened and how to fix it?</p><p>Thanks</p>","555792","","","","","2010-12-28 09:00:48","QemuSensors error in the LogCat","<android>","0","3","","",""
"4544888","1","","","2010-12-28 09:08:11","0","563","<p>I am trying to move an arrow image with translate and rotate animation periodically. I have implemented the animation on Imageview. When the animation stops for the first time the imageview stays at the new position but when another animation starts say after 5 seconds the animation should start from the new position but it always starts from the position which has been specified in xml. Do I need to do anything else in order to make sure that animation always starts from new position of imageview?</p>","261566","","","","","2011-02-08 00:32:19","Problem in Rotatation Animation and Translate Animation in Android?","<android><animation><imageview>","2","0","","",""
"4544919","1","4544944","","2010-12-28 09:13:41","7","14472","<p>HI  in my application i have photos videos etc, in the case of image i done the scaling ,but i get out of memory exception in sometimes, how can i handle the out of memory exception efficently.</p>","487219","","","","","2013-09-10 03:05:41","android how to handle out of memory exception","<android>","5","0","5","",""
"4544958","1","","","2010-12-28 09:21:12","0","199","<p>I am developing an application.I have 2 buttons in it back and item.I want to place a list below the buttons.How can i do this in xml file?Can anyone tell me...</p>","475349","","","","","2010-12-28 11:19:41","regarding placing 2 buttons on the left and right side in an xml file in android","<android>","2","2","","",""
"4544965","1","4561621","","2010-12-28 09:22:30","1","1440","<p>I stuck in middle of this situation,Please help me out.</p><p>My question is that I want to send files (Total 11 PDF Files) to android app using web service.</p><p>I tried it with below code.<strong>Main Class from which web service is created</strong></p><pre><code>public class MultipleFilesImpl implements MultipleFiles {public FileData[] sendPDFs() {    FileData fileData = null;    // List&lt;FileData&gt; filesDetails = new ArrayList&lt;FileData&gt;();    File fileFolder = new File(            ""C:/eclipse/workspace/AIPWebService/src/pdfs/"");    // File fileTwo = new File(    // ""C:/eclipse/workspace/AIPWebService/src/simple.pdf"");    File sendFiles[] = fileFolder.listFiles();    // sendFiles[0] = fileOne;    // sendFiles[1] = fileTwo;    DataHandler handler = null;    char[] readLine = null;    byte[] data = null;    int offset = 0;    int numRead = 0;    InputStream stream = null;    FileOutputStream outputStream = null;    FileData[] filesData = null;    try {        System.out.println(""Web Service Called Successfully"");        for (int i = 0; i &lt; sendFiles.length; i++) {            handler = new DataHandler(new FileDataSource(sendFiles[i]));            fileData = new FileData();            data = new byte[(int) sendFiles[i].length()];            stream = handler.getInputStream();            while (offset &lt; data.length                    &amp;&amp; (numRead = stream.read(data, offset, data.length                            - offset)) &gt;= 0) {                offset += numRead;            }            readLine = Base64Coder.encode(data);            offset = 0;            numRead = 0;            System.out.println(""'Reading File............................"");            System.out.println(""\n"");            System.out.println(readLine);            System.out.println(""Data Reading Successful"");            fileData.setFileName(sendFiles[i].getName());            fileData.setFileData(String.valueOf(readLine));            readLine = null;            System.out.println(""Data from bean "" + fileData.getFileData());            outputStream = new FileOutputStream(""D:/""                    + sendFiles[i].getName());            outputStream.write(Base64Coder.decode(fileData.getFileData()));            outputStream.flush();            outputStream.close();            stream.close();            // FileData fileDetails = new FileData();            // fileDetails = fileData;            // filesDetails.add(fileData);            filesData = new FileData[(int) sendFiles[i].length()];        }        // return fileData;    } catch (FileNotFoundException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    } catch (Exception e) {        e.printStackTrace();    }    return filesData;}</code></pre><p>}</p><p>Also The Interface MultipleFiles:-</p><pre><code>public interface MultipleFiles extends Remote {    public FileData[] sendPDFs() throws FileNotFoundException, IOException,            Exception;}</code></pre><p>Here I am sending an <strong>array of bean ""File Data""</strong>,having properties viz. FileData &amp; FileName.FileData- contains file data in encoded.FileName- encoded file name.</p><p>The Bean:- (FileData)</p><pre><code>public class FileData {    private String fileName;    private String fileData;    public String getFileName() {        return fileName;    }    public void setFileName(String fileName) {        this.fileName = fileName;    }    public String getFileData() {        return fileData;    }    public void setFileData(String string) {        this.fileData = string;    }}</code></pre><p>The android DDMS gives out of memory exception when tried below code &amp; when i tried to send two files then only first file is created.</p><pre><code>public class PDFActivity extends Activity {    private final String METHOD_NAME = ""sendPDFs"";    private final String NAMESPACE = ""http://webservice.uks.com/"";    private final String SOAP_ACTION = NAMESPACE + METHOD_NAME;    private final String URL = ""http://192.168.1.123:8080/AIPWebService/services/MultipleFilesImpl"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView textViewOne = (TextView) findViewById(R.id.textViewOne);        try {            SoapObject soapObject = new SoapObject(NAMESPACE, METHOD_NAME);            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(                    SoapEnvelope.VER11);            envelope.setOutputSoapObject(soapObject);            textViewOne.setText(""Web Service Started"");            AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);            httpTransport.call(SOAP_ACTION, envelope);            // SoapObject result = (SoapObject) envelope.getResponse();            Object result = envelope.getResponse();            Log.i(""Result"", result.toString());            // String fileName = result.getProperty(""fileName"").toString();            // String fileData = result.getProperty(""fileData"").toString();            // Log.i(""File Name"", fileName);            // Log.i(""File Data"", fileData);            // File pdfFile = new File(fileName);            // FileOutputStream outputStream =            // openFileOutput(pdfFile.toString(),            // MODE_PRIVATE);            // outputStream.write(Base64Coder.decode(fileData));            Log.i(""File"", ""File Created"");            // textViewTwo.setText(result);            // Object result = envelope.getResponse();            // FileOutputStream outputStream = openFileOutput(name, mode)        } catch (Exception e) {            e.printStackTrace();        }    }}</code></pre><p>Please help with some explanation or changes in my code.Thanks in Advance.   </p>","536148","","536148","","2010-12-29 04:36:56","2012-05-05 08:00:10","Sending the files (At least 11 files) from folder through web service to android app","<android><web-services><android-ksoap2>","1","0","1","",""
"4544967","1","","","2010-12-28 09:23:00","11","2878","<p>How do you get the preferred screen brightness in Android?</p><p>To change the screen brightness I use <a href=""http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#screenBrightness"">WindowManager.LayoutParams.screenBrightness</a>. According to the documentation:</p><blockquote>  <p>This can be used to override the  user's preferred brightness of the  screen. A value of less than 0, the  default, means to use the preferred  screen brightness. 0 to 1 adjusts the  brightness from dark to full bright.</p></blockquote><p>When <code>screenBrightness</code> is less than 0 I would like to start with the preferred screen brightness. How can I get this value?</p>","143378","","","","","2011-11-13 20:02:23","Get preferred screen brightness in Android","<android><preferences><brightness>","2","2","8","",""
"4544972","1","4545042","","2010-12-28 09:23:36","0","1655","<p>I am using LocationManager to get the values of Latitude and Longitude of a user. These values are updated regularly to a database.</p><p>Now, i want to find out the distance between two users basing on the stored Latitude and Longitude values. I want to display a message when distance between two users is less than (say 100 meters). Can anyone please guide me with a tutorial or some sample code of how to achieve it.</p>","303155","","","","","2013-03-13 11:39:13","How to calculate distance using coordinates from LocationManager","<android><gps><android-sdk-2.1><android-sdk-2.2>","2","0","","",""
"4544987","1","","","2010-12-28 09:26:20","0","5056","<p>How to get current screen's brightness in Android code dynamiclly?</p>","443407","","","","","2013-12-16 11:25:58","How to get current screen's brightness in Android code dynamiclly?","<android>","3","1","1","",""
"4545079","1","5440790","","2010-12-28 09:41:32","11","14441","<p>I have been trying to lock the device through program. But I can't find the solution still.I want to lock android froyo2.2 through program. I have tried keyguardmanager and DeviceAdminManager.</p><p>My app is to remote lock the device. When message is received with some code words to lock then it locks the phone. Please guide me. I have found many Api_demo program as solution but I can't extract lock code alone from that and find solution.</p>","554653","","1114055","","2012-06-14 22:31:05","2013-05-14 11:44:06","Lock the android device programatically","<android><android-emulator><locking><device-admin>","4","2","18","",""
"4545127","1","","","2010-12-28 09:52:38","0","342","<p>I like to make an android app which helps the user to share and send data from application to pc. How i can start doing this. Please help</p><p>Regards Mohammed Suhail.</p>","436765","","436765","","2010-12-28 09:59:19","2010-12-28 12:12:07","Data Sharing between android and personal computer","<android>","1","2","","",""
"4545137","1","5066083","","2010-12-28 09:54:30","0","121","<p>I have a game in Android that force closes after resuming from a phone call.I'm guessing I've not implemented som method correctly and I'm guessing it has something to do with savedInstanceState.</p><p>If I should save the state with savedInstanceState what should be stored there, every object and position of that object?</p><p>Or is there something very vital I'm missing?</p>","525016","","","","","2011-02-21 12:42:28","Game force closes after phone call? - Android","<android>","1","2","","",""
"4545159","1","","","2010-12-28 09:58:07","0","503","<p>I know that there is way to receive broadcast intents ACTION_SCREEN_ON at activity or service. But my widget doesn't have any activity or service. Only widget. Is is possible to receive ACTION_SCREEN_ON at my widget? Then how?</p>","555853","","","","","2010-12-28 11:16:38","how can I receive ACTION_SCREEN_ON at my widget?","<android>","1","0","","",""
"4545162","1","4545458","","2010-12-28 09:58:21","0","8858","<p>I am creating login screen with 2 editTexts: etUsername and etPassword.  </p><p>On the etUsername, user should input the username and press Enter to go to the edit text etPassword, then he inputs the password, press Enter to login. Here are my current codes:</p><pre><code>  etUsername.setOnKeyListener(new OnKeyListener() {      @Override   public boolean onKey(View v, int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_ENTER)) {              etPassword.requestFocus();     return true;    } else     return false;   }  });  etPassword.setOnKeyListener(new OnKeyListener() {      @Override   public boolean onKey(View v, int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_ENTER)) {              loginToServer();     return true;    } else     return false;   }  });</code></pre><p>But when I input the username, and then press Enter – the program tries to log in to the server.</p><p>In the debug mode, I saw that when I pressed Enter <strong>once</strong> (on the etUsername) then first: etUsername.onKey() is called and then etPassword.onKey() is also called !  </p><p>Can anyone please tell me, how to implement what I want ?<br>Thank you very much,<br>Son</p>","424721","","","","","2010-12-28 10:49:31","Handle edittexts onKeyListener?","<android>","1","1","0","",""
"4545215","1","4585386","","2010-12-28 10:05:03","0","1085","<p>I developed a android homescreen, the code seems right but when I run the project I get the following error:</p><pre><code>java.lang.RuntimeException:Unable to instantiate activity ComponentInfo{com.matthieu.launcher/com.matthieu.launcher.DragableSpace}:java.lang.InstantiationException: com.matthieu.launcher.DragableSpace</code></pre><p>Here is the complete log: <a href=""http://pastebin.com/iYtYW2W6"" rel=""nofollow"">http://pastebin.com/iYtYW2W6</a></p><p>The code is straight from the Android Launcher.</p><p><strong>DragableSpace</strong>: <a href=""http://pastebin.com/jpWDtFPF"" rel=""nofollow"">http://pastebin.com/jpWDtFPF</a></p><p><strong>MainActivity</strong>:</p><pre><code>public class MainActivity extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        DragableSpace space = new DragableSpace(this.getApplicationContext());        setContentView(space);    }}</code></pre><p><strong>attr.xml</strong> in values folder:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;declare-styleable name=""DragableSpace""&gt;        &lt;attr name=""default_screen"" format=""integer""/&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>Three xml files <strong>initial_screen</strong>, <strong>left_screen</strong> and <strong>right_screen</strong>, all have same code apart from the id:</p><pre><code>&lt;LinearLayout android:id=""@+id/center""    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&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.matthieu.launcher""      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;/application&gt;&lt;/manifest&gt; </code></pre><p>Any ideas how to fix that?</p>","401025","","401025","","2011-01-03 15:09:23","2011-01-04 01:17:18","Android homescreen project, RuntimeException","<java><android><eclipse><android-sdk-2.2><runtimeexception>","3","5","3","",""
"4545315","1","4545787","","2010-12-28 10:22:00","5","4778","<p>i want to create listview in android with following scenario</p><p>Heading Category 1</p><p>item 1item 2item 3</p><p>Heading Category 2</p><p>item 1item 2</p><p>Heading Category 3item 1</p><p>and so on.</p><p>any one guide me how to achieve this?any help would be appreciated.</p>","249991","","","","","2010-12-28 11:45:37","how to create listview with categories/segments?","<android><listview>","3","0","1","",""
"4545343","1","","","2010-12-28 10:27:49","0","519","<p>i am trying to make android (2.3) connection with mysql the code is given below:</p><pre><code>public class ConnectionClass {static String user = ""root"";public static void main() {    String url = ""jdbc:mysql://127.0.0.1:3306/mydatabase"";//  String url = ""jdbc:mysql://10.2.5.69:3306/test"";    try {        Class.forName(""com.mysql.jdbc.Driver"");        ***Connection con = DriverManager.getConnection(url, user, ""mypassword"");***        con.isReadOnly();        System.out.println(""success"");        Statement st = con.createStatement();        ResultSet rs = st.executeQuery(""select * from user"");        while (rs.next()) {            System.out.println(""id"" + rs.getInt(1));            System.out.println(""data"" + rs.getString(2));        }    } catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>}</p><p>but at the line ""Connection con = DriverManager.getConnection(url, user, ""mypassword"")"" i got com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure"" exception. </p>","304961","","","","","2010-12-28 12:15:40","Android database conectivity problem","<android>","2","0","","",""
"4545504","1","4545776","","2010-12-28 10:57:16","2","500","<p>I have a problem with the <code>FlurryAgent.onStartSession()</code> method. It's returns a <code>java.lang.VerifyError</code> when I launch my app. This app is developed using <b>android 2.3</b> and I have a project added into it. This project contains the FlurryAgent.jar. When my app needs to run <code>FlurryAgent.onStartSession()</code> it returns a <code>VerifyError</code>.</p><p>I only have this problem when I launch it using a 1.6 device or emulator.</p><p>Do you have any idea?</p>","495239","","143378","","2010-12-28 11:10:12","2010-12-29 16:00:15","Verify Error launching FlurryAgent","<android><flurry>","1","0","","",""
"4545623","1","","","2010-12-28 11:17:54","2","863","<p>I added a custom view with WindowManager, everything is right.Just one problem : I cannot find where to catch keyevents such as 'BACK' pressed.I caught some of the events in method 'View.dispatchKeyEvent()' in my custom view, but not including 'BACK' or 'HOME'.Any Advice?Thanks a lot!</p><p>My code is just like this:</p><pre><code>// get WindowManagerWindowManager windowManager = (WindowManager) getContext()  .getSystemService(Context.WINDOW_SERVICE);// set LayoutParamsWindowManager.LayoutParams wmparams = new WindowManager.LayoutParams(  WindowManager.LayoutParams.WRAP_CONTENT,  WindowManager.LayoutParams.WRAP_CONTENT);wmparams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;wmparams.format = PixelFormat.TRANSLUCENT;wmparams.windowAnimations = R.style.fade;// add this view to screenwindowManager.addView(this, wmparams);this.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) {  // cannot get 'BACK' pressed event here  return false; }});</code></pre>","555921","","","","","2010-12-28 11:17:54","How to deal with keyevents when added a view with WindowManager?","<android>","0","1","1","",""
"4545643","1","4545758","","2010-12-28 11:21:41","0","404","<p>im trying to increase the size of the picture in an ImageButton without changing the size of the button, is this possible?</p>","486086","","","","","2010-12-28 11:41:45","is it possible to change the thickness of the border around an ImageButton in android?","<android><imagebutton>","1","0","","",""
"4545687","1","","","2010-12-28 11:29:38","0","226","<p>I want to open different classes when I click on the ListView. I have already created the onItemClickListener and in that I am opening the class but I can open only one class instead of being able to open the class associated to the Item in the List.</p><p>There is a parameter called ""int position"" in the OnItemClickLcisterer but I don't know how to use.</p><p>I have so many different Items in my list and I want to Open a particular class from my OnItemClickListener associated to that Item from the List.</p><p>Here I am placing what I am doing in my OnItemClickListener:</p><p>nameOfStates.setOnItemClickListener(new OnItemClickListener()             {                public void onItemClick(AdapterView parent, View view, int position, long id)                 {                    Intent mIntent = new Intent(StateSelection.this, AlaskaZone.class);                    startActivity(mIntent);</p><pre><code>                Intent myIntent = new Intent(StateSelection.this, AlabamaZone.class);                startActivity(myIntent);             }        });</code></pre><p>There is Item(name) Alaska in my listing that is supposed to open the AlaskaZone Class, likewise the Item(name) Alabama from myh listing is supposed to open the AlabamaZone Class.</p><p>How can I do that particularly?</p><p>Can anyone please help me?</p><p>Thanks,david</p>","422859","","","","","2010-12-28 12:26:41","Opening different classes by Intent according to the position from the OnItemClickListener","<android><class><listview><click><item>","2","0","","",""
"4545770","1","","","2010-12-28 11:43:03","0","2035","<p>i'm trying this code found on internet...it should show a toast for OutComing call event using a BroadcastReceiver but on my htc tattoo with Android 1.6 it doesn't works (it don't show any toast)</p><pre><code>public class HFBroadcastOutComingRecevier extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) {     Toast.makeText(context, ""Phone Event"", Toast.LENGTH_SHORT).show();     Bundle bundle = intent.getExtras();     if(null == bundle)           return;     String phonenumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);     String info = ""Detect Calls sample application\nOutgoing number: "" + phonenumber;        Toast.makeText(context, info, Toast.LENGTH_LONG).show(); }}</code></pre><p>Naturally i've registered the BroadcastReceiver on my Manifest as:</p><pre><code>  &lt;receiver android:name="".HFBroadcastIncomingRecevier""&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 with this permissions:</p><pre><code>  &lt;uses-permission android:name=""android.permission.PROCESS_OUTGOING_CALLS""/&gt;</code></pre><p></p><p>Any idea?</p>","314554","","473070","","2010-12-28 12:09:59","2010-12-28 12:35:47","Android: A Toast when OutComing call","<android><call><broadcastreceiver>","1","2","","",""
"4545789","1","4546319","","2010-12-28 11:46:28","0","499","<p>I'm trying to post on facebook wall through my adapted FBConnect (something similar to this <a href=""http://www.mobisoftinfotech.com/blog/android/845/"" rel=""nofollow"">http://www.mobisoftinfotech.com/blog/android/845/</a>) and I'm having a issue with strings that contain """"</p><pre><code>public void postToWall(String message){     Bundle parameters = new Bundle();     parameters.putString(""message"", message);     String attachment;     if (website == null) {      attachment = ""{\""name\"":\""""+ name + ""\"","" +   ""\""description\"":\""""+ description + ""\"""" +          ""}"";     }     else {      attachment = ""{\""name\"":\""""+ name + ""\"","" +       ""\""href\"":\"""" + website + ""\"","" +       ""\""description\"":\""""+ description + ""\"""" +              ""}"";     }     parameters.putString(""attachment"", attachment);</code></pre><p>E.G. if description is 'lorem ipsum' it works quite fine but for instance if description is 'lorem ipsum ""blhe"" bazooka' than it doesn't work.</p><p>I already tried to encode the attachment this way</p><pre><code>parameters.putString(""attachment"", URLEncoder.encode(attachment));</code></pre><p>but I get the same result.EDIT: actually with URLEncoder it doesn't work at all..</p><p>Any ideas on how to solve this?</p><p>Thank you.</p>","508479","","473070","","2010-12-28 11:56:12","2010-12-28 13:13:31","Problem with strings containing "" "" in Stream.Publish, Android, Facebook","<android><facebook>","1","0","","",""
"4545874","1","4546690","","2010-12-28 12:02:05","2","2861","<p>Is there any way to control volume of TTS engine when sending request to TTS engine? Can I able to use AudioManager here?</p><p>Thank You.  </p>","377438","","168868","","2012-01-01 22:00:08","2013-10-28 23:34:14","Android TTS volume control","<android><text-to-speech>","3","0","1","",""
"4545875","1","4545910","","2010-12-28 12:02:41","-1","738","<p>I'm new to Android. I just want to display the selected text from <code>TextView</code> into next activity in Android. How could I do this? Please help me.</p>","555948","","1128737","","2012-01-13 14:48:06","2012-03-30 14:09:40","Displaying the selected text from TextView into next activity","<android>","2","0","","",""
"4545906","1","4546236","","2010-12-28 12:09:36","0","1812","<p>I want to create my own custom controls in Android application and use them in this way:In the XML file:</p><pre><code>&lt;MyButton .... /&gt;</code></pre><p>I would like to define MyButton some where in the resources XML</p>","501560","","452723","","2010-12-28 13:42:37","2010-12-28 13:42:37","Creating customs controls in Android","<android><controls><custom-controls>","1","0","","",""
"4545980","1","","","2010-12-28 12:21:18","0","1632","<p>How can i display two columns in listview that columns data is coming from sqlite database?In that columns first column is TextView and another column is EditView.i have tried below code. But I got the following exception </p><pre><code>unable to start the activity ComponentInfo:java.lang.NullPointerException.</code></pre><p>the code is shown below.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.categorynew);    lv = (ListView)findViewById(android.R.id.list);    getList();}public void getList(){      int x = 0;    cur=db.rawQuery(""SELECT * FROM detaillist ORDER BY symbol"",null);    ArrayList&lt;String&gt; al = new ArrayList&lt;String&gt;();    ArrayList&lt;String&gt; al1 = new ArrayList&lt;String&gt;();    cur.moveToFirst();    while (cur.isAfterLast() == false) {        al.add(cur.getString(cur.getColumnIndex(""symbol"")));        al1.add(cur.getString(cur.getColumnIndex(""position"")));        cur.moveToNext();    }    cur.close();    String[] str = new String[al.size()];    strArray = al.toArray(str);    String[] str1 = new String[al1.size()];    strArray1 = al1.toArray(str1);    lv.setAdapter(new EfficientAdapter(this));} private static class EfficientAdapter extends BaseAdapter {    static class ViewHolder {        TextView text;        EditText text2;    }    private LayoutInflater mInflater;    public EfficientAdapter(Context context) {        mInflater = LayoutInflater.from(context);    }    public int getCount() {        return symbols.size();    }    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(android.R.layout.simple_list_item_1, null);            convertView = mInflater.inflate(R.layout.editcategorylist, null);            holder = new ViewHolder();            holder.text = (TextView) convertView.findViewById(R.id.symbol);            holder.text2 = (EditText) convertView.findViewById(R.id.postion);            convertView.setTag(holder);        } else {            holder = (ViewHolder) convertView.getTag();        }        holder.text.setText(strArray[position]);        Log.e(""text"",holder.text.toString());        holder.text2.setText(strArray1[position]);        Log.e(""text2"",holder.text2.toString());           return convertView;    }}</code></pre>","555958","","104117","","2010-12-28 16:22:03","2010-12-28 16:22:03","how can i display two columns in listview. that columns data is coming from SQLite database","<android><listview><edittext>","1","1","0","",""
"4546009","1","4546031","","2010-12-28 12:25:36","5","3412","<p>If I put simple HTML formatting tags, such as &lt;b&gt;...&lt;/b&gt; into a string resource and display the string in a TextView, the expected formatting is applied. But how can I do this if I build up my own String and display it? If I do something like String str = ""This is &lt;b&gt;bold&lt;/b&gt;"";, the actual tags get displayed -- not the expected bolding.</p><p>Do I have to run the string through some other method to cause the tags to be recognized as tags?</p>","446874","","","","","2011-11-19 16:07:24","HTML tags in string for TextView","<android>","1","1","1","",""
"4546032","1","4546439","","2010-12-28 12:29:04","0","144","<p>Suppose I have a TextView with the text ""Select text in your web browser and click the Spreed"". If I select the first couple of words (""Select text"") and click the OK button, just those two selected words should be displayed in the next activity. How would I go about doing this in Android?</p>","555948","","366234","","2011-03-11 22:40:27","2011-03-11 22:40:27","Display selected Text","<android>","1","0","","",""
"4546127","1","","","2010-12-28 12:44:14","1","118","<p>I am new to Android,so please help me. I have tried separate layout folder(layout-land in which I have created xml file for landscape view having same name as compared to potrait view's xml file ) but it works only when I have hold the phone in landscape(horizontal) but when I hold it in vertical position, it distorted. How to maitain the same size of autocompleteview() irrespective of orientation(i.e. potrait or landscape )?</p>","526443","","526443","","2010-12-29 06:12:10","2010-12-29 06:12:10","how to maitain the same size of autocompleteview() irrespective of orientation(i.e. potrait or landscape )?","<android>","0","2","","",""
"4546201","1","4553318","","2010-12-28 12:55:48","8","13373","<p>I want to save <code>ArrayList&lt;CustomClass&gt;</code>-object to somewhere in Android storage to retrieve quickly and display data in it.</p><p>Is this possible or not? If yes, then which technique will be suitable, SQLite or external storage?</p>","249991","","263525","","2012-09-10 08:50:37","2012-09-10 09:21:44","How to cache/save custom class object in Android?","<java><android>","3","1","13","",""
"4546269","1","","","2010-12-28 13:06:16","0","682","<p>I can't figure out the correct setting for a webview to make it fit width!I've used in my HTML the viewport metatag with device-width option. In webview I've set WideViewPort and LoadWithOverviewMode to true. I've also tried to setInitialScale to 1.0.</p><p>All these seem to work in a few phones with android 1.6, 2.1, 2.2However when I upgraded to 2.2.1 it doesn't work as wanted. I have an horizontal scrolling which I don't want! With a double-tap on the webview it fits, but not automatically when loaded.</p><p>Does anyone have any idea what Google changed in Android 2.2.1 webkit?</p>","469222","","","","","2011-01-05 06:13:00","Webview render issues","<android>","1","0","","",""
"4546486","1","4550723","","2010-12-28 13:41:47","0","1490","<p>I started android programming just 3 weeks back. I want to implement quick search program. I want to create a text field and when I enter text in that and click search, it must display google results for that entered text. How do I do it? Please help me. I am new to programming. appending the query to the URL and stuff is what I read But its bouncing for me.</p>","466590","","","","","2010-12-29 00:48:43","search engine program in android","<android>","3","0","","",""
"4546500","1","4546971","","2010-12-28 13:44:35","2","1107","<p>How can I configure Youtube video player API for my Android applicarion to play Youtube video on video view or Surface view.</p>","554830","","213269","","2010-12-28 15:07:57","2012-04-12 09:56:07","How to play Youtube video in Android application?","<android><youtube-api>","2","0","2","",""
"4546505","1","4547419","","2010-12-28 13:45:21","0","1081","<p>I have one doubt, regarding the header navigation control. So my question is instead of having a normal/default title bar , my app should have a customized header view that should be placed at the parent (Top Position) of my screens and it(header) should have some options to be displayed in a horizontal view and those options should be reacting to the events and my inner view should navigate according to the select events</p><p>Is it possible to bring my thoughts live. Since i have seen this design and functionality in an android application, i am keen to know to do the same. So please let me know the details regarding the same,, if anybody knows.. Any help will be much thankful</p><p>Thanks in Advance...</p>","384193","","","","","2010-12-28 16:11:59","Header Navigation Control in android","<android><navigation><control>","1","2","","",""
"4546612","1","4546759","","2010-12-28 14:03:21","0","572","<p>i have an EditText ,it is located at the bottom of the screen ,when user touch on the edittext virtual keyboard is visible and hide the EditText, found on Motorolla , all other device it's working fine</p><pre><code>            &lt;EditText  android:textSize=""14sp""                android:id=""@+id/Edittext_Report"" android:textColor=""#000000""                android:layout_width=""270dp"" android:layout_height=""150dip""                android:maxLength=""1000"" android:layout_alignParentBottom=""true""                android:layout_alignParentRight=""true"" android:imeOptions=""actionNext""                android:inputType=""textCapSentences|textMultiLine"" /&gt;</code></pre>","487219","","","","","2010-12-28 14:28:39","Android EditText and VirtualKeyboard","<android>","1","1","","",""
"4546628","1","","","2010-12-28 14:06:26","1","2846","<p>Ubuntu Linux 10.04//Eclipse 3.5.2</p><p>I'm new to Eclipse and Android. Eclipse is up and running simple Jave apps OK.  I moved on to downloading the Android SDK starter package, which seemed to go OK.  Ran the SDK manager and downladed Platforms 7,8 &amp; 9.  Installed the ADT package in Eclipse.  </p><p>I've tried to load the SDK path into the Eclipse Preferences, but it won't retain the path.  After restart, Elipse says it can't find SDK package.  Also,one message said that the (revision?) number of the ADT couldn't be found.</p><p>I've reinstalled Eclipse a couple of times, and then gone through the SDK &amp; ADT download procedures a couple of times and am stuck.  Any suggestions will be appreciated.</p><p>Hertfordkc</p><p><strong>Stupid question caused by not thoroughly reading the Android Developers Guide and the tutorials before trying to start a project.  Don't know why I didn't get a message about a missing XML file.</strong></p>","556059","","556059","","2010-12-29 12:50:34","2010-12-29 12:50:34","SDK Platform Tools component missing - Similar to Android Eve below","<android><linux><eclipse>","0","2","","",""
"4546629","1","4546965","","2010-12-28 14:06:27","1","1632","<p>I would like to know how I can start an Activity from a Preference Activity.<br>My Scenario is like :   </p><p>I have an application which display a set of images in a View. It can be GridView, or a Gallery View or a ListView.(The default view will be GridView)  </p><p>On Pressing Menu, i ll get a preference Menu where i have List Preference of views (GridView/GalleryView/ListView).  </p><p>On selecting a Particular View my main Activity's View which displays images should change.<br>I would like to know how i can implement this?  </p><p>I thought of calling my main Activity by an intent which will be invoked on clicking a view in the preference Activity.  </p><p>Is that possible?  </p><p>Thanks,<br>Sen</p>","449378","","","","","2011-11-24 12:03:22","How to call an Activity from a Preference Activity?","<android><preference>","2","1","1","",""
"4546639","1","4546688","","2010-12-28 14:07:48","0","185","<p>How can i get all days of particular month and particular year..</p>","555221","","449693","","2010-12-28 14:18:58","2010-12-28 14:18:58","Android months of Year","<java><android>","1","1","","2012-11-15 15:57:34",""
"4546658","1","23036569","","2010-12-28 14:11:06","2","4741","<p>In my app there a button , and on pressing it the requirement is that an expandable list view should slide out. but the case is that slidingdrawer only moves from bottom to top..</p>","450487","","","","","2014-04-12 21:53:30","Is there a way to implement a top down sliding drawer","<android><slider>","2","1","","",""
"4546848","1","4546882","","2010-12-28 14:43:16","0","1478","<p>From the prevois post, <a href=""http://stackoverflow.com/questions/1827751/android-is-there-a-way-to-make-ellipsizemarquee-always-scroll"">Is there a way to make ellipsize=“marquee” always scroll?</a> I have create a vertical maquee textview. But my question is how can I hold the animation around 5 sec when it moving to a point and than resume and finish the animation.</p><p>For example:</p><pre><code>mAnimation2 = new TranslateAnimation(0f, 0f, 20f, -20f);mAnimation2.setDuration(5000);mAnimation2.setStartOffset(5000); mAnimation2.setRepeatMode(Animation.RESTART);TextView tv = (TextView)findViewById(R.id.text); tv.setAnimation(mAnimation2);</code></pre><p>I have define the above animation and set it to TextView. How can I stop the animation 5 sec when the textview was at coordinate (0,0) and than continues the animation?</p>","409419","","213269","","2010-12-28 14:47:23","2010-12-28 14:49:45","Vertical Maquee TextView","<android><animation>","1","0","","",""
"4546854","1","","","2010-12-28 14:44:44","-1","1774","<p>i want to connect sqlserver 2005 with the android application. i came to know that webservice is required to connect. but i dont know how to create webservice and dont have any idea of creating it. can please anyone help me with the source code or any related articles regarding it. </p><p>hope to hear soon.</p>","556077","","","","","2011-04-09 11:47:50","Regarding connection between sqlserver 2005 and android application","<android><web-services>","2","0","1","",""
"4546872","1","","","2010-12-28 14:47:55","8","15656","<p>Sorry if the question seems a bit silly but i am a complete beginer in android...</p><p>Can someone tell me how i can send a string (ex: ""hi"") to my pc from my android phone (htc desire), in java.</p><p>thanx in advance!</p><p>FlashCreated</p>","556086","","","","","2010-12-28 17:31:00","Send string from android phone to pc over wifi?","<android><string><wifi><send><pc>","2","2","9","",""
"4547055","1","6129473","","2010-12-28 15:16:02","1","539","<p>As per <a href=""http://stackoverflow.com/questions/4542777/android-sdk-not-compiling-apps-correctly"">this</a> question, my app is throwing seemingly random errors. Code that works fine starts to crash whenever I add a significant change (new resource, new code, function call), etc. The activity does not launch at all. The logcat output is telling me that the XML file has an error. Unfortunately, I haven't touched that file. Looking at it closely, it's also telling me something about a color resource not found in an animation XML file. The logcat output is below along with the code:</p><pre><code>E/ActivityThread(   54): Failed to find provider info for android.server.checkinE/AndroidRuntime(  241): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  241): java.lang.RuntimeException: Unable to start activity ComponentInfo{uris.apps.com/uris.apps.com.PlayGame}: android.view.InflateException: Binary XML file line #18: Error inflating class uris.apps.com.ClockTextViewE/AndroidRuntime(  241):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)E/AndroidRuntime(  241):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)E/AndroidRuntime(  241):        at android.app.ActivityThread.access$2200(Activi    tyThread.java:119)E/AndroidRuntime(  241):        at android.app.ActivityThread$H.handleMessage(Ac    tivityThread.java:1863)E/AndroidRuntime(  241):        at android.os.Handler.dispatchMessage(Handler.ja    va:99)E/AndroidRuntime(  241):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  241):        at android.app.ActivityThread.main(ActivityThrea    d.java:4363)E/AndroidRuntime(  241):        at java.lang.reflect.Method.invokeNative(Native     Method)E/AndroidRuntime(  241):        at java.lang.reflect.Method.invoke(Method.java:5    21)E/AndroidRuntime(  241):        at com.android.internal.os.ZygoteInit$MethodAndA    rgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  241):        at com.android.internal.os.ZygoteInit.main(Zygot    eInit.java:618)E/AndroidRuntime(  241):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  241): Caused by: android.view.InflateException: Binary XML fi    le line #18: Error inflating class uris.apps.com.ClockTextViewE/AndroidRuntime(  241):        at android.view.LayoutInflater.createView(Layout    Inflater.java:513)E/AndroidRuntime(  241):        at android.view.LayoutInflater.createViewFromTag    (LayoutInflater.java:565)E/AndroidRuntime(  241):        at android.view.LayoutInflater.rInflate(LayoutIn    flater.java:618)E/AndroidRuntime(  241):        at android.view.LayoutInflater.inflate(LayoutInf    later.java:407)E/AndroidRuntime(  241):        at android.view.LayoutInflater.inflate(LayoutInf    later.java:320)E/AndroidRuntime(  241):        at android.view.LayoutInflater.inflate(LayoutInf    later.java:276)E/AndroidRuntime(  241):        at com.android.internal.policy.impl.PhoneWindow.    setContentView(PhoneWindow.java:198)E/AndroidRuntime(  241):        at android.app.Activity.setContentView(Activity.    java:1622)E/AndroidRuntime(  241):        at uris.apps.com.PlayGame.onCreate(PlayGame.java    :41)E/AndroidRuntime(  241):        at android.app.Instrumentation.callActivityOnCre    ate(Instrumentation.java:1047)E/AndroidRuntime(  241):        at android.app.ActivityThread.performLaunchActiv    ity(ActivityThread.java:2459)E/AndroidRuntime(  241):        ... 11 moreE/AndroidRuntime(  241): Caused by: java.lang.reflect.InvocationTargetExceptionE/AndroidRuntime(  241):        at uris.apps.com.ClockTextView.&lt;init&gt;(ClockTextV    iew.java:29)E/AndroidRuntime(  241):        at java.lang.reflect.Constructor.constructNative    (Native Method)E/AndroidRuntime(  241):        at java.lang.reflect.Constructor.newInstance(Con    structor.java:446)E/AndroidRuntime(  241):        at android.view.LayoutInflater.createView(Layout    Inflater.java:500)E/AndroidRuntime(  241):        ... 21 moreE/AndroidRuntime(  241): Caused by: android.content.res.Resources$NotFoundExcept    ion: File res/anim/score_rotate.xml from color state list resource ID #0x7f04000    0E/AndroidRuntime(  241):        at android.content.res.Resources.loadColorStateL    ist(Resources.java:1813)E/AndroidRuntime(  241):        at android.content.res.Resources.getColor(Resour    ces.java:626)E/AndroidRuntime(  241):        at uris.apps.com.ClockTextView.init(ClockTextVie    w.java:42)E/AndroidRuntime(  241):        ... 25 moreE/AndroidRuntime(  241): Caused by: org.xmlpull.v1.XmlPullParserException: Binar    y XML file line #3: invalid drawable tag setE/AndroidRuntime(  241):        at android.content.res.ColorStateList.createFrom    XmlInner(ColorStateList.java:144)E/AndroidRuntime(  241):        at android.content.res.ColorStateList.createFrom    Xml(ColorStateList.java:127)E/AndroidRuntime(  241):        at android.content.res.Resources.loadColorStateL    ist(Resources.java:1810)E/AndroidRuntime(  241):        ... 27 moreE/gralloc (   54): [unregister] handle 0x4d08b0 still locked (state=40000001)</code></pre><p>The animation resource is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set     xmlns:android=""http://schemas.android.com/apk/res/android""     android:interpolator=""@android:anim/linear_interpolator""    &gt;  &lt;rotate       android:fromDegrees=""-45""       android:toDegrees=""-45""       android:pivotX=""75%""      android:pivotY=""100%""      android:duration=""1""       android:repeatCount=""infinite""      &gt;  &lt;/rotate&gt;&lt;/set&gt;</code></pre><p>The PlayGame class is</p><pre><code>package uris.apps.com;import android.widget.*;import android.widget.AdapterView.*;import android.app.Activity;import android.os.Bundle;import android.view.*;import android.view.View.*;import android.content.*;import android.graphics.PorterDuff.Mode;/* the PlayGame class coordinates: (1) the TreeGenerator (which is * actually the underlying board, I don't know why I called it * TreeGenerator), (2) the GameGridView that displays the pictures, (3) * the progress bar, (4) the running clock. */public class PlayGame extends Activity{    private GameGridView mGameGridView;    private TreeGenerator mTree;    private ImageAdapter mAdapter;    private ClockTextView mRunningClock;    //debug    private TextView mTextView;    // Menu    static final private int RESTART = Menu.FIRST;    static final private int BACK = Menu.FIRST + 1;    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //get settings from OptionsMenu    Intent settings=getIntent();    int difficulty = settings.getIntExtra(""level"",                          TreeGenerator.EASY);    //create progress bar - must be called before setcontentview    requestWindowFeature(Window.FEATURE_PROGRESS);    setContentView(R.layout.play_game);    //Set up TreeGenerator    //difficulty = TreeGenerator.HARD;    mTree = new TreeGenerator(12, difficulty, 3); // no art pieces,                             // difficulty, no                             // of stages    //Set up GridView    mGameGridView = (GameGridView) findViewById(R.id.game_grid_view);    mAdapter = new ImageAdapter(this, mTree);    mGameGridView.setAdapter(mAdapter);    //Set up RunningClock    mRunningClock = (ClockTextView) findViewById(R.id.running_clock);    mRunningClock.initStartTime();    //Call this method when user selects an image     mGameGridView.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent,                     View v,                     int position,                     long id) {            TreeGenerator mTree = PlayGame.this.mTree;            //check answer            boolean result = mTree.checkAnswer(position);            String text = ""Almost!"";            PlayGame.this.mGameGridView.deselect(); //if any            if ( result ) { // if answer correct            text = ""Correct!"";            //update text view            PlayGame.this.mGameGridView.flashGreen(position);            }            else {             PlayGame.this.mGameGridView.flashRed(position);            }            //check if game complete            if ( mTree.gameComplete() ) {            mTree.nextGame();            //PlayGame.this.mRunningClock.stop();            //tally score/calculate scores            //: max_score = no_stages * 1000;            //: ideal_time = 2 * no_stages + 4;            //: f(time,stage) = 1/time * max_score * ideal_time;            float time = PlayGame.this.mRunningClock                .getRunningTime();            float max_score = mTree.getStages() * 1000.0f;            float ideal_time = 2.0f * mTree.getStages() + 4.0f;            Score.time_bonus = (int) (1.0f / time * max_score * ideal_time);            PlayGame.this.mRunningClock.initStartTime();            Intent scoreReport = new                 Intent(                   PlayGame.this,                    uris.apps.com.ScoreReport.class                   );            scoreReport.putExtra(""score"",Score.score);            scoreReport.putExtra(""incorrect"",Score.incorrect_penal);            scoreReport.putExtra(""timebonus"",Score.time_bonus);            scoreReport.putExtra(""noerrorbonus"",Score.error_bonus);            startActivity(scoreReport);            }            //update pictures            PlayGame.this.mGameGridView.updateImages();            //update progress bar            PlayGame.this.updateProgressBar();            if ( MyDebug.playGameDebug ) {            //say if correct or not            Toast.makeText(PlayGame.this,                        text + "" "" + position,                       Toast.LENGTH_SHORT).show();            }        }        });    if ( MyDebug.playGameDebug) {        Toast.makeText(PlayGame.this,                    ""Level: ""+String.valueOf(difficulty),                    Toast.LENGTH_SHORT).show();        mTextView = (TextView) findViewById(R.id.textview);        mTextView.setText(                      mTree.toString()                       //+ ""\n"" + ""Item sel: "" + position                      );    }    //init progress bar    getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 0);    }</code></pre><p>play_game.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;uris.apps.com.GameGridView       android:id=""@+id/game_grid_view""      android:layout_width=""fill_parent""       android:layout_height=""wrap_content""      android:columnWidth=""90dp""      android:numColumns=""auto_fit""      android:verticalSpacing=""10dp""      android:horizontalSpacing=""10dp""      android:stretchMode=""columnWidth""      android:gravity=""center""      /&gt;  &lt;uris.apps.com.ClockTextView      android:id=""@+id/running_clock""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:textColor=""#ffffff""      android:textSize=""50sp""      /&gt;  &lt;!--Debug --&gt;  &lt;TextView      android:id=""@+id/textview""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      /&gt;&lt;/LinearLayout&gt;</code></pre><p>ClockView:</p><pre><code>package uris.apps.com;import android.content.Context;import android.content.res.Resources;import android.graphics.Canvas;import android.graphics.Paint;import android.util.AttributeSet;import android.widget.TextView;import android.os.SystemClock;public class ClockTextView extends TextView {    private Paint textPaintColor;    private long startTime;    private float secs;    public ClockTextView (Context context, AttributeSet ats, int ds) {    super(context, ats, ds);    init();    }    public ClockTextView (Context context) {    super(context);    init();    }    public ClockTextView (Context context, AttributeSet attrs) {    super(context, attrs);    init();    }    public void initStartTime() {    startTime = SystemClock.uptimeMillis();    }    private void init() {    // Get a reference to our resource table.    Resources myResources = getResources();    // Create the paint brushes we will use in the onDraw method.    textPaintColor = new Paint(Paint.ANTI_ALIAS_FLAG);    textPaintColor.setColor(myResources.getColor(R.color.clockTextColor));    textPaintColor.setTextSize( 50 );    startTime = SystemClock.uptimeMillis();    // // Get the paper background color and the margin width.    // paperColor = myResources.getColor(R.color.notepad_paper);    //margin = myResources.getDimension(R.dimen.notepad_margin);    }    public float getRunningTime() {    return secs;    }    @Override    public void onDraw(Canvas canvas) {    //number of milliseconds elapsed    long curTime = SystemClock.uptimeMillis() - startTime;    //convert to seconds    secs = curTime / 1000.0f;    //Round to 1 decimal place    //float p = (float) Math.pow(10,1);    secs = (float) (Math.round(secs*10.0f)/10.0f);    canvas.drawText(String.valueOf(secs), 60, 60, textPaintColor);    // Color as paper    // canvas.drawColor(paperColor);    // // Draw ruled lines    // canvas.drawLine(0, 0, getMeasuredHeight(), 0, linePaint);    // canvas.drawLine(0, getMeasuredHeight(),     //                    getMeasuredWidth(), getMeasuredHeight(),     //                    linePaint);    // // Draw margin    // canvas.drawLine(margin, 0, margin, getMeasuredHeight(), marginPaint);    // // Move the text across from the margin    // canvas.save();    // canvas.translate(margin, 0);    // Use the TextView to render the text.    super.onDraw(canvas);    //canvas.restore();    invalidate();    }}</code></pre><p>and finally the resource that defines the clock color:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;color name=""clockTextColor""&gt;#FFFFFF&lt;/color&gt;&lt;/resources&gt;</code></pre>","555493","","555493","","2010-12-28 15:22:09","2011-05-25 19:03:53","App Ran Fine, Now Breaking for Seemingly Unknown Reasons","<android>","1","2","0","",""
"4547255","1","","","2010-12-28 15:49:40","1","1805","<p>I have a business need to create the NinePatchDrawable objects at runtime, this is, an exterior .png image is received from a server and it has to be applied in a button's background (for example) as a nine patch.</p><p>I have tried to create the NinePatchDrawable object, but the constructor asks me for a ""byte[] chunck"" that describes the patch. The thing is, I have no idea on how to build this chunk from a bitmap that does not have the 9patch information in it.</p><p>Any ideas on this topic? Am I seeing the problem from a wrong perspective?</p>","556133","","29995","","2012-05-05 15:36:58","2012-05-05 15:36:58","Create NinePatch at Runtime","<java><android><runtime><nine-patch>","1","6","","",""
"4547353","1","","","2010-12-28 16:02:43","0","602","<p>Hi:We are developing a web app for Android. We flip the page an it fits smooth, everything works as expected.</p><p>We run tests on web browser on our test terminal (HTC Desire with Android 2.1) and with emulator running android 1.5, 1.6, 2.0, 2.1 and 2.2. Everything works as expected.</p><p>Then, the customer tests on their terminal (Samsung Galaxy S, Android 2.1) and when he flips the phone, it behaves weird, it scales poorly, and all the numbers computed from <code>document.documentElement.clientHeight</code> or <code>document.documentElement.clientWidth</code> behave weird.</p><p>Sometimes it will detect a huge screen so everything will become huge (and text is not readable), other times it will calculate a wrong width (so everything overflows) and is not usable.</p><p>Is there a way to test like in a Galaxy S? Does anybody know what changes do they have?</p>","459303","","","","","2011-01-17 13:48:53","Web works on android emulator but fails on Samsung galaxy S","<javascript><android><galaxy>","1","0","","",""
"4547412","1","4549437","","2010-12-28 16:11:07","0","708","<p>I'm doing a training application that practices a set of multiple-choice questions. I'd like to do a slide animation between two questions - when the user correctly answers one question, it slides away to the left while the new one slides in from right.</p><p>Currently, my question/answer layout looks like this (question.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;        &lt;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""                     android:textColor=""#000000""                    android:textSize=""8pt""                    android:textStyle=""bold""                android:layout_margin=""5px""                    android:layout_marginBottom=""10dp""                    android:clickable=""true""                    /&gt;                &lt;RadioGroup android:id=""@+id/answers""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:orientation=""vertical""                        android:layout_margin=""5px""                        &gt;                        &lt;RadioButton android:id=""@+id/answer_a""                                android:layout_width=""fill_parent""                                android:layout_height=""wrap_content""                                android:textColor=""#000000""                                android:textSize=""7pt""                                android:layout_margin=""5dp""                                android:layout_marginBottom=""10dp""                                /&gt;                        &lt;RadioButton android:id=""@+id/answer_b""                                android:layout_width=""fill_parent""                                android:layout_height=""wrap_content""                                android:textColor=""#000000""                                android:textSize=""7pt""                                android:layout_margin=""5dp""                                android:layout_marginBottom=""10dp""                                /&gt;                        &lt;RadioButton android:id=""@+id/answer_c""                                android:layout_width=""fill_parent""                                android:layout_height=""wrap_content""                                android:textColor=""#000000""                                android:textSize=""7pt""                                android:layout_margin=""5dp""                                android:layout_marginBottom=""10dp""                                /&gt;            &lt;/RadioGroup&gt;        &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>After answering the question and evaluating the answer, I just changed the text of the question and the three answers. Pretty straightforward.</p><p>Now, I've tried using ViewFlipper to do the animations:</p><pre><code>&lt;ViewFlipper android:id=""@+id/flipper""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;include android:id=""@+id/current_view"" layout=""@layout/question"" /&gt;    &lt;include android:id=""@+id/next_view""    layout=""@layout/question"" /&gt;&lt;/ViewFlipper&gt;</code></pre><p>But that way I can't access the views in the current and next question separately via <code>findViewById</code>.</p><p>Do I need to have two same question layouts just with different IDs to do this? it seems redundant to me. Or is there another way to access <em>only</em> the question&amp;answers in the second view?<br>Or is there an easier way to accomplish this?</p><p>Thanks!</p>","523100","","","","","2010-12-28 20:53:45","Correct way to do animations between views of the same type?","<android><animation><viewflipper>","1","0","","",""
"4547413","1","5307342","","2010-12-28 16:11:08","0","533","<p>I have an HTC incredible synced with my OWA.In OWA when I go to Options -> Mobile Devices, I see in the status column some device ID starting with HTCAnd followed by a 8 character hex number.</p><p>None of the API's I used on android gave me this ID. Is this some ID that is encrypted by Active Sync ? How do I co-relate this ID with my device (in case of multiple devices) ?</p>","517940","","","","","2011-03-15 03:51:25","Android ID showing up in Outlook web access","<android><activesync><outlook-web-app>","1","0","","",""
"4547461","1","12715032","","2010-12-28 16:19:16","46","10961","<p>This week I've been learning all about ContentProvider and using the SQLiteOpenHelper class to manage the creation and upgrading of the database inside of a provider.  Specifically, I've been reading through the NotePad example from the sdk's samples directory.  </p><p>Now, I can see that SQLiteOpenHelper has a close() method.  I'm aware that leaving idle databases open is bad practice and can cause memory leaks and whatnot (unless <a href=""http://stackoverflow.com/questions/1379200/android-content-provider-database-leak-issue"">this</a> discussion is headed in the right direction).  If I were using the class in an Activity, then I would simply call close() in the onDestroy() method, but as far as I know, ContentProvider does not have the same life cycle that activities do.  The code for NotePad never seems to call close(), so I would like to assume that it is handled by SQLiteOpenHelper or some other piece of the puzzle, but I'd really like to know for sure.  I don't really trust the sample code that much, either...</p><p>Question summary:  When should we close the database in a provider, if at all?</p>","387781","","135152","","2011-05-25 03:02:43","2012-10-03 18:59:16","Closing the database in a ContentProvider","<android><sqlite><android-contentprovider>","6","2","20","",""
"4547511","1","","","2010-12-28 16:25:59","0","763","<p>i am having a custom list view screen and another activity screen but now i want to display the custom list view screen is on top of the another activity ..</p><p>thanks for help...</p>","556163","","","","","2010-12-28 17:02:33","how can i display a listview on the top of another activity in Android","<android>","1","2","","",""
"4547533","1","","","2010-12-28 16:29:42","0","165","<p>I want to build an application where the user will have to login before using it...All the data will be stored in an SQLi database but instead of having the application talking directly to the database I want it to send the data to a middleware which will deal with the login and all the calculations that i will later need..</p><p>What would be the best/easiest way of implementing something like that?</p><p>I was thinking that a php application could do it but not sure if its the best way...</p><p>I am familiar with php, java servlets and jsp...Not sure on how to get android to work with them though...</p><p>Any help would be really appreciated...</p>","556178","","","","","2010-12-28 20:39:37","Android middleware for login and calculations","<android>","1","0","","",""
"4547551","1","4619539","","2010-12-28 16:32:57","6","2611","<p>I recently acquired a Samsung Galaxy S, Android 2.1 update and after running my app I found that some of the sound effects play twice concurrently. This is odd because the sound effects which exhibit this behaviour seem random - on some instances some will play twice on others they will play once as expected. This bug has not been reported on any other hardware platform for my app. I have only seen one reported incident of this on this site and the person switched to use MediaPlayer however I really want to get a remedy for this.</p><p>When the app is run it initiates the Soundpool as follows,</p><pre><code>public static final int SOUND_EXPLOSION = 1;public static final int SOUND_CLEAR = 2;public static final int SOUND_CLICK = 3;public static final int SOUND_MAGIC = 4;public static final int SOUND_ROCKET = 5;public static final int SOUND_MELT = 6;private SoundPool soundPool;private AudioManager mgr;private HashMap&lt;Integer, Integer&gt; soundPoolMap;private void initSounds(){        soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 100);     soundPoolMap = new HashMap&lt;Integer, Integer&gt;();     soundPoolMap.put(SOUND_EXPLOSION, soundPool.load(getContext(), R.raw.explosion3, 1));     soundPoolMap.put(SOUND_CLEAR, soundPool.load(getContext(), R.raw.pop, 1));     soundPoolMap.put(SOUND_CLICK, soundPool.load(getContext(), R.raw.click, 1));     soundPoolMap.put(SOUND_MAGIC, soundPool.load(getContext(), R.raw.swoosh, 1));     soundPoolMap.put(SOUND_ROCKET, soundPool.load(getContext(), R.raw.rocket, 1));     soundPoolMap.put(SOUND_MELT, soundPool.load(getContext(), R.raw.melt3, 1));     mgr = (AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE); }</code></pre><p>Sound fx are then played by calling the following sub, (PlaySound is a global toggled by the user options)</p><pre><code>public void playSound(int sound){ if (PlaySound == true) {     Log.w(""playSound"",""Playing Sound"" + sound);               float streamVolumeCurrent = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);        float streamVolumeMax = mgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC);            float volume = streamVolumeCurrent / streamVolumeMax;      soundPool.play(soundPoolMap.get(sound), volume, volume, 1, 0, 1f); }} </code></pre><p>As you can see there is a log call which I used to see how many times the sub had been called although this revealed that when the bug occurs the routine is only called once when the sound is heard twice from the device.</p><p>I have also one last sub which is called when the surface view is destroyed to tidy up.</p><pre><code>public void ReleaseSounds(){  if (soundPool != null)  {   soundPool.release();   soundPool = null;  }}</code></pre><p>Has anyone else had this issue, if so how did you resolve it? Any help on this would be greatly appreciated,</p><p>Many thanks in advance</p>","556180","","","","","2011-01-06 20:32:36","Issue with Soundpool and Samsung Galaxy S","<android>","1","1","","",""
"4547556","1","","","2010-12-28 16:33:49","0","855","<p>Is there any android app which uses SMS HTTP API Gateway to send and receive SMS.</p><p>For example if you buy an account in ClickaTell they will provide HTTP API to send &amp; receive SMS.</p><p>I am looking for an application where I can configure the HTTP API and start sending and receiving SMS.</p><p>Any ideas????</p><p>If it is not available in the market I planned to develop one.</p>","556181","","","","","2013-04-05 10:45:47","Android app using HTTP SMS API to send SMS","<android><http><api><sms>","1","0","","",""
"4547689","1","4571793","","2010-12-28 16:49:04","0","123","<p>I am developing a Soundboard application. I use MediaPlayer to Play Ogg sound files. Now when I switch from one sound to another sound, I get a noise similar to the ones heard while switching radio stations. I do not want this noise. How to eliminate it? Any Ideas? Thank You</p>","527053","","","","","2010-12-31 18:47:37","Android: Switching noise in SoundBoard","<android><noise><ogg>","2","0","","",""
"4547758","1","4572954","","2010-12-28 17:00:26","1","570","<p>Imagine that I would like to do an app where users can chat, but visually - they would paint stuff on the screen. The screen would be split in half, and each participant would draw something on their half, and it would appear to the other participant.</p><p>Sketching on the touch screen should be pretty straightforward, also providing user with color/brush selection, eraser, etc. I would need to capture user input into some kind of messages, each of which would describe a sketch action that would need to be replayed on the remote participant.</p><p><strong>But how would these two users communicate?</strong> I'm thinking about JSON+AppEngine+<a href=""http://code.google.com/appengine/docs/python/xmpp/overview.html"" rel=""nofollow"">XMPP</a>. </p><ul><li>I would serialize the sketch actions from <code>client A</code> into JSON and push them onto AppEngine, that would store them. Is this approach - store stuff on server - better than P2P connection? It would possibly add significant lag due to phone A->AppEngine->phone B round-trip</li><li>How would <code>client B</code> retrieve the message? I can't have constant open connection to AppEngine. There is something about push notifications in <a href=""http://stackoverflow.com/questions/2472617/using-xmpp-for-push-user-notifications-on-android-any-way-to-target-these-so-th"">this question</a>. If XMPP doesn't work, would it need to poll the server?</li></ul>","72746","","","","","2011-01-01 02:02:08","How would I share chat/sketches in real time on Android?","<android><google-app-engine><xmpp><chat>","2","2","1","",""
"4547820","1","4548319","","2010-12-28 17:11:08","1","794","<p>I am attempting to create an enhanced <code>Intent</code> class (I call it <code>DataIntent</code>) by giving it the ability to hold a ""payload"" of type Object (versus using it's built-in facility for <code>Uri</code>'s). <code>DataIntent</code> extends Android's <code>Intent</code> class.</p><p>My <code>Activity</code> creates the extended object without any problems and the invocation of the <code>startActivityForResult()</code> goes off without any problems also. But, in my responding <code>Activity</code> when I call the <code>getIntent()</code> method, and attempt to cast it to my <code>DataIntent</code>, I'll throw the <code>ClassCastException</code>.</p><p>I realize this is probably a very dumb question - a 1,000 appologies in advance - but does anyone know why I cannot cast it to the <code>DataIntent</code> since that's what was used to start the new <code>Activity</code>, and <code>DataIntent</code> is a child of <code>Intent</code>?</p><pre><code>DataIntent dataIntent = (DataIntent)getIntent();  // invoked inside the responding Activity instance - throws a ClassCastException</code></pre>","1970896","","432903","","2012-09-08 14:08:16","2013-04-11 14:08:14","Extending the Intent class ... received ClassCastException","<android>","2","2","1","",""
"4547844","1","4547956","","2010-12-28 17:15:24","1","1038","<p>I am working in Spinner.. I am having three spinners and i am going  to display days (i,e) 1,2,3,4,5...30,31 in 1st spinner and months in 2nd spinner (i,e)1,2,3,...11,12 and Year in 3rd spinner 2010,....  What i want is that that i wanna to display current date,month,year in 1st,2nd,3rd spinner resp when the page loads..from that it is possible to select any day,month,YearHere is my code::</p><pre><code>public class NoteEdit extends Activity implements OnItemSelectedListener {private EditText mTitleText;private EditText mBodyText;private Long mRowId;private NotesDbAdapter mDbHelper;private String array_spinner[];private int currentDayOfMonth=0;private int currentDayOfDays=0;private final String[] months = {""1"",""2"",""3"",""4"",""5"",""6"",""7"",""8"",""9"",""10"",""11"",""12""};Spinner s1,s,s2;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mDbHelper = new NotesDbAdapter(this);    mDbHelper.open();    setContentView(R.layout.note_edit);     Calendar cal = Calendar.getInstance();     cal.set(Calendar.MONTH,month);//month starts from 0     cal.set(Calendar.YEAR,year);     int noOfDayInMonthyear = cal.getActualMaximum(Calendar.DAY_OF_MONTH);     Log.v(""noOfDayInMonthyear"",""""+noOfDayInMonthyear);    ArrayList&lt;Integer&gt; obj=new ArrayList();    ArrayList&lt;Integer&gt; obj1=new ArrayList();      for(int i=1;i&lt;=noOfDayInMonthyear;i++){          obj.add(i);       }      Log.v(""Size"",""""+obj.size());      for(int i=2010;i&lt;=2020;i++){          obj1.add(i);       }      Log.v(""Size1"",""""+obj1.size());         s = (Spinner) findViewById(R.id.Spinner01);        ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item,obj);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        s.setAdapter(adapter);        s.setOnItemSelectedListener(NoteEdit.this);         s1 = (Spinner) findViewById(R.id.Spinner02);        ArrayAdapter adapter1 = new ArrayAdapter(this,android.R.layout.simple_spinner_item,months);        adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        s1.setAdapter(adapter1);        s1.setOnItemSelectedListener(NoteEdit.this);     s2 = (Spinner) findViewById(R.id.Spinner03);    ArrayAdapter adapter2 = new ArrayAdapter(this,android.R.layout.simple_spinner_item,obj1);    adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    s2.setAdapter(adapter2);    s2.setOnItemSelectedListener(NoteEdit.this);    s2.setAdapter(adapter2);    mTitleText = (EditText) findViewById(R.id.title);    mBodyText = (EditText) findViewById(R.id.body);    Button confirmButton = (Button) findViewById(R.id.confirm);    mRowId = savedInstanceState != null ? savedInstanceState.getLong(NotesDbAdapter.KEY_ROWID)                                         : null;    if (mRowId == null) {        Bundle extras = getIntent().getExtras();                    mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)                                 : null;    }    populateFields();    confirmButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            setResult(RESULT_OK);            finish();        }    });}public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2,        long arg3) {}public void onNothingSelected(AdapterView&lt;?&gt; arg0) {}</code></pre>","555221","","142162","","2010-12-28 17:18:30","2010-12-28 17:35:30","Android Spinner","<java><android>","1","1","","",""
"4548139","1","4548187","","2010-12-28 17:56:16","1","1787","<p>I'm working on designing a game with multiple levels and was wondering if I was going about it the right way. I have a menu screen with levels to choose from, and each level(button) would start a new activity specifically for that level. Is that a good practice or just terribly inefficient?</p>","507007","","","","","2010-12-28 19:57:01","Android game design","<java><android><design>","2","0","1","",""
"4548184","1","4548363","","2010-12-28 18:01:27","0","487","<p>For my example I am trying to replace ALL cases of ""the"" and ""a"" in a string with a space.Including cases where these words are next to characters such as quotes and other punctuation</p><pre><code>String oldString = ""A test of the exp.""Pattern p = Pattern.compile(""(((\\W|\\A)the(\\W|\\Z))|((\\W|\\A)a(\\W|\\Z)))"",Pattern.CASE_INSENSITIVE);Matcher m = p.matcher(oldString);newString = m.replaceAll("" "");</code></pre><p>""A test of the exp."" returns ""test of exp."" - Yeah!</p><p>""A test of the a exp."" returns ""test of a exp."" - Boooo!</p><p>""The a in this test is a the."" returns ""a in this test is the. - DoubleBoooo!</p><p>Any help would be greatly appreciated.Thanks!</p>","525495","","","","","2010-12-28 18:29:17","Android - Java - Regular Expression question - consecutive words not being matched","<java><android><regex>","3","1","","",""
"4548194","1","","","2010-12-28 18:02:25","0","3714","<p>Ok I'm a newbie at Android programming, have a hard time with the graphics part. Understand the beauty of creating layout in XML file, but lost how to access various elements, especially a View element to draw on it.</p><p>See example of my layout main.xml here;</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/root"" 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""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;  &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/Title"" android:text=""App title""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""   android:textColor=""#000000""   android:background=""#A0A0FF""/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/PaperLayout"" android:layout_width=""fill_parent""   android:layout_height=""0dp"" android:layout_weight=""1""   android:orientation=""horizontal"" android:focusable=""true""&gt;  &lt;View android:id=""@+id/Paper"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;  &lt;Button android:id=""@+id/File"" android:layout_width=""fill_parent""   android:layout_weight=""1"" android:layout_height=""34dp""   android:layout_alignParentTop=""true"" android:layout_centerInParent=""true""   android:clickable=""true"" android:textSize=""10sp"" android:text=""File"" /&gt;  &lt;Button android:id=""@+id/Edit"" android:layout_width=""fill_parent""   android:layout_weight=""1"" android:layout_height=""34dp""   android:clickable=""true"" android:textSize=""10sp"" android:text=""Edit"" /&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>As you can see I have a custom app title bar, then a View filling middle, and finally two buttons in bottom. Catching button events and responding to, for example changing title bar text and changing View background color works fine, but how the heck do I access and more importantly draw on the view defined in main.xml</p><p>UPDATE:Thank you very much for your suggestion, however besides that I need a View, not ImageView and you are missing a parameter on canvas.drawText and an ending bracket, it does not work.</p><p>Now this is most likely because you missed the fact that I am a newbie and assuming I can fill in any blanks.</p><p>Now first of all I do NOT understand why in my main.xml layout file I can create a View or even a SurfaceView element, which is what I need, but according to your solution I don't even specify the View like </p><p>Anyways I edited my main.xml according to your solution, and slimmed it down a bit for simplicity;</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/root"" 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""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;  &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/Title"" android:text=""App title""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""   android:textColor=""#000000""   android:background=""#A0A0FF""/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/PaperLayout"" android:layout_width=""fill_parent""   android:layout_height=""0dp"" android:layout_weight=""1""   android:orientation=""horizontal"" android:focusable=""true""&gt;    &lt;com.example.MyApp.CustomView     android:id=""@+id/Paper""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;    &lt;com.example.colorbook.CustomView/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;  &lt;Button android:id=""@+id/File"" android:layout_width=""fill_parent""   android:layout_weight=""1"" android:layout_height=""34dp""   android:layout_alignParentTop=""true"" android:layout_centerInParent=""true""   android:clickable=""true"" android:textSize=""10sp"" android:text=""File"" /&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>In my main java file, MyApp.java, I added this after OnCreate;</p><pre><code>public class CustomView extends ImageView {  @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        canvas.drawText(""Your Text"", 1, 1, null);    }}</code></pre><p>But I get error on the ""CustomView"" part;""Implicit super constructor ImageView() is undefined for default constructor.Must define an explicit constructor""</p><p>Eclipse suggests 3 quick fixes about adding constructor, but none helps, well it removes error but gives error on app when running.</p><p>I hope somebody can break this down for me and provide a solution, and perhaps explain why I can't just create a View element in my main.xml layout file and draw on it in code.</p><p>UPDATE:Ok I am still trying to use your solution, which is still giving me problems and various errors. But first and foremost I still do NOT understand why I have to create a custom class to use in my layout, when I have to option to even use the wysiwyg layout editor to insert a View element and ""just"" draw on that in my main, well for now only code file. So pleeeeeease someone answer me that one.</p><p>Anyways now I have;</p><pre><code>package com.example.myapp;import com.example.myapp.CustomView;and here comes other import  public class MyApp extends Activity { rest of code including OnCreate</code></pre><p>And i created a new class, new file CustomView.Java, where I directly pasted your code so it looks like;</p><pre><code>package com.example.myapp;public class CustomView extends ImageView {    @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        Paint paint = new Paint();        paint.setARGB(255, 150, 205, 129);        paint.setTextSize(20);        canvas.drawText(""Your Text"", 1, 1, paint);    }}</code></pre><p>Ok so this class code wants me to add imports for ImageView, Canvas, and Paint, which I did, and then again I am back to the error the public class ""CustomView"" part;""Implicit super constructor ImageView() is undefined for default constructor.Must define an explicit constructor"".</p><p>I appreciate you trying to help me, THANKS!</p>","556248","","556248","","2010-12-29 13:40:42","2010-12-29 15:02:17","Android programming - How to acces [to draw on] XML view in main.xml layout, using code","<android><xml><layout><view><drawing>","3","5","0","",""
"4548258","1","4548293","","2010-12-28 18:11:17","0","6286","<p>In my application after the user goes from one activity to another and vice versa. Im calling the activities using Intents on the event ""onClick"".</p><pre><code>public void onClick(DialogInterface dialog, int whichButton) {                    Intent intent = new Intent();                    intent.setClass(Field.this,Boll.class);                    startActivity(intent);                    finish();                }</code></pre><p>After using the application when the back button is pressed then application must end and should go back to the Home screen. </p><p>However what happening in my app is, when the Back button is clicked the activities are still in the stack and are traced back one by one(i.e to their previous state), and finally returns back to the Home Screen.</p><p>I have learned that Android takes care of quitting the application, <a href=""http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon/2034238#2034238"">from here</a></p><p>Please let me know where should i add the <code>finish()</code> in order to finsh all activities in the stack and go back to Home Screen(i.e to end the application).</p>","498338","","","","","2010-12-28 18:16:31","Where should we use finish() to end the application?","<android>","1","0","1","",""
"4548262","1","4548529","","2010-12-28 18:11:47","1","1073","<p>assuming that some opengl-veterans might facepalm now :-)</p><p>I am working on a tilebased game (2D only) on android with open gl es.</p><p>After days of introducing myself into the concepts of opengl basics, I still don't know how to keep the relation between object and screen size.</p><p>To be concrete: My mobile display has 480x800 pixels. When I specify the simple square with its following dimensions, it fills the whole screen (?):</p><p><strong>object-vertices:</strong></p><pre><code>float vertices[] = { -1.0f, -1.0f, 0.0f, // 0, Top Left    1.0f, -1.0f, 0.0f, // 1, Bottom Left    1.0f, 1.0f, 0.0f, // 2, Bottom Right    -1.0f, 1.0f, 0.0f // 3, Top Right};short[] indices = { 0, 1, 2, 2, 3, 0 };</code></pre><p><strong>onSurfaceCreated:</strong></p><pre><code>   public void onSurfaceCreated(GL10 gl, EGLConfig arg1) {gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    gl.glEnable(GL10.GL_BLEND);    gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);    gl.glShadeModel(GL10.GL_FLAT);    gl.glEnable(GL10.GL_TEXTURE_2D);    GLU.gluOrtho2D(gl, 0, Shared.dm.widthPixels, Shared.dm.heightPixels, 0);</code></pre><p><strong>onDrawFrame:</strong></p><pre><code>   @Override    public void onDrawFrame(GL10 gl) {    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    // Replace the current matrix with the identity matrix    gl.glLoadIdentity();    //Move this only    gl.glPushMatrix();    Log.d(Shared.LOGTAG, ""X: "" + offset.x + ""Y: "" + offset.y);    gl.glTranslatef(offset.x, offset.y, 0);    root.draw(gl);    gl.glPopMatrix();    }</code></pre><p>Can anyone give me a hint into the right direction? I assume it has something to do with the matrices?</p>","470517","","44729","","2010-12-28 19:08:07","2010-12-28 19:08:07","square in opengl fills whole display","<android><opengl-es>","2","0","1","",""
"4548352","1","4548499","","2010-12-28 18:24:05","5","1515","<p>I have several activities in my app. I want my activities to have the same menuitem, except one. I was wondering if there is an easy way to put the menuitem in all selected activities instead of copying and pasting the menuitem for each single activity? Basically I want to share the menuitem with selected activities.</p><p>Thanks,</p>","522559","","","","","2010-12-28 18:50:02","Android: display menu across several activities","<android><menu><menuitem>","2","0","1","",""
"4548357","1","","","2010-12-28 18:25:18","2","7760","<p>How to open local .html file in Android and Blackberry emulators? </p><p>I'm able to open any url from internet, but I'm developing a site for mobile on my local PC and I want to run my locally developed HTML files in emulators.</p><p><img src=""http://i.stack.imgur.com/SBMNe.jpg"" alt=""alt text""><img src=""http://i.stack.imgur.com/IutBB.jpg"" alt=""alt text""></p>","84201","","84201","","2010-12-28 18:35:37","2013-05-06 09:26:50","How to open local .html file in Android and Blackberry emulators, for testing?","<android><html><css><mobile-website><blackberry-simulator>","3","0","","",""
"4548359","1","","","2010-12-28 18:25:23","0","577","<p>i have created an app with music buttons.the app is running with no problem in the emulator of eclipse but as i use my samsung galaxy s for emulator i have a force down error as i press any button..this is my logcat when i press a btn:![alt text][1]</p><p>this is my code from 56-86 line</p><pre><code> button.setOnClickListener(new View.OnClickListener() {             public void onClick(View v){               if(mp2.isPlaying()==true||mp3.isPlaying()==true||mp4.isPlaying()==true||mp5.isPlaying()==true||mp6.isPlaying()==true||mp7.isPlaying()==true||mp8.isPlaying()==true||mp9.isPlaying()==true||mp10.isPlaying()==true||mp11.isPlaying()==true||mp12.isPlaying()==true)                       {mp2.stop();                       mp3.stop();mp4.stop();mp5.stop();mp6.stop();mp7.stop();mp8.stop();mp9.stop();mp10.stop();mp11.stop();mp12.stop();                   try {                    mp2.prepare();                    mp3.prepare();                    mp4.prepare();                    mp5.prepare();mp6.prepare();mp7.prepare();mp8.prepare();mp9.prepare();mp10.prepare();                    mp11.prepare();mp12.prepare();                } catch (IllegalStateException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                        mp.start();                        Toast.makeText(a.this, ""Eisai"", Toast.LENGTH_SHORT).show();                       }               else               mp.start();                Toast.makeText(a.this, ""Eisai sto myalo"", Toast.LENGTH_SHORT).show();           }              });         </code></pre>","519526","","519526","","2011-07-03 23:20:27","2011-07-03 23:20:27","Force close error in device but not in emulator","<android><android-emulator>","2","1","","",""
"4548416","1","4555585","","2010-12-28 18:32:22","0","2627","<p>Im trying to send an image from an android client to a python server , I have achieved it before with a python test client and the server. Basically my client app takes a form consisting of users details and an image. Once the user selects the image I get the uri in the onActivityResult method and parse it to a string Like so </p><p><code>selectedImagePath = selectedImageUri.toString();</code></p><p>when the user hits submit button on the form the sending activity is invoked with the form data as extras in an array in a bundle like so.</p><p><code>Bundle b=new Bundle(); b.putStringArray(""regValues"", new String[]{name,email,selectedImagePath});</code></p><p>in  the sending activity I establish a connection with the server and attempt to send the image like so .</p><p>` //establish link with the server</p><pre><code>    try{     //refer to the host computer's loopback interface     host = InetAddress.getByName(""10.0.2.2"");      link = new Socket(host,port);     in = new BufferedReader(new InputStreamReader(link.getInputStream()));     //access the strings that were passed to this activity      Bundle b = this.getIntent().getExtras();     String[] regFormValues = b.getStringArray(""regValues"");     //display connection confirmation     String message = in.readLine();     status.setText(message);        File myFile = new File (regFormValues[2]);        byte [] mybytearray  = new byte [(int)myFile.length()];        FileInputStream fis = new FileInputStream(myFile);        BufferedInputStream bis = new BufferedInputStream(fis);        bis.read(mybytearray,0,mybytearray.length);        OutputStream os = link.getOutputStream();        os.write(mybytearray,0,mybytearray.length);        os.flush();        link.close();    }    catch(IOException e ){     e.printStackTrace();    }    `</code></pre><p>It connects to the server no problem , the server creates a file for output to write the data to as usual but it just appears empty so no data is being recieved. I think it may be a problem with the file path on the client side. Any Ideas ? </p><p>EDIT: Basically I would like to know if I am accessing the image file in the right way or if you have any better suggestions for accessing and sending it.</p>","506892","","506892","","2010-12-30 21:44:14","2010-12-30 21:44:14","Send an image file using sockets , Android to Python","<python><android><sockets><file>","2","1","","",""
"4548449","1","","","2010-12-28 18:36:30","-2","801","<p>This is the first time i am trying this. Can somebody pls share some bit of code which would help me doing this.</p><p>Any help would be appreciated.</p><h2>Initial Attempt</h2><p>hi,</p><p>I am trying to write code that will do client-server comm over https.</p><p>The code snippet(Mostly from different forums) for what i did is as under:</p><p>_FakeX509TrustManager.allowAllSSL();</p><p>The code for allowAllSSL() is</p><p>public static void allowAllSSL() { HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {</p><pre><code>            public boolean verify(String hostname, SSLSession session) {                // TODO Auto-generated method stub                return false;            }    });    SSLContext context = null;    if (trustManagers == null) {            trustManagers = new TrustManager[] { new _FakeX509TrustManager() };    }    try {            context = SSLContext.getInstance(""TLS"");            context.init(null, trustManagers, new SecureRandom());    } catch (NoSuchAlgorithmException e) {            e.printStackTrace();    } catch (KeyManagementException e) {            e.printStackTrace();    }    HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());</code></pre><p>}</p><p>Also in the main activity the code after the above is:</p><p>HttpPost post = new HttpPost(new URI(eText.getText().toString())); post.setEntity(new StringEntity(""test""));</p><pre><code>            KeyStore trustStore = KeyStore.getInstance(""JKS"");            TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());            InputStream trustStoreStream = getBaseContext().getResources().openRawResource(R.raw.mytruststore);            trustStore.load(trustStoreStream, ""test1234"".toCharArray());            trustManagerFactory.init(trustStore);            // Setup keystore            KeyStore keyStore = KeyStore.getInstance(""JKS"");            KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());            InputStream keyStoreStream = getBaseContext().getResources().openRawResource(R.raw.mykeystore);            keyStore.load(keyStoreStream, ""test1234"".toCharArray());            keyManagerFactory.init(keyStore, ""test1234"".toCharArray());            SSLSocketFactory sslf = new SSLSocketFactory(keyStore);            sslf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);            SchemeRegistry schemeRegistry = new SchemeRegistry();            schemeRegistry.register(new Scheme (""https"", sslf, 443));            SingleClientConnManager cm = new            SingleClientConnManager(post.getParams(), schemeRegistry);            HttpClient client = new DefaultHttpClient(cm, post.getParams());            HttpResponse result = client.execute(post); </code></pre><p>I have generated the JKS Keystore and Truststore files and kept it under /res/raw folder in my app.</p><p>The error which i get here is :</p><p>W/System.err( 358): java.security.KeyStoreException: KeyStore JKS implementation not found W/System.err( 358): at java.security.KeyStore.getInstance(KeyStore.java:134) W/System.err( 358): at com.msi.getwebpage.GetWebPage$2.onClick(GetWebPage.java:93) W/System.err( 358): at android.view.View.performClick(View.java:2408) W/System.err( 358): at android.view.View$PerformClick.run(View.java:8816) W/System.err( 358): at android.os.Handler.handleCallback(Handler.java:587) W/System.err( 358): at android.os.Handler.dispatchMessage(Handler.java:92) W/System.err( 358): at android.os.Looper.loop(Looper.java:123) W/System.err( 358): at android.app.ActivityThread.main(ActivityThread.java:4627) W/System.err( 358): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err( 358): at java.lang.reflect.Method.invoke(Method.java:521) W/System.err( 358): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) W/System.err( 358): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) W/System.err( 358): at dalvik.system.NativeStart.main(Native Method)</p><p>Any idea why am i getting this error?</p><p>Also if i am trying to change the KeyStore instance to BKS i am getting the error as:</p><p>W/System.err( 387): java.io.IOException: Wrong version of key store. W/System.err( 387): at org.bouncycastle.jce.provider.JDKKeyStore.engineLoad(JDKKeyStore.java:839) W/System.err( 387): at java.security.KeyStore.load(KeyStore.java:676) W/System.err( 387): at com.msi.getwebpage.GetWebPage$2.onClick(GetWebPage.java:96) W/System.err( 387): at android.view.View.performClick(View.java:2408) W/System.err( 387): at android.view.View$PerformClick.run(View.java:8816) W/System.err( 387): at android.os.Handler.handleCallback(Handler.java:587) W/System.err( 387): at android.os.Handler.dispatchMessage(Handler.java:92) W/System.err( 387): at android.os.Looper.loop(Looper.java:123) W/System.err( 387): at android.app.ActivityThread.main(ActivityThread.java:4627) W/System.err( 387): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err( 387): at java.lang.reflect.Method.invoke(Method.java:521) W/System.err( 387): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) W/System.err( 387): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) W/System.err( 387): at dalvik.system.NativeStart.main(Native Method)</p><p>This is probably because i have kept the jks keystore and truststore files under /res/raw folder in my app.(just a guess).</p><p>Please let me know how can i generate a BKS keystore and truststore file.</p><p>Or is their any other way that i can try to make this code snippet working. Thanks!!</p>","552712","","552712","","2011-01-03 10:04:38","2011-01-19 09:23:12","Client Server communication over https using xml in android","<android><ssl>","1","2","0","",""
"4548467","1","","","2010-12-28 18:39:01","0","332","<p>While connecting USB to the device It is showing the following error without showing the content of USB. It is not reading the content of USB. The media scanner class started and also getting finished but no content is displayed and showing the following error. </p><p>ERROR/NVOMXMetadataRetriever(1161): Error creating metadata extractor for: /mnt/usbdisk/ ERROR/MediaScanner(1161): new omx scannerERROR/MediaScanner(1161): process file: /mnt/usbdisk/</p><p>What is the solution to process all the files with mediasanner class while connecting USB to the device</p>","470169","","","","","2010-12-28 19:30:51","Problem with Mediascanner class of android while connecting USB to device","<android>","1","0","","",""
"4548519","1","4549011","","2010-12-28 18:47:26","2","10566","<p>Greetings,</p><p>I am trying to implement a timer that sends GPS coordinates to my server every 10 seconds.</p><p>Here is the code snippet from the Service I'm implementing:</p><pre><code>@Override    public int onStartCommand(Intent intent, int flags, int startId) {        Timer timer=new Timer();        TimerTask tt=new TimerTask(){            @Override            public void run() {                Location loc=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);                sendCoords(String.valueOf(loc.getLatitude()), String.valueOf(loc.getLongitude()));                Toast.LENGTH_SHORT).show();                Log.i(""EOH"",String.valueOf(loc.getLatitude()));            }        };        timer.schedule(tt,0,10000);        return START_STICKY;    }</code></pre><p>Now the problem is that anything inside run() causes my app to force closed. </p><p>Here is the LogCat dump:</p><blockquote>  <p>12-28 18:44:18.284:  ERROR/AndroidRuntime(6537): FATAL  EXCEPTION: Timer-0 12-28 18:44:18.284:  ERROR/AndroidRuntime(6537):  java.lang.RuntimeException: Can't  create handler inside thread that has  not called Looper.prepare() 12-28  18:44:18.284:  ERROR/AndroidRuntime(6537):     at  android.os.Handler.(Handler.java:121)  12-28 18:44:18.284:  ERROR/AndroidRuntime(6537):     at  prestocab.driver.Background$2.(Background.java:83)  12-28 18:44:18.284:  ERROR/AndroidRuntime(6537):     at  prestocab.driver.Background.sendCoords(Background.java:83)  12-28 18:44:18.284:  ERROR/AndroidRuntime(6537):     at  prestocab.driver.Background$3.run(Background.java:114)  12-28 18:44:18.284:  ERROR/AndroidRuntime(6537):     at  java.util.Timer$TimerImpl.run(Timer.java:289)  12-28 18:44:18.554:  ERROR/WindowManager(1310): return in  removeWindowLocked</p></blockquote><p>Can anyone suggest a fix for this?</p><p>I've tried using the locationManager onLocationChanged() function, but I can't set the interval to 10 seconds. Apparently the time specified is only a guidance and the OS determines what's best. Even when I set the interval to 100 seconds, it gives me the location every second or so. Hence the reason for me using a timer.</p><p>I hope someone can suggest something.</p><p>Thanks in advance,</p>","395974","","","","","2012-10-19 08:27:27","Android: Timer in a Background Service","<android><timer><gps>","3","2","","",""
"4548562","1","4548665","","2010-12-28 18:52:15","0","514","<p>I need to show a ""graphic"" with part of the box colored in. In the box it it will have text, but then I want to be able to put a color on the background to show how high the numbers are.  see the graphic I made in excel. (I guess I am not allowed to upload a picture.  So not sure how to explain this..<br><a href=""http://qa.mark-systems.com:83/Capture2.jpg"" rel=""nofollow"">Click here to see the excel picture</a></p><p>Anyone know how to do this?</p>","528130","","1292730","","2012-05-01 17:25:50","2012-05-01 17:25:50","Android Java how to make single bar graphic","<java><android><graphic>","2","0","1","",""
"4548574","1","4548591","","2010-12-28 18:53:37","0","272","<p>I was looking something similar to this <a href=""http://roshanbh.com.np/examples/exapandable-panel/"" rel=""nofollow"">http://roshanbh.com.np/examples/exapandable-panel/</a> for my android application, ie I want to achieve this expandable div like functionality where if somebody click on a name in my application a sub options can pop out. Similar to the expandable div in the above link. </p><p>Thanks.</p>","443694","","35060","","2010-12-28 18:55:27","2010-12-28 18:56:21","Expandable div like functionality","<android><android-layout>","1","0","1","",""
"4548664","1","4548937","","2010-12-28 19:06:25","0","94","<p>Can someone share an easy example to see how people are overriding methods called during application lifecycle. How to save and restore the data of activities. Thanks.</p>","397991","","","","","2010-12-28 19:44:16","Simple example of Andoroid's state changing","<android>","1","0","","",""
"4548764","1","4549279","","2010-12-28 19:19:49","5","887","<p>Below is a link to the bug I am experiencing with my Android application.  Rather than trying to explain it via a huge wall of text, I figured a simple video would be much more direct and easier to understand.</p><p><a href=""http://www.youtube.com/watch?v=9V3v854894g"">http://www.youtube.com/watch?v=9V3v854894g</a></p><p>I've been beating my head against a wall on this problem for a day and a half now.  I only found that it could be solved by changing the XML layout just recently which makes absolutely no sense to me.  I have no idea how to properly fix it, or a way to band-aid the problem since I need the nested layouts in my application.</p><p>Thank you everyone for all your help!</p><p>Here is the code:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.AdapterView.OnItemSelectedListener;public class Builder extends Activity {    private Spinner mCompSelect;    private Spinner mNameSelect;    private int[] mCompColorAsBuilt;    private int mComponent;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.builder);        mCompColorAsBuilt = new int[3];        //Attach our objects        mCompSelect = (Spinner) findViewById(R.id.component);        mNameSelect = (Spinner) findViewById(R.id.component_name);        //Attach an adapter to the top spinner        ArrayAdapter&lt;CharSequence&gt; a = ArrayAdapter.createFromResource(this, R.array.cc_components, android.R.layout.simple_spinner_item);        a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        mCompSelect.setAdapter(a);        //Create a listener when the top spinner is clicked        mCompSelect.setOnItemSelectedListener(new OnItemSelectedListener() {            public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {                //Save the position                mComponent = position;                //Create a new adapter to attach to the bottom spinner based on the position of the top spinner                int resourceId = Builder.this.getResources().getIdentifier(""component""+Integer.toString(mComponent)+""_color"", ""array"", Builder.this.getPackageName());                      ArrayAdapter&lt;CharSequence&gt; a = ArrayAdapter.createFromResource(Builder.this, resourceId, android.R.layout.simple_spinner_item);                a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                mNameSelect.setAdapter(a);                //Set the position of the bottom spinner to the saved position                mNameSelect.setSelection(mCompColorAsBuilt[mComponent]);            }            public void onNothingSelected(AdapterView&lt;?&gt; parent) {            }        });        //Attach an adapter to the bottom spinner        int resourceId = this.getResources().getIdentifier(""component""+Integer.toString(mComponent)+""_color"", ""array"", this.getPackageName());              ArrayAdapter&lt;CharSequence&gt; b = ArrayAdapter.createFromResource(this, resourceId, android.R.layout.simple_spinner_item);        b.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        mNameSelect.setAdapter(b);        mNameSelect.setOnItemSelectedListener(new OnItemSelectedListener() {            public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {                       //Save the position of the bottom spinner                mCompColorAsBuilt[mComponent] = position;            }            public void onNothingSelected(AdapterView&lt;?&gt; parent) {            }        });    }}</code></pre><p>XML</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;Spinner        android:id=""@+id/component""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@+id/finish""        android:drawSelectorOnTop=""true""        android:prompt=""@string/component_spinner"" /&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_alignParentBottom=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" &gt;        &lt;Spinner            android:id=""@+id/component_name""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:drawSelectorOnTop=""true""            android:prompt=""@string/component_name_spinner"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","432209","","432209","","2010-12-28 19:32:47","2010-12-28 20:32:04","Bug with Android spinner in 2.2 related to layout arrangement","<java><android><layout>","1","0","1","",""
"4548807","1","4617207","","2010-12-28 19:25:01","7","3151","<p>I have an OpenGL ES View in Android thats controlled by a matrix for translation. Im trying to figure out a way to get a hint of momentum scrolling as seen in the google maps app or the iPhone. Thanks.</p>","385051","","","","","2011-01-06 16:53:23","smooth scroll/inertial scrolling/momentum scroll","<iphone><android><opengl-es><matrix-multiplication>","2","0","1","",""
"4548828","1","4550347","","2010-12-28 19:27:21","2","1367","<p>I've got the basic scenario: a test project, in it - one test class, nothing less, nothing more. The code of the test class is this:</p><pre><code>public class SManagerTest extends AndroidTestCase {private SManager sm;public SManagerTest(){    sm = SManager.getInstance(getContext());}@Testpublic void trainTest(){    sm.go();}</code></pre><p>}</p><p>What's wrong? because I get this:</p><pre><code> Test run failed: Test run incomplete. Expected 1 tests, received 0</code></pre><p>Thanks!</p>","481828","","","","","2012-03-21 04:50:25","android: a newby question about Android Unit Testing?","<android><unit-testing>","2","2","","",""
"4548856","1","","","2010-12-28 19:32:32","0","3284","<p>I have a simple locationListener that is using GPS only to start.  Inside OnLocationChanged I do a geocode lookup and display a Toast message.  The problem is once the activity is no longer in front the gps is still receiving updates and processing the Toasto.  I have RemoveUpdates in onStart, onPause, onDestroy and onStop.</p><p>Any idea why I can't get this service to stop?</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mapView = (MapView) findViewById(R.id.mapView);    mc = mapView.getController();    locationListener = new GPSLocationListener();     locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);               locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener);    ......       public void onStart(Bundle savedInstanceState) {    locationManager.removeUpdates(locationListener);    locationManager=null;}public void onPause(Bundle savedInstanceState) {    locationManager.removeUpdates(locationListener);    locationManager=null;}public void onDestroy(Bundle savedInstanceState) {    locationManager.removeUpdates(locationListener);    locationManager=null;}public void onStop(Bundle savedInstanceState) {    locationManager.removeUpdates(locationListener);    locationManager=null;}class GPSLocationListener implements LocationListener {         @Override    public void onLocationChanged(Location location) {        if (location != null) {          current_heading=location.getBearing();          String current_bearing = headingToString2(location.getBearing());          point = new GeoPoint(              (int) (location.getLatitude() * 1E6),               (int) (location.getLongitude() * 1E6));          // add marker          MapOverlay mapOverlay = new MapOverlay();          mapOverlay.setPointToDraw(point);          List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();          listOfOverlays.clear();          listOfOverlays.add(mapOverlay);          mapView.setStreetView(showStreet);          // enable to show Satellite view          mapView.setSatellite(showSatellite);                  // enable to show Traffic on map          mapView.setTraffic(showTraffic);                  mapView.setBuiltInZoomControls(true);          mc.animateTo(point);          mc.setZoom(16);          address = ConvertPointToLocation(point);          Toast.makeText(getBaseContext(), address, Toast.LENGTH_LONG).show();          Toast.makeText(getBaseContext(), address, Toast.LENGTH_LONG).cancel();          }         } </code></pre><p>Here is the LogCat when attempting to go home</p><pre><code>12-28 16:41:51.402: ERROR/LocationMasfClient(577): reverseGeocode(): GLS failed with status 2012-28 16:41:51.423: INFO/NotificationService(577): enqueueToast pkg=com.kuli.example.android511 callback=android.app.ITransientNotification$Stub$Proxy@4375d1f0 duration=112-28 16:41:53.272: DEBUG/LocationMasfClient(577): getAddressFromProtoBuf(): Ignore feature 0,Lyndon Station12-28 16:41:53.282: INFO/NotificationService(577): enqueueToast pkg=com.kuli.example.android511 callback=android.app.ITransientNotification$Stub$Proxy@43711b70 duration=112-28 16:41:55.533: DEBUG/dalvikvm(633): GC freed 715 objects / 92504 bytes in 324ms12-28 16:41:57.883: INFO/ActivityManager(577): Starting activity: Intent { action=android.intent.action.MAIN categories={android.intent.category.HOME} flags=0x10200000 comp={com.android.launcher/com.android.launcher.Launcher} }12-28 16:41:57.932: DEBUG/LocationManager(1191): removeUpdates: listener = com.kuli.example.android511.android511$GPSLocationListener@43762f4012-28 16:41:57.952: DEBUG/AndroidRuntime(1191): Shutting down VM12-28 16:41:57.952: WARN/dalvikvm(1191): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)12-28 16:41:57.966: ERROR/AndroidRuntime(1191): Uncaught handler: thread main exiting due to uncaught exception12-28 16:41:57.972: ERROR/AndroidRuntime(1191): android.app.SuperNotCalledException: Activity {com.kuli.example.android511/com.kuli.example.android511.android511} did not call through to super.onPause()12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2830)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2797)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2780)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.app.ActivityThread.access$2000(ActivityThread.java:112)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.os.Handler.dispatchMessage(Handler.java:99)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.os.Looper.loop(Looper.java:123)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at android.app.ActivityThread.main(ActivityThread.java:3948)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at java.lang.reflect.Method.invokeNative(Native Method)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at java.lang.reflect.Method.invoke(Method.java:521)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)12-28 16:41:57.972: ERROR/AndroidRuntime(1191):     at dalvik.system.NativeStart.main(Native Method)12-28 16:41:57.992: INFO/Process(577): Sending signal. PID: 1191 SIG: 312-28 16:41:57.992: INFO/dalvikvm(1191): threadid=7: reacting to signal 312-28 16:41:58.133: INFO/dalvikvm(1191): Wrote stack trace to '/data/anr/traces.txt'12-28 16:41:58.442: WARN/ActivityManager(577): Activity pause timeout for HistoryRecord{437b5170 {com.kuli.example.android511/com.kuli.example.android511.android511}}12-28 16:43:08.393: DEBUG/dalvikvm(631): GC freed 9811 objects / 553776 bytes in 104ms</code></pre>","556335","","213269","","2010-12-28 22:18:35","2012-03-04 18:07:58","LocationListener with Geocoded Toast not stopping once activity leaves ""OnCreate""","<android><gps><lifecycle><toast><locationlistener>","1","1","","",""
"4548947","1","","","2010-12-28 19:46:11","2","1499","<p>I am working on my own home launcher replacement and it works fine but one thing bothers me. When I press a home key, current home activity (the one defined in manifest as main/defualt/launcher/home) restarts - current activity instance onpause is executed and oncreate is fired again, so new activity is brought up.</p><p>On the other hand, ADW launcher and LauncherPRo does not behave like that - I do not a refresh like in my case. LAuncher Pro even can do several actions:1) if you are on the main screen with app icons, it zooms out to see a snapshot of all screens2) if you open a drawer and press Home, it just go back to the main screen</p><p>Any ideas how to do that?</p><p>I just did a very simple prototype from scratch with just one activity (defined in manifest as main/defualt/launcher/home) and I see the same thing - it gets recreated if I press Home</p>","556358","","","","","2011-06-16 03:05:56","how to prevent custom home launcher app restart activity","<android><home><launcher>","1","0","2","",""
"4549235","1","","","2010-12-28 20:24:45","7","1299","<p>I use a <code>ContentProvider</code> to speak with my application's database and I'm running into a bit of a problem.</p><p>I have a query that is slightly complicated. It looks something like this:</p><pre class=""lang-java prettyprint-override""><code>String sql =    ""select "" +    ""  tblHistory._id _id, "" +    ""  tblHistory.item item, "" +    ""  tblHistory.updated_on updated_on, "" +    ""  (select _id from tblList "" +        ""where tblList.item = tblHistory.item) list_id, "" +    ""  1 priority, "" +    ""from "" +    ""  tblHistory "" +    ""where "" +    ""  tblHistory.status &lt;&gt; 'STATE_DELETING' and "" + selection + "" "" +    ""union "" +    ""select "" +    ""  tblSearch._id _id, "" +    ""  tblSearch.item item, "" +    ""  -1 updated_on, "" +    ""  (select _id from tblList "" +        ""where tblList.item = tblSearch.product_name) list_id, "" +    ""  2 priority, "" +    ""from "" +    ""  tblSearch "" +    ""where "" +    ""  not exists (select * from tblHistory "" +        ""where tblHistory.item = tblSearch.product_name) "" +    ""order by "" +    ""  priority, _id asc"";    c = mDb.rawQuery(sql, null);</code></pre><p>Selection is:</p><pre class=""lang-java prettyprint-override""><code>String where = ""tblHistory.user_id=""               + Integer.toString(intUserId)               + "" and tblHistory.item like '%""               + strSearch + ""%'"";</code></pre><p>My problem is my sub-queries.  I have a constraint I need to add, but no good way of getting that constraint down the pipe to the method.  I need to use the correct user_id on the sub-queries.</p><p>At this point, I think I have 2 options:</p><p>1) Parse out the <code>user_id</code> substring from selection.</p><p>2) Use <code>selectionArgs</code> as a hack to pass <code>""user_id = "" + Integer.toString(intUserId)</code> to the method.</p><p>Any other ideas?</p><p>I should note that while I'd rather not doing anything hack-ish, I have made my <code>ContentProvider</code> private as it is intended to only be used by my application; so if I absolutely have to, I can.</p>","406790","","2642204","","2013-10-06 10:31:10","2014-01-17 15:33:48","Elegant way of doing complex raw queries using a ContentProvider","<android><android-contentprovider>","1","3","1","",""
"4549272","1","4572874","","2010-12-28 20:30:49","0","1485","<p>1) What are good APIs for OCR (optical character recognition) for Chinese characters?</p><p>2) We know many exist for English ones, and some are documented on StackOverflow.</p><p>Which are good ones for web-centric development, though?  In other words, we want to build a service based on JSON and Javascript.  Ideally, we would send imagesto some API and receive a JSON response with all the characters embedded inside the images.</p><p>Are there specific APIs for Android or iOS, if we decide to perform the OCR natively on the device as opposed to through a central server?</p><p>Thanks!</p>","144088","","","","","2011-01-01 01:14:19","Good APIs for optical character recognition Chinese<->English characters?","<iphone><android><ios><html5><ocr>","1","1","","",""
"4549374","1","","","2010-12-28 20:44:13","1","467","<p>I am new to eclipse scala and android but I've been trying to build a scala android application and run it successfully for some time now. I found <a href=""https://github.com/banshee/AndroidProguardScala"" rel=""nofollow"">this</a> plugin that is supposed to allow me to do that but I can't seem to make heads or tails of it.</p><p>I read the readme. I downloaded it. I copied the contents of the bin folder to the dropins folder of my eclipse instalation( which includes the sdk which includes the plugin development tools which were a requirement). I manually added the nature to the project file.</p><p>Now what?</p><p>I still can't reference scala classes from my java android app.</p><p>I guess what I am trying to ask is: How do I know when the thing is installed? and How do I work with it after adding the nature? Do i make an android project add the nature and then reference a scala project to it? Did I add the nature ok in the first place?</p><p>Thanks</p>","242721","","","","","2011-03-31 15:38:47","Installing the scala android eclipse plugin","<java><android><scala>","1","2","","",""
"4549401","1","4731675","","2010-12-28 20:47:15","13","9673","<p>I am integrating AdMob into my app and I wonder how to disable Ads correctly. I want to give the user the ability to disable them. I don't want to get any problems with AdMob because of wrong impressions. Is this way correct or should I consider something?</p><pre><code>AdView ads = (AdView) findViewById(R.id.ad);ads.setEnabled(false);</code></pre>","247002","","","","","2014-04-05 05:14:35","Correctly disable AdMob ads","<android><admob>","5","2","12","",""
"4549623","1","4549646","","2010-12-28 21:21:25","1","432","<p>What are good APIs/services for offering in-app notifications for Android and iOS devices?</p><p>We need to send notifications in real-time.  The notifications need to get sent independent of whether the user has the app open at the time.</p><p>Should we build from scratch or outsource?</p><p>Thanks!</p>","144088","","144088","","2010-12-28 22:54:24","2011-02-10 01:00:24","Messaging APIs for iPhone and Android","<iphone><android><ios><notifications><messaging>","1","2","1","",""
"4549635","1","4549675","","2010-12-28 21:23:26","3","892","<p>I have two receivers that are listening for <code>android.intent.action.BOOT_COMPLETED</code> and <code>android.intent.action.PACKAGE_REPLACED</code>. I was wondering how much battery life they are causing my phone to consume since they cause my app to constantly run now.</p>","408079","","759866","","2013-12-28 10:45:29","2013-12-28 10:45:29","Do android broadcast receivers consume battery life?","<android><broadcastreceiver><power-management>","1","4","0","",""
"4549708","1","4551831","","2010-12-28 21:36:31","0","952","<p>I'd like to declare an asynchronous service API in AIDL using ResultReceiver instead of creating my own callback interface.</p><p>But when I try to import android.os.ResultReceiver, it doesn't know that ResultReceiver is parcelable.  Is there a trick?</p><p>Example:</p><pre><code>import android.os.ResultReceiver;interface IPrimeService {    int computePrimes(in int number, in ResultReceiver resultReceiver);}</code></pre><p>Results in (Android 2.2):</p><pre><code>IPrimeService.aidl:3: couldn't find import for class android.os.ResultReceiver</code></pre><p>It seems if I create ResultReceiver.aidl in src/android/os within my project like:</p><pre><code>package android.os;parcelable ResultReceiver;</code></pre><p>it works, but that seems like such a hack. Is there a better way?</p><p>Thanks, Eric</p>","436820","","","","","2010-12-29 06:02:11","How to use ResultReceiver in AIDL","<android><aidl>","1","0","","",""
"4549726","1","4549785","","2010-12-28 21:39:23","0","329","<p>I'm developing an android app that has a bunch of screens (activities) that are supposed to have ""continue"" and ""back"" buttons at the top.  Can you tell me the right pattern for implementing this?  I've seen some iPhone apps that have this but Android apps usually don't (I think partly because the back button is part of the phone).  </p><p>I found a post online about an Activity class that has ""sub activities"" which kind of seems like what I want to do, but I'm wondering if there's a simpler solution or pattern for creating flows like this (in which several activities are linked with continue/back buttons).</p>","372528","","","","","2010-12-29 05:57:39","Android pattern for activity ""flows""","<java><android>","3","1","","",""
"4549746","1","4557852","","2010-12-28 21:42:37","8","10012","<p>I am trying to create a ListPreference but somehow disable one of the items. Sort of like gray it out or something and not have the ability to choose it. It will be an upcoming feature and I want it to be in the list just not selectable.</p><p>I have created a custom ListPreference class and in that class a custom adapter, hoping to use the adapter to create what I want.</p><p>The code works, and it sets the adapter, but none of the adapter functions get called. I set breakpoints on the methods, such as getCount() but they never get called.</p><p>Here's my code. Custom ListPreference taken from <a href=""http://blog.350nice.com/wp/archives/240"" rel=""nofollow"">http://blog.350nice.com/wp/archives/240</a></p><pre><code>import android.content.Context;import android.content.DialogInterface;import android.graphics.Color;import android.preference.ListPreference;import android.util.AttributeSet;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.app.AlertDialog.Builder;public class CustomListPreference extends ListPreference {    private boolean[] mClickedDialogEntryIndices;    CustomListPreferenceAdapter customListPreferenceAdapter = null;    Context mContext;    public CustomListPreference(Context context, AttributeSet attrs) {        super(context, attrs);        mContext = context;        mClickedDialogEntryIndices = new boolean[getEntries().length];    }    @Override    protected void onPrepareDialogBuilder(Builder builder) {        CharSequence[] entries = getEntries();        CharSequence[] entryValues = getEntryValues();        if (entries == null || entryValues == null                || entries.length != entryValues.length) {            throw new IllegalStateException(                    ""ListPreference requires an entries array ""                    +""and an entryValues array which are both the same length"");        }        builder.setMultiChoiceItems(entries, mClickedDialogEntryIndices,                new DialogInterface.OnMultiChoiceClickListener() {                    public void onClick(DialogInterface dialog, int which,                            boolean val) {                        mClickedDialogEntryIndices[which] = val;                    }                });        // setting my custom list adapter        customListPreferenceAdapter = new CustomListPreferenceAdapter(mContext);        builder.setAdapter(customListPreferenceAdapter, null);    }    private class CustomListPreferenceAdapter extends BaseAdapter {        public CustomListPreferenceAdapter(Context context) {}        public int getCount() {            return 1;        }        public Object getItem(int position) {            return position;        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            convertView.setBackgroundColor(Color.BLUE);            return convertView;        }    }}</code></pre>","548949","","281545","","2013-03-30 17:02:41","2013-11-24 12:25:58","custom row in a listPreference?","<android><listadapter><listpreference>","7","3","13","",""
"4549768","1","","","2010-12-28 21:46:33","1","887","<p>I have a two column, three row GridView that I would like to have fill the available screen space provided by the surrounding layouts. By setting the layout_height and layout_width to ""fill_parent"" and the background color to red I can see that the GridView is in fact filling the space -- but the content is not. </p><p>When there is extra space, I'd like the GridView to have more verticalSpacing or horizontalSpacing to ""fill up"" the screen. I don't see an available setting to do that though.</p><p>There has to be an elegant way to do this, but I've yet to find it =\</p>","497400","","","","","2010-12-28 21:46:33","Causing a 3 row GridView to fill the available vertical space?","<android><gridview>","0","2","","",""
"4549854","1","","","2010-12-28 21:57:39","0","1227","<p>I'm working with a custom layout to modify the functionality of HorizontalScrollView for my purposes, but I'm having problems getting that view working, even in a bare minimum test app.</p><p>I've went through a little tutorial on making custom layouts, and it seems like I can get it added in, but when I try to add anything as a child of that view I'm given the error ""IllegalStateException: HorizontalScrollView can host only one direct child"".  It does this regardless if the child is another layout, or even just a single button.</p><p>I'm sure there's a simple reason for this, I just can't find it.  If you have any idea what the issue might be you would be my hero to point me in the right direction.  Thank you in advance!</p>","556485","","650492","","2012-02-23 13:06:02","2012-02-23 13:06:02","Android - HorizontalScrollView cannot contain anything","<android><exception><horizontalscrollview>","1","2","","",""
"4549919","1","4590601","","2010-12-28 22:07:51","2","693","<p>So, basically, I have a ScrollView with lots of various ViewGroups and Views added inside it and my Activity should respond to clicks on those Views. Unfortunately, OnClickListeners I set to them slows down ScrollViews reaction time to faster scroll or fling gestures (when they start on Views in question). </p><p>Is there any way to do this right or workaround this issue?</p>","90571","","65977","","2011-01-08 02:29:14","2011-01-09 22:12:30","Views with attached OnClickListeners slows down ScrollView. What can be done?","<android><user-interface><scrollview>","4","4","2","",""
"4550011","1","4550160","","2010-12-28 22:22:41","0","415","<p>I am a beginner to android programming. So I am sorry if some of you find this trivial.I want to implement a functionality where a button is not separate from edittext.That is they have no physical distinction. </p><hr><p>|          aa | |          aa |</p><hr><p>In place of the a's there is the button. How do I implement this?</p>","556167","","","","","2010-12-28 22:50:42","android user interface, integrating button and edit text","<android><user-interface><button><edittext>","1","2","","",""
"4550068","1","","","2010-12-28 22:32:39","0","117","<p>I created the Hello World android application, which is automatically created by the ADT plugin for eclipse. I noticed that when I reorient in the emulator, the hello world application properly automatically reorients from portrait to landscape, but not the other way. How do I fix this?</p>","556512","","","","","2010-12-28 22:51:28","Android Hello World orients from portrait to landscape but not visa versa","<android>","1","0","","",""
"4550081","1","4550120","","2010-12-28 22:35:26","3","348","<p>I'm parsing an RSS feed using SAX</p><pre><code>messages = parser.parse();List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());for (Message msg : messages){    titles.add(msg.getTitle() + ""\n"" +msg.getDate() + ""\n\n"" + msg.getDescription()); }ArrayAdapter&lt;String&gt; adapter =                 new ArrayAdapter&lt;String&gt;(this, R.layout.row,titles);this.setListAdapter(adapter);</code></pre><p>This creates a nice list with the entire post included, but I'd like to just show the title and date in the list.</p><p>Here's my onListItemClick right now</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        String selection = l.getItemAtPosition(position).toString();        Dialog dialog = new Dialog(this);            dialog.setContentView(R.layout.single);            dialog.setTitle(""Blog"");            dialog.setCancelable(true);            TextView text = (TextView) dialog.findViewById(R.id.SinglePost);            text.setText(selection);            dialog.show();    }</code></pre><p>but this just pops-up whatever is in the list.</p><p>Is there a way to pass the description to the list, without it showing, so when they click the list item, the dialog just has the description?Thanks!</p>","556505","","","","","2010-12-28 22:43:06","Android - pass extra information to a ListView without it being displayed, for an RSS reader?","<android>","1","0","","",""
"4550108","1","4550381","","2010-12-28 22:40:45","0","161","<p>I use a ListView for text-items in my APP. But I have one problem: if a put a text with numbers, the numbers are convert to a link to show the phone dial screen. Can I disable this? </p>","512870","","241590","","2010-12-29 01:17:52","2010-12-29 01:17:52","Phone number in listview","<java><android>","2","1","","",""
"4550170","1","5955948","","2010-12-28 22:52:25","3","1516","<p>I've been recently exploring the device administration APIs, and i've found that neither my code, nor the sample code on the android developing website have been able to enable the device administration.</p><p>The error i get on launching is:</p><pre><code>12-28 17:24:49.596: WARN/PackageManager(60): Not granting permission android.permission.BIND_DEVICE_ADMIN to package com.example (protectionLevel=2 flags=0x8446)</code></pre><p>and then this when i try to enable the administrator:</p><pre><code>12-28 17:27:22.426: WARN/DeviceAdminAdd(396): Unable to retrieve device policy ComponentInfo{com.example/com.example.Receiver}org.xmlpull.v1.XmlPullParserException: No android.app.device_admin meta-data</code></pre><p>I set all the permissions exactly the same as per the requirements for the manifest:</p><pre><code>    &lt;activity android:name="".MyActivity""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;receiver android:name="".Receiver""              android:label=""device_admin""              android:permission=""android.permission.BIND_DEVICE_ADMIN""/&gt;              &lt;meta-data android:name=""android.app.device_admin""                         android:resource=""@xml/device_admin""  /&gt;              &lt;intent-filter&gt;                    &lt;action android:name=""android.app.action.DEVICE_ADMIN_ENABLED""/&gt;              &lt;/intent-filter&gt;</code></pre><p>and the device policies are also set exactly as per the requirements stated by the APIs.</p><pre><code>&lt;device-admin xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;uses-policies&gt;        &lt;limit-password /&gt;        &lt;watch-login /&gt;        &lt;reset-password /&gt;        &lt;force-lock /&gt;        &lt;wipe-data /&gt;    &lt;/uses-policies&gt;</code></pre><p>Did i make a mistake in getting the permission or is device administration not available without extra code signing?    </p>","556562","","19750","","2011-06-22 03:34:09","2011-06-22 03:34:09","Android ""Not granting permission"" error","<android><android-manifest><device-admin>","2","1","","",""
"4550239","1","4898676","","2010-12-28 22:32:36","14","2654","<p>There is a specific and official analytics SDK for native Android apps (note that I'm not talking about webpages in apps on a phone). This library basically sends pages and events to Google Analytics and you can view your analytics in exactly the same dashboard as for websites. Since my background is apps rather than websites, and since a lot of the Google Analytics terminology seems particularly inapplicable to a native app, I need some pointers. Please discuss my remarks, provide some clarification where you think I'm off-track, and above all share good experiences!</p><h2>1. Page Views</h2><p>Pages mostly can match different Activities (and Dialogs) being displayed.  Activities can be visible behind non-full-screen Activities however, though only the top-level Activity can be interacted. This sort-off clashes with a ""(page) view"". <strong>update -></strong> Read <a href=""http://android-developers.blogspot.com/2010/12/analytics-for-android-apps.html"">http://android-developers.blogspot.com/2010/12/analytics-for-android-apps.html</a> and accept it.</p><p>You'd also want at least one page view for each visit and therefore put one page view tracker in the Application class. However this does not constitute a window or sorts. Usually an Activity will open at the same time, so the time spent on that page will have been 0. This will influence your ""time spent"" statistics. How are these counted anyway?</p><p>Moreover, there is a loose coupling between the Activities, by means of Intents. A user can, much like on any website, step in at any Activity, although usually this then concerns resuming the application where he left off. This makes that the hierarchy of Activities usually is very flat. And since there are no url's involved. What meaning would using slashes in page titles have, such as ""/Home""? All pages would appear on an equal level in the reports, so no content drilldown.</p><p>Non-unique page views seem to be counted as some kind of indicator of successfulness: how often does the visitor revisit the page. When the user rotates the screen however usually an Activity is recreated, thus making it a new page view. This happens a lot. Maybe a well-thought-through placement of the call might solve this, or placing several, I'm not sure.</p><p>How to deal with Page Views?</p><h2>2. Events</h2><p>I'd say there are two sorts:</p><ul><li>A user event</li><li>Something that happened, usually as an indirect consequence of the above.</li></ul><p>The latter particularly is giving me headaches. First of all, many events aren't written in code any more, but pieced logically together by means of Intents. This means that there is no place to put the analytics call. You'd either have to give up this advantage and start doing it the old-fashioned way in favor of good analytics, or, just be missing some events.</p><p>Secondly, as a developer you're not so much interested in when a user clicks a button, but if the action that should have been performed really was performed and what the result was. There seems to be no clear way to get resulting data into Google Analytics (what's up with the integers? I want to put in Strings!).</p><p>The same that applies to the flat pages hierarchy, also goes for the event categories. You could do ""vertical"" categories (topically, that is), but some code is shared ""horizontally"" and the tracking will be equally shared. Just as with the Intents mechanism, inheritance makes it hard for you to put the tracking in the right places at all times. And I can't really imagine ""horizontal"" categories. Unless you start making really small categories, such as all the items form the same menu in one category, I have a hard time grasping the concept.</p><p>Finally, how do you deal with cancelling? Usually you both have an explicit cancel mechanism by ways of a button, as well as the implicit cancel when the ""back""-button is pressed to leave the activity and there were no changes. The latter also applies to ""saves"", when the back button is pressed and there ARE changes. How are you consequently going to catch all these if not by doing all the ""back""-button work yourself?</p><p>How to deal with events?</p><h2>3. Goals</h2><p>For goal types I have choice of: URL Destination, Time on Site, and Pages/Visit. Most apps don't have a funnel that leads the user to some ""registration done"" or ""order placed"" page. Apps have either already been bought (in which case you want to stimulate the user to love your app, so that he might bring on new buyers) or are paid for by in-app ads. So URL Destination is not a very important goal.</p><p>Time on Site also seems troublesome. First, I have some doubt on how this would be measured. Second, I don't necessarily want my user to spend a lot of time in my already paid app, just be active and content. Equivalently, why not mention how frequent a user uses your app?</p><p>Regarding Pages/Visit I already mentioned how screen orientation changes blow up the page view numbers.</p><p>In an app I'd be most interested in events/visit to measure the user's involvement/activity. If he's intensively using the app then he must be loving it right? </p><p>Furthermore, I also have some small funnels (that do not lead to conversion though) that I want to see streamlined. In my mind those funnels would end in events rather than page views but that seems not to be possible.</p><p>I could also measure clickthroughs on in-app ads, but then I'd need to track those as Page Views rather than Events, in view of ""URL Destination"".</p><p>What are smart goals for apps and how can you fit them on top of Analytics?</p><h2>4. Optimisation</h2><p>Is there a smart way to manually do what ""Website Optimiser"" does for websites? Most importantly, how would I track different landing page designs? <strong>update -></strong> Seems I could use the Custom Variables for that. More details are still welcome.</p><h2>5. Traffic Sources</h2><p>Referrals deal with installation time referrals, if you're smart enough to get them included. But perhaps I'd also want to get some data which third-party app sends users to my app to perform some actions (this app interoperability is possible via Intents). </p><p>Many of the terminologies related to ""Traffic Sources"" seem totally meaningless and there is no possibility of connecting in AdSense.</p><p>What are smart uses of this data?</p><h2>6. Visitors</h2><p>Of the ""Browser capabilities"", ""Network Properties"" and ""Mobile"" tabs, many things are pointless as they have no influence on / relation with my mostly offline app that won't use flash anyway. Only if you drill down far enough, can you get to OS versions, which do matter a lot. I even forgot where you could check what exact Android devices visited.</p><p>What are smart uses of this data? How can you make the relevant info more prominent?</p><h2>7. Other</h2><p>No in-page analytics. I have to register my app as a web-url (What!?)? </p>","458813","pjv","458813","","2010-12-29 04:06:20","2013-01-31 22:17:56","Google Analytics on Android","<android><mobile><google-analytics><adsense>","3","5","12","",""
"4550335","1","","","2010-12-28 23:22:01","5","15437","<p>Does anyone know if there are any specifics on writing info into a RFID tag and reading it from Android, Nexus S? </p><p>Is there special RFID tag just for Android, or a special RFID writer? </p>","556486","","327466","","2012-11-30 18:50:04","2013-02-06 06:28:17","How TO write RFID Tag for Nexus S NFC to read?","<android><rfid><nfc><nexus-s>","6","0","6","",""
"4550349","1","4550384","","2010-12-28 23:25:02","0","432","<p>I have developed a <em>free</em> Android app and placed in on the market. I have fully tested the app on one device (LG Ally) and tested it with the whole range of emulators. I am getting reports of crashes on some 2.2 devices. The people reporting the crashes are not being at all helpful. I am looking for some expert help here.</p><p>The application and a description of the problems can be found at:</p><p><a href=""http://laughton.com/basic/versions/v00.03/index.html"" rel=""nofollow"">BASIC! v00.03</a></p><p>If having access to the source would help, send me an email.</p><p>Any help that could be provided would be greatly appreciated.</p>","496890","","","","","2010-12-28 23:32:55","My Android App Crashes","<android><debugging>","1","2","","",""
"4550394","1","","","2010-12-28 23:35:46","0","1206","<p>I am using Eclipse to write an Android app. I want my app to display a background image which is stretched to the size of the screen.</p><p>I have written the following code, but in the emulator it immediately exited the app when I ran it. Could someone please help me to understand the problem...</p><p>Here is my code...</p><pre><code>public class Roller extends Activity {    Display display = getWindowManager().getDefaultDisplay();     int dwidth = display.getWidth();    int dheight = display.getHeight();    Bitmap background1 = BitmapFactory.decodeResource(getResources(),R.drawable.sunnybackground);    Bitmap BSunny = Bitmap.createScaledBitmap(background1,dwidth,dheight,true);    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(new Panel(this));    }    class Panel extends View {        public Panel(Context context) {            super(context);        }        public void onDraw(Canvas canvas) {            canvas.drawBitmap(BSunny, 0, 0, null);        }    }}</code></pre>","556186","","1268895","","2012-04-19 23:07:45","2013-02-07 00:56:12","How to fit a background image to the screen of an Android device","<java><android><image><background>","3","3","","",""
"4550414","1","","","2010-12-28 23:41:04","1","1068","<p>i wanted to draw a rectangle in android, but not just by specifying the left, top, right and bottom. what I have are 4 vetex coordinates . The rectangle is not horizontal but oblique, so something like the image of rectangle at below link:</p><p><a href=""http://people.missouristate.edu/lesreid/POW10.html"" rel=""nofollow"">http://people.missouristate.edu/lesreid/POW10.html</a></p><p>I've been trying to see if I can use a matrix to perform some kind of rotation  or use canvas.rotate(), but I'm still not clear how to do it. Can somebody help me with how to draw such a rectangle?</p>","556555","","","","","2013-12-14 19:31:53","drawing oblique rectangle in android","<android><matrix><rotation><drawable>","2","0","1","",""
"4550471","1","4550611","","2010-12-28 23:57:31","1","860","<p>I want to do the following:After visiting several activities, a user logs out from the app and is redirected to the login page.The problem is, I want the user to not be able to go to the previous activities upon logout. the method finish() seems to work but it only destroys the method from where the user logged out.</p><p>Any ideas on the issue?Thanks.</p>","522559","","","","","2010-12-29 00:24:57","Android: clear activity history on logout","<android><activity>","1","0","0","",""
"4550515","1","","","2010-12-29 00:07:34","2","307","<p>Folks,</p><p>As a start, I would like to develop a Java application that will act as a guitar tuner. The application should listen to what I play on the guitar and tell me the notes I played. I am wondering what level of support is provided by Android SDK. Do I need any other open source library? Any pointers would be appreciated.</p><p>Thank you in advance for your help. </p><p>Regards,</p><p>Peter</p>","556560","","","","","2010-12-29 00:07:34","How to process sound in Java for Android?","<android>","0","1","1","",""
"4550555","1","","","2010-12-29 00:14:25","1","1506","<p>I am using following command to execute specific package:</p><p>adb shell monkey -v -p com.google.android.apps.maps 500</p><p>adb shell monkey -p com.google.android.voicesearch 10</p><p>Q-1: But I want to execute all the packages in batch mode,can anyone please suggest?I have used a process like putting all the individual commands in batch file and executing but it is not working after first command execution.</p><p>Q-2: Can you please suggest what is the command only to put random key strokes through out the phone?</p><p>Thanks in Advance !!!</p>","556574","","121493","","2011-02-10 16:19:40","2012-08-21 13:27:35","Monkey command to execute all the packages at a time","<android><monkey><android-monkey>","1","0","","",""
"4550557","1","","","2010-12-29 00:15:38","6","1816","<p>Greetings all!</p><p>I'm trying to play a video that is hosted on our webserver on an android phone. I've already built this for iPhone and it works great.</p><p>Droid, however is a different issue. Instead of getting video, I'm just getting a black screen, no error or anything.</p><p>The code I am using is:</p><p>activeContent = Titanium.Media.createVideoPlayer({      contentURL: content,      backgroundColor:'#111',      movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT}); </p><p>win.add(activeContent);activeContent.play();</p><p>The video I'm downloading does play on the droid when not using Titanium, so I know its not a format issue. (its an .MP4 incase anyone is wondering.)</p><p>I've used Titanium SDK's 1.5.1 and am on the continuous build of 1.6.0 from earlier today.</p><p>using the 2.2 Droid SDK, and Titanium Developer 1.2.2</p><p>Does anyone have any thoughts on this? One of the big selling points for android is its ability to pull media from the net, and I'm honestly a little concerned about this shortcoming if its an issue with Titanium.</p>","556576","","","","","2011-04-12 15:15:04","Android Remote Video with Titanium","<android><video><titanium>","2","1","0","",""
"4550567","1","","","2010-12-29 00:16:59","1","1449","<p>I was able to run the HelloAndroid app on the emulator, running on my Mac and using Eclipse. I was hoping I could keep adding code to test new features, but can't get the emulator to reflect any changes. Even just changing the tv.setText text doesn't work - the emulator keeps showing the original text. I am not getting any error codes, so why are the changes taking?</p>","556579","","","","","2013-05-12 10:51:21","Can't get emulator to reflect minor changes I made to HelloAndroid app","<android><eclipse><emulator>","5","1","","",""
"4550617","1","","","2010-12-29 00:25:56","2","749","<p>I'm new here and I don't know if I post on to the right forum.</p><p>I'd like to do an application.Application could capture a photo and GPS location and store everything together in database. I could add a description to picture next time when I want. This would be like my diary with photos and locations where I was (trip). Next time I could look and search for the picture or location and see the details of the description I wrote.</p><p>For now I don't heave an android phone so I'm doing just in emulator.</p><p>Any idea how to done this app?</p><p>Thanks Matej </p>","556571","","","","","2010-12-30 22:04:04","android app for store pictures and gps location and description","<android><gps><location><photo><store>","1","0","","",""
"4550757","1","","","2010-12-29 00:58:57","22","9833","<p>While running my apps, I have got this kind of logs: </p><blockquote>  <p>GC_EXTERNAL_ALLOC freed 2K, 38% free 8772K/14087K, external 17480K/17998K, paused 87ms<br>  GC_FOR_MALLOC freed 0K, 38% free 8772K/14087K, external 17480K/17998K, paused 67ms<br>  GC_CONCURRENT freed 2125K, 47% free 6214K/11719K, external 7142K/8400K, paused 3ms+5ms </p></blockquote><p>Does anyone know what these logs mean? Thanks in advance!</p><ol><li>What is the difference between 'GC_EXTERNAL_ALLOC', 'GC_FOR_MALLOC' and 'GC_CONCURRENT'. Are there some other 'GC' events?  </li><li>What does '38% free 8772K/14087K' mean? What is '8772K' and what is '14087K'?  </li><li>What does 'external 17480K/17998K' mean? What is '17480K' and what is '17998K'?</li></ol><p>Thanks!</p>","556604","","556604","","2010-12-29 01:53:22","2011-08-03 22:06:15","Android logs 'GC_EXTERNAL_ALLOC' 'GC_FOR_MALLOC'","<android><logging>","2","0","13","",""
"4550896","1","4551398","","2010-12-29 01:42:50","5","8487","<p>The SQLite database table I'm using is subjected to adding columns whenever I need to. I don't want to hard-code the columns at the risk of updating the database and forgetting to update the hard-coded values. How could I return all the names of the columns in a table?  (Preferably in a <code>String[]</code>)</p>","200477","","200477","","2010-12-29 01:48:10","2013-05-15 08:59:12","Return all columns of a SQLite table in Android","<java><android><sqlite><table>","2","0","1","",""
"4550898","1","4925994","","2010-12-29 01:43:36","1","531","<p>I am writing a mobile app (Android) that will allow the user to 'write' to a canvas using a single-touch device with 1 pixel accuracy.  The app will be running on a tablet device that will be approximately standard 8 1/2"" x 11"" size.  My strategy is to store the 'text' as vector data, in that each stroke of the input device will essentially be a vector consisting of a start point, and end point, and some number of intermediate points that help to define the shape of the vector (generated by the touchscreen/OS on touch movement).  This should allow me to keep track of the order that the strokes were put down (to support undo, etc) and be flexible enough to allow this text to be re-sized, etc like any other vector graphic.</p><p>However, doing some very rough back of the envelope calculations, with a highly accurate input device and a large screen such that you can emulate on a one for one basis the standard paper notepad, that means you will have ~1,700 strokes per full page of text.  Figuring, worst-case, that each stroke could be composed of up to ~20-30 individual points (a point for every pixel or so of the stroke), that means ~50,000 data points per page...  WAY too big for SQLite/Android to handle with any expectation of reliability when a page is being reloaded and the vector strokes are being recreated (I have to imagine that pulling 50,000+ results from the SQLite db will exceed the CursorWindow <a href=""http://stackoverflow.com/questions/1407442/android-sqlite-and-huge-data-sets"">limit of 1Mb</a>)</p><p>I know I could break up the data retrieval into multiple queries, or could modify the stroke data such that I only add an intermediate point to help define the stroke vector shape if it is more than X pixels from a start, finish or other intermediate pixel, but I am wondering if I need to rethink this strategy from the ground up...</p><p>Any suggestions on how to tackle this problem in a more efficient way?</p><p>Thanks!</p><p>Paul</p>","357801","","","","","2011-02-07 20:09:17","Best Strategy for Storing Handwriting","<android><vector><vector-graphics><handwriting>","2","0","0","",""
"4550911","1","4550953","","2010-12-29 01:47:09","2","1244","<p>I'm currently in the process of creating an OBJ importer for an opengles android game. I'm relatively new to the language java, so I'm not exactly clear on a few things.</p><p>I have an array which will hold the number of vertices in the model(along with a few other arrays as well):</p><pre><code>float vertices[];</code></pre><p>The problem is that I don't know how many vertices there are in the model before I read the file using the inputstream given to me.</p><p>Would I be able to fill it in as I need to like this?:</p><pre><code>vertices[95] = 5.004f; //vertices was defined like the example above</code></pre><p>or do I have to initialize it beforehand?</p><p>if the latter is the case then what would be a good way to find out the number of vertices in the file? Once I read it using inputstreamreader.read() it goes to the next line until it reads the whole file. The only thing I can think of would be to read the whole file, count the number of vertices, then read it AGAIN the fill in the newly initialized array.</p><p>Is there a way to dynamically allocate the data as is needed?</p>","482085","","44729","","2010-12-29 03:16:07","2010-12-29 03:16:07","Filling in uninitialized array in java? (or workaround!)","<java><android><opengl-es><inputstream><dynamic-memory-allocation>","3","0","","",""
"4551127","1","4552140","","2010-12-29 02:48:12","2","380","<p>I have some unicode filenames in assets such as ""heiß"". And the following code to grab the file returns an IOException. Are unicode filenames not supported or is there something else I can do?</p><pre><code>        AssetFileDescriptor afd = getAssets().openFd(""heiß"");</code></pre>","317033","","","","","2010-12-29 07:01:28","Android - Unicode filenames in assets/","<android><unicode>","1","0","1","",""
"4551134","1","4551639","","2010-12-29 02:50:40","0","1070","<p><strong>EDIT:</strong> Please ignore this question - I've managed to solve it in a way which works fine for what I need (see my own answer below).</p><p>I have a WeatherSpinner class which extends Spinner. The class shows region names which I originally did using an <code>ArrayAdapter&lt;String&gt;</code> but I now want to use <code>ArrayAdapter&lt;Locale&gt;</code>(Locale is an abstract 'empty' class of my own).</p><p>I'm getting a <code>ClassCastException</code> when trying to populate my ArrayAdapter with the following...</p><pre><code>protected ArrayList&lt;?&gt; theList;protected ArrayAdapter&lt;Locale&gt; aa = null;...protected void updateContents(ArrayList&lt;?&gt; list, int selectedItem) {    theList = list;    // Exception thrown on next line    aa = new ArrayAdapter&lt;Locale&gt;(theContext, android.R.layout.simple_spinner_item,        (Locale[]) theList.toArray());    ...</code></pre><p>}</p><p>I'm passing a <code>RegionList</code> object into updateContents() as the 'list' parameter and <code>RegionList extends ArrayList&lt;Region&gt;</code>, and <code>Region extends Locale</code>. I've also overriden Region's <code>toString()</code> method to return a valid String.</p><p>What am I not seeing here? Am I wrong about the way <code>ArrayList&lt;?&gt;.toArray()</code> works?</p>","488241","","488241","","2010-12-29 05:15:09","2010-12-29 05:15:09","Need help with a custom Spinner/ArrayAdapter setup","<android><android-arrayadapter>","1","0","","",""
"4551135","1","","","2010-12-29 02:51:13","3","1622","<p>I use a <code>ListActivity</code> to display a list of items. The user can long-press an item in the list to display a contextual menu. This menu contains among other things an option to delete the long-pressed item. When the user selects this option, a dialog pops up asking for confirmation of the deletion. Upon confirmation, the item is deleted from the list.</p><p>I would like to reuse the <code>AlertDialog</code> as much as possible. My attempts at using <code>onPrepareDialog(int, View, Bundle)</code> have been defeated by the fact that the <code>Bundle</code> is not passed to the <code>DialogInterface.OnClickListener</code>. I end up having to recreate a listener on every invocation.</p><p>I see several ways to solve this:</p><ol><li>recreate the dialog on every occasion (pros: simple, cons: wasteful)</li><li>keep the <code>DialogInterface.OnClickListener</code> in a field on the <code>ListActivity</code> and keep the item to be deleted as a field of the listener. (pros: no memory waste, cons: need to manage state). Q: is this safe?</li><li>have <code>onPrepareDialog</code> update the title, and bind new <code>View.OnClickListener</code>s on the buttons of the <code>AlertDialog</code>. (pros: limit waste, cons: new <code>View.OnClickListener</code> on every invocation).</li></ol><p>If <code>DialogInterface.OnClickListener</code> accepted a <code>Bundle</code>, I wouldn't have to jump through hoops to keep track of the item being deleted.</p><p>This is not a blocker, but I would love to see an elegant solution. I would love to hear your suggestions :)</p><p>Here is the code for option #1, if you want to play with this:</p><pre><code>public class Example extends ListActivity {  private static final int CONFIRM_DELETE_DIALOG = 1;  private static final String POSITION_KEY = ""position"";  private ArrayAdapter&lt;String&gt; mAdapter;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mAdapter = new ArrayAdapter&lt;String&gt;(        this, android.R.layout.simple_list_item_1,        new String[] { ""one"", ""two"" });    setListAdapter(mAdapter);    registerForContextMenu(getListView());  }  @Override  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    getMenuInflater().inflate(R.menu.my_lovely_menu, menu);  }  @Override  public boolean onContextItemSelected(MenuItem item) {    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();    switch (item.getItemId()) {    case R.id.delete_item:      Bundle bundle = new Bundle();      bundle.putInt(POSITION_KEY, info.position);      showDialog(CONFIRM_DELETE_DIALOG, bundle);      return true;    default:      return super.onContextItemSelected(item);    }  }  @Override  protected Dialog onCreateDialog(int id, Bundle args) {    switch (id) {    case CONFIRM_DELETE_DIALOG:      final int position = args.getInt(POSITION_KEY);      AlertDialog.Builder builder = new AlertDialog.Builder();      builder.setCancelable(false);      builder.setTitle(String.format(          getString(R.string.confirm_delete), mAdapter.getItem(position)));      DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {          switch (which) {          case DialogInterface.BUTTON_POSITIVE:            mAdapter.remove(mAdapter.getItem(position));            // Dismiss the dialog to ensure OnDismissListeners are notified.            dialog.dismiss();            break;          case DialogInterface.BUTTON_NEGATIVE:            // Cancel the dialog to ensure OnCancelListeners are notified.            dialog.cancel();            break;          }          // Remove the dialog so it is re-created next time it is required.          removeDialog(CONFIRM_DELETE_DIALOG);        }      };      builder.setPositiveButton(android.R.string.yes, listener);      builder.setNegativeButton(android.R.string.no, listener);      return builder.create();    default:      return super.onCreateDialog(id, args);    }  }}</code></pre>","555901","","","","","2011-03-26 02:21:31","Looking for suggestions on how to reuse AlertDialogs to confirm actions of contextual menus on the items of an ActivityList","<android>","1","2","0","",""
"4551167","1","","","2010-12-29 03:02:40","0","590","<p>i'm new to image color picking on Java, or to be specific, on Android. All I understand is that I have to create a custom view for an image, I dunno about the rest. </p><p>Are there any specific examples that shows how to show color codes and color from an image? </p>","409296","","","","","2010-12-29 03:25:03","Pick colors from Image - Android","<android><image><colors><picker>","1","0","","",""
"4551183","1","","","2010-12-29 03:07:10","0","366","<p>I have developed a TTS based application. When playing it sound, if any other notification triggered, then TTS playing with sound breaking. (Ex: if SMS received TTS sound breaks)What are condition under which such an issue can occur? </p>","377438","","667810","","2012-08-25 02:24:05","2012-08-25 02:24:05","Android TTS sound breaking","<android><text-to-speech>","1","0","1","",""
"4551368","1","4551412","","2010-12-29 03:57:41","2","5762","<p>I am alerting the user with and alert dialog box that has an EditText field. </p><pre><code>AlertDialog.Builder alert = new AlertDialog.Builder(this);    db.open();    Cursor f = db.getTitle(position + 1);    alert.setTitle(""Age"");    alert.setMessage(""New age?"");    // Set an EditText view to get user input    final EditText input = new EditText(this);    alert.setView(input);    input.setText(f.getString(3));    db.close();    alert.setPositiveButton(""Change"",            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int whichButton) {                    String age = input.getText().toString();                    db.open();                    Cursor ff = db.getTitle(position + 1);                    db.updateTitle(ff.getLong(0), ff.getString(1),                            ff.getString(2), age, ff.getString(4),                            ff.getString(5));                    db.close();                    details();                    age();                }            });    alert.setNegativeButton(""Keep"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            // do nothing        }    });    alert.show();</code></pre><p>Is there a way to only allow the user to input a two digit number (no letters, symbols, etc)?</p>","536673","","","","","2013-02-02 23:02:22","Alert Dialog with a numeric EditText field","<android><formatting><edittext><alertdialog>","2","0","","",""
"4551403","1","","","2010-12-29 04:08:59","10","18203","<p>I am using a TableLayout with TableRows as my main activity.</p><p>Inside the TableLayout is a Radio Group containing 2 Radio Buttons inside the activity (the Radio Group being inside a table row). I want to be able to align the rightmost radio button to the right edge screen, so the ""gap"" is between the left radio button and right button (instead of after the right radio button). i.e.</p><p>So instead of having<br>| (x) (x) gap |<br>I will have<br>|(x) gap (x)| </p><p>where (x) are the Radio Buttons and | are the edges of the screen</p><p>I can use gravity (center_horizontal) to put both the buttons in the middle (i.e. | gap (x)(x) gap|) however I can't seem to be able to split them the way I want as said before</p>","556710","","657020","","2011-04-30 14:39:48","2013-01-29 09:32:35","Manage Layout Inside a Horizontal Oriented Radiogroup","<android><radio-button><orientation><gravity><radio-group>","4","0","5","",""
"4551534","1","","","2010-12-29 04:43:18","0","1860","<p>i just wanna display one image with rounded corners(not on background view)in android.How could i do this?Help me..ThanksRegards,Sudhakar.</p>","555948","","","","","2011-03-09 18:34:45","Image with rounded corners in android","<android>","1","0","","",""
"4551632","1","4552069","","2010-12-29 05:10:50","0","74","<p>hai every one...i am displaying a pdf. is there any way or any method to scale the different   sizes of pdf pages according to the screen size. thank you in advance.</p>","493244","","493244","","2010-12-31 08:35:15","2010-12-31 08:35:15","view is not fittng to screen width in android","<android>","1","0","","",""
"4551636","1","4551915","","2010-12-29 05:12:08","5","4770","<p>I have a problem with the contextual menu, I have a control ""ImageButton"" when you make a long click displays a context menu.</p><p>I need to display the contextual menu with a short click, not a long click, is this possible?</p><p>This is the code I currently use, the menu works perfectly.</p><pre><code>    private ImageView btnRutas;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.fclientes);        btnRutas =(ImageView)findViewById(R.id.btnRutas);        btnRutas.setOnClickListener(this);        registerForContextMenu(btnRutas);     }    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {        if(v.getId()== R.id.btnRutas) {            menu.setHeaderIcon(android.R.drawable.ic_menu_more);            menu.setHeaderTitle(""Rutas"");            menu.add(0, 0, 0, ""Ruta 1"");        }         super.onCreateContextMenu(menu, v, menuInfo);    }     @Override    public boolean onContextItemSelected(MenuItem item) {    switch (item.getItemId()){    case 0:        function();        }    }</code></pre><p>Thanks in advance.</p>","518657","","","","","2010-12-29 06:17:42","Show Context Menu With Short Click not Long Click","<java><android><eclipse><contextmenu><imageview>","1","0","2","",""
"4551680","1","4554572","","2010-12-29 05:24:12","-1","3538","<p>Hai, I want to edit the spinner value in runtime in android application</p>","555910","","","","","2014-03-02 18:52:08","I want to edit the spinner value in runtime in android application","<android><spinner>","5","5","1","",""
"4551747","1","","","2010-12-29 05:40:13","2","126","<pre><code>         I have to make one application which is start in android phone as par user given </code></pre><p>time automatically.</p><pre><code>          If is there any intent which i used my application to start it by user given time.</code></pre>","554830","","","","","2011-10-21 15:21:27","How to start application as par fix time in android mobile phone","<android>","1","0","1","",""
"4551757","1","4551777","","2010-12-29 05:42:02","13","18025","<p>i want to allow only numbers and period(.) in a android edit text. How to do this .. can any body help?</p>","489762","","","","","2011-10-13 20:43:25","allow only number and period(.) in edit text in android","<android>","5","3","1","",""
"4551779","1","5153613","","2010-12-29 05:47:16","0","800","<p>What is the exact color code used in Android(i.e. by default) for state-focus and state-pressed.(Its orange family , but what is the color code !)<br>Where in the source code of Android its defined ?</p>","207646","","","","","2011-03-01 11:05:20","ColorCode of (default) focus in Android","<android>","3","0","","",""
"4551792","1","","","2010-12-29 05:52:18","0","4155","<p>Im trying to install Android SDK but it says that JRE is not enough and that it needs JDK, I already installed JDK from Oracle website. I'm sure it is installed 'cause I have an eclipse running with the JDK intead of JRE but it was configured manually. How can I make the android SDK installer recognize the JDK?</p>","556782","","","","","2012-04-20 20:29:19","How to set JDK instead of JRE as the default JVM on WIndows 7 64bit?","<android><windows-7><jdk>","3","1","","",""
"4551850","1","4551875","","2010-12-29 06:05:52","0","531","<p>my coding is working well .But I want to store the edited spinner value in the database how it be done.here is my code</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.Spinner;public class tooo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Spinner localSpinner = (Spinner)findViewById(R.id.color_spinner);        ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this, R.array.color_array, R.layout.my_normal_spinner_item_style);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        localSpinner.setAdapter(adapter);        }}</code></pre><p>my simple_spinner_dropdown_item.xml</p><p></p>","555910","","105460","","2010-12-29 06:08:03","2010-12-29 06:11:29","I want to store the edited spinner value in the database","<android><sqlite><spinner>","1","0","","",""
"4551864","1","4552007","","2010-12-29 06:09:04","0","61","<p>I am trying to create a list view from the database. this is the code</p><p>List Activity</p><pre><code> protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.inbox);  DBAdapter db = new DBAdapter(InboxActivity.this);  db.open();  long userID = Long.parseLong(MessagingApplication.getUserID());  Cursor inbox = db.readInbox(userID);  startManagingCursor(inbox);  String[] mails = new String[] { DBAdapter.KEY_NAME };  int[] to = new int[] { R.id.name };  SimpleCursorAdapter inboxmail = new SimpleCursorAdapter(this,    R.layout.inbox_list, inbox, mails, to);  setListAdapter(inboxmail);  db.close(); }</code></pre><p>This is the code that fetches data from the DB</p><pre><code> public Cursor readInbox(long toId) throws SQLException {  return db.query(TABLE_MAILS, new String[] { ID, KEY_FROM, KEY_TO,    KEY_SUB, KEY_BODY, KEY_DATETIME, KEY_READ }, KEY_TO + ""=""    + toId, null, null, null, null, null); }</code></pre><p>My DB</p><pre><code>private static final String CREATE_MAILS = ""CREATE TABLE mails (id INTEGER PRIMARY KEY AUTOINCREMENT, pid INTEGER DEFAULT '0', from_id INTEGER, to_id INTEGER, subject TEXT, body TEXT, datetime TEXT, read INTEGER);"";</code></pre><p>Error:</p><p><img src=""http://i.stack.imgur.com/xPjoE.png"" alt=""alt text""></p><p><a href=""http://variable3.com/files/screenshots/2010-12-29_1136.png"" rel=""nofollow"">http://variable3.com/files/screenshots/2010-12-29_1136.png</a></p>","155196","","","","","2010-12-29 06:40:34","Db to ListView error","<android><listview>","1","0","","",""
"4551868","1","4552127","","2010-12-29 06:09:41","1","2208","<p>I'm trying to write a very simple app that will do just one very simple non-GUI action, then display a short message (using toast, on top of what was already on the screen, e.g. home screen), and finish.  That's all.</p><p>This almost works, but i'm still getting a brief black screen after the app starts, then back to home screen and things work as i intend after that. I thought that not using setContentView on my activity (thus depriving it of a View) would be enough to avoid the black screen, but it still pops up.Please notice that (as suggested in a related question), a service is not the answer to my problem.  I just want a GUI-less (except for one toast) app that runs and ends right away.Thanks :)</p>","556794","","","","","2013-11-20 13:17:49","how to completely get rid of an activity's GUI (avoid a black screen)","<android><gui>","3","2","5","",""
"4551874","1","4552538","","2010-12-29 06:11:23","4","5644","<p>I have a pretty simple screen with a couple of EditText widgets and a button.  In the emulator, when I click on the EditText widget, a virtual keyboard comes up.  However, I can't seem to get rid of it.  Clicking on an empty space on the screen does not make it go away.  Only clicking the virtual Return key or the hardware Back button makes it disappear.</p><p>I don't have a real Android phone handy, so is this an emulator only thing or will it be like this on the actual device.  If it is, what can I do to make the virtual keyboard go away, when I click elsewhere on the form?</p>","9382","","","","","2013-02-18 16:54:27","Why doesn't the virtual keyboard go away?","<java><android><android-emulator><virtual-keyboard>","4","0","","",""
"4551912","1","4564400","","2010-12-29 06:16:59","4","748","<p>I was wondering by using <a href=""http://www.sencha.com/products/touch/"" rel=""nofollow"">Sencha</a> or <a href=""http://jquerymobile.com/demos/1.0a2/"" rel=""nofollow"">JQuery Mobile</a>, is it possible</p><ol><li>Is it possible to deploy them as single click install app in Android Market?</li><li>Is it possible to deploy them as single click install app in IPhone App Store? Does Apple place any restriction on non-native app deploy through IPhone App Store?</li><li>How can I package my HTML, JS and CSS files as one click executable file? That's is, by single click on the icon on mobile ""desktop"", browser will launch a default HTML file?</li></ol>","72437","","","","","2011-09-01 11:51:09","Deploy Sencha/ JQuery Mobile as one touch launched app in Android / IPhone","<iphone><android><sencha><jquery-mobile>","2","0","1","",""
"4551926","1","4552014","","2010-12-29 06:20:22","7","7386","<p>friends,</p><p>i am using following code to write Serializable object to external storage.</p><p>it throws me error java.io.NotSerializableExceptioneven my object is serializable any one guide me what mistake am i doing?</p><pre><code>public class MyClass implements Serializable {// other veriable stuff here...    public String title;    public String startTime;    public String endTime;    public boolean classEnabled;    public Context myContext; public MyClass(Context context,String title, String startTime, boolean enable){            this.title = title;            this.startTime = startTime;            this.classEnabled = enable;            this.myContext = context;} public boolean saveObject(MyClass obj) {        final File suspend_f=new File(cacheDir, ""test"");            FileOutputStream   fos  = null;            ObjectOutputStream oos  = null;            boolean            keep = true;            try {                fos = new FileOutputStream(suspend_f);                oos = new ObjectOutputStream(fos);                oos.writeObject(obj);   // exception throws here            }            catch (Exception e) {                keep = false;            }            finally {                try {                    if (oos != null)   oos.close();                    if (fos != null)   fos.close();                    if (keep == false) suspend_f.delete();                }                catch (Exception e) { /* do nothing */ }            }            return keep;        }}</code></pre><p>and calling from activity class to save it</p><pre><code> MyClass m= new MyClass(this, ""hello"", ""abc"", true); boolean  result =m.saveObject(m);</code></pre><p>any help would be appreciated.</p>","249991","","","","","2012-06-05 17:28:45","java.io.NotSerializableException while writing Serializable object to external storage?","<android><serialization>","1","0","2","",""
"4551959","1","","","2010-12-29 06:27:06","1","4691","<p>I have to set the background color during run time, i am using ""setBackgroundColor(R.color.focusColor)"" . but its nots working. </p>","556807","","","","","2014-02-19 06:55:54","How to set the background color for button in Android during run time?","<android>","5","0","","",""
"4552040","1","4552247","","2010-12-29 06:43:43","2","6501","<pre><code>     can anybody tell me how to read socket input stream. Here is my code.if (!serverIpAddress.equals(""""))        {            try            {                InetAddress serverAddr = InetAddress.getByName(serverIpAddress);                Log.i(""ClientActivity"", ""Connecting..."");                Socket socket = new Socket(serverAddr, 5777);                try {                    Log.i(""ClientActivity"", ""Sending command."");                    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket                            .getOutputStream())), true);                    // where you issue the commands                    out.println(""&lt;maplist /&gt;"");                    Log.i(""ClientActivity"", ""Sent."");                    input = new BufferedReader(new InputStreamReader(socket.getInputStream()));                                         buffer = new StringBuilder();                    new Thread(new Runnable() {                        @Override                        public void run() {                            try                             {                                buffer.append(input.readLine());                            } catch (IOException e) {                                // TODO Auto-generated catch block                                e.printStackTrace();                            }                        }                    }).start();                        this.WriteXMLResponse(buffer.toString());                } catch (Exception e) {                    Log.e(""ClientActivity"", ""S: Error"", e);                }</code></pre><p>In my code and in run method where i am reading the input Stream a exception occurs. which says java.net.socketException: bad file number.</p><p>and if i use while loop my app freezes. any suggestion will be appretiative.thanks</p>","397901","","","","","2010-12-29 07:34:42","how to read socket input stream in Android","<android><multithreading><sockets><inputstream>","1","0","","",""
"4552076","1","","","2010-12-29 06:48:59","1","3452","<p>I want to read Android system level log file.So I use the following code:</p><pre><code>        Process mLogcatProc = null;    BufferedReader reader = null;    try {        mLogcatProc = Runtime.getRuntime().exec(                new String[] { ""logcat"", ""-d"",                        ""AndroidRuntime:E [Your Log Tag Here]:V *:S"" });        reader = new BufferedReader(new InputStreamReader(mLogcatProc                .getInputStream()));        String line;        final StringBuilder log = new StringBuilder();        String separator = System.getProperty(""line.separator"");        while ((line = reader.readLine()) != null) {            log.append(line);            log.append(separator);        }    }    catch (IOException e) {}    finally {        if (reader != null)            try {                reader.close();            } catch (IOException e) {}    }</code></pre><p>I also used  in AndroidManifest.xml.But I can't read any line. The StringBuilder log is empty. And the method mLogcatProc.waitFor return 0.</p><p>So how can I read the log ?</p>","554861","","","","","2011-01-21 11:38:19","How I start a process to run logcat on Android?","<android><logging><logcat>","3","0","","",""
"4552168","1","","","2010-12-29 07:07:59","0","1071","<p>is following both lines are <br></p><pre>getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);  setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);</pre><p>considering I am writing this line in activity class </p><p>Thanks in advance</p>","526359","","","","","2010-12-29 07:57:40","full screen in android at runtime (no notification/status bar and app title bar)?","<android>","1","1","","",""
"4552182","1","","","2010-12-29 07:12:44","0","370","<p>I am working on android application in which I have created one service that fetch data from web service but the service fetch data when I click on the button to start service.what I want is my service fetch data from web service 24 hours because data on web service updated at any time.so should I use timer or anything else please give me solution,thanks </p>","461503","","576671","","2012-04-10 15:15:27","2012-10-26 20:02:41","Android Service that uses web service data","<android>","2","0","","",""
"4552201","1","","","2010-12-29 07:15:51","0","38","<p>I am developing an application.I want to align text in upwards.When i give there padding button position changes....It dissapears from the screen.What should i do??</p>","475349","","","","","2010-12-29 07:15:51","regarding placing of texts in xml file in android","<android>","0","3","1","",""
"4552235","1","4552254","","2010-12-29 07:20:56","0","1025","<p>In my app, I have a service that gets the location of the device and passes this info through to a thread. I also need to pass a sharedpreferences value through to the thread. When I do this, the application gets a runtime error and forces close. Everything else works and is passed through to the thread if I don't try to get that value.<br>I presume this occurs because <code>onLocationChanged()</code> does not have a context, can anyone help with this please? Thanks in advance  </p><p><strong>Service Code:</strong>    </p><pre><code> public class TrackGPS extends Service implements LocationListener{       LocationManager lm;        LocationListener loc;       public SharedPreferences sharedpreferences;           public static final String US = ""usersettings"";       public String prefPhoneNum = ""prefPhoneNum"";       double lat = 0, lon = 0, alt = 0, acc = 0;       long tim = 0;      public void onCreate() {           super.onCreate();            /* Calling the value works fine here but can't pass to onLocationChanged() */           // sharedpreferences = getSharedPreferences(US, MODE_WORLD_READABLE);          // prefPhoneNum = sharedpreferences.getString(""prefPhoneNum"" , """");           lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);           loc = new TrackGPS();           enableGPS();              onDestroy();           stopSelf();}public void enableGPS() {      new CountDownTimer(120000, 1000) {                  //120 seconds         public void onTick(long millisUntilFinished)          {              lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, loc);                      }         public void onFinish()          {                                  lm.removeUpdates(loc);               }    }.start();         }@Overridepublic void onLocationChanged(Location location) {    lat = location.getLatitude();    lon = location.getLongitude();    alt = location.getAltitude();    acc = location.getAccuracy();    tim = location.getTime();    sharedpreferences = getSharedPreferences(US, MODE_WORLD_READABLE);    prefPhoneNum = sharedpreferences.getString(""prefPhoneNum"" , """");    Thread cThread = new Thread(new SocketsClient(lat, lon, alt, acc, tim, prefPhoneNum));    cThread.start();}@Overridepublic void onProviderDisabled(String provider) {   }@Overridepublic void onProviderEnabled(String provider)  {   }@Overridepublic void onStatusChanged(String provider, int status, Bundle extras) {   }@Overridepublic IBinder onBind(Intent intent) { return null; }public void onDestroy() { super.onDestroy(); }}</code></pre><p><strong>Logcat Errors:</strong>       </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(912): 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","","1553563","","2013-01-11 09:58:34","2013-01-11 09:58:34","Accessing sharedpreferences within onLocationChanged forces close of application","<android><service><gps><context><sharedpreferences>","2","0","","",""
"4552250","1","4552409","","2010-12-29 07:24:21","16","9398","<p>Take accessing contacts in androidandroid.jar for versions 1.6 has People.CONTENT_URI for invoking contacts related info whereas in later versions we need to have api support for RawContacts.CONTENT_URI.</p><p>Same thing is true for accessing calendar for instance as its URI is changed in android 2.2.</p><p>Is there a best practice to manage all different changes without adding additional application or build separately for each version of changes?</p>","119031","","","","","2013-05-12 04:29:24","How to support multiple android version in your code?","<java><android>","8","0","4","",""
"4552267","1","4563477","","2010-12-29 07:26:42","0","578","<p>I have created a List view of all the Inbox emails of a user. Now on clicking the email id. I wanna have an activity where i display the content of the mail. Problem is i am not able to understand how to pass the ID of the mail to the activity to fetch that Email with Details.</p><pre><code>public class InboxActivity extends ListActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.inbox);        DBAdapter db = new DBAdapter(InboxActivity.this);        db.open();        long userID = Long.parseLong(MessagingApplication.getUserID());        Cursor inbox = db.readInbox(userID);        startManagingCursor(inbox);        String[] mails = new String[] { DBAdapter.KEY_SUB };        int[] to = new int[] { R.id.subject };        SimpleCursorAdapter inboxmail = new SimpleCursorAdapter(this,                R.layout.inbox_list, inbox, mails, to);        setListAdapter(inboxmail);        db.close();    }}</code></pre><p>This is  my Inbox as List View</p>","155196","","","","","2010-12-30 14:41:26","List View onClick passing _id","<android><listview>","1","0","","",""
"4552272","1","","","2010-12-29 07:27:27","3","1154","<p>I require actual Text width from a TextView.</p><p>To expalin this heres my TextView description:</p><ol><li>TextView lies in a LinearLayout with some internal padding.</li><li>TextView is set to fill the width and wrap up the height.</li><li>TextView has a leftCompoundDrawable set and a rightCompoundDrawable set.</li><li>Theres also padding given to text of textview from left compound drawable.</li><li>Text from text view can be multiline.</li></ol><p>What I meant from <em>text</em> from <em>TextView</em> is property of TextView which can be set using <code>android:text</code> property from XML or by calling setText() on TextView.</p><p>Heres what I am doing.</p><pre><code>[ScreenWidth]-[LeftCompundDrawableIntrinsic Width]-[RightDrawabaleIntrinsicWidth]-[LeftCompoundDrawablePadding]</code></pre><p><strong>is there any stock method from framework which can precisely caluclate this ?</strong></p><p>Heres an image describing my TextView</p><p><img src=""http://i.stack.imgur.com/KCwX0.png"" alt=""TextView""></p>","447238","","","","","2010-12-29 13:16:01","Actual Text Width android","<android><width><textview><measure>","1","0","","",""
"4552282","1","4552335","","2010-12-29 07:29:49","3","519","<p>How can I get the position of current image displaying in Gallery view while it is swiping ?</p>","376035","","37865","","2011-04-28 05:33:55","2012-10-10 19:32:06","Getting Position of Image on GalleryView while swipping?","<android><position><swipe><galleryview>","2","0","","",""
"4552292","1","7761754","","2010-12-29 07:33:03","7","1088","<p>I'm using a MultiAutoCompleteTextView in my app to show various suggestions.</p><p>I noticed that MultiAutoCompleteTextView doesn't support the regular android suggerstion that come defaultly with an EditText (the strip of suggestions that pops above the soft keyboard.</p><p>Is there a way of showing both the regular suggestions, and the ones I want to show in my MultiAutoCompleteTextView?</p>","554233","","","","","2013-03-24 09:14:00","EditText and MultiAutoCompleteTextView suggestions","<android><autocomplete><edittext>","2","0","1","",""
"4552323","1","","","2010-12-29 07:40:10","0","152","<p>I am new to android,in my application i want to add charecters while the user is entering the data.(ex:if user enters 'a' i want to show '(a' in EditText).</p><p>please help me.</p>","523046","","","","","2011-04-05 00:42:47","Appending Charecters in EditText","<android>","1","1","","",""
"4552345","1","4552361","","2010-12-29 07:43:59","4","501","<p>I often find myself writing very similar code across projects. And more often than not, I copy stuff over from old projects.</p><p>Things like:</p><ul><li>Create images with round corners</li><li>read density into a static variable &amp; re-use. 4 lines..</li><li>disable / hide multiple views / remote views at once. Example:</li></ul><p>} </p><pre><code>public static void disableViews(RemoteViews views, int... ids) {    for (int id : ids) {        views.setInt(id, SET_VISIBILITY, View.GONE);    }}public static void showViews(RemoteViews views, int... ids) {    for (int id : ids) {        views.setInt(id, SET_VISIBILITY, View.VISIBLE);    }}</code></pre><p>I'd love to package these kind of functions into 1 letter / 2 letter class names, i.e. <code>V.showViews(RemoteViews views, int... ids)</code> would be easy to write &amp; remember I hope.</p><p>I'm searching for Github recommendations, links and if nothing is found, I perhaps will start a small project on github to collect.</p>","375209","","","","","2010-12-29 07:46:58","What is a recommended Android utility class collection?","<android><android-widget>","1","0","1","",""
"4552402","1","5577968","","2010-12-29 07:55:47","1","2483","<p>Hi I am new to Android and I want to know that how can we get the path of the installed application in android, So that we can open the file in our application by using that installed application.</p><p>for example:I want to open the pdf file or doc file in my application but i require the path of that application which can open this file...</p><p>Please Help me Thanks in advance...</p>","556869","","556869","","2014-01-14 19:20:42","2014-01-14 19:20:42","How to get the path of android installed application","<android><android-intent>","2","2","1","",""
"4552428","1","4553771","","2010-12-29 08:01:50","1","3596","<pre><code>Uri myUrl = Uri.parse(stringURL); Intent update1 = new Intent(Intent.ACTION_VIEW).setData(myUrl);startActivity( update1 );</code></pre><p>This enables download of apk file, but after download install does not start. You need to start it manually by clicking download completed in notification bar. This is also solution in most forum answers.</p><pre><code>Uri myUrl = Uri.parse(stringURL); Intent update2 = new Intent(Intent.ACTION_VIEW).setDataAndType(myUrl,""application/vnd.android.package-archive"");startActivity( update2 );</code></pre><p>In this scenario i get message (DDMS): No Activity found to handle intent... I also think that MIME ""application/vnd.android.package-archive"" is not obligatory. Is this true?If not, do you have to config http server to make this work. Like .htaccess file needs to be updated with: </p><blockquote>  <p>AddType application/vnd.android.package-archive</p></blockquote><p>If is it so, do you know any link of apk that i can test, if after download, installation process starts automatically (files on this site are not <a href=""http://code.google.com/p/openintents/downloads/list"" rel=""nofollow"">samples</a> installed).</p><p>Is any workaround that I can call install intent from code?</p>","407471","","","","","2010-12-29 11:42:36","Install apk with Intent.ACTION_VIEW is downloading but not installing the file","<android>","1","0","1","",""
"4552435","1","4553780","","2010-12-29 08:03:16","4","26214","<p>I am new to Android development. I tried to run LunarLander project (create new project based on sample) in this folderC:\Program Files\Android\android-sdk-windows\samples\android-9\LunarLander</p><p>But I got this error:Failed to install LunarLander.apk on device 'emulator-5554': timeout</p><p>But if I copied it out to C:\LunarLander, it runs fine. I guess there is something wrong with the path. How do I fix or troubleshoot this?</p>","149367","","","","","2013-10-27 04:56:52","Failed to install apk on device 'emulator-5554': timeout","<android><eclipse><path><timeout>","4","1","3","",""
"4552453","1","","","2010-12-29 08:06:08","0","309","<p>I want to upload the images in gallery view,when i supposed to do the following error is thrown.<strong>Error:Observer is null</strong></p><blockquote><pre><code>   public void uploadGallery() {</code></pre></blockquote><pre><code>     gallery.setAdapter(new GalleryAdapter(this));   }</code></pre><p>if i call this function ,when i click the button the error is thrown</p>","461972","","461972","","2010-12-29 08:28:44","2010-12-29 08:28:44","Dynamic updation on gallery in android","<android>","0","2","","",""
"4552501","1","","","2010-12-29 08:15:48","1","1656","<p>Guys I have a textview that show a html text, and it has image tag inside. I want to show the image using imageGetter but it just show a little blue box.I've been working with this problem for days. so please help me with this. </p><p>my current code is this </p><pre><code>  TextView textD = (TextView) findViewById(R.id.body);  textD.setText(Html.fromHtml(Body, imgGetter, null));  textD.setMovementMethod(new ScrollingMovementMethod()); private ImageGetter imgGetter = new ImageGetter() {        public Drawable getDrawable(String source) {          try{           InputStream is = (InputStream) new URL(source).getContent();           Drawable d = Drawable.createFromStream(is, ""src name"");           return d;          }catch (Exception e){           Log.d(""image"", imageSource, e);           return null;          }        }};</code></pre>","550921","","536148","","2011-04-08 02:14:30","2013-02-06 07:30:49","how to show images inside html text using textview","<android><textview>","2","0","2","",""
"4552505","1","4553762","","2010-12-29 08:16:49","6","1411","<p>How could I restrict Android widgets in a way that only one instance can be created by the user at all times?</p><p>A possible way is to store a <code>SharedPreference</code> including a <code>counter</code> variable and crash, if the count is 1, but obviously I'm not in favor of that solution. ;-)</p>","375209","","","","","2011-11-29 07:08:23","Restrict Android Widget to one instance per device","<android><android-widget>","1","0","1","",""
"4552542","1","","","2010-12-29 08:23:37","0","657","<p>i have developed an android application which has listview and tabview.sue to crossplatform necessity i am creating the application with the help of phonegap. is it possible to have the native listview and tabview using html and css??? thank you in advance.</p>","430652","","","","","2010-12-29 08:33:21","how to get listview and tabview effect using phonegap?","<iphone><android><listview><phonegap><tabview>","1","0","","",""
"4552819","1","4553363","","2010-12-29 09:13:40","0","5148","<p>I have a activity that can launch a service after the user presses the button. In this service, i have a Timer that runs every 10s. I want to run another activity (google maps) from this service every 10s. If i put it in service i get this error:</p><pre><code>12-29 10:09:21.369: ERROR/AndroidRuntime(235): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</code></pre><p>Where shoud i put my code to launch activity? </p>","324417","","","","","2010-12-29 10:40:19","How to launch activity from service properly?","<android><service><activity>","1","0","2","",""
"4552831","1","4553705","","2010-12-29 09:15:12","15","7007","<p>I am using <code>Intent .ACTION_SEND</code> to get default email client. It works fine but now  i need to attach more than one file to email.</p><p><code>email.putExtra(android.content.Intent.EXTRA_STREAM,...)</code> attaches only last uri added to it. </p><p>So can I attach multiple files? I think this can be done by using <code>Intent.ACTION_SEND_MULTIPLE</code>. Here is the code I am trying:</p><pre><code>String uri=getScreenShot();Intent email = new Intent(android.content.Intent.ACTION_SEND);            email.setType(""application/octet-stream"");            email.putExtra(Intent.EXTRA_STREAM, Uri.parse(uri));            email.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(""file:""+csvpath));            alert.dismiss();            ctx.startActivity(Intent.createChooser(email, ""Send mail...""));</code></pre><p>Thanks in advance.</p>","443387","","35060","","2010-12-29 09:19:29","2013-10-10 07:01:42","how to attach multiple files to email client in android","<android><android-intent>","4","0","2","",""
"4552833","1","4552886","","2010-12-29 09:15:21","11","14169","<p>HI, </p><p>I want to get width and height of the image which i was stored in the drawable folder.Is this possible, if so please let me know ?</p>","487604","","","","","2013-05-08 10:40:08","How to get width and height of the image?","<android>","2","0","1","",""
"4552848","1","4552880","","2010-12-29 09:18:21","1","206","<p>can I customize my android OS for myself? for example, Instead of having 6 screen, I change to 10 screen. Or, change the view of default dial tone?</p><p>or any changes exactly in OS?</p><p>It is just a question, I don't want to do it. But I want to know does OS manipulatable?</p><p>thanks</p>","513413","","","","","2010-12-29 09:22:53","Android, Can I manipulate OS according to my own taste?","<android><operating-system><manipulation>","1","0","","",""
"4552899","1","","","2010-12-29 09:26:23","0","292","<p>Recently I've discovered that I can define shapes in an xml file. Until now I was using nine patch images to create custom buttons etc. When I tried with an xml defined shape it didn't worked. None of the shaps, also from stackoverflow which were provided as examples didn't show up. I've seen that someone has already had a similar problem, however eventually it worked on an actual device. Well in my case it didn't.</p><p>Here's the navigation_bar.xml I've tried:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""rectangle""&gt;&lt;gradient android:startColor=""#FFFF0000"" android:endColor=""#80FF00FF""        android:angle=""270""/&gt;&lt;padding android:left=""7dp"" android:top=""7dp""        android:right=""7dp"" android:bottom=""7dp"" /&gt;&lt;corners android:radius=""8dp"" /&gt;</code></pre><p></p><p>and then used in:</p><pre><code> &lt;TextView        android:id=""@+id/main_navigation_bar""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""                android:background=""@drawable/navigation_bar""/&gt;</code></pre><p>The background stays as default/black, nothing is shown.</p><p>Am I missing something here? I've also looked at ApiDemos, official documentation and didn't find anything to solve my problem.</p><p>Is it better to stay with nine patch images?</p><p>Thanks for the replies.   </p><p>When tweaking a little with code, I've noticed strange behaviour. My IDE is IntelliJ.</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:visible=""true""    android:shape=""rectangle""&gt;&lt;gradient    android:startColor=""#FF89B4EE""    android:endColor=""#FF5791E6""    android:type=""linear""    android:angle=""90""/&gt;&lt;size    android:height=""fill_parent""    android:dfv=""fill_parent"" /&gt;</code></pre><p></p><p>I made an intentional typo and code compiled. It looks like shape is being ignored or something. Anyone noticed anything similar?</p>","524384","","524384","","2010-12-29 11:48:43","2010-12-29 14:05:53","Xml defined shapes do not show up","<android>","2","2","","",""
"4552968","1","4553015","","2010-12-29 09:38:56","0","2332","<p>I want to create a ListView like in ListView twitter..when the list items on a slide, so you will have the option to reply, retweet, etc. (not the quick actions).</p><p>Can you give an example for my problem?</p><p>thanks before :D</p>","430280","","","","","2010-12-29 10:19:27","How to make listview like listview Twitter","<android><listview><listviewitem><slide>","1","0","","",""
"4552977","1","4554798","","2010-12-29 09:39:55","9","5129","<p>I have search the internet and so on but couldnt find a solution for my problem. I'm creating a listview and setting an adapter:</p><pre><code>myListView.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, theStringList));</code></pre><p>theStringList is a simple LinkedList&lt;String&gt; with items.</p><p>and the <code>android.R.layout.simple_list_item_1</code> is:</p><pre><code>&lt;TextView android:id=""@android:id/text1""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:textAppearance=""?android:attr/textAppearanceLarge""   android:gravity=""center_vertical""   android:paddingLeft=""6dip""   android:minHeight=""?android:attr/listPreferredItemHeight""/&gt;;</code></pre><p>problem: the listView items only fit the text but NOT the whole screen?!?!?</p>","433618","","935627","","2012-09-22 01:33:21","2012-09-22 01:33:21","android: listview item width fill_parent doesnt work","<android><listview>","2","0","","",""
"4552988","1","4591575","","2010-12-29 09:41:52","0","933","<p>I am getting some strange behavior from list view. I need to change background color of rows which confirmed the requirement below but it applied on one or two other rows too. which disappeared on scroll.</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {if (item.get(""how_out"").equals(""not out"")) {         v.setBackgroundColor(Color.LTGRAY);             return v;                        }          }</code></pre><p>thanks</p>","227129","","227129","","2010-12-30 16:32:49","2011-01-04 07:55:11","Android Listview highlight selected rows","<android><listview>","1","0","","",""
"4553004","1","4553216","","2010-12-29 09:44:58","7","5524","<p>HI I'm developing an application in wich I want to permit the user to login to my server with his Google account without asking him the credentials because I know that are saved into the AccountManager class.The problem is that I don't know how to autenticate the user because the account ID is just stored in Google's server, so Where can I find an ID for the account and how can I use it to autenticate user? I'd like to follow these steps: user choose one of the stored account, I get an id, send it from the terminal to the server, and I answere that ""he trust"" this user, after this I save this id in my server and request an auth token to Google just to use it between my server and the application on android device.</p>","499140","","41956","","2013-12-30 19:08:18","2013-12-30 19:08:18","Android login in my app with google credentials","<android><google-account>","1","0","4","",""
"4553044","1","4553449","","2010-12-29 09:49:51","1","945","<p>Currently I am getting company name using following code</p><pre><code>public class ContactsDemo extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Cursor cursor = getContentResolver().query(Contacts.Organizations.CONTENT_URI,             null, null, null, null);    //ContactsContract.CommonDataKinds.    if(cursor!=null){        System.out.println(cursor.getString(cursor.getColumnIndex                (Contacts.Organizations.COMPANY)));    }}}</code></pre><p>but I don't want to use deprected API's.&amp; in new API's there is no CONTENT_URI in Organisation class.How to get company name using new API. </p>","484073","","484073","","2011-01-01 11:40:04","2011-01-01 11:40:04","Get company name form Content Provider in android using new API's","<android>","1","0","","",""
"4553052","1","4554112","","2010-12-29 09:51:23","2","12667","<p>I am trying to create a table layout with buttons dynamically. I am able to get the table layout with buttons. bt i need padding between buttons. How i can get programatically.</p><p>I tried following code bt </p><pre><code>private void showCowsTblField(){    for (int row = 0; row &lt; numberOfRowsInField-1; row++)    {        TableRow tableRow = new TableRow(this);          tableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT ));        for (int column = 0; column &lt; numberOfColumnsInField -1; column++)        {            blocks[row][column].setLayoutParams(new LayoutParams(                      LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));             blocks[row][column].setPadding(blockPadding, blockPadding, blockPadding, blockPadding);            tableRow.addView(blocks[row][column]);            tableRow.setPadding(blockPadding, blockPadding, blockPadding, blockPadding);        }        tblCows.addView(tableRow,new TableLayout.LayoutParams(                  LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));      }}</code></pre><p>Please let me know.... Thanks.</p>","341443","","","","","2012-08-29 21:14:23","How to set padding to columns in table layout dynamically","<android><android-layout><tablelayout>","3","0","","",""
"4553174","1","4553611","","2010-12-29 10:09:25","0","1957","<p>While sending mail from a button's click my device shows an error. Which throws SuperNotCalledException in logcat</p><p>I am posting the code and the logcat output here.</p><p>Code</p><pre><code>Intent emailIntent = new Intent(      android.content.Intent.ACTION_SEND);    emailIntent.setType(""text/plain"");    String recosubject = getString(R.string.recoSub);    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, """"      + recosubject);    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, """"      + reco);    startActivity(Intent.createChooser(intent, ""Send mail...""));</code></pre><p>And here is the logcat output</p><pre><code>Uncaught handler: thread main exiting due to uncaught exception12-29 15:29:14.488: ERROR/AndroidRuntime(6823): android.app.SuperNotCalledException: Activity {android/com.android.internal.app.ChooserActivity} did not call through to super.onCreate()12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2461)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.os.Handler.dispatchMessage(Handler.java:99)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.os.Looper.loop(Looper.java:123)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at android.app.ActivityThread.main(ActivityThread.java:4367)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at java.lang.reflect.Method.invokeNative(Native Method)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at java.lang.reflect.Method.invoke(Method.java:521)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)12-29 15:29:14.488: ERROR/AndroidRuntime(6823):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Can anybody tell what is going wrong in this code? </p>","246942","","","","","2010-12-29 11:20:05","android: problem sending mail, SuperNotCalledException thrown","<android><email>","3","1","","",""
"4553186","1","5239889","","2010-12-29 10:11:09","4","14391","<p>I want to disable/enable all checkboxes in listview. infact want to get select all behaviour by clicking on top checkbox.</p><p>thanks</p>","227129","","","","","2012-07-25 22:03:24","Android Checkbox listview select all (disable/enable)","<android><listview><checkbox>","2","0","1","",""
"4553238","1","","","2010-12-29 10:19:32","3","5332","<p>i want to clear data cache programmatic of my application that is increasing, right now i am clearing from Settings->Applications->Manage Application->My Application->Clear Cache.</p><p>but i want to do it by programmatic, please help me.</p>","554837","","1471203","","2013-01-10 07:00:02","2013-01-10 07:00:02","how to clear data cache of the application through code","<android>","1","0","3","",""
"4553361","1","","","2010-12-29 10:40:13","0","289","<p>HI , why my text is not coming at the bottom evethough i have given  tParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);Here is my code please help, </p><pre><code> footScroll_relative = new RelativeLayout(this);    footScroll_scrollView = new ScrollView(this);    footScroll_horizontalScrollView = new HorizontalScrollView(this);    test_text = new TextView(this);    footScroll_relative.setLayoutParams(new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.FILL_PARENT));    LayoutParams tParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    tParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);    footScroll_horizontalScrollView.setLayoutParams(new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT,android.view.ViewGroup.LayoutParams.FILL_PARENT));    footScroll_scrollView.setLayoutParams(tParams);    test_text.setText(""Ramesh "");    footScroll_horizontalScrollView.addView(test_text);    footScroll_scrollView.addView(footScroll_horizontalScrollView);    footScroll_relative.addView(footScroll_scrollView);    setContentView(footScroll_relative);</code></pre>","487604","","487604","","2010-12-29 12:54:14","2010-12-29 13:34:53","text is not coming at the bottom of the screen","<android>","1","0","","",""
"4553367","1","14038978","","2010-12-29 10:41:18","7","7460","<p>i am trying to change the color of horizontal progress bar but it is not changing. i did some googling and gone through some example given in ur site. But i am not getting success to change the color accurately. i used <code>progressBar.setProgressDrawable(Drawable d)</code> but it sets the background color of the whole progress bar view instead of setting the background color of only the bar itself. </p><p>Please, any body help me.</p><p>thanks </p>","489762","","473070","","2010-12-29 11:00:59","2012-12-26 10:04:44","Change color of progress bar in android","<android><progress-bar>","2","0","0","",""
"4553374","1","4877526","","2010-12-29 10:43:37","74","45749","<p>How can I trigger a button click event through code in Android? Basically, I want to trigger the button click programmatically when some other event occurs.</p><p>Thanks a lot :)</p>","557021","","557021","","2010-12-29 11:02:35","2013-11-12 18:58:39","How to simulate a button click through code in Android?","<android>","3","2","19","",""
"4553418","1","4553429","","2010-12-29 10:50:03","0","2911","<p>Is there something simple i might be missing?  The ""kruis"" picture shows up on my ImageButton, so i'm pretty sure my main.xml is good, but when i click on the ImageButton, i get no Toast and testView does not change... been struggling for a few hours on this now, not sure what i'm doing wrong!</p><pre><code>package com.matchit;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ImageButton;import android.widget.TextView;import android.widget.Toast;public class matchit extends Activity {OnClickListener cardListener;TextView testView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    testView = (TextView)findViewById(R.id.test);    ImageButton b1 = (ImageButton)findViewById(R.id.card1);    b1.setImageResource(R.drawable.kruis);    b1.setOnClickListener(cardListener);    cardListener = new OnClickListener(){        @Override        public void onClick(View v) {            testView.setText(""its working"");            Toast.makeText(getApplicationContext(),                    ""its working"",                     Toast.LENGTH_LONG).show();        }    };}</code></pre><p>}</p>","486086","","","","","2010-12-29 10:52:08","can someone help me with why my OnClickListener won't work? Android","<android><imagebutton>","1","0","","",""
"4553436","1","4553471","","2010-12-29 10:53:20","0","398","<p>How can we switch on landscape mode from portrait on Mac OS in andriod? </p><p>I already tried with <kbd>7</kbd>, <kbd>9</kbd>, <kbd>CTRL</kbd><kbd>F12</kbd>, <kbd>CTRL</kbd><kbd>F11</kbd> but they didn't work.</p>","432559","","11621","","2012-04-05 08:50:00","2012-04-05 08:50:00","how can we switch on landscape mode from portrait on mac os in android","<android>","1","0","","",""
"4553451","1","","","2010-12-29 10:55:46","0","1085","<p>how do i store a static html page in android emulator and later on view it from WebView while running?</p>","557038","","","","","2011-02-01 08:00:18","how do i store a static html page in android emulator and later on view it from WebView while running?","<android><android-webview><asset>","2","0","","",""
"4553605","1","4653671","","2010-12-29 11:19:21","69","30756","<p>I can't get the meaning of <code>onStart()</code> transition state. The <code>onResume()</code> method is always called after <code>onStart()</code>. Why can't it be the <code>onResume()</code> is invoked after <code>onRestart()</code> and <code>onCreate()</code> methods just excluding <code>onStart()</code>? What is its purpose?</p><p>Why can't we live without <code>onStart()</code>. I still consider it as redundant (probably because don't understand its meaning completely).</p>","397991","","1321640","","2013-01-02 11:44:23","2013-01-02 11:44:23","Difference between onStart() and onResume()","<android>","7","1","58","",""
"4553630","1","4553755","","2010-12-29 11:22:46","2","1249","<p>What is the common approach to save user's inputed data:1. Overriding onPause() method with subsequent calling to specially designed method to store data using Android PreferencesOR2. Usage of onSaveInstanceState() and onRestoreInstanceState()?</p><p>Thank you very much.</p>","397991","","","","","2014-02-07 07:05:44","Data saving during Activity life cycle","<android>","2","0","","",""
"4553650","1","4555528","","2010-12-29 11:26:10","18","11535","<p>I have an activity showing preview from camera, so it need to be set as landscape only. At the bottom (regardless of device rotation) I want to show a text view. I am using OrientationEventListener which gives device's orientation from its natural position. I can implement a solution which works well on portrait default devices but to make it work also on landscape default devices I need to be aware of running on such a device. Thus the question is how to check it?</p>","501940","","","","","2013-05-10 10:38:46","How to check device natural (default) orientation on Android (i.e. get landscape for e.g., Motorola Charm or Flipout)","<android>","9","1","7","",""
"4553669","1","","","2010-12-29 11:28:18","0","60","<p>I am developing an android app that will send out SMS on birthdays,new year etc . I was able to add my own field for contact s DB , but is this a good idea modifying contacts DB ? There s also one more way , ie to have my own DB , but do i update this if the user adds new contact s ?? any ideas ?</p>","557072","","","","","2010-12-29 12:02:05","Holiday alerts to family and friends","<android>","1","1","","",""
"4553885","1","","","2010-12-29 11:58:53","0","226","<p>I am sure there is a better way to do what I am doing in my apps.  The current one I am trying to improve is a list of military cadences.  The way I am doing it now is by loading html files in a web view.</p><p>What I would like to be able to do is have one view set up and just be able to add the text portion of what I would be displaying with the html file.  </p><p>What would be the best method.  I know this is probably a pretty simple thing to do with a sting or array but I am at the very beginner level and would need to be pointed in the right direction to do it.</p>","465131","","","","","2010-12-29 12:50:40","Android app display different blocks of text using the same views","<android><layout><view>","1","0","","",""
"4553937","1","","","2010-12-29 12:09:03","2","1370","<p>I'm trying to capture audio from a microphone and no matter what buffer size (<code>bufferSizeInBytes</code>) I set at construct time of <code>AudioRecord</code>, when I do a <code>AudioRecord.read</code> I always get <code>8192</code> bytes of audio data (128 ms). I would like the <code>AudioRecord.read</code> be able to read <code>40ms</code> of data (<code>2560 bytes</code>). The only working sample code that I can find is Sipdroid (<a href=""http://code.google.com/p/sipdroid/source/browse/trunk/src/org/sipdroid/media/RtpStreamSender.java%29"" rel=""nofollow""><code>RtpStreamSender.java</code></a>) which I haven't tried. Here's the relevant piece of my code: </p><pre><code>public void run(){ running = true; android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URG ENT_AUDIO); try {      frameSize = AudioRecord.getMinBufferSize(samplingRate,               AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);      Log.i(TAG, ""trying to capture "" + String.format(""%d"", frameSize) + "" bytes"");      record = new AudioRecord(MediaRecorder.AudioSource.MIC, samplingRate,     AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, frameSize);     record.startRecording();      byte[] buffer = new byte[frameSize];      while (running)     {         record.read(buffer, 0, frameSize);         Log.i(TAG, ""Captured "" + String.format(""%d"", frameSize) + "" bytes of audio"");      }      record.stop();      record.release();  } catch (Throwable t) {  Log.e(TAG, ""Failed to capture audio"");    }  }</code></pre><p>My questions/comments are: </p><ol><li>Is this a limitation of AudioRecord class and/or the particular device ? </li><li>I don't see a method to query the supported sampling rate (steps of bufferSizeInBytes) a given device can do. It would be nice if there's one. </li><li>Can we use AudioRecord.OnRecordPositionUpdateListener and how?</li><li>In above code encoding pcm in 8 bit is not working. why?if anyone tried sipdroid code, help me.Thanks in advance, </li></ol>","549929","","35060","","2010-12-29 12:36:47","2010-12-29 12:36:47","real time audio recording and sending","<android>","0","1","2","",""
"4554039","1","","","2010-12-29 12:22:35","1","613","<p>I'm developing application in android. I have contactID, so how can I fetch particular People._ID record from contact list?</p>","557112","","473070","","2010-12-29 13:28:41","2010-12-29 18:02:58","select contact detail where People._ID = contact ID in android","<android><contacts>","1","0","","",""
"4554243","1","","","2010-12-29 12:51:13","0","463","<p>I have an inner handler class that calls the method sendMessage. sendMessige is outside the handler class, but inside the conatining Android java class.</p><p>On the emulator (AVD 2.2) it works fine, but on my Android 2.2 device the method sendMessage is not called at all. </p><p>Inner handler class:</p><pre><code>private Handler handler2 = new Handler() {          public void handleMessage(Message msg) {        if (GeoSetting.equals(""s"") &amp;&amp; (inNumber.equals(definedNumber))) **SendService.this.sendMessage(definedNumber, DisplayLoc)**;        if (GeoSetting.equals(""a"")) **SendService.this.sendMessage(inNumber, DisplayLoc)**;        stopService(new Intent(getApplicationContext(), GeoService.class));                  };</code></pre><p>The method that should be called:</p><pre><code>private void sendMessage(String sendNumber, String sendText){    Toast.makeText(getApplicationContext(), ""done!!!"", Toast.LENGTH_LONG).show();    SmsManager sms = SmsManager.getDefault();    try {        sms.sendTextMessage(sendNumber, null, sendText, null, null);         if (Message == true) {Toast.makeText(getApplicationContext(), ""Sending SMS to ""+sendNumber+"": ""+sendText, Toast.LENGTH_LONG).show();}    }     catch (Exception exeption){        Toast.makeText(getApplicationContext(), ""Something is wrong, could not send SMS!"", Toast.LENGTH_LONG).show();    }    Toast.makeText(getApplicationContext(), ""method called!"", Toast.LENGTH_LONG).show();}</code></pre><p>Does anybody have an idea why sendMessage is not called on the real device? Thank you for the help!</p>","522276","","","","","2010-12-29 12:51:13","Works on emulator but not on device","<android><methods><android-emulator><handler>","0","3","","",""
"4554276","1","4554417","","2010-12-29 12:54:51","4","967","<p>Is there any way we can launch the android widget from our application immediately application installation or by showing button(eg:- 'Add Widget') within the application. So it like automatically add widget to our home screen using code.</p><p>ThanksPrakhs</p>","557012","","","","","2010-12-29 13:16:40","Launch Android Widget from Activity","<android><android-widget>","1","2","2","",""
"4554344","1","","","2010-12-29 13:05:29","4","1029","<p>i am using libgdx framework in android. i copied gdx-helloworld.zip from the link <a href=""http://code.google.com/p/libgdx/downloads/list"" rel=""nofollow"">http://code.google.com/p/libgdx/downloads/list</a> and imported it in eclipse. but the problem is i couldn't run the application.</p><p>Description - Conversion to Dalvik format failed with error 1 Resource - gdx-helloworld-android Location - Unknown Type - Android Packaging Problem</p><p>I dont where is the problem. any pls help me solve the pbm</p>","392339","","","","","2013-10-07 06:36:37","Android Packaging Problem","<android>","2","1","","",""
"4554349","1","","","2010-12-29 13:05:58","0","865","<p>when nothing selected from the spinner it shows alert message in android</p>","555910","","","","","2010-12-29 15:05:01","when nothing selected from the spinner it shows alert message in android","<android><spinner><alertdialog>","1","3","","",""
"4554377","1","","","2010-12-29 13:10:21","1","335","<p>I want to develop one small application to transfer a file from my android emulator to an android device through coding. I dont know how to achieve this, please if anybody knows help me.</p>","131062","","473070","","2010-12-29 13:15:41","2012-03-07 15:46:44","How to transfer a file from one android emulator to my Android device?","<java><android><networking>","1","0","","",""
"4554409","1","","","2010-12-29 13:15:34","0","1238","<p>Is there anyway to trigger some code when the Alarm in the clock-application is executed? I read about the Alarm Manager but its only for creating your own alarms.</p><p>I guess you will never be sure if the clock-application exists on the device. But if it does I would like to get notified.</p><p>/Br Johannes</p>","185433","","","","","2010-12-29 14:46:39","Trigger code when alarm from Clock-application starts in Android","<android><notifications><clock><alarm>","1","0","1","",""
"4554435","1","4554529","","2010-12-29 13:20:55","1","3033","<p>i have a listview like this</p><pre><code>companyname              symbolsamsung                  samonida                    ondtata                     ta.                         ..                         ..                         .</code></pre><p>so i want to get the index of the selected item and also string of the selected item(i.e.,sam(or)ond(or)ta) .So please tell me how to get the index of the selected item and string also .</p><p>Thank you in advance</p>","745367","","","","","2010-12-29 15:28:44","how to get the index and string of the selected item in listview in android","<android><listview>","2","0","","",""
"4554569","1","4554873","","2010-12-29 13:37:27","2","4782","<p>Greetings,</p><p>Does anyone know how I can get coarse GPS coordinates when I don't have a fix and get fine GPS coordinates when I have a fix?</p><p>I've tried googling for some sample code to no avail.</p><p>I did find this: <a href=""http://www.android10.org/index.php/articleslocationmaps/226-android-location-providers-gps-network-passive"" rel=""nofollow"">http://www.android10.org/index.php/articleslocationmaps/226-android-location-providers-gps-network-passive</a></p><p>But I don't know how to implement the fallback to coarse/upgrade to fine.</p><p>I hope someone can help. Thanks in advance,</p>","395974","","395974","","2010-12-29 13:47:58","2010-12-29 14:20:09","Android: GPS fallback from fine to coarse","<android><gps>","2","0","1","",""
"4554570","1","4554601","","2010-12-29 13:37:44","2","101","<p>And now a very easy java question....</p><pre><code>        Object[] objectList={            new Object(name[0], description[0], R.drawable.creep_0),            new Object(name[1], description[1], R.drawable.creep_1),            new Object(name[2], description[2], R.drawable.creep_2),            new Object(name[3], description[3], R.drawable.creep_3),};</code></pre><p>How can i do this dynamically with a <code>for</code> cycle? Thanks!</p>","396133","","","","","2010-12-29 13:41:43","Doing this with a for cycle","<java><android>","2","1","","",""
"4554583","1","","","2010-12-29 13:39:34","4","3974","<p>The topic pretty much says it all.</p>","557187","","473070","","2010-12-30 12:58:58","2010-12-30 12:58:58","Android 2.2: How to make an app to run automaticly on startup & how to make an app start another app","<java><android><autostart><bootcompleted>","2","0","2","",""
"4554605","1","4556456","","2010-12-29 13:42:30","7","868","<p>I am trying to find a way to have plugins in an application.</p><p>My goal is to have a Core application, and offer plugins that can be downloadable on the market. (It can be anything, weather, radio player, etc...)</p><p>The plugins would not interact with each other, so the core application is more like a directory of multiple applications with kind of a SDK that the plugins use.</p><p>There is the Tic Tac Toe example in the Android doc, but the requires the main app to declare the external lib. My wish is that the core app detects the new installed plugins and shows them.</p><p>I found <a href=""http://stackoverflow.com/questions/2232195/how-to-achieve-modularity-structure-of-app-subcomponents-on-android"">this other question</a> but there is no answer.</p><p>Is there a way to do that?</p><p>Edit: There are also applications that can be unlocked by buying another app on the market. How do they work? I could not find anything interesting yet. You know what you find when you google ""android unlock"" :)</p>","183665","","","","","2011-02-21 03:52:33","Write an application that can use plugins","<android><plugins>","3","2","5","",""
"4554608","1","","","2010-12-29 13:42:51","1","183","<p>I have a working app which reports a bunch of statistics. I am now wanting to include a couple of widgets that show some summary data so that the user doesn't have to open the app to get to it.</p><p>What's the relationship between widgets and apps? Can I reuse the main code or do I need to duplicate some of the code so that the widget can function independently?</p>","330368","","","","","2010-12-29 14:03:17","Relationship between Widget and main app?","<android><android-widget>","1","0","","",""
"4554690","1","","","2010-12-29 13:53:38","0","202","<p>is there anyway of creating a String overlay? Because I'm working on a project which I show the spots in the map, but I wanna also show some String identifing the spot, like an id, for exampleatt,Andre Mariano</p>","256971","","","","","2010-12-29 13:59:30","String Overlay in Android","<java><android><overlay><itemizedoverlay><overlays>","1","0","","",""
"4554735","1","4554870","","2010-12-29 14:00:19","2","657","<p>java.lang.OutOfMemoryErrorat com.solvoterra.xmlengine.Element.(Element.java:9)at com.solvoterra.xmlengine.XML_Handler_Main.startElement(XML_Handler_Main.java:71)at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:146)at org.apache.harmony.xml.ExpatParser.append(Native Method)at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:505)at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:492)at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:308)at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:264)at com.solvoterra.xmlengine.Project_Man.readXML_File(Project_Man.java:148)at com.solvoterra.xmlengine.Project_Man.run(Project_Man.java:83)at java.lang.Thread.run(Thread.java:1102)</p><p>I can see from this the error has occurred whilst running a new process which only contains the function to SAX Parse an XML file into memory (RAM) I don't know all the details as this information has been provided by an anonymous user on the market.</p><p>Before the function to Parse is called all buffers and memory is cleared of existing data. </p><p>Q: is it possible that the user is trying to Parse a HUGE XML database into memory and the RAM allocated by his phone simply isn't enough to handle his database?</p>","548552","","","","","2010-12-29 14:22:50","OutOfMemoryError","<android>","2","2","","",""
"4554770","1","","","2010-12-29 14:05:52","0","143","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4547511/how-can-i-display-a-listview-on-the-top-of-another-activity-in-android"">how can i display a listview on the top of another activity in Android</a>  </p></blockquote><p>hi..i want to display a custom list view  on one existing activity so that the custom list view will cover half screen of the existing activity without interrupting the actions of the existing activity...how can i do that..can any one pls help methanks for help.</p>","556163","","","","","2010-12-29 14:13:25","custom listview over an exsisting activity","<android>","0","0","0","2010-12-29 20:07:48",""
"4554802","1","4554818","","2010-12-29 14:09:24","0","648","<p>hi i have found Uri as immutable reference i dont know what it is the exact meaning of immutable reference... can anyone help me?</p>","553670","","","","","2013-04-16 08:53:13","what is an immutable reference?","<android>","5","0","","",""
"4554821","1","","","2010-12-29 14:12:04","2","256","<p>I am trying to parse some unsigned integers from a file stored on the memory card.Since java does not provide unsigned types I use longs to store the obtained values.</p><p>The performance seems to be influenced by the Debugger:Without the debugger connected I can parse 20000 values in ~820ms.With the debugger ~5800ms (on HTC Desire).</p><p>Can you reproduce this on your devices? Any clue why the debugger has such an overhead?</p><p>Here is the code:</p><pre><code>public class IntParsingTest extends Activity {public static final String TEST_FILE = ""yourfile"";public static final int LOOPS = 20000; private Handler handler = new Handler() {    @Override    public void handleMessage(Message msg) {        super.handleMessage(msg);        Toast.makeText(IntParsingTest.this, (CharSequence) msg.obj, Toast.LENGTH_LONG).show();    }};@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    try {        Runnable r = new Runnable() {            @Override            public void run() {                Message m = new Message();                File path = Environment.getExternalStorageDirectory();                File f = new File(path, TEST_FILE);                long startTime = SystemClock.currentThreadTimeMillis();                try {                    InputStream is = new FileInputStream(f);                    for (int i = 0; i &lt; LOOPS; i++) {                        readUnsignedInt(is);                    }                    long total = SystemClock.currentThreadTimeMillis() - startTime;                    m.obj = ""Time to parse\r\n""                        + LOOPS                         + "" unsigned integers:\r\n""                         + total + "" ms"";                    handler.sendMessage(m);                } catch (Exception e) {                    m.obj = e.getMessage();                    handler.sendMessage(m);                }            }        };        new Thread(r).start();    } catch (Exception e) {    }}public static long readUnsignedInt(InputStream input) throws IOException {    long b1 = input.read();    long b2 = input.read();    long b3 = input.read();    long b4 = input.read();    return (b1 &lt;&lt; 24) + (b2 &lt;&lt; 16) + (b3 &lt;&lt; 8) + b4;}</code></pre><p>}</p><p><strong>Edit:</strong> It is also interesting that only the shift opperations are slow. If I return one of the bytes or a sum of them it works much faster. It may be the way shift is implemented !?</p>","557203","","557203","","2011-01-02 13:03:13","2011-01-02 13:03:13","Android parsing ints efficiency","<android><performance><debugging>","1","1","","",""
"4554831","1","5893961","","2010-12-29 14:13:35","4","2139","<p>I'm in a bit of a situation with my HTML <strong>&lt;select&gt;</strong> dropdowns, when they are displayed in an iPhone or Android browser. I often need to render <strong>&lt;option&gt;</strong> labels that are quite long, such as for instance</p><blockquote>  <p>[AccountType] [EUR] - [Customer] - CH12 3456 7890 1234 5678 9</p></blockquote><p>On Android, this will render something like that:</p><blockquote>  <p><img src=""http://i.stack.imgur.com/5Eloe.png"" alt=""android screen""></p></blockquote><p>On the iPhone it's even worse. While I like the native look and feel, the cropping of the labels is a no-go. Circled in red, you'll find how the dropdown itself is rendered. I could live with that. But check out the blue popup that appears, when I click on it. The user will never find his data...</p><h2>PLEASE, before you answer...</h2><p>... consider these points:</p><ul><li>I can abbreviate some information, but I will still have cases with long option labels in the select. So no need to tell me that the IBAN could be abbreviated, etc.</li><li>I cannot rely on CSS styling of <strong>&lt;select&gt;</strong> or <strong>&lt;option&gt;</strong> elements.</li><li>User hunter has already proposed the <strong>&lt;optgroup&gt;</strong> tag <a href=""http://stackoverflow.com/questions/4554831/html-select-element-is-abbreviated-too-much-in-iphone-or-android-browsers#4554858"">here</a>. That's quite a nice idea and will be a small workaround, but is not enough, as the IBAN is still cropped by both iPhone and Android browsers :-(</li><li>I already know the very nice looking <a href=""http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/"" rel=""nofollow"">jQuery UI Selectmenu prototype</a>. Unfortunately, it's not yet compatible with jquery-ui 1.8.5 and there is no guarantee when it will be stable.</li><li>I am using jquery and jquery-ui 1.8.5, so any ideas / references to plugins are very welcome.</li><li>Any other ideas to circumvent that problem <strong>GENERALLY</strong> are welcome.</li></ul>","521799","","521799","","2011-01-03 12:29:03","2011-05-17 00:19:24","HTML <select> element is abbreviated in iPhone or Android browsers","<iphone><jquery><android><html><jquery-ui>","4","0","2","",""
"4554879","1","4554914","","2010-12-29 14:21:07","0","2404","<p>i am using application context for saving data, and it work fine for me ,but the problem comes,when i press home button and take some other application  and return to my application after a long time my app fail, no data in application context, how can i save the application context  </p>","487219","","","","","2010-12-29 14:27:47","Android save Application Context","<android>","2","2","","",""
"4555187","1","4712048","","2010-12-29 15:05:46","1","3651","<p>Im implementing tablelayout dynamically code below. </p><pre><code>private void showCowsTblField() {    for (int row = 0; row &lt; numberOfRowsInField - 1; row++) {        TableRow tableRow = new TableRow(this);        tableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,                LayoutParams.WRAP_CONTENT));        for (int column = 0; column &lt; numberOfColumnsInField - 1; column++) {            LayoutParams layoutParams = new LayoutParams(                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);            if (column == 0) {                textSno[row][column].setLayoutParams(layoutParams);                layoutParams.setMargins(0, 0, 0, 0);                tableRow.addView(textSno[row][column]);            } else {                blocks[row][column].setLayoutParams(layoutParams);                layoutParams.setMargins(1, 1, 1, 1);                tableRow.addView(blocks[row][column]);            }            tableRow.setBackgroundResource(R.drawable.bar_1);        }        tblCows.addView(tableRow, new TableLayout.LayoutParams(                LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));    }}</code></pre><p>here block is a class extends Button class,in this class iam setting background image as </p><pre><code>this.setBackgroundResource(R.drawable.edit_button);</code></pre><p>Here problem is the button background image size(height) is changing to fit to tablerow height. which is not looking good.</p><p>How i can set button background image to actual size (wrapcontent) in table row.</p><p>Please let me know....Thanks.........</p>","341443","","","","","2013-05-31 18:06:48","How to set button background image to wrap content in a table layout dynamically","<android><android-layout><tablelayout>","2","0","1","",""
"4555215","1","5939558","","2010-12-29 15:09:17","18","57760","<p>I'm just trying this little sample project, all it does:Activity one has a Button that sends a Broadcast. Activity two displays a toast when received.Below is the code, the Broadcast is never received. What do I do wrong?</p><p><em>Sending the Broadcast</em></p><pre><code>public class SendBroadcast extends Activity {    public static String BROADCAST_ACTION = ""com.unitedcoders.android.broadcasttest.SHOWTOAST"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void sendBroadcast(View v){        Intent broadcast = new Intent();        broadcast.setAction(BROADCAST_ACTION);        sendBroadcast(broadcast);    }}</code></pre><p><em>Receiving it</em></p><pre><code>public class ToastDisplay extends Activity {    private BroadcastReceiver receiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            Toast.makeText(getApplicationContext(), ""received"", Toast.LENGTH_SHORT);        }    };    @Override    protected void onResume() {        IntentFilter filter = new IntentFilter();        filter.addAction(SendBroadcast.BROADCAST_ACTION);        registerReceiver(receiver, filter);        super.onResume();    }    @Override    protected void onPause() {        unregisterReceiver(receiver);        super.onPause();    }}</code></pre><p>Manifest</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".SendBroadcast"" 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="".ToastDisplay""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.unitedcoders.android.broadcasttest.SHOWTOAST""&gt;&lt;/action&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre>","257387","","281545","","2013-03-11 13:44:01","2013-03-11 13:44:01","Android BroadcastReceiver within Activity","<android><broadcastreceiver>","5","6","8","",""
"4555218","1","4555245","","2010-12-29 15:09:40","1","4989","<p>How can I add a <code>Bitmap</code> taken from the web (in the app i mean!) to the drawable resources? So i can access the <code>Bitmap</code> using <code>R.drawable.bitmapName</code>...</p>","396133","","958370","","2012-02-05 11:32:36","2012-02-05 11:32:36","Adding a bitmap to the drawable resources","<android><android-resources>","2","2","","",""
"4555253","1","4555762","","2010-12-29 15:14:52","0","457","<p>I have multiple levels each with their own activity and surfaceview. I'm have a difficult time figuring out how I could use just one thread extended class for all the levels without explicitly setting each surfaceview to the thread. In the thread I'm going to have to use a set method to get the surfaceview class and call its onDraw method in the loop, but I want to use this thread again with all the other levels. Can someone help me on this matter?</p>","507007","","","","","2010-12-29 16:15:43","Android thread class reuse","<java><android><multithreading>","1","3","","",""
"4555523","1","4555587","","2010-12-29 15:46:33","2","391","<p>The <a href=""http://developer.android.com/guide/topics/fundamentals.html#actlife"" rel=""nofollow"">Activity lifecycle</a> section in the Application Fundamentals tutorial states that there are <strong>3</strong> states:</p><blockquote>  <p>An activity has essentially three  states:</p></blockquote><p>(1. active/running 2. paused 3. stopped)</p><p>But then as I continued reading the actual Activity class documentation, the <a href=""http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle"" rel=""nofollow"">Activity Lifecycle</a> section states that there are <strong>4</strong> state:</p><blockquote>  <p>An activity has essentially four  states:</p></blockquote><p>(1. active/running 2. paused 3. stopped 4. ""dropped""?)</p><p>Both sources (on the same website) agree about the first 3, but the 4th one is only mentioned in the class documentation and is unnamed.</p><p>So, are there really 4 states or only 3?</p><p>If there are 4, what is the name of the 4th one?</p><p>Please help me understand this discrepancy.</p><p>Also, highlighted colored blocks in <a href=""http://developer.android.com/images/activity_lifecycle.png"" rel=""nofollow"">this beautiful and very informative flowchart</a> don't seem to correspond to the states. Where, in <a href=""http://developer.android.com/images/activity_lifecycle.png"" rel=""nofollow"">the flowchart</a>, would you mark the 3 or 4 states?</p>","418055","","","","","2011-05-24 19:16:38","How Many States Does an Activity Have?","<android><activity><lifecycle><states>","2","0","2","",""
"4555547","1","4556095","","2010-12-29 15:49:11","0","601","<p>I've a widget that is packaged in an application and I've several doubts about the context/lifecycle of the widget/application:</p><ul><li>The application and widget share the same process, and consecuently singletons?</li><li>If I've services they have to be remote ones?</li><li>What's the lifecycle of the process that updates the widget? Is only for the widget?</li></ul><p>In general any information about the widget lifecycle/context would be very apreciated</p>","269454","","","","","2010-12-29 17:04:59","Information about widget context/lifecycle","<java><android><android-widget>","1","2","1","",""
"4555619","1","4556904","","2010-12-29 15:59:04","4","917","<p>Does anyone have any experience with analytics software/services for the mobile app stores? I am currently developing only for iOS so that's what I'm mainly interested in, however I would like to know if there are some analytics that aggregate data across several app stores in case I make some say Android apps.</p><p>I find the iTunes Connect reporting a bit lacking.</p>","399772","","399772","","2010-12-29 17:49:51","2011-11-17 20:21:33","options for mobile app store analytics (Apple, Android, OVI, etc)?","<iphone><android><blackberry><app-store><nokia>","4","0","","",""
"4555621","1","4555924","","2010-12-29 15:59:15","0","1198","<p>can somebody tell me why this happens, please read below. I have my own class Data which extends Button. In my Activity's class I have a List which is appending with new Data object on each button click. I want to keep created objects of class Data on the screen after configuration changes, namely orientation change. So I've overrided onSaveInstanceState() and using it to restore my data in onCreate() method. In mentioned method I'm saving every Data object from the list of objects. In onCreate() method I'm trying to restore my data like this: </p><pre><code>public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.main);          button = (Button) findViewById(R.id.Button01);          layout = (LinearLayout) findViewById(R.id.MyLayout);          dataList = new ArrayList&lt;Data&gt;();          if(savedInstanceState != null) {              int numberOfObjects = savedInstanceState.getInt(""Number of objects"");              for (int i = 1; i &lt; numberOfObjects; i++) {                  Data tmp = (Data)savedInstanceState.getSerializable(""Button name "" + i);                  if (tmp != null) {                      dataList.add(tmp);                  }                  if (dataList.size() != 0) {  // I'm using one of the lines at a time, uncommented here just for example:                      layout.addView((Data)dataList.get(i-1)); // IllegalStateException happens here with advice to invoke removeView() method. I tried to call it on the method beginning, but no success.                      layout.addView(new Data(getApplicationContext())); // This one is perfectly fine                  }              }          }  </code></pre><p>So in first case I'm getting IllegalStateException but it is working great for the second one. I don't understand the difference. </p><p>Just in case, here is my onSaveInstanceState() method: </p><pre><code>@Override      protected void onSaveInstanceState(Bundle outState) {          super.onSaveInstanceState(outState);          Log.d(""Dev"", ""onSaveInstanceState()"");          outState.putInt(""Number of objects"", dataList.size());          for (Data object : dataList) {              outState.putSerializable(""Button name "" + object.getNumber() , object);          }      }  </code></pre><p>And my Data class, but nothing special: </p><pre><code>package as.as.as;  import java.io.Serializable;  import android.content.Context;  import android.widget.Button;  public class Data extends Button implements Serializable {      public static int counter;      public int number;      public Data(Context context) {          super(context);          counter++;          this.number = counter;           this.setText(""Button number "" + Integer.toString(number));      }      public String getNumber() {          return Integer.toString(number);      }  }  </code></pre>","397991","","","","","2010-12-29 16:40:48","IllegalStateException on LinearLayout.addView(View view) method call","<android>","2","1","","",""
"4555680","1","4556144","","2010-12-29 16:05:55","0","142","<p>We have an application:</p><pre><code>public class MyApplication extends Application {...}</code></pre><p>containing a main Activity called Start, configured in AndroidManifest.xml  </p><p>MyApplication starts an AsyncTask, which loads data.   </p><p>When the AsyncTask returns, the Application wants to notify Start,<br>but MyApplication seems to have no reference to Start.  </p><p><strong>Can an Application call methods directly on an Activity ?</strong>  </p>","77115","","","","","2010-12-29 17:20:56","Can an Application call methods directly on an Activity?","<android>","2","2","","",""
"4555721","1","4556318","","2010-12-29 16:11:10","1","1397","<p>In debugger I am getting this warning (5 times):</p><blockquote>  <p>W 2265 ResourceType Skipping entry 0x106000d in package table 0 because it is not complex!</p></blockquote><p>These warnings show every time an activity is brought to the front.I have checked R.java and there is no resource with this address 0x106000d.</p><p>I have no idea what to do.</p>","507153","","","","","2012-05-16 17:07:48","ResourceType (Skipping entry in package table) problem","<android><resources><types>","2","0","","",""
"4555802","1","4555877","","2010-12-29 16:21:41","2","1304","<p>Simple question, but I can't seem to find a good answer within the Android docs. What exactly does it mean when a view has <code>focus</code>? </p><p>More specifically, if using a <code>RadioGroup</code>, can I access the selected child <code>RadioButton</code> by using something like the following?</p><pre><code>RadioGroup rg = (RadioGroup) findViewById(radiogroup);RadioButton activeChild = rg.getFocusedChild();</code></pre><p>My thought was that this would not work... so I started to investigate exactly what <code>focus</code> was. But alas, I've been unsuccessful.</p>","382252","","","","","2010-12-29 16:33:16","What is 'focus' within the Android API?","<java><android><focus>","1","0","","",""
"4555809","1","4795795","","2010-12-29 16:23:11","0","584","<p>I've implemented (thanks to a tutorial) a way to show a custom listView, with images, names and description.</p><p>I used the <code>simpleAdapter</code> to pass the strings <code>name</code> and <code>description</code> to the textViews, and the int of an image's Id (the image is stored in R.drawable) to the imageView.</p><p>The problem is: now i should set the ImageViews to display images downloaded from the web, so I have drawables but i can't get IDs from them.</p><p>How can i customize the simpleAdapter to pass a <code>Drawable</code> to the <code>imageView</code>, and set the image with the <code>setImageDrawable</code> method?</p><p>Please be clear! Thanks</p>","396133","","","","","2011-01-25 16:05:04","Passing values to view with the adapter","<android><adapter>","3","0","","",""
"4555811","1","","","2010-12-29 16:23:14","-3","268","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/4554770/custom-listview-over-an-exsisting-activity"">custom listview over an exsisting activity</a><br>  <a href=""http://stackoverflow.com/questions/4547511/how-can-i-display-a-listview-on-the-top-of-another-activity-in-android"">how can i display a listview on the top of another activity in Android</a>  </p></blockquote><p>i am having 2different activities ..one is main screen in that a menu option is there if i clicked on index means the other custom list activity will be displayed in another screen ..now i want to display that custom list view activity is placed over the main activity and it covers only half of that main activity and the man activity functioning should be normal..how can i do this ...help me to resolve it..</p><p>Thanks for help..</p>","556163","","","","","2010-12-29 16:23:14","dispaly a listview over other activity","<android>","1","2","0","2010-12-29 20:07:17",""
"4555888","1","","","2010-12-29 16:35:24","3","3780","<p>I play around with the 'searchable dictionnary' to get into Android development.</p><p>My problem is that I get some <code>ClassCastException</code> when modifying the XML layouts.</p><p>My guess is that the R file is outdated, but what is weird is that I still have the problem even after recreating it.</p><p>Here are the releveant piece of code and log :</p><p><b>The log file :</b><br /></p><blockquote>  <p>Caused by: java.lang.ClassCastException: android.widget.ImageButton  E/AndroidRuntime(  438):        at  eu.accleaner.android.WordActivity.onCreate(WordActivity.java:87)</p></blockquote><p><b>The incriminated line in the Activity :</b><br /></p><pre><code>mDefinition = (TextView) findViewById(R.id.definition);</code></pre><p>Thanks in advance for your help.</p><p>Cheers,</p><p>Vincent</p>","557339","","638994","","2013-01-31 14:42:03","2014-03-27 07:43:50","Unexpected ClassCastException with findViewById","<android><layout><classcastexception>","3","0","","",""
"4555905","1","5411997","","2010-12-29 16:38:33","1","191","<p>I'm having a specific problem that I'd love some insight on. Here is my code</p><pre><code>Intent i = new Intent();i.setDataAndType(media, mediaType);startActivity(i);</code></pre><p>This starts an audio activity for me and it even puts a notification item in the notification bar saying that it is an ongoing task. However, if I hit the Home button or Back button the ongoing task is immediately killed for me. I was confused by this behavior.</p><p>I found a way to keep the task going by the following: when the audio activity starts I drag down the notification bar and click the notification item ( which really just shows me the same activity again ) and when I do this it behaves accordingly. When I click the Home button it continues. When I hit the back button, it continues. For some reason when I click the notification item the ""correct"" Intent is fired.</p><p>What I'd like is for this behavior to start when I first launch the audio, because no one that uses my app is going to pull down the notification bar and click the notification item to get this to work properly.</p>","375490","","375490","","2011-03-23 21:37:40","2011-03-23 21:42:46","How can I keep my ongoing audio task ongoing?","<android><audio><android-intent>","1","0","","",""
"4555946","1","","","2010-12-29 16:44:24","0","484","<p>I have an apk in my raw folder. I can start the installation procedure by:</p><pre><code>            Uri installUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory() + ""/sample.apk""));        Intent intent = new Intent(Intent.ACTION_VIEW);        intent.setDataAndType(installUri, ""application/vnd.android.package-archive"");</code></pre><p>Before I start it I want to show the permission. Is it possible to see the permission before (!) starting the android installation dialog?</p><p>Thanks, best regards.</p>","472355","","","","","2010-12-30 00:34:48","See permission of an raw apk-file","<android>","1","0","0","",""
"4556002","1","4556195","","2010-12-29 16:52:33","0","658","<p>i heard the rumors about google tv and stuff, but after falling in lovewith android and the sdk i tought ""why not to have android on my tv"".Some days ago I was looking for hardware for my mini-pc media center computer.</p><p>I think it is possible and i think is a good idea too - using android oncustom media center computer, but the question is - how? What typeof hardware i need to make it real. Connecting Htc desire HD to TVis not the solution :-)</p>","508043","","","","","2010-12-29 17:18:06","Good way to start making own Android based Media Center","<java><android><linux><media><center>","1","0","","",""
"4556070","1","4556697","","2010-12-29 17:01:15","1","2224","<p>In my mainActivity I declare static List like this:</p><pre><code>public static List&lt;Map&lt;String, String&gt;&gt; ArrList = new ArrayList&lt;Map&lt;String, String&gt;&gt;();</code></pre><p>Then in other activities I access this list with mainActivity.ArrList ...I am almost sure that I am not supposed to do this, but anyway, I would like to understand all of it a little bit better...</p><p>So, here are my questions:1) As far as I know, due to low memory or something, my mainActivity could get destroyed (while another activity is in focus) and in that case my ArrList would get destroyed too. Is that right?2) Whene I exit, then restart, my app crashes and debugger reports OutOfMemory. I assume upon restart android allocates another block of memory for my static List. So, I also assume that I should destroy static List when Activity ends. How to do that properly?</p><p>I appreciate any other advice about this matter.</p>","507153","","","","","2011-03-17 18:01:38","using static variables in android","<android><variables><static>","2","1","1","",""
"4556075","1","4556763","","2010-12-29 17:02:19","0","867","<p>Hey, I want to implement a view exactly like the callLog table layout.Exactly like <a href=""http://the-gadgeteer.com/wp-content/uploads/2009/01/android-g1-42.jpg"" rel=""nofollow"">this</a></p><p>I´ve studied the documentation, but it didnt helped. because I want to print in a table layout a lot of data from the SQLite Database, so it must be generic, for all the retrieved data. But I cant.</p><p>If someone could show me the code that google uses on the Android CallLog List (for the TableLayout).</p><p>I need to know how to make the name of the contact bigger than the other texts, how to put the icon, etc.</p><p>thx.</p>","399459","","","","","2010-12-29 18:30:41","How to implement the Android CallLog TableLayout","<android><android-layout>","1","0","2","",""
"4556107","1","4631309","","2010-12-29 17:05:55","12","5034","<p>I'm looking for some ideas from a design perspective, and I'm hoping Romain or one of the folks from Google will pick this up as well.  What have you all done with the design of your ListView elements to make it obvious to the user which elements in the list are interactive and which are not?</p><p>In iPhone UI, this is where disclosure indicator arrows are included, but it feels wrong to copy/paste that idea into an Android application.  When we include section headers, they are usually visually different enough (different size and background) to make this point, but what about in cases where only some of the list elements lead to more information?</p><p>I appreciate all thoughts on this topic, and would love to see more of these covered in the Android UI Guidelines.</p>","246461","","","","","2012-05-12 05:31:18","Android UI Design: Interactive ListView Elements","<android><listview><user-interface>","2","2","6","",""
"4556157","1","5078060","","2010-12-29 17:13:27","0","784","<p>Have some problem to use android.net.wifi.ScanResult class in my own service.In fact i have noticed that CREATOR in my class is missing, but in android doc (http://www.kiwidoc.com/java/l/x/android/android/8/p/android.net.wifi/c/ScanResult)CREATOR is present, i have tried with all versions of SDK and i lose hope... : (</p><p>Anyone can help me ?</p><p>Thanks,</p><p>Anthony.</p>","513243","","199972","","2012-06-23 16:05:44","2012-06-23 16:05:44","Need to use ScanResult class in service","<android><android-service>","1","0","","",""
"4556169","1","","","2010-12-29 17:14:47","1","7750","<p>Would anyone by chance have a working example of using GestureListner with Monodroid?  I can't seem to successfully translate what's out on the Net using Java.</p><p>I think I am close...  And I think if I can get this ""OnTouchEvent"" to fire, I could in turn get my GestureDetector Class' OnTouchEvent to fire, and then I would be able to get the swipe motion (or OnFling).</p><p>What do I need to do to get this event to fire in my Activity class?  No </p><pre><code>public override bool OnTouchEvent(MotionEvent e){      m_gestureDetector.OnTouchEvent(e);      return base.OnTouchEvent(e);}</code></pre><p>And I think I definitely need the OnTouch event instead of OnClick because I need the MotionEvent.</p>","281295","","","","","2013-06-11 07:04:16","Android - Can't get the OnTouchEvent to fire in Activity - using MonoDroid (Need the MotionEvent from OnTouch)","<android><ontouchevent><monodroid><gesturedetector>","2","0","1","",""
"4556175","1","4988154","","2010-12-29 17:15:32","0","1066","<p>I don't like the way the tabs look with the native tab control in Android so I'd like to create my own control.  I can create and draw my own tabs in a horizontal LinearLayout at the top of the screen using a vertical LL, but how do I setup the various hidden tab contents in the XML and how do I show/hide them?</p><p>Any potential issues?</p>","317033","","","","","2011-02-14 01:37:37","Android - My own tab control","<android><custom-controls>","2","3","","",""
"4556230","1","4702496","","2010-12-29 17:22:13","9","12721","<p>I'm relatively new to Java programming and need to parse a complex JSON object across the wire.  I've been reading documentation on GSON the past day and Haven't had much luck being able to fully parse this type of structure:</p><pre><code>{  'Events' : [{    'name' : 'exp',    'date' : '10-10-2010',    'tags' : [""tag 1"", ""tag2"", ""tag3""]    },...more events...],  'Contacts' : [{    'name' : 'John Smith',    'date' : '10-10-2010',    'tags' : [""tag 1"", ""tag2"", ""tag3""]    },...more contacts...],}</code></pre><p>I've been able to get it to work similarly to <a href=""http://stackoverflow.com/q/2818697/235708"">this</a> question but can't figure out how to get that additional array level to work.</p>","235708","","235708","","2010-12-29 22:19:14","2011-01-15 22:26:59","Using GSON in Android to parse a complex JSON object","<android><json><parsing><serialization><gson>","2","0","5","",""
"4556330","1","4556419","","2010-12-29 17:37:58","0","1116","<p>Here is my code:</p><pre><code>public class TasksList extends ListActivity {    ...    private static final int COLUMNS_DIALOG = 7;    private static final int ORDER_DIALOG = 8;    private Bundle bundle = new Bundle();    ...     /**     * @see android.app.Activity#onCreateDialog(int)     */    @Override    protected Dialog onCreateDialog(int id) {        Dialog dialog;        final String[] columns;        Cursor c = managedQuery(Tasks.CONTENT_URI, null, null, null, null);        columns = c.getColumnNames();        final String[] order = { ""Ascending"", ""Descending"" };        switch (id) {        case COLUMNS_DIALOG:            AlertDialog.Builder columnDialog = new AlertDialog.Builder(this);            columnDialog.setSingleChoiceItems(columns, -1, new DialogInterface.OnClickListener() {                @Override                public void onClick(DialogInterface dialog, int which) {                    bundle.putString(""column"", columns[which]);                }            });            dialog = columnDialog.create();            break;        case ORDER_DIALOG:            AlertDialog.Builder orderDialog = new AlertDialog.Builder(this);            orderDialog.setSingleChoiceItems(order, -1, new DialogInterface.OnClickListener() {                @Override                public void onClick(DialogInterface dialog, int which) {                    String orderS;                    if (order[which].equalsIgnoreCase(""Ascending""))                        orderS = ""ASC"";                     else                        orderS = ""DESC"";                    bundle.putString(""order"", orderS);                }            });             dialog = orderDialog.create();             break;        default:            dialog = null;            break;        }        return dialog;    }    /**     * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)     */    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case SORT_MENU:            showDialog(COLUMNS_DIALOG);            showDialog(ORDER_DIALOG);            String orderBy = bundle.getString(""column"") + bundle.getString(""order"");            Cursor tasks = managedQuery(Tasks.CONTENT_URI, projection, null, null, orderBy);            adapter = new TasksAdapter(this, tasks);            getListView().setAdapter(adapter);            break;        case FILTER_MENU:            break;        }        return false;    }}</code></pre><p>The <code>showDialog</code> doesn't display the dialog. I used the Debugger and it does executes these statements, but the dialog doesn't show.</p>","200477","","200477","","2010-12-29 19:36:53","2010-12-29 19:36:53","showDialog in Activity not displaying dialog","<java><android><dialog><showdialog>","1","0","","",""
"4556392","1","4556512","","2010-12-29 17:45:29","2","3795","<p>I want to create an Intent that opens the screen showing the call logs of the current device? </p><p>How would I specify such an Intent?</p>","114066","","","","","2013-12-20 09:56:02","How to create an Intent that opens the Call Log Activity?","<android><android-intent><calllog>","2","0","1","",""
"4556486","1","","","2010-12-29 17:58:13","2","1041","<p>I am using android 2.0 emulator. logcat says:</p><pre><code>Could not open GPS configuration file /etc/gps.conf</code></pre><p>I checked everywhere, its not present.Can you tell me what I should do?Can you also tell me how to get latitude and longitude in logcat?</p><p>One more thing.The geo fix command stores the latitude and longitude. Can you tell me where they are stored in the emulator (I mean mydroid folder) and how can I retrieve those values using adb shell.The folder ""location"" at location /data/misc/location is not present. I created it and a subfolder named gps also in it. But no changes are made to it or no files are written in it by the emulator.I only want to use adb shell, no java.</p>","557437","","1108213","","2012-03-10 15:42:03","2012-03-10 15:42:03","gps.conf file is not present","<android><gps>","0","0","","",""
"4556503","1","4556549","","2010-12-29 18:00:29","4","4607","<p>In the below code if i remove the keyword final from EditText i am an getting error in the line (6) where i pass EditText object (et) to the intent...I have to knw the significance of final keyword here...</p><pre><code>final EditText et=(EditText)findViewById(R.id.t);        Button b=(Button)findViewById(R.id.b1);        b.setOnClickListener(new Button.OnClickListener(){            public void onClick(View v)&lt;br&gt;            {            Intent on=new Intent(Intent.ACTION_CALL,Uri.parse(""tel:""+et.getText()));            startActivity(on);            }        });</code></pre>","553670","","473070","","2010-12-29 18:04:39","2010-12-30 07:27:28","what is the use of keyword final?","<java><android><final>","6","2","","",""
"4556510","1","4556642","","2010-12-29 18:01:29","1","4306","<p>I am trying to determine where on an android phone an apps SQLite database is stored. I am testings and need to be able to delete it and test the code for creation. On the simulator it is in /data/data/app package name/something.db but I am unable to find it on the actual phone. Does anybody know where it is stored and if it is accessable via DDMS?</p><p>Thanks</p>","467569","","","","","2013-12-05 06:04:02","Where is apps SQLite DB Stored on Android","<android><sqlite>","2","0","","",""
"4556604","1","","","2010-12-29 18:11:50","0","446","<p>I am porting my flash games on android. I have ported 3 successfully. But the problem with all of them is they are giving very low frame rate near about 7-8. And I have observed 1 thing that frame rate always varies. Sometimes it goes upto 45 and again in next frame it comes to 3-4 and again goes to 15-16.</p><p>I am quite confused. Please let me know if anyone is having any idea about this.</p><p>Thanks,</p>","557453","","","","","2010-12-29 18:34:48","frame rate is very low for android game developed by flash CS5","<android><flash><frame><cs5><rate>","1","1","","",""
"4556667","1","4557489","","2010-12-29 18:20:02","2","291","<p>I would like to create an Intent that opens the messages application in a specific conversation. </p><p>If a short message notification is clicked Logcat reveals the following: </p><pre><code>INFO/ActivityManager(31909): Starting activity: Intent { act=android.intent.action.VIEW dat=content://mms-sms/conversations/3 flg=0x34000000 cmp=com.android.mms/.ui.ConversationList bnds=[0,586][600,682] }</code></pre><p>This brought me a little bit further using <code>content://mms-sms/conversations/3</code> as the data starts up the messages app in the correct conversation. I now only need to find out which conversation a message belongs to. </p>","114066","","114066","","2010-12-29 18:51:37","2010-12-29 20:15:09","How to generate an Intent that jumps into a specific short message conversation?","<android><sms><android-intent>","1","2","1","",""
"4556670","1","","","2010-12-29 18:20:27","42","12044","<p>When my app starts I want it to check if a particular alarm (registered via AlarmManager) is already set and running.   Results from google seem to indicate that there is no way to do this .   Is this still correct?   I need to do this check in order to advise the user before any action is taken to create a new alarm.ThanksRon</p>","538847","","296108","","2012-03-05 22:59:00","2013-12-21 22:40:59","How to check if AlarmMamager already has an alarm set?","<android>","4","0","22","",""
"4556712","1","","","2010-12-29 18:24:52","0","536","<p>I'm trying to figure out how to get from a List View to a Web View.</p><p>I have a list of different items, and depending on which item is selected I want to load a different URL for the Web View.</p><p>I cannot figure out how to do it in the same class because I cannot extend Activity and ListActivity.  </p><p>I have tried making a switch statement depending on which list item was selected, and then assigning the URL and loading it in a different class, but that seems a little too complicated.</p><p>Is there an easier way to do this??</p>","557431","","","","","2010-12-29 19:11:15","Going from a List View to a Web View","<android><url><listview><webview>","3","1","1","",""
"4556764","1","4557063","","2010-12-29 18:30:54","1","570","<p>My son is starting to write some Android apps using Java, which they are teaching at school.I saw some interesting videos from Adobe MAX online that showed a car spinning around using 1% of the CPU, instead using the GPU for the processing.</p><p>Q: Where do I point my son to tell him there are alternatives to Java?I need something to help him write a Hello World application on the Android, but include graphics, sound, touch, geo-location, etc, etc.</p>","111665","","","","","2011-10-31 07:11:16","ADOBE AIR FOR Android","<android><flash><air><adobe>","4","0","","2014-01-01 08:24:54",""
"4556866","1","","","2010-12-29 18:44:08","0","758","<p>For my project, I am trying to execute a Method every 10 seconds when I click a button ""A""and it should stop when I click the button again (kind of on/off).</p><p>this is what i reached :-/ :</p><pre><code>  ButtonA.setOnClickListener(new OnClickListener() {                        @Override            public void onClick(View v) {                                       Handler handler = new Handler();                     handler.postDelayed(new Runnable() {                          public void run() {                              showCurrentLocation();                                Methodexecute();                         }                     }, 10000);                 }                    }        });</code></pre><p>How can I repeat executing this method every 10 seconds until the button is clicked again?</p><p>thanks</p>","557475","","53195","","2011-12-22 07:48:52","2011-12-22 07:48:52","Android Thread Button sleep","<android><multithreading><button><click><handler>","3","0","","",""
"4556979","1","4556988","","2010-12-29 19:02:51","7","7882","<p>Does anyone know where the documentation is for Android's <code>VideoView</code>?  I'm trying to play some .mov files and they aren't working, and I believe it is because that is an unsupported format, but I can't find anywhere in the docs that lists what formats are supported for video playback on android.</p><p>I figure if .mov files won't work, then I'll need to convert them on the server using something like ffmpeg, but I want to make sure I do it correctly, so I need to see what the supported types are.</p><p>Any ideas?</p>","469682","","545951","","2012-05-08 11:12:20","2013-12-31 11:34:29","Supported formats for Android's VideoView","<android><encoding><format><videoview>","2","0","1","",""
"4557035","1","4558249","","2010-12-29 19:11:44","1","449","<p>I have a ListView that has rows with basically 2 TextViews each. But, one of these textviews is inside a HorizontalScrollView.</p><p>I desire the following behavior IN TOUCH MODE: </p><p>1) When the user presses any of TextViews, the ENTIRE row must be highlighted. He can scroll left/right the first textview, but the entire row must remain highlighted.</p><p>2) After user realease the ""press"", the row MUST STAY highlighted, until the user presses another row or scrolls up/down the list.</p><p>Thanks in advance.</p><p>Row layout:</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""&gt;    &lt;HorizontalScrollView        android:id=""@+id/frmclientes_listview_linha_scrollView1""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:gravity=""center_vertical""        android:fillViewport=""true""        android:scrollbars=""none""        android:scrollbarAlwaysDrawHorizontalTrack=""false""        android:scrollbarAlwaysDrawVerticalTrack=""false""        android:fadingEdge=""horizontal""        android:fadingEdgeLength=""30sp""    &gt;        &lt;TextView            android:id=""@+id/frmclientes_listview_line_firstline""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:layout_alignParentTop=""true""            android:ellipsize=""marquee""            android:textAppearance=""?android:attr/textAppearanceLarge""            android:gravity=""center_vertical""            android:focusable=""false""            android:lines=""1"" /&gt;    &lt;/HorizontalScrollView&gt;    &lt;TextView        android:id=""@+id/frmclientes_listview_line_secondline""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_below=""@+id/frmclientes_listview_linha_scrollView1""        android:ellipsize=""marquee""        android:gravity=""center_vertical""        android:lines=""1""        android:textAppearance=""?android:attr/textAppearanceSmall"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","112670","","","","","2010-12-29 22:08:08","How to keep entire row highlighted (with HorizontalScrollView)","<android><android-layout><android-listview>","1","1","","",""
"4557086","1","4557391","","2010-12-29 19:16:22","0","776","<p>As far as I understand <code>onSaveInstanceState()</code> and <code>onRestoreInstanceState()</code> method are intended to store dynamic data before Activity's state is about to go <code>onPause()</code>. I made a simple <code>Activity</code> with a button which changes its text after clicking on it. I did override both these methods with nothing in their body:</p><pre><code>@Override    protected void onSaveInstanceState(Bundle outState) {        super.onSaveInstanceState(outState);    }    @Override    protected void onRestoreInstanceState(Bundle savedInstanceState) {        super.onRestoreInstanceState(savedInstanceState);    }</code></pre><p>I'm hidding and restoring the activity by means of moving to home screen and back to app. And when activity is restored the button's text isn't default, as I expected, but it is as it was before passing the activity to <code>onPause()</code>. How does it work if my <code>onRestoreInstanceState()</code> method is empty.</p><p>What is more odd - I tried to debug to see when these two methods are being invoked and noticed the <code>onRestoreInstanceState()</code> wasn't even called.</p>","397991","","","","","2010-12-29 20:02:28","State changes while onRestoreInstanceState() has been override","<android>","1","0","1","",""
"4557127","1","","","2010-12-29 19:21:04","2","3195","<p>I pulled down the latest source from GIT for the camera app, but android.hardware.Camera.CameraInfo seems to be missing when it's imported (and messing the rest of the app up).  I tried changing from Android 2.2 to Google APIs 2.2, but that didn't do anything.  What am I missing here?</p>","375566","","","","","2010-12-29 19:55:00","Android 2.2 SDK - Android Camera app missing import android.hardware.Camera.CameraInfo","<android><mobile><android-emulator><android-sdk-2.2>","1","0","","",""
"4557154","1","4557198","","2010-12-29 19:25:47","36","15463","<p>I am working with a SQLite database on android. My database manager is a singleton and right now opens a connection to the database when it is initialized. It is safe to leave the database open the entire time so that when someone calls my class to work with the database it is already open? Or should I open and close the database before and after each access is needed. Is there any harm in just leaving it open the whole time?</p><p>Thanks!</p>","467569","","","","","2012-12-11 13:05:05","Android SQLite DB When to Close","<android><sqlite>","3","0","24","",""
"4557179","1","4557816","","2010-12-29 19:30:08","0","356","<p>I have downloaded an IBM Android tutorial about how to develop an rss with android.</p><p>here's the url</p><p><a href=""http://www.ibm.com/developerworks/xml/tutorials/x-androidrss/"" rel=""nofollow"">http://www.ibm.com/developerworks/xml/tutorials/x-androidrss/</a></p><p>Seems to me it's a little old. I have insert new generics syntax but still have problems to compile at this lines</p><pre><code>private void UpdateDisplay()    {        TextView feedtitle = (TextView) findViewById(R.id.feedtitle);        TextView feedpubdate = (TextView) findViewById(R.id.feedpubdate);        ListView itemlist = (ListView) findViewById(R.id.itemlist);        if (feed == null)        {            feedtitle.setText(""No RSS Feed Available"");            return;        }        feedtitle.setText(feed.getTitle());        feedpubdate.setText(feed.getPubDate());        ArrayAdapter&lt;RssItem&gt; adapter = new ArrayAdapter&lt;RssItem&gt;(this,android.R.layout.simple_list_item_1,feed.getAllItems());        itemlist.setAdapter(adapter);        **itemlist.setOnItemClickListener(this);**        itemlist.setSelection(0);    }    public void onItemClickListener(AdapterView&lt;?&gt; parent, View v, int position, long id)    {     Log.i(tag,""item clicked! ["" + feed.getItem(position).getTitle() + ""]"");     Intent itemintent = new Intent(this,ShowDescription.class);     Bundle b = new Bundle();     b.putString(""title"", feed.getItem(position).getTitle());     b.putString(""description"", feed.getItem(position).getDescription());     b.putString(""link"", feed.getItem(position).getLink());     b.putString(""pubdate"", feed.getItem(position).getPubDate());     itemintent.putExtra(""android.intent.extra.INTENT"", b);     //Replacing startSubActivity from the example     startActivityForResult(itemintent,0);    }</code></pre><p>The compiler give me error here:</p><p><strong>itemlist.setOnItemClickListener(this);</strong></p><p>any idea? What's the correct way to do the callback?</p><p>Thanks in advance</p>","557518","","244296","","2010-12-29 19:45:00","2011-03-01 18:51:43","Problem with IBM tutorial about an RSSReader","<android><listview><callback>","1","1","","",""
"4557180","1","","","2010-12-29 19:30:16","2","10653","<p>I'm trying to access a web service whose WSDL is at <a href=""http://srilanka.lk:9080/services/CropServiceProxy?wsdl"" rel=""nofollow"">http://srilanka.lk:9080/services/CropServiceProxy?wsdl</a> . Using SoapUI I sent a request and successfully got a response. </p><p>Then using KSoap2 for Android I tried to get a response. But all I get is a SoapFault Error. The code is as follows. </p><p>String NAMESPACE = ""http://schemas.icta.lk/xsd/crop/handler/v1"";</p><pre><code>    String URL = ""http://www.srilanka.lk:9080/services/CropServiceProxy.CropServiceProxyHttpSoap12Endpoint"";    String method_name = ""getCropDataList"";    String SOAP_ACTION = method_name;    SoapObject request = new SoapObject(NAMESPACE, method_name);    String crop_code_str = String.valueOf(code.getText().toString());    System.out.println(crop_code_str);    System.out.println(request.toString());    request.addProperty(""code"", crop_code_str );    System.out.println(request.getProperty(""code"").toString());    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);    envelope.setOutputSoapObject(request);    System.out.println(""body out : "" + envelope.bodyOut.toString());    HttpTransportSE http_transport  = new HttpTransportSE(URL);    try {        http_transport.call(SOAP_ACTION, envelope);        System.out.println(envelope.bodyIn.toString());    } catch (Exception e) {        e.printStackTrace();        answer.setText(""error caught"");    }</code></pre><p>This results in the following.</p><pre><code>W/System.err(  394): 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@43e81258)  </code></pre><p>I tried with VER11 but it then gives the following error as the bodyIn.</p><pre><code>I/System.out(  365): SoapFault - faultcode: 'soapenv:Server' faultstring: 'org.apache.axis2.databinding.ADBException: Unexpected subelement code' faultactor: 'null' detail: org.kxml2.kdom.Node@43e84648</code></pre><p>Is this something wrong with Ksoap2 for android? Then is there another way that a web service can be consumed in Android? (Only SOAP is available)</p><p>UPDATE: I tried the KvmSerializable interface for the complext type. Following is my code. I still get the same errors. The XMLPullParser error is being thrown at the http_transport.call line.</p><p>This is the complex type implementation at the client side. I have only the WSDL. </p><pre><code>public class CropInfo implements KvmSerializable {    private String name;    private float price;    private String location;    @Override    public Object getProperty(int arg0) {        switch (arg0){        case 0:            return name;        case 1:            return price;        case 2:            return location;        default:                return null;        }    }    @Override    public int getPropertyCount() {        return 3;    }    @Override    public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {        switch (arg0){        case 0:            arg2.type = PropertyInfo.STRING_CLASS;            arg2.name = ""Name"";            break;        case 1:            arg2.type = Float.class;            arg2.name = ""Price"";            break;        case 2:            arg2.type = PropertyInfo.STRING_CLASS;            arg2.name = ""Location"";            break;        default:                break;        }    }    @Override    public void setProperty(int arg0, Object arg1) {        switch(arg0){        case 0:            name = arg1.toString();            break;        case 1:            price = Float.parseFloat(arg1.toString());        case 2:            location = arg1.toString();        default:            break;        }    }}</code></pre><p>The modified code to access and parse the response of the web service.</p><p>String NAMESPACE = ""http://schemas.icta.lk/xsd/crop/handler/v1/"";        String URL = ""http://www.srilanka.lk:9080/services/CropServiceProxy.CropServiceProxyHttpSoap12Endpoint"";        String method_name = ""getCropDataList"";        String SOAP_ACTION = ""http://schemas.icta.lk/xsd/crop/handler/v1/getCropDataList"";</p><pre><code>    SoapObject soap_request = new SoapObject(NAMESPACE, method_name);    String crop_code_str = String.valueOf(code.getText().toString());    System.out.println(crop_code_str);    System.out.println(soap_request.toString());    soap_request.addProperty(""code"", crop_code_str );    System.out.println(soap_request.getProperty(""code"").toString());    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);    envelope.setOutputSoapObject(soap_request);    envelope.addMapping(NAMESPACE, ""cropInfo"", CropInfo.class);    //envelope.dotNet=true;    Marshal floatMarshal = new MarshalFloat();    floatMarshal.register(envelope);    System.out.println(""body out : "" + envelope.bodyOut.toString());    //AndroidHttpTransport http_transport = new AndroidHttpTransport(URL);    HttpTransportSE http_transport  = new HttpTransportSE(URL);    try {                //error comes from this call                            http_transport.call(SOAP_ACTION, envelope);        Vector&lt;CropInfo&gt; result_array = (Vector&lt;CropInfo&gt;)envelope.getResponse();        if(result_array != null){            for (CropInfo current_crop: result_array){                System.out.println(current_crop.getName());                System.out.println(Float.toString(current_crop.getPrice()));            }        }    } catch (Exception e) {        e.printStackTrace();        answer.setText(""error caught"");    }</code></pre>","169174","","169174","","2011-01-01 15:00:20","2013-10-13 06:42:53","KSOAP2 for Android gives","<android><web-services><soap><soapui><ksoap2>","3","5","2","",""
"4557261","1","4557277","","2010-12-29 19:42:55","0","284","<p>I have a ListView which displayes 5 listitems . When the user selects the last item(5th item) , a hit goes to server &amp; the next set of 5 items is displayed.</p><p>I have implemented the code for displaying the first 5 items . I am also able to fetch the next set of items from the server , but the items are not updated in the ListView.</p><p>If required I can share the sample code.</p><p>Kindly provide hints/sample source code.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2010-12-29 19:45:48","Unable to update the listView in Android","<android>","1","1","","",""
"4557300","1","4580093","","2010-12-29 19:50:12","11","3167","<p>is there a way of getting access to the details of each one programatically?</p>","557117","","","","","2011-01-09 09:22:56","Finding a list of all the android apps on the market","<android><api><marketplace>","3","1","3","",""
"4557358","1","","","2010-12-29 19:57:07","1","2192","<p>I want to write a very simple application (maybe it is not so simple). I want to run application on my PC (either windows or linux) from the android phone. lets say I will have couple of buttons on my phone's screen and each button will open an application, say notepad or calculator. Or even better I will have an application on my computer screen (this will also be written) lets say 8 buttons on the appliaction and I will have same 8 buttons on my phone screen which will imitate as if I am clicking those buttons on my computer screen. I do not want to do this like GMote does by controlling mouse (touchpad). </p><p>I have some programming experience but not in Android. I dont know where to start so I will appreciate if someone could head me to the right direction.</p><p>Thanks in advance...</p><p>cs</p>","557539","","557539","","2010-12-29 20:46:09","2012-02-08 10:27:35","a simple client-server application for android","<android><windows><linux><client-server>","2","0","1","",""
"4557414","1","4557477","","2010-12-29 20:05:20","2","1731","<p>I am a beginner. So I request you to be patient with me.I am trying to achieve a custom shape for the button instead of the usual rectangular one.Is there any other way to do this than setting it as background for a button? Also i am trying to use different colours for different states for the button. Towards this I have created this file: </p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true""           android:state_pressed=""false""           android:drawable=""@android:drawable/my_button_background_focus_blue"" /&gt;    &lt;item android:state_focused=""true""           android:state_pressed=""true""          android:drawable=""@android:drawable/my_button_background_pressed_blue"" /&gt;    &lt;item android:state_focused=""false""           android:state_pressed=""true""      android:drawable=""@android:drawable/my_button_background_pressed_blue"" /&gt;    &lt;item android:drawable=""@android:drawable/my_button_background_normal"" /&gt;&lt;/selector&gt;</code></pre><p>Do I include this inside the main.xml or create another xml file? If so, where do I create it? Thank you.</p>","556167","","","","","2010-12-29 20:13:37","android custom button shape","<android><user-interface><uibutton><android-layout><shape>","1","0","1","",""
"4557450","1","","","2010-12-29 20:09:32","12","11383","<p>I need to play live audio stream, actually it is radio. The problem is that I also need to manage 20 minute buffer for stream. As far as I understand it's not easy to implement with adnroid. </p><p>First I checked MediaPlayer, but it doesn't provide any methods for buffer managment. In fact you even can't set buffer size directly.</p><p>Secondly I tried to manage buffer using  local files: progressively download the stream to a temporary files and switch them. But when you want to switch to following file (change datasource in MediaPlayer), audio is not played continuously. You can hear short interruptions.</p><p>The last idea is to use stream proxy. Usually it is used for playing streams in Adnroid versions below 8. In stream proxy you create ServerSocket, read from audio stream and write to player. So actually I can manage buffering there. I can cache stream and write to MediaPlayer whatever I want. But. It doesn't work with Android 8. </p><p>I got exception: Connection reset by peer java.net.SocketException: Connection reset by peer. MediaPlayer 8 doesn't want to read data from socket.</p><p>Thus I have two questions:1) What other way to implement  stream buffering?2) how to adapt StreamProxy for android 8?  </p><p>Any ideas are appreciated.</p><p>Thanks</p>","557541","","","","","2013-10-12 08:15:55","Audio stream buffering","<android><proxy><stream><media-player><buffering>","4","2","11","",""
"4557468","1","4557603","","2010-12-29 20:12:15","1","294","<p>I created this Sign-In page. I start by declaring variables for username/password &amp; buttons. If user enters ""test"" as username &amp; ""test"" as password and hits the login button, its supposed to go to the DrinksTwitter.class activity, else throw error message I created. To me the code and login makes perfect sense. I'm not sure why it wont go to the next activity I want it to go to </p><pre><code>package com.android.drinksonme;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class Screen2 extends Activity {    // Declare our Views, so we can access them later    private EditText etUsername;    private EditText etPassword;    private Button btnLogin;    private Button btnSignUp;    private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Get the EditText and Button References                etUsername = (EditText)findViewById(R.id.username);                etPassword = (EditText)findViewById(R.id.password);                btnLogin = (Button)findViewById(R.id.login_button);                btnSignUp = (Button)findViewById(R.id.signup_button);                lblResult = (TextView)findViewById(R.id.result);                    // Check Login                       String username = etUsername.getText().toString();                       String password = etPassword.getText().toString();         if(username.equals(""test"") &amp;&amp; password.equals(""test"")){            final Intent i = new Intent(Screen2.this, DrinksTwitter.class);            btnLogin.setOnClickListener(new OnClickListener() {                public void onClick(View v) {                     startActivity(i);                              }                  // lblResult.setText(""Login successful."");                                else { /* ERROR- Syntax error on token ""else"", { expected */                                    lblResult.setText(""Invalid username or password."");                                }                            }                        });                        final Intent k = new Intent(Screen2.this, SignUp.class);                        btnSignUp.setOnClickListener(new OnClickListener() {                            public void onClick(View v) {                                 startActivity(k);                            }                        }); /* ERROR- Syntax error, insert ""}"" to complete Statement*/    }}</code></pre>","554786","","19679","","2010-12-30 15:44:35","2010-12-30 15:44:35","Beginner Android Dev question navigating through intents, getting errors not sure how to fix it. I've tried rearranging and everything even tabbing","<android>","3","1","","",""
"4557642","1","","","2010-12-29 20:34:28","2","1812","<p>When I send an SMS message in my Android application, is it possible to make the built-in Messaging app recognize that the message was sent and show it in the appropriate thread?</p><p>Currently when my app sends a message, there is no record of it being sent. I would like the message to show up like any other message sent from the phone. I'm hoping for something easier than manually adding the message to the sms database.</p>","557566","","","","","2011-04-14 07:41:31","Making Android Messaging app recognize messages sent from other app","<android><sms><messaging>","2","0","","",""
"4557721","1","","","2010-12-29 20:48:39","0","988","<p>I've searched around quite a bit to try and find some additional information on Smack and their ChatManager, but there isn't much, so it's time to come to SOF.</p><p>I'm doing something very basic at a certain point in my code:</p><pre><code> chatmanager = con.getChatManager(); chatmanager.createChat(name, message.getThread(), new MessageListener() {  public void processMessage(Chat chat, Message message) {  } }); System.out.println(""Chat created""); Chat chat = chatmanager.getThreadChat(message.getThread()); if (chat == null)   System.out.print(""Newly created chat is null""); else   System.out.println(""Newly created chat is saved in manager"");</code></pre><p>I'm trying to verify that the chat I <em>just</em> created, is actually in the chatManager</p><p>In my program I have only 1 instance of chatManager ever created, but multiple times I do this:</p><pre><code> chatmanager = con.getChatManager();</code></pre><p>I have a feeling that each time I do that, the chatManager is being re-initialized.  Am I completely mistaken?</p><p>Anyway, the problem is that I don't get any output. Neither, ""chat is null"" or ""chat is saved"". Leads me to believe that the chatManager is causing problems.</p><p>Can anyone help?</p>","544884","","","","","2012-02-02 11:52:40","Smack ChatManager not behaving properly","<android><chat><xmpp><smack>","2","1","","",""
"4557824","1","4558035","","2010-12-29 21:02:22","2","4434","<p>I am using a slightly modified version of the Camera API Demo and it works in the emulator.  I am using a reflect class I found in one of the mailing groups, but I still get this error when testing on my Nexus One (Android 2.2.1):</p><pre><code>12-29 13:22:04.027: ERROR/QualcommCameraHardware(2145): Invalid preview size requested: 320x40212-29 13:22:04.037: DEBUG/AndroidRuntime(16514): Shutting down VM12-29 13:22:04.037: WARN/dalvikvm(16514): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)12-29 13:22:04.047: ERROR/AndroidRuntime(16514): FATAL EXCEPTION: main12-29 13:22:04.047: ERROR/AndroidRuntime(16514): java.lang.RuntimeException: setParameters failed12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.hardware.Camera.native_setParameters(Native Method)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.hardware.Camera.setParameters(Camera.java:647)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at com.android.iwasthere.Preview.surfaceChanged(Preview.java:78)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.SurfaceView.updateWindow(SurfaceView.java:538)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.View.draw(View.java:6743)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.widget.FrameLayout.draw(FrameLayout.java:352)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.View.draw(View.java:6743)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.widget.FrameLayout.draw(FrameLayout.java:352)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewRoot.draw(ViewRoot.java:1407)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.os.Handler.dispatchMessage(Handler.java:99)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.os.Looper.loop(Looper.java:123)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at java.lang.reflect.Method.invokeNative(Native Method)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at java.lang.reflect.Method.invoke(Method.java:521)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)12-29 13:22:04.047: ERROR/AndroidRuntime(16514):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>CameraPreview.java</p><pre><code>package xxx;import android.app.Activity;import android.os.Bundle;import android.view.Window;public class CameraPreview extends Activity {    private Preview mPreview;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        mPreview = new Preview(this);        setContentView(mPreview);    }}</code></pre><p>Preview.java</p><pre><code>package xxx;import java.io.IOException;import java.util.List;import android.content.Context;import android.hardware.Camera;import android.hardware.Camera.Size;import android.view.SurfaceHolder;import android.view.SurfaceView;class Preview extends SurfaceView implements SurfaceHolder.Callback {    SurfaceHolder mHolder;    Camera mCamera;    Preview(Context context) {        super(context);        mHolder = getHolder();        mHolder.addCallback(this);        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    }    public void surfaceCreated(SurfaceHolder holder) {        mCamera = Camera.open();        try {           mCamera.setPreviewDisplay(holder);        } catch (IOException exception) {            mCamera.release();            mCamera = null;        }    }    public void surfaceDestroyed(SurfaceHolder holder) {        mCamera.stopPreview();        mCamera.release();        mCamera = null;    }    private Size getOptimalPreviewSize(List&lt;Size&gt; sizes, int w, int h) {        final double ASPECT_TOLERANCE = 0.05;        double targetRatio = (double) w / h;        if (sizes == null) return null;        Size optimalSize = null;        double minDiff = Double.MAX_VALUE;        int targetHeight = h;        for (Size size : sizes) {            double ratio = (double) size.width / size.height;            if (Math.abs(ratio - targetRatio) &gt; ASPECT_TOLERANCE) continue;            if (Math.abs(size.height - targetHeight) &lt; minDiff) {                optimalSize = size;                minDiff = Math.abs(size.height - targetHeight);            }        }        if (optimalSize == null) {            minDiff = Double.MAX_VALUE;            for (Size size : sizes) {                if (Math.abs(size.height - targetHeight) &lt; minDiff) {                    optimalSize = size;                    minDiff = Math.abs(size.height - targetHeight);                }            }        }        return optimalSize;    }    public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {        Camera.Parameters parameters = mCamera.getParameters();        //MODIFIED HERE        List&lt;Size&gt; sizes = Reflect.getSupportedPictureSizes(parameters);        //List&lt;Size&gt; sizes = parameters.getSupportedPreviewSizes();        Size optimalSize = getOptimalPreviewSize(sizes, w, h);        parameters.setPreviewSize(optimalSize.width, optimalSize.height);        mCamera.setParameters(parameters);        mCamera.startPreview();    }}</code></pre><p>Reflect.java</p><pre><code>package xxx;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.util.List;import android.hardware.Camera;import android.hardware.Camera.Size;public class Reflect {    private static Method Parameters_getSupportedPictureSizes;    private static Method Parameters_getSupportedPreviewSizes;    static {        initCompatibility();    };    private static void initCompatibility() {        try {            Parameters_getSupportedPictureSizes = Camera.Parameters.class                    .getMethod(""getSupportedPictureSizes"", new Class[] {});            /* success, this is a newer device */        } catch (NoSuchMethodException nsme) {            /* failure, must be older device */        }        try {            Parameters_getSupportedPreviewSizes = Camera.Parameters.class                    .getMethod(""getSupportedPreviewSizes"", new Class[] {});            /* success, this is a newer device */        } catch (NoSuchMethodException nsme) {            /* failure, must be older device */        }    }    @SuppressWarnings(""unchecked"")    public static List&lt;Size&gt; getSupportedPictureSizes(Camera.Parameters p) {        try {            if (Parameters_getSupportedPictureSizes != null) {                return (List&lt;Size&gt;) Parameters_getSupportedPictureSizes                        .invoke(p);            } else {                return null;            }        } catch (InvocationTargetException ite) {            /* unpack original exception when possible */            Throwable cause = ite.getCause();            if (cause instanceof RuntimeException) {                throw (RuntimeException) cause;            } else if (cause instanceof Error) {                throw (Error) cause;            } else {                throw new RuntimeException(ite);            }        } catch (IllegalAccessException ie) {            System.err.println(""unexpected "" + ie);            return null;        }    }    @SuppressWarnings(""unchecked"")    public static List&lt;Size&gt; getSupportedPreviewSizes(Camera.Parameters p) {        try {            if (Parameters_getSupportedPreviewSizes != null) {                return (List&lt;Size&gt;) Parameters_getSupportedPreviewSizes                        .invoke(p);            } else {                return null;            }        } catch (InvocationTargetException ite) {            /* unpack original exception when possible */            Throwable cause = ite.getCause();            if (cause instanceof RuntimeException) {                throw (RuntimeException) cause;            } else if (cause instanceof Error) {                throw (Error) cause;            } else {                /*                 * unexpected checked exception; wrap and re-throw                 */                throw new RuntimeException(ite);            }        } catch (IllegalAccessException ie) {            return null;        }    }}</code></pre>","375566","","","","","2010-12-29 21:31:43","Android 2.2 SDK - setParameters failed for Camera API on Nexus One","<android><mobile><android-emulator><android-sdk-2.2>","1","0","3","",""
"4557872","1","4558007","","2010-12-29 21:08:31","1","439","<p>It is stated in documentation that <code>onSaveInstanceState(Bundle)</code> is called before placing the activity in such a background state, allowing you to save away any <strong>dynamic</strong> instance state in your activity into the given Bundle. Note that it is important to save <strong>persistent</strong> data in <code>onPause()</code> instead of <code>onSaveInstanceState(Bundle)</code>.</p><p>What is the best way to distinguish dynamic data with persistent?</p>","397991","","","","","2012-08-10 15:37:23","Dynamic and persistent data","<android>","2","0","","",""
"4557966","1","4557989","","2010-12-29 21:22:40","0","892","<p>There are multiple posts on SO describing the various screen resolutions available on Android.</p><p>My question is whether there are any rules of thumbs, or general advice, for designing on Android screens.  For instance, on the desktop web, one rule of thumb i have heard is to design for a width of ~ 970 pixels.</p><p>This question could address both native apps and web apps on Android.</p><p>We're also curious to hear any similar suggestions for the iPhone (though I believe there is a post somewhere that discusses this).</p><p>Thanks!</p>","144088","","","","","2010-12-29 21:45:14","Guidelines or rules of thumb for mobile web design (HTML5, Android, iPhone)?","<iphone><android><ios><html5><mobile-website>","2","0","","",""
"4557973","1","","","2010-12-29 21:23:19","2","1799","<p>I've invested now more than a day looking for a solution on how to render transparent textures with OpenGL on Android. Obviously others had more luck than I but after trying various solutions (e.g. <a href=""http://stackoverflow.com/questions/2361602/transparent-texture-in-opengl-es-for-android"">Transparent texture in OpenGL ES for Android</a>) offered I still cannot get it done.</p><p>Here is my basic setup:</p><pre><code>        gl.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, w, h);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    GLU.gluOrtho2D(gl, -ratio, ratio, -1, 1);</code></pre><p>The textures are loaded via ...</p><pre><code>    gl.glBindTexture(GL10.GL_TEXTURE_2D, textureName);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,            GL10.GL_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,            GL10.GL_LINEAR);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S,            GL10.GL_CLAMP_TO_EDGE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T,            GL10.GL_CLAMP_TO_EDGE);    gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,            GL10.GL_MODULATE);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);</code></pre><p>... and there are hints that this leads to problems due to pre-multiplied alpha. But ReplicaIsland does use the GLUtils function as well and the game does not seem to have problems with transparent images.</p><p>Now if I draw textures with alpha channel (PNG) they appear solidly black. Textures without alpha are drawn correctly in their respective color). I applied various glBlendFunc calls without luck, i.e.</p><pre><code>    gl.glShadeModel(GL10.GL_FLAT);    gl.glEnable(GL10.GL_BLEND);        gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);    gl.glColor4x(0x10000, 0x10000, 0x10000, 0x10000);</code></pre><p>I also gave this one a try</p><pre><code>    gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);</code></pre><p>The result is always that the textures are no visible at all (fully transparent?).</p><p>Images for testing are used from the ReplicaIsland project, these are standard PNGs. This also means that the textures used conform to the power-of-2-rule - another solution offered in various posts. I see one difference which is that ReplicaIsland seems mostly to rely on the draw_texture extension whereas I have to use VBOs (in order to be able to apply rotations).</p><p>Help would be greatly appreciated!ThanksBen</p>","557617","","557617","","2010-12-29 22:19:02","2011-12-14 14:19:17","Problems displaying transparent textures with OpenGL ES on Android","<android><opengl-es><transparency><textures><vbo>","1","0","","",""
"4558198","1","4558212","","2010-12-29 21:53:48","0","704","<p>Here is the relevant code: </p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case SORT_MENU:        showDialog(ORDER_DIALOG);        showDialog(COLUMNS_DIALOG);        String orderBy = bundle.getString(""column"") + bundle.getString(""order"");        break;    }    return false;}@Overrideprotected Dialog onCreateDialog(int id) {    Dialog dialog;    final String[] columns = { ""title"", ""completed"" };    final String[] order = { ""Ascending"", ""Descending"" };    switch (id) {    case COLUMNS_DIALOG:        AlertDialog.Builder columnBuilder = new AlertDialog.Builder(this);        columnBuilder.setTitle(""Columns"");        columnBuilder.setItems(columns, new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {                bundle.putString(""column"", columns[which]);                dialog.dismiss();            }        });        dialog = columnBuilder.create();        break;    case ORDER_DIALOG:        AlertDialog.Builder orderBuilder = new AlertDialog.Builder(this);        orderBuilder.setTitle(""Order"");        orderBuilder.setItems(order, new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {                String orderS;                if (order[which].equalsIgnoreCase(""Ascending""))                    orderS = ""ASC"";                else                    orderS = ""DESC"";                bundle.putString(""order"", orderS);                dialog.dismiss();            }        });        dialog = orderBuilder.create();        break;    default:        dialog = null;        break;    }    return dialog;}</code></pre><p>I know that a Dialog is asynchronous from the main UI thread. So calls like these:</p><pre><code>showDialog(ORDER_DIALOG);showDialog(COLUMNS_DIALOG);String orderBy = bundle.getString(""column"") + bundle.getString(""order"");</code></pre><p>Only result in <code>orderBy</code> being null. Is there any way to have <code>orderBy</code> wait until both dialogs are confirmed to be finished? Even if <code>dialog.isShowing()</code> is false, this may be because the dialog has already finished or hasnt't even started.</p>","200477","","","","","2010-12-29 21:56:43","Return data from Dialog displayed to the user in Android","<java><android><dialog>","1","0","","",""
"4558220","1","4558581","","2010-12-29 21:57:15","0","630","<p>I'm trying to make my first android game and to do this I made an OBJ loader which takes a resource id and uses the InputStream returned by Context.getResources().openRawResource().</p><p>I managed to read vertex information and face info and I can successfully load a mesh without any textures.</p><p>See the problem is that the textures are not mapped correctly. I managed to read the information from the file by putting all the numbers after 'vt' into an array as well as the indexes in f after the first '/' (ie 'f 1/1 ...')</p><p>I'm not exactly sure what I'm supposed to do with the numbers though...if I just put everything into a bytebuffer and continue as I normally would the way I learned from these two tutorials(<a href=""http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/"" rel=""nofollow"">jayway</a>, and the nehe ports) it will still come out wrong.</p><p>My thoughts are that the 'vt' info in the file is out of order(hence the need for the '/x' in the 'f' data) and I'm supposed to put it in order somehow before creating the bytebuffer from the array....I don't know how to do that :(</p><p>So I ask, can anyone offer me some help please? I know there are other obj loaders out there on the internet but I already made this one and I know how it works, not only that but its a better learning experience for me.</p><p>Heres the code I'm using:</p><pre><code>import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.util.Vector;import android.content.Context;import android.util.Log;import com.snakeinalake.catchthemoney.Mesh.CMeshInfo;public class CMeshParserOBJ extends CMeshParser{ public CMeshParserOBJ(){  type = ""OBJ"";   } @Override public CMeshInfo loadMesh(Context context, int FileID){  CMeshInfo ret = new CMeshInfo(type);  String buildWord = """";  int data;  int found = -1;  Vector&lt;Float&gt; vert = new Vector&lt;Float&gt;();  Vector&lt;Float&gt; uv = new Vector&lt;Float&gt;();  Vector&lt;Short&gt; ind = new Vector&lt;Short&gt;();  Vector&lt;Short&gt; map = new Vector&lt;Short&gt;();  InputStream is = context.getResources().openRawResource(FileID);  InputStreamReader rd = new InputStreamReader(is);  try {   data = rd.read();   while(data!=-1){     char c = (char)data;     if(found == -1){      if(c == 'v'){    //found vertex data       data = rd.read();        if((char)data == ' '){         found = 1;        }else if((char)data == 't'){ //found uv map data         data = rd.read();         if((char)data == ' '){          found = 3;         }        }else{         found = -1;                }      }else if(c == 'f'){   //found index data (faces)       data = rd.read();       if((char)data == ' '){        found = 2;       }else{        found = -1;               }      }else{       found = -1;             }     }     if(found == 1){      float x = 0,y = 0,z = 0;           for(int repeat = 0; repeat&lt;3; repeat++){       buildWord="""";       do{        data = rd.read();        c = (char)data;            buildWord+=c;       }while((char)data!=' ' &amp;&amp; (char)data!='\n');       if(repeat==0)        x = Float.parseFloat(buildWord.trim());       else if(repeat==1)        y = Float.parseFloat(buildWord.trim());       else if(repeat==2)        z = Float.parseFloat(buildWord.trim());      }      vert.add(x);      vert.add(y);      vert.add(z);      found = -1;     }     if(found == 2){      short v1 = 0, v2 = 0, v3 = 0;      short map1 = 0, map2 = 0, map3 = 0;      boolean uvdata = false;      for(int repeat = 0; repeat&lt;3; repeat++){       buildWord="""";       do{        data = rd.read();        if(!uvdata &amp;&amp; (char)data == '/'){         uvdata = true;                }else{         c = (char)data;             buildWord+=c;        }       }while((char)data!=' ' &amp;&amp; (char)data!='\n' &amp;&amp; (char)data!='/');       if(repeat==0){        v1 = Short.parseShort(buildWord.trim());       }else if(repeat==1){        v2 = Short.parseShort(buildWord.trim());       }else if(repeat==2){        v3 = Short.parseShort(buildWord.trim());       }       if(uvdata){        uvdata = false;        buildWord = """";        do{         data = rd.read();         c = (char)data;             buildWord+=c;         if(!uvdata &amp;&amp; (char)data == '/'){          uvdata = true;                 }        }while((char)data!=' ' &amp;&amp; (char)data!='\n');        if(repeat == 0)         map1 = Short.parseShort(buildWord.trim());        else if(repeat == 1)         map2 = Short.parseShort(buildWord.trim());        else if(repeat == 2)         map3 = Short.parseShort(buildWord.trim());        else{         map1 = 0; map2  = 0; map3 = 0;             }       }      }             ind.add(v1);      ind.add(v2);      ind.add(v3);      map.add(map1);      map.add(map2);      map.add(map3);      found = -1;     }     if(found == 3){      float uvx = 0, uvy = 0;           for(int repeat = 0; repeat&lt;2; repeat++){       buildWord="""";       do{        data = rd.read();        c = (char)data;            buildWord+=c;       }while((char)data!=' ' &amp;&amp; (char)data!='\n');       if(repeat==0)        uvx = Float.parseFloat(buildWord.trim());       else if(repeat==1)        uvy = Float.parseFloat(buildWord.trim());      }      uv.add(uvx);      uv.add(uvy);      found = -1;     }    data = rd.read();   }   rd.close();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }  ret.vertices = new float[vert.size()];  for(int i=0; i&lt;ret.vertices.length; i++){   ret.vertices[i] = vert.get(i);   Log.d(""CATCH"", Float.toString(ret.vertices[i]));  }  ret.uvMappings = new short[map.size()];  for(int i=0; i&lt;ret.uvMappings.length; i++){   ret.uvMappings[i] = (short) (map.get(i)-1);   Log.d(""CATCH"", Float.toString(ret.uvMappings[i]));  }  ret.uvtex = new float[uv.size()];  for(int i=0; i&lt;ret.uvtex.length; i++){   ret.uvtex[i] = uv.get(i);   Log.d(""CATCH"", Float.toString(ret.uvtex[i]));  }  ret.indices = new short[ind.size()];  for(int i=0; i&lt;ret.indices.length; i++){   ret.indices[i] = (short) (ind.get(i)-1);  }  ret.MapUVCoordinates();  ret.fillBuffers();  return ret; }}</code></pre><p>The method 'ret.MapUVCoordiantes' doesn't work, it was just my attempt at ordering them myself...I'm not going to post it because it, just, doesn't do anything. The method 'ret.fullBuffers' is below. It just creates bytebuffers out of the arrays:</p><pre><code>    public void fillBuffers(){  ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);  ByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2);  ByteBuffer ubb = ByteBuffer.allocateDirect(uvtex.length * 4);  Log.d(""CMeshInfo::fillBuffers"", Float.toString(vertices.length * 4));  Log.d(""CMeshInfo::fillBuffers"", Float.toString((indices.length * 2)));  Log.d(""CMeshInfo::fillBuffers"", Float.toString(uvtex.length * 4));  vbb.order(ByteOrder.nativeOrder()); //Vertices  ubb.order(ByteOrder.nativeOrder()); //UV coordinates  ibb.order(ByteOrder.nativeOrder()); //Indices  vertBuff = vbb.asFloatBuffer();  uvBuff = ubb.asFloatBuffer();  IndBuff = ibb.asShortBuffer();  vertBuff.put(vertices);  uvBuff.put(uvtex);  IndBuff.put(indices);  vertBuff.position(0);  uvBuff.position(0);  IndBuff.position(0); }</code></pre>","482085","","21234","","2011-01-13 09:53:56","2011-01-13 09:53:56","Help with UV on my obj loader for android","<java><android><opengl-es><file-format><.obj>","1","0","1","",""
"4558356","1","","","2010-12-29 22:18:17","-1","149","<pre><code>package com.android.drinksonme;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class Screen2 extends Activity {    // Declare our Views, so we can access them later    private EditText etUsername;    private EditText etPassword;    private Button btnLogin;    private Button btnSignUp;    private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Get the EditText and Button References                etUsername = (EditText)findViewById(R.id.username);                etPassword = (EditText)findViewById(R.id.password);                btnLogin = (Button)findViewById(R.id.login_button);                btnSignUp = (Button)findViewById(R.id.signup_button);                lblResult = (TextView)findViewById(R.id.result);                       btnLogin.setOnClickListener(new OnClickListener () {                             public void onClick(View v){                            final String username = etUsername.getText().toString();                            final String password = etPassword.getText().toString();                           if(username.equals(""test"") &amp;&amp; password.equals(""test"")){                               Intent i = new Intent(Screen2.this, DrinksTwitter.class);                               startActivity(i);}                            else                               lblResult.setText(""Invalid username or password.""); }                          /*  final Intent k = new Intent(Screen2.this, SignUp.class);                           btnSignUp.setOnClickListener(new OnClickListener() {                               public void onClick(View v) {                                    startActivity(k);                               }*/                            }                       );                    }                                      }</code></pre>","554786","","1237116","","2012-12-07 05:55:09","2012-12-07 05:55:09","With lots of help, I have gotten this android class activity down to only one error. Eclipse ask me to add "")"" ,""}"", and "";"" why though?","<android>","3","0","","",""
"4558435","1","4558506","","2010-12-29 22:29:35","3","3643","<p>I got this error. Any idea ?</p><pre><code>12-29 22:24:46.087: WARN/dalvikvm(2307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)12-29 22:24:46.147: ERROR/AndroidRuntime(2307): FATAL EXCEPTION: main12-29 22:24:46.147: ERROR/AndroidRuntime(2307): java.lang.NullPointerException12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.opengl.GLSurfaceView.surfaceCreated(GLSurfaceView.java:471)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.SurfaceView.updateWindow(SurfaceView.java:532)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.View.draw(View.java:6743)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.widget.FrameLayout.draw(FrameLayout.java:352)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.View.draw(View.java:6743)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.widget.FrameLayout.draw(FrameLayout.java:352)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewRoot.draw(ViewRoot.java:1407)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.os.Handler.dispatchMessage(Handler.java:99)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.os.Looper.loop(Looper.java:123)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at java.lang.reflect.Method.invokeNative(Native Method)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at java.lang.reflect.Method.invoke(Method.java:521)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at dalvik.system.NativeStart.main(Native Method)12-29 22:24:46.167: WARN/ActivityManager(57):   Force finishing activity com.kamil.cakir/.ResimEgici12-29 22:24:46.667: WARN/ActivityManager(57): Activity pause timeout for HistoryRecord{43fc5250 com.kamil.cakir/.ResimEgici}</code></pre>","459904","","","","","2010-12-29 22:41:37","android glsurfaceview null pointer exception","<android>","1","2","","",""
"4558478","1","4558559","","2010-12-29 22:37:14","0","115","<p>I am very new to this, and I more looking for what information I need to study to be able to accomplish this.</p><p>What I want to do is use my GUI I have built for my app, but pull the information from a website.  </p><p>If I have a website that looks like this:</p><p>(Sorry, can't post pics yet)</p><p>http://dl.dropbox.com/u/7037695/ErrorCodeApp/FromWebsite.PNG</p><p>(full website can be seen at <a href=""http://www.atmequipment.com/Error-Codes"" rel=""nofollow"">http://www.atmequipment.com/Error-Codes</a>)</p><p>What would I need from the website so that if a user entered an error code here:</p><p>http://<br>dl.dropbox.com/u/7037695/ErrorCodeApp/InApp.PNG</p><p>It would use the search from the website, and populate the error description in my app?</p><p>I know this is a huge question, I'm just looking for what is actually needed to accomplish this, and then I can start researching from there.   --  Or is it even possible?</p>","557431","","","","","2010-12-30 08:52:48","Using Website Information Without WebView","<android><url><data><website>","2","1","","",""
"4558502","1","","","2010-12-29 22:41:16","0","680","<p>I've managed to display OBJ and Collada files in Android using OpenGL ES but when UV mapped textures are added to the equation I experience some issues.  The texture displays incorrectly and the object's polygons ""blink"" (Possibly from overlapping polys).</p><p>I've tried exporting from 3DS Max using the default Autodesk Collada plugin and OpenCallada.  I've tried running the files through Collada Refinery to ""Deindex"" the object which is supposed to make the position, UV, and normal indices match up.</p><p>I've been at this for a while and have read everything on the subject I could find but still havin' no luck.  I get the feeling there is probably some sort of gotcha like 3DS Max swaps U and V values or something like that.</p><p>I didn't paste in the loadCollada method but it parses the Collada file and adds the data to verts[], indicies[], textures[], normals[].</p><pre><code>public Model(Context context){    this.context = context;    loadCollada(""obj/dice.dae"");    ByteBuffer byteBuf = ByteBuffer.allocateDirect(verts.length * 4);    byteBuf.order(ByteOrder.nativeOrder());    vertexBuffer = byteBuf.asFloatBuffer();    vertexBuffer.put(verts);    vertexBuffer.position(0);    indexBuffer = ByteBuffer.allocateDirect(indices.length);    indexBuffer.put(indices);    indexBuffer.position(0);    byteBuf = ByteBuffer.allocateDirect(texture.length * 4);    byteBuf.order(ByteOrder.nativeOrder());    textureBuffer = byteBuf.asFloatBuffer();    textureBuffer.put(texture);    textureBuffer.position(0);    byteBuf = ByteBuffer.allocateDirect(normals.length * 4);    byteBuf.order(ByteOrder.nativeOrder());    normalBuffer = byteBuf.asFloatBuffer();    normalBuffer.put(normals);    normalBuffer.position(0);}    public void draw(GL10 gl){    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);                   gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);    gl.glNormalPointer(3, GL10.GL_FLOAT, normalBuffer);    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer);                   gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);    gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);}public void loadGLTexture(GL10 gl, Context context) {    InputStream is;    Bitmap bitmap = null;    try {        is = context.getAssets().open(""obj/dice.png"");              bitmap = BitmapFactory.decodeStream(is);        is.close();        is = null;    }    catch (IOException e) {        Log.v(""TEXTURE LOAD ERROR"", e.toString());    }    gl.glGenTextures(1, textures, 0);    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    bitmap.recycle();}</code></pre>","557658","","557658","","2010-12-29 23:12:18","2010-12-29 23:12:18","Trouble displaying 3D objects with UV mapping from 3DS Max with OpenGL ES","<iphone><android><opengl-es><3d><collada>","0","2","","",""
"4558534","1","4559289","","2010-12-29 22:45:32","0","1120","<p>I have problem with changing activity. I added the line to AndroidManifest and it doesn't work. It means, there's error after click of ""NowaGra"" ImageButton. ( Error - ""Sorry !, The Application Gra_Milionerzy(process gra_Milionerzy.Gra) has stopped unexpectdelly. Please try again )</p><p>It's main Activity ( Gra - Game in English )</p><pre><code>    package gra_Milionerzy.Gra;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ImageButton;public class Gra extends Activity {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        /*   Menu Gry */            ImageButton Nowa_Gra = (ImageButton)this.findViewById(R.id.nowa_gra);          Nowa_Gra.setOnClickListener(new OnClickListener()            {      public void onClick(View v)       {       Intent intent = new Intent(Gra.this, NowaGra.class);        startActivity(intent);             }                  });          ImageButton Profile = (ImageButton)this.findViewById(R.id.profile);          Profile.setOnClickListener(new OnClickListener()            {      public void onClick(View arg0)       {        finish();       }            });          ImageButton OAutorze = (ImageButton)this.findViewById(R.id.o_autorze);          OAutorze.setOnClickListener(new OnClickListener()            {      public void onClick(View arg0)       {        finish();       }            });          ImageButton Ustawienia = (ImageButton)this.findViewById(R.id.ustawienia);          Ustawienia.setOnClickListener(new OnClickListener()            {      public void onClick(View arg0)       {        finish();       }            });          /*  Koniec Menu Gry  */          /*  Kola Ratunkowe  */    }}</code></pre><p>and here's NowaGra ( NewGame ;P )</p><pre><code>package gra_Milionerzy.Gra;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ImageButton;public class NowaGra extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);       finish();        /*   Kola Ratunkowe */      }}</code></pre><p>and AndroidManifest </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""gra_Milionerzy.Gra""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Glowna""                  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="".NowaGra""&gt;&lt;/activity&gt;    &lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""1""&gt;&lt;/uses-sdk&gt;&lt;/manifest&gt; </code></pre><p>plus LogCat</p><pre><code>12-30 12:43:06.738: ERROR/AndroidRuntime(1379): FATAL EXCEPTION: main12-30 12:43:06.738: ERROR/AndroidRuntime(1379): android.content.ActivityNotFoundException: Unable to find explicit activity class {gra_Milionerzy.Gra/gra_Milionerzy.Gra.NowaGra}; have you declared this activity in your AndroidManifest.xml?12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Activity.startActivityForResult(Activity.java:2817)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.Activity.startActivity(Activity.java:2923)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at gra_Milionerzy.Gra.Gra$1.onClick(Gra.java:25)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.view.View.performClick(View.java:2408)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.view.View$PerformClick.run(View.java:8816)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.os.Handler.handleCallback(Handler.java:587)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.os.Handler.dispatchMessage(Handler.java:92)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.os.Looper.loop(Looper.java:123)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at java.lang.reflect.Method.invokeNative(Native Method)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at java.lang.reflect.Method.invoke(Method.java:521)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-30 12:43:06.738: ERROR/AndroidRuntime(1379):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>And what I'm doing wrong ? Any ideas ?</p><p><em><strong></em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>____</strong>-ANWSER - The bad wrote in AndroidManifest</p>","557698","","557698","","2010-12-30 16:25:26","2010-12-30 16:25:26","Android - Changing Activity","<android>","1","6","1","",""
"4558539","1","","","2010-12-29 22:46:55","0","261","<p>I am making a java application that balances chemical equations. I loop through each term and create two arraylists. In one arraylist, I have the set of all of the elements. For example (in the first term) if the equation is C6H12O6+O2=CO2+H2O, the arraylist will have {C, H, O}. In another, I have the corresponding numbers, so it will contain {6,12,6}. I need to combine all of these to form a matrix (3 by 4), which would be:</p><p>(0,0) = 6(1,0) = 12(2,0) = 6(0,1) = 0(1,1) = 0(2,1) = 2(0,2) = 1(1,2) = 0(2,2) = 2(0,3) = 0(1,3) = 2(2,3) = 1</p><p>The matrix above is designed so that row 0 is C, row 1 is H, and row 2 is O. The columns are the terms (0, 1, 2, and 3)</p><p>Any suggestions for converting the arraylists into a matrix?</p>","557699","","","","","2010-12-30 09:35:15","Help with a Chemical Balancer? (Conversion from arraylists to matrix) in java","<java><android><sdk><chemistry>","3","2","","",""
"4558551","1","","","2010-12-29 22:49:08","0","468","<p>I've been trying to find a tutorial of how to create a ListView that get its data from a server dynamically as it's scrolled.  I have not been able to find complete documents of how to do this.  Only small examples or ListView tutorials that deals with set arrays.  This has left me where I don't know where to start building the ListView code.</p><p>I have some code that gets data from the server.  I also do have all the layouts and basic Activity code.</p><ul><li>How/what do ListView do to get one more rows as it is scrolled?</li><li>And when I need to have different row layouts. How do ListView handles this?</li></ul><p>Is there a complete tutorial that deals with ListView and getting data from a server?</p>","324943","","","","","2010-12-30 00:07:44","How to setup a ListView that get its data from a server","<android><listview><layout>","1","1","","",""
"4558563","1","","","2010-12-29 22:51:21","1","299","<p>We are trying to make a board with sticky notes. We have used ScrollView in which we have LinearLayout. We have four columns. If there are more than 3 notes in one column, scrollview comes up. Issue is, if I try to move Row 5 column 1 note to Row 1 Column 2, scroll views hides all the notes. If we scroll to top of the board, notes become visible again. Any idea what's the issue ?</p><p>Thanks</p><p>Salman</p>","557702","","","","","2010-12-30 09:43:21","Android ScrollView issue","<android><scrollview>","0","2","","",""
"4558564","1","4559525","","2010-12-29 22:51:27","3","2999","<p>I have some TextViews in my app that I want updated automatically each 5 seconds. I have a method for refreshing them, but how do I make a timer that runs the method every 5 seconds? Thanks!</p>","557703","","","","","2011-09-01 09:21:33","Android 2.2: How to update textviews automatically with a timer?","<android><timer><textview>","3","1","","",""
"4558630","1","","","2010-12-29 23:01:35","0","1116","<p>I am writing an app to monitor some files under /sys/devices/.../cpu.  There is one file that is owned by root:root, with only read permissions for root.</p><p>I added code to exec(""su""), but even then I get a file not found exception.  The only way I don't get an error is if I chmod the file permissions.  However, these permissions get set back to root read after boot, so I'd really like to find how to do the read without changing the file perms.</p><p>Thanks,Jim</p>","555303","","","","","2010-12-31 04:45:51","Problem reading system file in Android app, even with root","<android>","1","5","1","",""
"4558640","1","4558975","","2010-12-29 23:03:03","2","1227","<p>I have currently have the same code from the android list view tutorial. I want to use the images saved in my drawable resource folder and assign each individual image to a specific row in the listview.</p><p>I have tried to put an imageview in the xml and this resulted in only the use of the same image for all rows in the list view but I need to use a different image for each row. </p><p>I feel I need to create an array of these images and then add them to the listview using the .java file associated with the listview. If anyone can help, it would be much appreciated, thanks.</p>","557711","","","","","2010-12-30 00:03:25","Adding a series of images in drawable folder to list view","<android><listview>","1","2","","",""
"4558774","1","4559017","","2010-12-29 23:28:35","4","1665","<p>The Android class SQLiteOpenHelper has a method to return a readable database as well as a read and writable database. Currently I am only using writable database and have no issues but I am wondering what the benefit would be to change to using readable only if I am only reading in an async task (or activity).</p><p>There might be performance benefits but I have not seen any reference to actual numbers. Also if I keep switching between readable and writable the change has an overhead that might take all the performance advantage away.</p><p>Does anybody have any real numbers or experience with this? Is it worth implementing separate access?</p>","136445","","","","","2010-12-30 00:15:31","Reasons for using readable SQLite database","<android><sqlite><sqlite3>","2","2","2","",""
"4558810","1","4789886","","2010-12-29 23:33:53","12","7915","<p>I'm trying to create a pretty basic chat screen with a ListView displaying the text and an EditText at the bottom and a ""Send"" button to the right of the EditText. Everything is functional, but when I click the EditText, the virtual keyboard covers it. The screen pans up a little but not enough to become visible above the keyboard. I've got the ""adjustPan"" tag in my manifest and have also tried the ""adjustResize"" tag to no avail. I'm guessing it has something to do with the way my layout is set up, but I honestly have no clue. Please help!</p><p>Current Layout...</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ListView android:id=""@+id/android:list""     android:layout_height=""0dip""     android:layout_width=""fill_parent""    android:layout_weight=""1""    android:stackFromBottom=""true""&gt;&lt;/ListView&gt;&lt;LinearLayout android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;EditText android:id=""@+id/sendMessageBox""        android:focusable=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:scrollbars=""vertical""        android:maxLines=""4""        android:text=""""        android:inputType=""textShortMessage|textAutoCorrect|textCapSentences|textMultiLine""        android:maxLength=""1000""        android:hint=""Type your message...""        android:imeOptions=""actionSend""/&gt;    &lt;Button android:id=""@+id/sendMessageButton""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_gravity=""bottom""        android:text=""Send""/&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","490642","","","","","2014-01-22 20:53:19","adjustPan not preventing keyboard from covering EditText","<android><android-layout><android-manifest><android-softkeyboard>","3","0","2","",""
"4558887","1","4558961","","2010-12-29 23:45:54","0","4103","<p>I need to connect to a server via TCPIP.  I found out how to do this, but the examples do not make a permanent connection, it just connects sends data and drops the connection. I need to leave the connection open to pass back and forth several packages.</p><p>For example I am used to requesting a connection, then having a process to listen for incoming data. Like this:</p><ol><li>Connect</li><li>Acknowledge connection</li><li>Send data</li><li>Receive data ... go back to #3</li><li>Close the connection.</li></ol><p>Is there anything that I can read on this or better yet sample code?</p>","528130","","","","","2013-01-10 01:24:53","Android Java Socket Socket TCPIP open connection","<java><android><sockets><tcp>","3","0","3","",""
"4558929","1","4559366","","2010-12-29 23:54:54","3","3489","<p>This <em>seems</em> like a dumb question, but I couldn't see any way to do this using methods in the <code>Drawable</code> class. Then I thought maybe I'd have to flip the Canvas in some way.. still couldn't find a suitable method.</p><p>I just need to ""flip"" a Drawable on it's y-axis.. the center y preferably. How can I do this?</p>","408178","","","","","2010-12-30 01:36:58","Flipping Drawable on an X or Y axis","<java><android><drawable>","1","0","2","",""
"4558959","1","","","2010-12-30 00:00:05","0","928","<pre><code>package com.android.drinksonme;import android.app.Activity;import android.content.Intent;import android.util.Log;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class Screen2 extends Activity {    // Declare our Views, so we can access them later    private EditText etUsername;    private EditText etPassword;    private Button btnLogin;    //private Button btnSignUp;    private TextView lblResult;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Get the EditText and Button References                etUsername = (EditText)findViewById(R.id.username);                etPassword = (EditText)findViewById(R.id.password);                btnLogin = (Button)findViewById(R.id.login_button);               // btnSignUp = (Button)findViewById(R.id.signup_button);                lblResult = (TextView)findViewById(R.id.result);                       btnLogin.setOnClickListener(new OnClickListener() {                           @Override                           public void onClick(View v) {                            String username = etUsername.getText().toString();                            String password = etPassword.getText().toString();                           if(username.equals(""test"") &amp;&amp; password.equals(""test"")){                               Intent i = new Intent(Screen2.this, DrinksTwitter.class);                               startActivity(i);                           } else {                               lblResult.setText(""Invalid username or password."");                            }                          }                       });    }}                         /*  final Intent k = new Intent(Screen2.this, SignUp.class);                           btnSignUp.setOnClickListener(new OnClickListener() {                               public void onClick(View v) {                                    startActivity(k);                               }*/</code></pre><p>This is the log trace:</p><pre><code>12-29 17:55:50.215: WARN/KeyCharacterMap(276): No keyboard for id 012-29 17:55:50.215: WARN/KeyCharacterMap(276): Using default keymap: /system/usr/keychars/qwerty.kcm.bin12-29 17:55:56.645: DEBUG/dalvikvm(120): GC_FOR_MALLOC freed 1585 objects / 216672 bytes in 77ms12-29 17:55:57.615: DEBUG/dalvikvm(120): GC_EXTERNAL_ALLOC freed 1934 objects / 132912 bytes in 74ms12-29 17:55:59.136: WARN/KeyCharacterMap(120): No keyboard for id 012-29 17:55:59.165: WARN/KeyCharacterMap(120): Using default keymap: /system/usr/keychars/qwerty.kcm.bin12-29 17:56:03.435: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.android.drinksonme/.DrinksTwitter }12-29 17:56:03.965: DEBUG/AndroidRuntime(276): Shutting down VM12-29 17:56:03.965: WARN/dalvikvm(276): threadid=1: thread exiting with uncaught exception (group=0x4001d800)12-29 17:56:04.335: ERROR/AndroidRuntime(276): FATAL EXCEPTION: main12-29 17:56:04.335: ERROR/AndroidRuntime(276): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.drinksonme/com.android.drinksonme.DrinksTwitter}: java.lang.NullPointerException12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.os.Handler.dispatchMessage(Handler.java:99)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.os.Looper.loop(Looper.java:123)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invokeNative(Native Method)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invoke(Method.java:521)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at dalvik.system.NativeStart.main(Native Method)12-29 17:56:04.335: ERROR/AndroidRuntime(276): Caused by: java.lang.NullPointerException12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at com.android.drinksonme.DrinksTwitter.onCreate(DrinksTwitter.java:24)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)12-29 17:56:04.335: ERROR/AndroidRuntime(276):     ... 11 more12-29 17:56:04.415: WARN/ActivityManager(58):   Force finishing activity com.android.drinksonme/.DrinksTwitter12-29 17:56:04.435: WARN/ActivityManager(58):   Force finishing activity com.android.drinksonme/.Screen212-29 17:56:04.975: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{43f9f0c8 com.android.drinksonme/.DrinksTwitter}12-29 17:56:05.045: INFO/ARMAssembler(58): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x340c68:0x340d24] in 4299931 ns12-29 17:56:15.909: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43f470c8 com.android.drinksonme/.Screen2}12-29 17:56:15.909: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43f9f0c8 com.android.drinksonme/.DrinksTwitter}</code></pre><p>Snippet from DrinksTwitter.java:    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.specials);</p><pre><code>        WebView mWebView = (WebView) findViewById(R.id.drinks);</code></pre><p>/<em>line:24</em>/ mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""http://www.yahoo.com"");    }</p>","554786","","19679","","2010-12-30 15:42:07","2010-12-30 15:42:07","Android simple login screen crashes app when logging, no errors in eclipse. Which java class activity is at fault?","<android>","1","6","","",""
"4558980","1","","","2010-12-30 00:04:28","0","429","<p>I've created my own tab control and now I'm trying to decide on sizing and positioning of the tabs.  I currently use:</p><p>android:layout_weight=""9""  android:layout_weight=""1""</p><p>So that the tab buttons at the top of the screen take up 1/10th of the screen height, and I want the text only labels of my tabs to fill up half that height. I currently specify the height of the text in the TextView as follows:</p><p>android:textSize=""16dp""</p><p>Which looks nice on my emulator, but I assume doesn't do what I want on various screen sizes. Can I specify the text size to be half the size of the containing TextView? (Which itself was sized correctly already by the layout_weight).</p>","317033","","","","","2010-12-30 00:41:46","Android - Tab sizing and positioning","<android><layout><textview>","1","2","","",""
"4559069","1","4559170","","2010-12-30 00:27:15","1","3566","<p>On the android <code>TabHost layout</code>, when the user selects a tab the color of the tab changes temporarily. How do I either disable this color change, or specify the color that the tab changes to?</p>","92937","","750613","","2012-06-28 06:46:24","2012-06-28 06:46:24","How do I change the color used to indicate a tab has been selected on a TabHost?","<android><android-tabhost>","2","0","2","",""
"4559117","1","4575037","","2010-12-30 00:38:54","0","142","<p>I'm on my first week with android and would appreciate any insight if it's possible to hook or override the default behaviour as my android application read the values from the resource-files to the shown layouts.</p><p>What I want is to over time be able to add new/updated strings <code>OTA</code> and store locally and then on launch of application load new values instead of the ones in the default /res.</p><p>Ideally i guess, would be an override of setContentView.</p><p>Files holding updates will be in same xml-format as those in /res.</p><p>(Please, no advices in other ways to do this. Just need to know if it's at all possible, without hacking the SDK)</p><p>regards,</p>","247245","","750613","","2012-06-28 06:45:56","2012-06-28 06:45:56","Possible to add hook as android fetches XML-strings?","<java><android><xml><oop>","1","4","","",""
"4559122","1","4804404","","2010-12-30 00:40:22","0","257","<p>Some very very strange behaviour was appearing in my Android application.</p><p>I was extending Button to replace the standard. In my own button I set:- TextAppearence (text 16px, bold..)- BackgroundDrawable (to an selector that replaced the standard button, that used images of 60px)- <code>Gravity: LEFT|CENTER_VERTICAL.</code></p><p>Whenever the text was enough to make the button have 2 text lines, if it had the property <code>Gravity.CENTER_VERTICAL</code>, a top padding would appear!</p><p>This kept me overflowing and googling for weeks... (set paddingTop, singleLine, and other simple solutions didn't work of course!)</p><p>Finally got the solution!!!</p><pre><code> @Override protected boolean setFrame(int l, int t, int r, int b) {  int fixedTopSize = 5;  return super.setFrame(l,fixedTopSize, r, b-t); }</code></pre><p>By overriding this method on the extended Button finally i got it to work without the irritating top padding... still i don't understand why this happens.</p><p>Any ideia?</p>","327011","","750613","","2012-06-28 06:37:38","2012-06-28 06:37:38","Button top increase with multiple lines","<android><layout-gravity>","1","0","","",""
"4559177","1","4560144","","2010-12-30 00:52:47","0","2247","<p>I have some class (<b>SomeClass.class</b>). I want to have some static methods in it like <b>getAllDatabaseItems</b>, getTableItems, insertNewRecord and so on.</p><p>If I do it this way</p><pre><code>SQLiteDatabase db = openOrCreateDatabase(DATABASE_NAME, MODE_PRIVATE, null);</code></pre><ul><li>I need to extend Activity (but still can't use it in static methods) or pass a ""db"" variable in every single method (from ""caller activity"") which is pretty bulky.</li></ul><p>What's the solution so I can from some class call <b>SomeClass.getAllDatabaseItems()</b>?</p><p><b>@MobileDev123</b> So I still need to extend Activity (because of the method <b>openOrCreateDatabase</b>)?If I have this class (which isn't actually an activity, I don't use it that way)</p><pre><code>public class Partner extends Activity {@SuppressWarnings(""static-access"")public Partner(Context mContext) {    myContext = mContext;    db = openOrCreateDatabase(DATABASE_NAME, myContext.MODE_PRIVATE, null);    db.execSQL(""CREATE TABLE IF NOT EXISTS "" + PARTNER_TABLE_NAME + "" (id INTEGER PRIMARY KEY AUTOINCREMENT, "" + NAME + "" VARCHAR);"");    db.execSQL(""CREATE TABLE IF NOT EXISTS "" + ADDRESS_TABLE_NAME + "" (id INTEGER PRIMARY KEY AUTOINCREMENT, "" + PARTNER_ID + "" INT, "" + ADDRESS + "" VARCHAR, "" + CITY + "" VARCHAR);"");}</code></pre><p>And then call it from some of my activites like this</p><pre><code>    Partner newPartner = new Partner(this);    partnersItems = newPartner.getAllItems();</code></pre><p>I get an NullExceptionError on line 4 (Partner.class) - why? If I use static reference on</p><pre><code>MODE_PRIVATE =&gt; (Context.MODE_PRIVATE)</code></pre><p>again it's not working.</p><p><b>@Falmarri</b> same with static, if I pass in ""this"" argument (from some caller class) and receive it as an Context argument in my static method still can't successfully create/open my database (see lines before)</p>","455268","","135152","","2011-05-25 03:02:29","2012-03-22 12:03:56","Access database in non-Activity class","<android><sqlite>","4","3","1","",""
"4559203","1","4559240","","2010-12-30 00:58:45","0","751","<p>I copied the ApiDemos sample to my workspace, then tried creating a new project out of it. The New Android Project wizard page is obvious but then the wizard led me to a page named ""New Android Test Project"", which creates a new ""Android Test Project resource"".</p><p>What is that ""test resource"" and where I can learn more about it?</p>","418055","","","","","2010-12-30 01:07:12","In Eclipse+Android, what is the difference between a Project and a ""Test Project""?","<android><eclipse>","1","0","","",""
"4559222","1","4559287","","2010-12-30 01:03:53","0","262","<p>How could I resize menu entries to have, for example, only one entry on the bottom row. Here is an example:<br><img src=""http://i.stack.imgur.com/54mfo.png"" alt=""entry""><br>Notice how the ""Add"" and ""Wallpaper"" are both on the top and the others are on the bottom. How could I accomplish the same feat, but having just one menu entry on the bottom and two on the top?</p>","200477","","","","","2010-12-30 01:17:32","Resize Options Menu entries","<java><android><options-menu>","1","0","","",""
"4559367","1","4600618","","2010-12-30 01:37:24","7","10963","<p>I found <a href=""http://stackoverflow.com/questions/1925428/android-when-the-keyboard-pops-up-the-layout-is-invisible-how-do-i-solve-this"">this</a> old post which definitely helps with my problem, but I'm noticing that it doesn't really seem to solve my problem.  I have gathered that I need to set android:windowSoftInputMode=""adjustPan"" for my activity.  But the issue is that it simply doesn't pan ENOUGH.</p><p>The text field is toward the bottom of the view, and when the keyboard shows up, the view shifts slightly but only the very top of the EditText.  The text field has autocomplete turned on, and when it begins to show autocomplete options, the view pans down slightly more, but actually winds up even further obscured by the autocomplete options.  It makes the text input field very difficult to use since you can't see anything you're typing.</p><p>It is a multiline input field, and when text rolls to the next line, the view pans farther, so you can actually see the previous line(s) of text.  But you cannot see what you're typing, which I think is pretty important.</p><p>Does anyone have any thoughts on solving this issue?</p>","313141","","313141","","2012-02-10 23:31:23","2012-02-10 23:31:23","Soft Keyboard Overlapping with EditText Field","<android><view><edittext>","2","1","4","",""
"4559416","1","","","2010-12-30 01:50:27","1","1179","<p>I have a lite version of an application that uses a SQLite database. I want to copy that database over to the full version of the application when the user installs the full version.</p><p>I have written some code to perform the file copy, but the lite database file always comes up as unreadable. The file is there and I can point to it, but I can't read it to perform the copy.</p><p>In the Android <a href=""http://developer.android.com/guide/topics/data/data-storage.html"" rel=""nofollow"">documentation</a>, we read:</p><blockquote>  <p>You can save files directly on the  device's internal storage. By default,  files saved to the internal storage  are private to your application and  other applications cannot access them  (nor can the user).</p></blockquote><p>Note the words, ""by default"".</p><p>Is there a way that I can override that default and make the SQLite file readable by my other application?</p><p>Thank you.</p>","398641","","","","","2010-12-30 02:04:24","Android: How to copy a SQLite database from one application to another","<android><file><sqlite><copy><io>","1","0","","",""
"4559459","1","","","2010-12-30 02:03:06","0","3334","<p>NEWBIE to Android Warning:  I have successfully completed 5 of the android developers tutorials but I am having a problem with the Google Maps tutorial.  I have entered the code letter for letter and ctrl+shift+o to import all the packages and I am still getting an error that mContext cannot be resolved.  I'm sure its something simple, I've just been staring at the screen too long to see it.  Thanks in Advance.</p><pre><code>package com.example.HelloGoogleMaps;import java.util.ArrayList;import android.app.AlertDialog;import android.content.Context;import android.graphics.drawable.Drawable;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.OverlayItem;public class HelloItemizedOverlay extends ItemizedOverlay {private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();public HelloItemizedOverlay(Drawable defaultMarker) {super(boundCenterBottom(defaultMarker));}public void addOverlay(OverlayItem overlay) {mOverlays.add(overlay);populate();}@Overrideprotected OverlayItem createItem(int i) {// TODO Auto-generated method stubreturn mOverlays.get(i);}@Overridepublic int size() {// TODO Auto-generated method stubreturn 0;}public HelloItemizedOverlay(Drawable defaultMarker, Context context) {super(defaultMarker);mContext = context; //ERROR #1} @Overrideprotected boolean onTap(int index) {OverlayItem item = mOverlays.get(index);AlertDialog.Builder dialog = new AlertDialog.Builder(mContext); //ERROR #2dialog.setTitle(item.getTitle());dialog.setMessage(item.getSnippet());dialog.show();return true;}}</code></pre>","557805","","","","","2010-12-30 02:39:42","Google Maps Tutorial mContext cannot be resolved","<android><maps><context>","1","0","1","",""
"4559560","1","4559713","","2010-12-30 02:29:58","0","1541","<p>So in this app I made, The user makes a project and when they save, the number of frames is saved to numberFrames.txt on the SD card. Then I retrieve the file in another class. Only thing is that nFrames = 50 when i show a toast of nFrames to the screen after I run this code. The only initializing of nFrames I do is to zero right above this code, which is located in the onCreate().</p><pre><code>File sdcardLocal =  Environment.getExternalStorageDirectory();                 File dir = new File (sdcardLocal.getAbsolutePath() + ""/Flipbook/""+customizeDialog.getTitle()+""/"");                 dir.mkdirs();                 File fileNum = new File(dir, ""numberFrames.txt"");                 FileWriter myFileWriter = null;        try {         myFileWriter = new FileWriter(fileNum);        } catch (IOException e) {         e.printStackTrace();        }                 BufferedWriter out = new BufferedWriter(myFileWriter);                           try {                           String text = bitmaps.size()+"""";                           out.write(text);         out.close();        } catch (IOException e) {         e.printStackTrace();        }</code></pre><p>I retrieve the file like this. I have no idea where this ""50"" value for nFrames came from as there are no loops around this and I know for sure that the particular project saved has only 3 frames. Why is this?</p><pre><code>FileInputStream is = null;             BufferedInputStream bis = null;             try {                 is = new FileInputStream(new File(mFolderDialog.getPath()+""/numberFrames.txt""));                 bis = new BufferedInputStream(is);                 nFrames = bis.read();             }catch (IOException e) {     e.printStackTrace();    }</code></pre>","413488","","140328","","2011-08-18 15:46:10","2011-08-18 15:46:10","Reading int value from txt file on SD card android","<android><file><int><sd-card>","1","0","","",""
"4559640","1","4559674","","2010-12-30 02:47:25","1","3100","<p>I have a subclass of <code>CursorAdapter</code> and I would like to filter my listview. I know that this can be accomplished with an <code>ArrayAdapter</code> as stated <a href=""http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android"">here</a> and that way using a custom <code>CursorAdapter</code> does not work for me. I would like to do this with a custom <code>CursorAdapter</code>. What should I override and can I have an example?</p>","200477","","","","","2010-12-30 03:03:44","Cannot filter ListView with CursorAdapter subclass","<java><android><listview><filter><cursor>","1","0","","",""
"4559695","1","","","2010-12-30 02:59:15","1","243","<p>Is it possible in the Android API to communicate directly to another android phone within close proximity? If so, which version of the API is it in? For example, if both phones had the same app, can they exchange messages in the background within close proximity?</p>","221026","","","","","2011-11-15 12:06:38","Android Proximity Messaging","<android>","1","0","","",""
"4559708","1","","","2010-12-30 03:02:46","0","635","<p>I have two applications.They have to communicate through a file.I know I can write a file on Android using Context.openFileOutput and pass it <code>MODE_WORLD_READABLE|MODE_WORLD_WRITEABLE</code>. But how can I find the file in another application?</p><p>thanks.</p><p>Sorry , I have found the solution. In another application, you just need get appropriate Context, then you can do the same things.The API is <code>Context.createPackageContext</code>.</p>","554861","","750613","","2012-06-28 06:36:45","2012-10-20 01:46:41","How I read another Android application's file?","<android><file><context>","1","2","","",""
"4559880","1","4573638","","2010-12-30 03:54:35","0","1014","<p>I am coding in java for android. the issue is how to get mp3 file size and its audio length before hand so that I can set my Progress bar / Seek bar. to respond to seeking events.</p><p>The answer can be a simple info in a header file or a algorithm. </p><p>I am using androids mediaplayer to stream and the only issue is seeking which requires both the above mentioned things.</p><p>Any help is appreciated.</p><p>I also tried manually looking into mp3 file and get the header to decode the mp3 length, with this noob code.</p><pre><code>total = ucon.getContentLength(); //ucon is an HTTPURLconnectionis= ucon.getInputStream();byte[] buffer = new byte[1024];  is.read(buffer , 0, 1024);int offset = 1024;int loc = 2000;//FrameLengthInBytes = 144 * BitRate / SampleRate + Paddingwhile(loc == 2000 &amp;&amp; offset&lt; total){    for(int i = 0 ; i &lt;1024 ;i++ )    {        if((int)buffer[i] == 255)        {            if((int)buffer[i+1] &gt;= 224)              {                 loc = i+1;                  break;             }        }    }    is.read(buffer , 0, 1024);    offset = 1024 + offset;         }</code></pre><p>Coudn't find the pattern which marks a mp3 header (<code>11111111 111xxxxx</code>). Tried on different files. Can't find anything else to do.</p><p><strong>Update 2</strong>:</p><p>Now I know I dont have to search for mp3 headers but ID3v2 headers. But still its done when streaming the file and on Android. I really hope someone helps and there are a lot of programs doing these things I wonder why would I have to do it the hard way.</p>","557869","","35060","","2011-01-01 09:33:15","2013-03-05 06:12:52","How every one does mp3 streaming?","<java><android><streaming><mp3>","1","7","1","",""
"4559910","1","","","2010-12-30 04:03:22","0","105","<p>I was trying to run a small worker thread in the middle of an activity which would get some stuff from a web service and fill a container when it returned. </p><pre><code>    new Thread() {        @Override        public void run() {            Log.w(""thread"", ""can read from thread"");            try {                                   MyActivity.this.runOnUiThread(new Runnable() {                    public void run() {                        Log.w(""internal thread"", ""running"");                    }                });            }            catch (Exception e) {                // etc            }        }    }.start();</code></pre><p>The ""internal thread: running"" would never print in the log, and when I ripped out the contents and just pasted it into the main body of the method, it worked. My conclusion is that the doubly nested thread never ran. Why would that happen? Am I misusing runOnUiThread?</p><p>Thanks!</p>","210920","","","","","2010-12-30 05:50:04","runOnUIiThread Not Running In a Thread","<android><multithreading>","1","8","","",""
"4559912","1","4560002","","2010-12-30 04:03:40","0","346","<p>Hi In my android application i would like to set alarm for particular time.I am using the below code.I am able to view the toast but no ring or alert is observed.Could anyone please let me know if i can display the toast with an default alarm tone.</p><pre><code>  int newAlarmPeriod = 15000; // For debugging      Intent alarmIntent = new Intent(this, GroupsCheckAlarmReceiver.class);     PendingIntent sender = PendingIntent.getBroadcast(this,0,alarmIntent, 0);     AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);     am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+ newAlarmPeriod, newAlarmPeriod, sender); public class GroupsCheckAlarmReceiver extends BroadcastReceiver{   @Override  public void onReceive(Context context, Intent intent) {          Toast.makeText(context, ""Alarm worked."", Toast.LENGTH_LONG).show();     Log.d(""XXX"", ""GroupsCheckAlarmReceiver.onReceive"");   }</code></pre><p>}</p><p>Do i need to set any manifest permissions except receiver registery.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2010-12-30 04:26:12","Alarm not ringing in android","<android>","1","0","","",""
"4559927","1","4559973","","2010-12-30 04:08:59","1","571","<p>When adding a ""settings"" screen to my app I seem to have come up with two choices:</p><ul><li><p>use the PreferenceActivity that is given by Android</p></li><li><p>create a standard Activity that saves all the user's choices</p></li></ul><p>Assuming I don't mind writing the code that saves the preferences (a relatively trivial task), what other advantages are there to using a PreferenceActivity? If anything, using a standard Activity provides much more flexibility with regards to UI design.</p>","312499","","","","","2010-12-30 04:20:29","Advantages of PreferenceActivity","<android><preferenceactivity>","1","0","","",""
"4559930","1","","","2010-12-30 04:09:53","7","7682","<p><em>EDIT</em>: I should have mentioned this already, but I'm running this code in a service. The entire app is turned on/off by a widget button and has no activity.</p><hr><p><em>Update</em>: I tried attaching the SDK sources to the project so I could get a more precise idea of where the failure was occurring, but from <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/a680b65f287e1b8c/caecec75f1b384f3?lnk=gst&amp;q=+Stub!+%09&amp;pli=1"">the looks of it</a>, only public APIs are included, which seems to make them a lot less useful... can anyone suggest at least a debugging approach for solving this issue? I'm kind of stuck.</p><hr><p>I'm trying to use Android's <a href=""http://developer.android.com/reference/android/speech/package-summary.html"">speech recognition package</a> to record user speech and translate it to text. Unfortunately, when I attempt initiate listening, I get an ANR error that doesn't point to anything specific.</p><p>As the SpeechRecognizer API indicates, a RuntimeException is thrown if you attempt to call it from the main thread. This would make me wonder if the processing was just too demanding... but I know that other applications use the Android API for this purpose and it is typically pretty snappy.</p><p><code>java.lang.RuntimeException: SpeechRecognizer should be used only from the application's main thread</code></p><p>Here is a (trimmed) sample of the code I'm trying to call from my service. Is this the proper approach?</p><p>Thanks for taking the time to help. This has been a hurdle I haven't been able to get over yet.</p><pre><code>Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,        RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,        ""com.domain.app"");SpeechRecognizer recognizer = SpeechRecognizer        .createSpeechRecognizer(this.getApplicationContext());RecognitionListener listener = new RecognitionListener() {    @Override    public void onResults(Bundle results) {        ArrayList&lt;String&gt; voiceResults = results                .getStringArrayList(RecognizerIntent.EXTRA_RESULTS);        if (voiceResults == null) {            Log.e(getString(R.string.log_label), ""No voice results"");        } else {            Log.d(getString(R.string.log_label), ""Printing matches: "");            for (String match : voiceResults) {                Log.d(getString(R.string.log_label), match);            }        }    }    @Override    public void onReadyForSpeech(Bundle params) {        Log.d(getString(R.string.log_label), ""Ready for speech"");    }    @Override    public void onError(int error) {        Log.d(getString(R.string.log_label),                ""Error listening for speech: "" + error);    }    @Override    public void onBeginningOfSpeech() {        Log.d(getString(R.string.log_label), ""Speech starting"");    }};recognizer.setRecognitionListener(listener);recognizer.startListening(intent);</code></pre>","555642","","555642","","2011-01-02 20:33:48","2012-04-17 02:48:16","SpeechRecognizer causes ANR... I need help with Android speech API","<android><android-service><speech-to-text>","6","2","9","",""
"4559969","1","","","2010-12-30 04:19:47","0","819","<p>I have defined six animations like <code>a1</code>, <code>a2</code>, <code>a3</code>, <code>a4</code>, <code>a5</code> and <code>a6</code> for six image views. These animations are performed in a sequence. For instance, <code>a2</code> will start when <code>a1</code> ends, <code>a3</code> will start when <code>a2</code> ends and so on. Starting from <code>a1</code>, the animation ends with <code>a6</code>. Now I want to repeat again from <code>a1</code> to <code>a6</code>. Where should I write this <code>setRepeatMode</code>? How to achieve this in some other way? Please help.</p>","542975","","1128737","","2012-01-13 13:12:58","2012-01-13 13:12:58","Repeating animation in Android","<android>","1","0","","",""
"4560145","1","4560164","","2010-12-30 05:06:25","2","3725","<p>I am building an android app and I have a warning that is not causing any problems however, when I see a warning I like to at least know what is causing it.  The app uses webview.</p><p>Here is the bit if code that is causing the warning.</p><pre><code>ImageView viewSplash;WebView mWebView;@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    viewSplash = (ImageView) findViewById(R.id.splash);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.getSettings().setGeolocationEnabled(true);    mWebView.loadUrl(""http://www.google.com"");    mWebView.setWebViewClient(new WebViewtest(){        @Override        public void onPageFinished(WebView View, String url)        {            viewSplash.setVisibility(View.GONE);                }    });}</code></pre><p>This is the error:</p><p>The static field View.GONE should be accessed in a static way.</p>","528396","","65977","","2010-12-30 05:13:32","2012-12-27 17:06:51","The static field view.GONE should be accessed in a static way?","<java><android><webview>","3","1","2","",""
"4560191","1","4570078","","2010-12-30 05:16:44","5","572","<p>In project 1 question &amp; Its 4 Answer .</p><p>Here As question I want to take 1 image Randomaly&amp; Its Answer 4 images Randomaly.</p><p>But Problem is that which image As question me take Randomaly It also want to take in Answer 4 images also contain question image </p><p>how to this possible </p><p>Pls  Reply</p>","545951","","422060","","2012-06-13 08:41:25","2012-06-13 08:41:25","how to shuffle Images in Android","<android><android-widget>","2","0","1","",""
"4560212","1","4560256","","2010-12-30 05:23:09","5","4354","<pre><code>delete(String table, String whereClause, String[] whereArgs)update(String table, ContentValues values, String whereClause, String[] whereArgs)</code></pre><p>What is this <code>String[] whereArgs</code>? Is it connected with ""?"" (so called wild card)?  </p>","509138","","254477","","2013-08-19 04:12:08","2013-08-19 04:13:48","String[] whereArgs parameter of database method in android","<android>","1","0","3","",""
"4560228","1","","","2010-12-30 05:27:08","4","987","<p>I am trying to build a simple sms app for which edit page lists all the saved smses. I gave 2 buttons in my layout for Edit and Delete but when I am clicking on them I am unable to get the rowid (row number from top) to retrieve the sms corresponding to that particular row.. Somebody please help me..my sms adapter is not not extending anything..Here's my class and xml files..</p><pre><code>public class SMSEdit extends ListActivity{ private SMSDbAdapter mDbHelper; //private Button editsmsbtn, deletesmsbtn; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);    setContentView(R.layout.editsmslist);    mDbHelper = new SMSDbAdapter(this);    mDbHelper.open();    fillData();} public void fillData() {     Cursor smsCursor = mDbHelper.fetchAllNotes();     startManagingCursor(smsCursor);     // Create an array to specify the fields we want to display in the list (only TITLE)     String[] from = new String[]{SMSDbAdapter.KEY_TITLE,       SMSDbAdapter.KEY_BODY,        SMSDbAdapter.KEY_DATE,        SMSDbAdapter.KEY_TIME};     // and an array of the fields we want to bind those fields to (in this case just text1)     int[] to = new int[]{R.id.smseditlistTO,        R.id.smseditlistMessage,       R.id.smseditlistDay,       R.id.smseditlistTime};     // Now create a simple cursor adapter and set it to display     SimpleCursorAdapter smsadap =          new SimpleCursorAdapter(this, R.layout.smsrow, smsCursor, from, to);     setListAdapter(smsadap); }  public void myEditClickHandler(View v)  {  //get the row the clicked button is in  LinearLayout vwParentRow = (LinearLayout)v.getParent();  Button btnChild = (Button)vwParentRow.getChildAt(4);  btnChild.setText(""I've been clicked!"");  ListAdapter pos = getListAdapter();  Intent intent = new Intent();      intent.setClass(SMSEdit.this, SMS.class);     // intent.putExtra(SMSDbAdapter.KEY_ROWID, id);      startActivity(intent);      finish(); }  public void myDeleteClickHandler(View v)  {  //get the row the clicked button is in  LinearLayout vwParentRow = (LinearLayout)v.getParent();  //TextView child = (TextView)vwParentRow.getChildAt(0);  Button btnChild = (Button)vwParentRow.getChildAt(5);  //btnChild.setText(child.getText());  btnChild.setText(""I've been clicked!""); int c = Color.CYAN;   vwParentRow.setBackgroundColor(c); vwParentRow.refreshDrawableState();         } }</code></pre><p>editsmslist.xml -- >></p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;&lt;ListView android:id=""@+id/android:list""          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=""No Future SMS Yet"" android:textSize=""35px""/&gt;&lt;/LinearLayout&gt;</code></pre><p>smsrow.xml -- >></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;LinearLayout  android:id=""@+id/LinearLayout02""       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""        android:orientation=""vertical""&gt;      &lt;LinearLayout android:id=""@+id/LinearLayout03""                      android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            &lt;TextView android:layout_height=""wrap_content""                     android:layout_width=""fill_parent"" android:text=""@string/smsdetailseditlist""       android:id=""@+id/smseditlistTO"" android:paddingLeft=""5px""&gt;              &lt;/TextView&gt;               &lt;TextView android:layout_height=""wrap_content""     android:text=""@string/smsdetailseditlist"" android:id=""@+id/smseditlistMessage""        android:paddingLeft=""20px"" android:maxLines=""1"" android:layout_width=""wrap_content""&gt;            &lt;/TextView&gt;&lt;/LinearLayout&gt;       &lt;LinearLayout android:id=""@+id/LinearLayout01""          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:orientation=""horizontal"" android:paddingLeft=""5px""&gt;         &lt;TextView android:layout_width=""wrap_content""       android:layout_height=""wrap_content"" android:text=""Date: ""&gt;&lt;/TextView&gt;&lt;TextView                 android:text=""@string/smsdetailseditlist"" android:id=""@+id/smseditlistDay""          android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;            &lt;TextView android:layout_width=""wrap_content""               android:layout_height=""wrap_content"" android:text=""Time: "" android:paddingLeft=""5px""&gt;               &lt;/TextView&gt;&lt;TextView android:text=""@string/smsdetailseditlist""                 android:id=""@+id/smseditlistTime"" android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" android:paddingRight=""10px""&gt;&lt;/TextView&gt;            &lt;Button  android:layout_width=""wrap_content""          android:layout_height=""wrap_content"" android:id=""@+id/EditSMSButton""          android:text=""@string/editsms"" android:onClick=""@string/myEditClickHandler""&gt;&lt;/Button&gt;            &lt;Button android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/DeleteSMSButton""            android:text=""@string/deletesms"" android:onClick=""@string/myDeleteClickHandler""&gt;&lt;/Button&gt;         &lt;/LinearLayout&gt;       &lt;/LinearLayout&gt;      &lt;/ScrollView&gt;</code></pre><p>Also Please suggest if there'a yn better way to implement this or make the layout look better...</p>","531069","","750987","","2011-05-28 13:03:29","2011-12-25 07:03:16","Not able to get the clicked row number in list view of android","<android><listview><android-layout><android-listview><listactivity>","3","0","1","",""
"4560238","1","","","2010-12-30 05:29:38","1","10514","<p>I have a <code>ListView</code> with a custom layout for each row having one <code>TextView</code> and three <code>EditText</code>. When I am clicking on individual row in <code>ListView</code> one activity is started and that takes you to another page. </p><p>I wrote some code but its not working. The code is shown below.</p><p>In adapter class getView() method i have place the below code</p><pre><code>   convertView = mInflater.inflate(R.layout.editcategorylist, null);   convertView.setClickable(true);    convertView.setOnClickListener(clickListener);</code></pre><p>and I declare the click listener in your ListActivity as follows</p><pre><code>   lv=getListView();     myClickListener = new OnClickListener(){       public void onClick(View v) {           Intent intent = new Intent(CategoryList.this,AddSubCategoryList.class);           startActivity(intent);           }   };</code></pre><p>Thank you.</p>","552978","","613495","","2011-09-19 13:33:35","2011-09-19 13:33:35","How can i attach an listener to listview?","<android><listview><textview><listener>","2","0","0","",""
"4560241","1","","","2010-12-30 05:30:32","0","120","<p>How to open a text file of some xyz format which is placed in the sd card in the android device, if anybody knows please help me.</p>","548441","","635608","","2012-04-22 16:21:25","2012-04-22 16:21:25","How to open a text file of some xyz format which is placed in the sd card in the android device","<android><file>","1","0","","",""
"4560265","1","4632210","","2010-12-30 05:36:51","12","4423","<p>It's possible to access the alpha channel of a given bitmap with <code>extractAlpha()</code>, but I haven't been able to find any way to actually set the alpha channel of a bitmap. </p><p>How can multiple greyscale images be recombined as channels into a Bitmap with Android?</p>","118241","","263525","","2012-09-13 07:30:28","2012-09-13 07:30:28","Android Edit Bitmap Channels","<java><android><bitmap><paint><color-channel>","3","0","15","",""
"4560306","1","4562381","","2010-12-30 05:47:57","2","6966","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3611457/android-temporarily-disable-orientation-changes-in-an-activity"">Android: Temporarily disable orientation changes in an Activity</a>  </p></blockquote><p>Me testing in Samsung Galaxy tab. In that i have made two layout folder for both ORIENTATION_LANDSCAPE and ORIENTATION_PORTRAIT with specific layout xml in it.<br>In that layout i have a button and on clicking it start a progress dialog (doing some stuff using AsyncTask, after that going to new intent)<br>But when the device is rotated when the progress dialog is working, that dialog and AsyncTask stop and new layout is loaded. If i understood correctly, I think the <code>onCreate</code> is called when device is rotatedHow i can block calling onCreate while rotating device when My AsyncTask start?<br><strong>IN SHOT</strong><br>How i can lock Orientation of a device by code, for example Lock Orientation on a button click<br>Thank you </p>","477754","","477754","","2010-12-30 11:18:00","2010-12-30 11:55:01","How i can lock Orientation of a device by code","<android>","5","1","0","2012-05-22 13:10:20",""
"4560331","1","","","2010-12-30 05:55:00","1","1673","<p>I'm trying to change the brightness mode and value on my phone, and found a <a href=""http://stackoverflow.com/questions/4057331/how-can-we-turn-automatic-brightness-off-in-android"">great thread here at SO</a> that I thought answered my question, but on my froyo Dell Streak this code simply does nothing.  putInt() is returning true so by all accounts it seems to be successful, yet brightness remains exactly the same, can't even get it to switch between manual and automatic......I have the WRITE_SETTINGS permission set, and logcat doesn't seem to have any other relevant output coming out....stumped right now, gonna take a break for a while o_0</p><p>Here's a snippet of how I'm calling it, this is inside my (only) Activity:</p><pre><code>public void onCheckedChanged(RadioGroup group, int checked) {    //BrightSettings bright = new BrightSettings();    switch(checked)    {        case R.id.daybutton:            //bright.setBrightMode(BrightSettings.DAY_MODE);            if(Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC))                Log.d(""NightMode"", ""Brightness seems to be set to auto...."");        case R.id.nightbutton:            //bright.setBrightMode(BrightSettings.NIGHT_MODE);            if (Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL) &amp;&amp; Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 2) )                Log.d(""NightMode"", ""Night mode seems to have been set...."");    }}</code></pre>","376844","","","","","2011-07-20 05:31:42","setting brightness via Settings.System.putInt() isn't working","<android><settings><brightness>","1","3","","",""
"4560338","1","","","2010-12-30 05:56:08","1","3521","<p>i have a listview from webservice and i want to get the index and textview of the selected item .my list view is </p><pre><code>         company                  symbol         android                   an         iphone                    ip         blackderry                bb            .                       .            .                       .            .                       .</code></pre><p>so tell me how to get the index and textview of symbol in the listview from webservice.i used two methods </p><p>firstmethod:</p><pre><code>protected void onListItemClick(ListView l, View v, int position,long id) {        super.onListItemClick( l, v, position, id);        ID = id;    int selectedPosition = l.getSelectedItemPosition();        index=String.valueOf(selectedPosition);         Log.e(""index value"",""index""+index);   TextView txt=(TextView)findViewById(R.id.symboltext);        TextView temp=(TextView)v;        txt.setText(temp.getText());        Log.e(""text"",txt.toString());</code></pre><p>}</p><p>in above code the logcat shows index is -1 and could not shows the txt.</p><p>Second method:</p><pre><code>    listview.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()    {    public void onItemSelected(AdapterView parentView, View childView, int position, long id)     {      String text = ((TextView)childView.getText()).toString();      //The above text variable has the text value of selected item      // position will reflect the index of selected item    }   public void onNothingSelected(AdapterView parentView)    {   }});</code></pre><p>in above method the listview didnt get onclick action. so please tell me how to get the index and textview of the selected item in listview.</p><p>Best Regards</p><p>Thanks in advance</p>","552978","","","","","2013-04-17 08:15:24","how to get the index and textview of the selected item in listview?","<android><web-services><listview>","2","1","","",""
"4560347","1","4561448","","2010-12-30 05:58:19","4","835","<p>How to implement <code>SD Card Gallery</code> into our application directly?</p><p>I know it is possible in iphone . We can implement and access photos of sdcard directly without any customization in iphone.</p><p>I want to implement the same interface of <code>Gallery</code> into android app.</p><p>Please let me know...</p><p>Thank you.</p>","376035","","750613","","2012-06-28 06:30:41","2012-06-28 06:30:41","How to implement SD Card Gallery without customization in android?","<android><implementation><gallery><sd-card>","1","2","","",""
"4560357","1","","","2010-12-30 05:59:27","0","854","<p>I am getting the Run time exception in my application and I have tried a lot to sort it out but couldn't do it. </p><p>Here is the code where I am getting the error:</p><pre><code>public class FirstDemo extends ListActivity{    private ListView Lv02;    private String Lv_Arr02[]={ ""darshan"", ""sunil"", ""viral"", ""jaimin"", ""aashish"", ""jaydev"", ""bhavesh""};    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.mylistview);  ( Here I am getting the Exception )        Lv02=(ListView) findViewById(R.id.lstvw_mylist);}}My Stack Trace is as under:12-30 11:21:09.525: ERROR/AndroidRuntime(517): FATAL EXCEPTION: main12-30 11:21:09.525: ERROR/AndroidRuntime(517): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mytabhostdemo/com.android.mytabhostdemo.FirstDemo}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:651)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.widget.TabHost.setCurrentTab(TabHost.java:323)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:129)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:453)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.view.View.performClick(View.java:2408)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.view.View$PerformClick.run(View.java:8816)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.os.Handler.handleCallback(Handler.java:587)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.os.Handler.dispatchMessage(Handler.java:92)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.os.Looper.loop(Looper.java:123)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at java.lang.reflect.Method.invokeNative(Native Method)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at java.lang.reflect.Method.invoke(Method.java:521)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at dalvik.system.NativeStart.main(Native Method)12-30 11:21:09.525: ERROR/AndroidRuntime(517): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.ListActivity.onContentChanged(ListActivity.java:245)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:201)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.Activity.setContentView(Activity.java:1647)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at com.android.mytabhostdemo.FirstDemo.onCreate(FirstDemo.java:17)  (Here I think)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)12-30 11:21:09.525: ERROR/AndroidRuntime(517):     ... 18 more</code></pre><p>It would be great if anybody could help me.Thanks,david</p>","422859","","750613","","2012-06-28 06:31:04","2012-06-28 06:31:04","Getting the Runtime exception in the application","<android><listview><nullpointerexception>","1","1","","",""
"4560428","1","4560489","","2010-12-30 06:11:49","0","261","<p>I'm using my phone as the ""emulator"", e.g. running my app from Eclipse to the phone.  I'm trying to access the SD card from within the app (create a folder, save a file), but the error I'm getting is almost as if the SD card isn't inserted (write permissions are granted inside manifest, too).  What is wrong here?</p>","375566","","","","","2010-12-30 06:24:07","Android 2.2 SDK - can't access SD when using phone as app testing device","<android><mobile><android-emulator><android-sdk-2.2>","1","0","","",""
"4560461","1","","","2010-12-30 06:18:32","2","6470","<p>I have the following code.</p><pre><code>    byte[] input = etInput.getText().toString().getBytes();    byte[] keyBytes = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,        0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };    SecretKeySpec key = new SecretKeySpec(keyBytes, ""AES"");    Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS7Padding"", ""BC"");    // encryption pass    cipher.init(Cipher.ENCRYPT_MODE, key);    byte[] cipherText = new byte[cipher.getOutputSize(input.length)];    int ctLength = cipher.update(input, 0, input.length, cipherText, 0);    ctLength += cipher.doFinal(cipherText, ctLength);    cipher.init(Cipher.DECRYPT_MODE, key);    byte[] plainText = new byte[cipher.getOutputSize(ctLength)];    int ptLength = cipher.update(cipherText, 0, ctLength, plainText, 0);    String strLength = new String(cipherText,""US-ASCII"");    byte[] byteCiphterText = strLength.getBytes(""US-ASCII"");    Log.e(""Decrypt"", Integer.toString(byteCiphterText.length));    etOutput.setText(new String(cipherText,""US-ASCII""));    cipherText  = etOutput.getText().toString().getBytes(""US-ASCII"");    Log.e(""Decrypt"", Integer.toString(cipherText.length));    ptLength += cipher.doFinal(plainText, ptLength);    Log.e(""Decrypt"", new String(plainText));    Log.e(""Decrypt"", Integer.toString(ptLength));</code></pre><p>It works perfectly.But once I convert it to the class. It always hit the error in this line.</p><pre><code> ptLength += cipher.doFinal(plainText, ptLength); Error:Pad block corrupted</code></pre><p>I have checked and both code are exactly the same. Even the value passed in conversion string to byte all is no different from the code above. Any idea what's wrong with the code?</p><pre><code>public String Encrypt(String strPlainText) throws Exception, NoSuchProviderException,        NoSuchPaddingException {    byte[] input = strPlainText.getBytes();    byte[] keyBytes = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,            0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };    SecretKeySpec key = new SecretKeySpec(keyBytes, ""AES"");    Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS7Padding"", ""BC"");    // encryption pass    cipher.init(Cipher.ENCRYPT_MODE, key);    byte[] cipherText = new byte[cipher.getOutputSize(input.length)];    int ctLength = cipher.update(input, 0, input.length, cipherText, 0);    ctLength += cipher.doFinal(cipherText, ctLength);    return new String(cipherText, ""US-ASCII"");}public String Decrypt(String strCipherText) throws Exception,        NoSuchProviderException, NoSuchPaddingException {    byte[] cipherText = strCipherText.getBytes(""US-ASCII"");    int ctLength = cipherText.length;    byte[] keyBytes = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,            0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };    SecretKeySpec key = new SecretKeySpec(keyBytes, ""AES"");    Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS7Padding"", ""BC"");    // decryption pass    cipher.init(Cipher.DECRYPT_MODE, key);    byte[] plainText = new byte[cipher.getOutputSize(ctLength)];    int ptLength = cipher.update(cipherText, 0, ctLength, plainText, 0);    ptLength += cipher.doFinal(plainText, ptLength);    return new String(plainText);}</code></pre>","557964","","2806497","","2014-01-06 11:39:13","2014-01-06 11:39:13","Decryption Error: Pad block corrupted","<java><android><encryption>","3","1","","",""
"4560475","1","4560618","","2010-12-30 06:22:28","2","1100","<p>I have an activity with an ""Add"" and a ""Delete"" button. </p><p>The ""Add Button"" inflates a view, the ""Delete Button"" removes a selected View.</p><p>When I inflate a view with the ""Add Button"", it is automatically drawn below any previously infalted view.</p><p>I would like to give the user the possibility to move each inflated view up and down, so he could change the order they are show in screen (in a drag'n'drop kind of effect) </p><pre><code>+---------------------+     +---------------------+| +-----------------+ |     | +-----------------+ | | |      View 1     | |     | |      View 2     | |  | +-----------------+ |     | +-----------------+ ||                     | --&gt; |                     || +-----------------+ |     | +-----------------+ || |      View 2     | |     | |      View 1     | || +-----------------+ |     | +-----------------+ |  +---------------------+     +---------------------+</code></pre><p>Is it possible to specify the ""position"" in which each view is inflated? (for instance, below or above the currently selected view?)</p><p>If not, what is the best way to accomplish the desired effect?</p><p>(feel free to ask for any piece of code, if you think it might help)</p>","295342","","","","","2010-12-30 06:49:37","How to inflate a view in a determined position?","<android><drag-and-drop><view><inflate>","1","1","","",""
"4560550","1","4560633","","2010-12-30 06:35:50","3","118","<p>I developed one application. I planed to release that as a free app in market, also I want to add some extra functionality in a same app as a paid app. But I want to release only one apk in that, I have one button in a my free app, so user when click that it will show message like to enable this you have to buy this app. My problem is after the user bought my app I have to dismiss that message and  enable that functionality within the my app as programmatic.Is it possible?, and How do I know user bought my apps?</p><p>Thanks,</p><p>Lakshamanan</p>","450596","","","","","2010-12-30 06:53:02","How to enable some extra functionality for paid app alone in android?","<android>","1","0","1","",""
"4560617","1","","","2010-12-30 06:49:30","1","983","<p>I have spinner in my application .The spinner have drop down list.I want to take the value of the dropdown list from the database .how can i do this ?</p><p>here is my code for spinner with dropdownlist:</p><pre><code> ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, selectdefault);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);</code></pre>","555910","","750613","","2012-06-28 06:26:10","2012-06-28 06:26:10","here is my code for spinner with dropdownlist:","<android><sqlite><drop-down-menu><spinner>","1","0","","",""
"4560627","1","","","2010-12-30 06:51:10","3","360","<p>Is there any 2-Factor Authentication technique (which is not depends on external devices like security tokens) like Key Stock based, is available for the mobile platform like Android? Any reference to commercial solution provider is also helpful. </p><p><strong>NOTE:</strong> I am not looking for application, which generate 2-nd Key.</p>","423671","","750613","","2012-06-28 06:25:29","2012-11-28 07:47:34","2 Factor Authentication for Mobile Application","<android><authentication><mobile>","2","3","2","",""
"4560671","1","","","2010-12-30 07:00:25","4","3619","<p>I am facing a problem here. I am trying to bulk update my table i.e trying to update multiple rows in the database. The update is simple. I just need to set a column value to 1 which is actually used as a flag in the app. So I want to set the value to 1 and in the where clause I give the string array of all the ids where i want it to set. But the problem is that it gives me an ""android.database.sqlite.SQLiteException: bind or column index out of range:"" . However when a single value is provided either as string or an string array, the update works fine.</p><p>here is the query</p><pre><code>db.update( tableName, cv, Z_ID + ""=?"", items );</code></pre><p>where items is of type String[ ]</p><p>kindly tell me what am I missing?</p><p>regards</p><p>Fahad Ali Shaikh</p>","558003","","135152","","2011-05-25 03:02:13","2011-05-25 03:02:13","Cannot update multiple rows in Sqlite database update command in android","<android><sqlite>","1","0","","",""
"4560714","1","5231576","","2010-12-30 07:06:08","5","341","<p>Please help me to resolve this problem.</p><pre><code>1 &gt; I am having application which Uses Service to retrieve data from server.2 &gt; Now on Pressing Home key and i have opened new application..3 &gt; I have opened around 20 application.4 &gt; So my application might go out of memory stack.5 &gt; now i am resuming my application, application crashes as i am opening activity of my    application which is not in the stack.</code></pre><p>Is there anyway by which i can handle this exception and redirect my activity to Homepage or relaunch application resume and is not in stack...  </p>","1386533","","750613","","2012-06-28 06:24:13","2012-06-28 06:24:48","Android : Application's state when application is out of stack due to Memory constrain","<android><service>","2","1","2","",""
"4560743","1","","","2010-12-30 07:09:41","2","1360","<p>Will App Inventor work with Samsung Galaxy 5? Or do I need other drivers for it? I already have the App Inventor Setup.</p>","558014","","631051","","2011-06-01 01:55:51","2011-06-01 01:55:51","Samsung Galaxy 5 Driver for App Inventor","<android><app-inventor>","1","0","1","",""
"4560756","1","","","2010-12-30 07:12:32","0","2184","<p>I have a <code>list view</code>, and one of its items I set <code>android: visibility =""gone ""</code>.I want when I click an item from the <code>ListView</code>, I hide the item becomes visible, and if the item had already seen, when I click the <code>ListView</code> return, the item was going to hide anymore.</p>","430280","","1905445","","2013-05-30 15:10:32","2013-05-30 15:10:32","How to show/hide item in listview..","<android><listview><hide><visibility><show>","1","2","","",""
"4560758","1","4560848","","2010-12-30 07:13:42","0","269","<p>I am writing an alarm app, and would like to do some specific work when the alalrm is triggered. For this I use the <code>AlarmManager.set()</code> method and the pending intent broadcasts the intent. So far so good. But what if the OS decides to close my app which was in background due to memory crunch. Could someone help me with this.</p><p>Also if I want repeated alarms then I can use the AlarmManager.setRepeating(). Does this take into consideration the day light saving adjustment ?</p>","266272","","750613","","2012-06-28 06:21:00","2012-06-28 06:21:00","How will my app receive an intent broadcasted by AlarmManager if the OS has closed my due to memory crunch","<android><alarmmanager>","1","0","","",""
"4560776","1","4560894","","2010-12-30 07:17:14","1","393","<p>With every upgrade there is some change in database schema? The change could alteration of column types or addition/deletion of columns.</p><p>This forces a reinstall of app ie., uninstall older version and then download app again from the android market. </p><p>Is there a best practice to follow so that old data is copied during app installation and reinitialized with newer schemas?</p>","119031","","473070","","2010-12-30 07:43:29","2010-12-30 07:43:29","How to manage database changes while upgrading application versions in android?","<java><android><sqlite>","1","0","","",""
"4560874","1","4561042","","2010-12-30 07:38:03","1","1191","<p>i am using date picker in android, when i am picking date it coming like this 10-26-2010, but i want to show date in this format October 26,2010. is it possible? please any body help.</p>","489762","","1471203","","2013-01-09 11:18:21","2013-01-09 11:18:21","date picker date month name in android","<android>","1","3","","",""
"4560905","1","","","2010-12-30 07:43:22","0","1109","<p>I have</p><pre><code>&lt;EditText android:hint=""Enter provider's phone #""      android:id=""@+id/Edit_ProviderPhoneNo""      android:inputType=""number""     android:singleLine=""true""     android:layout_width=""250dp""      android:maxLength=""10""     android:imeOptions=""actionDone""     android:layout_height=""wrap_content"" /&gt;</code></pre><p>The <code>actionDone</code> have no effect in HTC Desire.</p>","487219","","35060","","2010-12-30 07:49:15","2010-12-30 09:00:30","Android Imeoption not working in HTC Desire","<android>","1","2","","",""
"4560937","1","4561027","","2010-12-30 07:49:00","1","262","<p>I am trying to make 3 rows of 4 buttons each that will take up the entire width of the screen. I have tried Linear Layout but have trouble adding a second row and from what I have read nesting Linear Layouts is bad practice. I tried to use relative layout several times but I cannot manage to get the buttons to fill the width of the screen because it ignores layout_weight, I then tried nesting linear layout in relative layout but layout_weight is still ignored.</p><p>What is the best way to accomplish this?</p>","558043","","","","","2010-12-30 08:11:16","(android) rows of buttons that take up the entire width of the screen","<android><layout><button><rows>","1","0","","",""
"4560974","1","","","2010-12-30 07:57:04","2","903","<p>I want my application to maintain the user session, </p><p>It will keep me in home screen until define minutes, after that it should redirect to launcher activity (or login screen).</p><p>Is there any defined way in manifest file? or in any configuration?</p><p>I tried with my own custom code but ended up with few other impact on my app. </p>","240737","","","","","2011-03-12 08:44:44","Android app session timeout","<android><android-manifest>","1","0","1","",""
"4561005","1","4561015","","2010-12-30 08:07:01","2","429","<p>I develop on Android platform and something bothered me , there is no GLFloat , GLInt , etc etc....</p><p>It forced me to create buffer everytime and that sucks.</p><p>I want to create a class for each type but when I initialize them I like to do it the same way that the original :</p><pre><code>GLFloat vertex = new GLFloat() { 0.0f ,0.0f ,0.0f,                   1.0f,1.0f,1.0f};</code></pre><p>How I should write constructor to make that happen ?</p>","2556147","","473070","","2010-12-30 08:11:43","2010-12-30 08:11:43","How to create class constructeur that accept array of values?","<java><android><arrays><constructor><opengl-es>","1","0","","",""
"4561025","1","","","2010-12-30 08:10:42","13","10061","<p>Update: </p><p>It turned up to be a corrupted AndroidManifest.xml file</p><ol><li>I set the logging to verbose to get more info on the error.</li><li>I ended up creating a new android project in eclipse and comparing my corrupted AndroidManifest.xml file with the new one.</li><li>I added the admob lines one by one.</li><li>I cleaned the project and rebuilt it again.</li></ol><p>After that it work and I was able to run the emulator.</p><hr><p>I've added instructions in my manifest file to include the Admob module which gives me the error message: </p><p>Console Message:</p><pre><code>Unparsed aapt error(s)! Check the console for output.Unknown    Android Packaging Problem</code></pre><p>Error Message:</p><pre><code>02:56:23,077 FATAL [main] Main  - No embedded stylesheet instruction for file: file:/Users/eladio/Documents/workspace/NprStationFinder/AndroidManifest.xmlorg.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/Users/eladio/Documents/workspace/NprStationFinder/AndroidManifest.xml    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:225)</code></pre><p>Code Snippet:</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.caritos.android.nprstationfinder"" 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;!-- The application's publisher ID assigned by AdMob --&gt;        &lt;meta-data android:value=""xyz"" android:name=""ADMOB_PUBLISHER_ID"" /&gt;        &lt;!-- AdMobActivity definition --&gt;        &lt;activity android:name=""com.admob.android.ads.AdMobActivity"" android:theme=""@android:style/Theme.NoTitleBar.Fullscreen"" android:configChanges=""orientation|keyboard|keyboardHidden"" /&gt;        &lt;!-- Track Market installs --&gt;        &lt;receiver android:name=""com.admob.android.ads.analytics.InstallReceiver"" android:exported=""true""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;        &lt;meta-data android:value=""true"" android:name=""ADMOB_ALLOW_LOCATION_FOR_ADS"" /&gt;    &lt;/application&gt;    &lt;!-- AdMob SDK requires Internet permission --&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;/manifest&gt; </code></pre>","117261","","117261","","2010-12-30 08:42:21","2011-07-26 12:44:05","AndroidManifest.out.xml being generated with errors","<android>","2","1","3","",""
"4561085","1","","","2010-12-30 08:22:29","5","2837","<p>We are creating an app that syncs 5000 calendar entries with the server. The issue is that after adding 1913 entries it failing and giving the following stack trace. What is the problem?</p><pre>12-30 11:48:16.989: DEBUG/dalvikvm(384): GC_EXPLICIT freed 5699 objects / 345848 bytes in 579ms12-30 11:48:22.530: DEBUG/dalvikvm(232): GC_EXPLICIT freed 2552 objects / 124160 bytes in 311ms12-30 11:48:24.560: ERROR/CursorWindow(232): need to grow: mSize = 1048576, size = 414, freeSpace() = 328, numRows = 191312-30 11:48:24.599: ERROR/CursorWindow(232): not growing since there are already 1913 row(s), max size 104857612-30 11:48:24.599: ERROR/CursorWindow(232): The row failed, so back out the new row accounting from allocRowSlot 191212-30 11:48:24.620: ERROR/Cursor(232): Failed allocating fieldDir at startPos 0 row 191212-30 11:48:27.340: DEBUG/Cursor(232): finish_program_and_get_row_count row 326612-30 11:48:28.070: ERROR/Calendar(Vikas)(384): Uncaught exception in EasSyncServicejava.lang.NullPointerException12-30 11:48:28.089: ERROR/Calendar(Vikas)(384): Sync ended due to an exception.</pre>","558022","","61974","","2010-12-30 08:36:38","2011-11-02 08:53:01","Android SQL Lite fail to grow","<sql><android><sqlite>","2","1","1","",""
"4561087","1","4561167","","2010-12-30 08:23:18","1","709","<p>I have some TextViews for phone no.These are not editable. So I have made them as TextView.I want to perform click action on phone no, i.e. on clicking phone no i have to make a call.How to implement that? Anyone any idea?</p>","504162","","","","","2010-12-30 08:39:33","how to make a text as selectable?","<android>","2","0","","",""
"4561119","1","4561166","","2010-12-30 08:30:19","0","979","<p>I am trying to display an image using ImageView in Android. The image data is coming from Database through a Web Service. All other values other than image is successfully visible on android screen. I tried following code : </p><pre><code>Bitmap bm=BitmapFactory.decodeStream((InputStream)response.getProperty(7));image.setImageBitmap(bm);</code></pre><p>But i am getting class cast exception as:</p><pre><code>12-30 12:51:52.241: ERROR/AndroidRuntime(310): FATAL EXCEPTION: main12-30 12:51:52.241: ERROR/AndroidRuntime(310): java.lang.ClassCastException: org.ksoap2.serialization.SoapPrimitive12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at com.trueVUE.modules.report.MainSimulation.onClick(MainSimulation.java:131)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at android.view.View.performClick(View.java:2408)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at android.view.View$PerformClick.run(View.java:8816)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at android.os.Handler.handleCallback(Handler.java:587)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at android.os.Handler.dispatchMessage(Handler.java:92)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at android.os.Looper.loop(Looper.java:123)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at android.app.ActivityThread.main(ActivityThread.java:4627)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at java.lang.reflect.Method.invokeNative(Native Method)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at java.lang.reflect.Method.invoke(Method.java:521)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)12-30 12:51:52.241: ERROR/AndroidRuntime(310):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Please suggest me the solution for this.</p><p>Thanks &amp; Regards,Rahul Jaiswal</p>","315140","","","","","2012-11-19 05:35:26","Displaying an image coming from database through web service in Android","<android><imageview>","2","0","","",""
"4561122","1","","","2010-12-30 08:30:45","0","1253","<p>I am very new to android application development.I want to know how to create custom option menu class in android so that it is able to display 5 menu name in one Any help will be </p><p>greatly appreciated...Thanks in advance..</p>","322111","","","","","2011-04-09 09:40:52","How to create Custom option menu class display 5 menu name in one line","<android>","1","0","","",""
"4561154","1","","","2010-12-30 08:37:50","-2","649","<p>I am having three spinner. I wanna to display today date in 1st spinner and current month in 2nd spinner and year in 3rd spinner when new Activity started.. Like this 30 12 2010</p>","558077","","","","","2011-04-18 05:31:44","Android Spinner","<android>","1","3","0","2013-03-09 13:17:31",""
"4561217","1","4561242","","2010-12-30 08:48:31","6","11284","<p><br>         i have a folder in sd card which contains several files.now i need to get the names of that files.can anybody have any idea how to get the file names stored in sd card?</p><p>any help will be appreciative.thanks a lot.</p>","397901","","473070","","2010-12-30 08:56:30","2013-09-05 09:13:13","how to get the file names stored in sd card in android","<java><android><file><sd-card>","3","0","5","",""
"4561270","1","4562782","","2010-12-30 08:57:54","1","1451","<p>Ok,</p><p>Possibly another bizare undocumented quirk of android, but I'm finding something quite odd when adding flags to my notification...</p><p>If I do this:</p><pre><code>  Notification notification = new Notification(R.drawable.status_icon, ""[Ticker Text]"",System.currentTimeMillis());  PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, CarparkScreen.class), 0);  notification.setLatestEventInfo(AlertService.this,""[Title]"", ""[Detail]"", intent);  mNM.notify(NOTIFICATION_BREACH, notification);</code></pre><p>Then the notification appears as a one off, clicking cancels is and you can clear it in the normal way.</p><p>If however I add these flags</p><pre><code>  Notification notification = new Notification(R.drawable.status_icon, ""[Ticker Text]"",System.currentTimeMillis());  PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, CarparkScreen.class), 0);  notification.setLatestEventInfo(AlertService.this,""[Title]"", ""[Detail]"", intent);  notification.flags = Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE | Notification.DEFAULT_LIGHTS;  mNM.notify(NOTIFICATION_BREACH, notification);</code></pre><p>It creates an <em>ongoing</em> notification, despite there being no <em>ongoing</em> flag!!</p><p>I think its actually the DEFAULT_VIRBATE flag which is causing this, which at first I though was because I didn't have vibrate permissions, but I've added that now but it still causes the notification to be ongoing.</p><p>Urgh!!!!</p><p>Can anyone else re-create this? Seems such an obvious use case to be a bug or quirk.</p><p>I am actually using an ongoing notification at the same time as trying to create a non-ongoing notification above, but this really shouldn't cause this as I'm using new instances of everything apart from the NotificationManager. The ID in the above code is also different to the ongoing notification.</p><p>Any ideas muchly appreciated! :)</p><p>Andy.</p>","187100","","764846","","2011-09-05 15:14:47","2011-09-05 15:14:47","Android notification becomes ongoing with certain flags","<java><android><notifications><vibrate>","1","0","1","",""
"4561274","1","4561302","","2010-12-30 08:58:43","1","2257","<p>I am making an app where I would like the notification bar to be toggled for being show/ not being shown. Is that possible? I already know how to set button listener/override buttons but I just need the java code that makes that possible. Thanks</p>","413488","","1292730","","2012-05-01 15:05:08","2012-05-01 15:05:08","android notification bar show/hide toggle","<android><hide><show><android-notification-bar>","1","0","","",""
"4561345","1","","","2010-12-30 09:11:43","6","4737","<p>I want to use java.util.logging on Android. I want to configure the logging system with logging.properties. But how can I tell Android using the specific configure file? For example, I placed the logging.properties in the classpath root of the application. How Android knows the location of logging.properties.</p><p>Thanks</p>","554861","","","","","2014-02-20 23:50:45","How to configure java.util.logging on Android?","<android><logging>","4","0","4","",""
"4561413","1","4562041","","2010-12-30 09:23:00","3","2090","<p>i am developing one app i am using upload image in sdcard getting from uri of image ,this convert in to byte array how can implemented i am new developer in android i am saving this image in byte array in database backend please forward some solution ....</p><pre><code> startActivityForResult(new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);            }  public void onActivityResult(int requestCode,int resultCode,Intent data)   { super.onActivityResult(requestCode, resultCode, data); if (resultCode == Activity.RESULT_OK)  { Uri selectedImage = data.getData(); Cursor cur = PhotoImage.this.managedQuery(selectedImage, null, null, null, null); if(cur.moveToFirst()) { long Length = cur.getLong(cur.getColumnIndex(ImageColumns.SIZE)); try{ String Image=Base64.encodeBytes(selectedImage.getPath().getBytes()); Log.v(""check"",Image); byte[] bytedata = new byte[(int) Length]; FileOutputStream fos=new FileOutputStream(Img); fos.write(bytedata[0]); fos.close();   } catch (Throwable th) {}</code></pre><p>output is:</p><p><code>12-30 13:00:24.619: VERBOSE/check(773): L2V4dGVybmFsL2ltYWdlcy9tZWRpYS8y</code></p><p>this is the display output i think not converted in byte array please some solution ..</p>","254790","","254790","","2010-12-30 10:22:30","2012-10-17 20:06:35","convert image data in to byte code using base64 encodein android","<android><byte><bytearray>","1","3","2","",""
"4561473","1","4612178","","2010-12-30 09:30:38","1","1126","<p>I tried to follow this instruction:<a href=""http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse"" rel=""nofollow"">http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse</a></p><p>I can run the example but when I clicked on the ""Beep"" button or anything button, it has error in ""adb logcat"" like this and the app crashed:</p><pre><code>D/dalvikvm(  387): GC_EXPLICIT freed 115K, 52% free 2656K/5447K, external 2075K/2792K, paused 4856ms  I/BootReceiver(   68): Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)  I/DEBUG   (   30): debuggerd committing suicide to free the zombie!  D/Zygote  (   32): Process 425 terminated by signal (11)  I/ActivityManager(   68): Process com.PhoneGap3 (pid 425) has died.  I/WindowManager(   68): WIN DEATH: Window{406acdf0 com.PhoneGap3/com.PhoneGap3.PhoneGap3 paused=false}  I/InputDispatcher(   68): Dropping event because there is no touched window or focused application.  I/DEBUG   (  440): debuggerd: Nov 24 2010 13:31:11  D/dalvikvm(   68): GC_CONCURRENT freed 957K, 48% free 4497K/8583K, external 2062K/2576K, paused 46ms+19ms  D/dalvikvm(   68): GC_FOR_MALLOC freed 373K, 46% free 4635K/8583K, external 2062K/2576K, paused 340ms  I/dalvikvm-heap(   68): Grow heap (frag case) to 9.291MB for 196628-byte allocation  D/dalvikvm(   68): GC_FOR_MALLOC freed &lt;1K, 46% free 4826K/8839K, external 2062K/2576K, paused 231ms  W/InputManagerService(   68): Got RemoteException sending setActive(false) notification to pid 425 uid 10040  </code></pre><p>Can someone help please? Thanks.</p>","149367","","1288","","2011-01-30 16:56:30","2011-01-30 16:56:30","Unable to run example of PhoneGap for Android","<android><eclipse><phonegap>","1","1","","",""
"4561490","1","","","2010-12-30 09:32:50","0","51","<p>I am making an application of  book bottle in android .I have having problem while i am showing array list in listview.Can anyone tell me</p>","475349","","","","","2010-12-30 09:32:50","regarding parsing data from url and showing in list in android","<android>","0","2","","",""
"4561521","1","4562742","","2010-12-30 09:36:56","2","4760","<p>HI all</p><p>I want cancel notification on click using code below but some reason it always shows notification in Ongoing section in Notifications area and could not clear too .. </p><pre><code>  NOTIFICATION_ID = NOTIFICATION_ID + 1;  Intent intent1 = new Intent(this, MyClass.class);  PendingIntent pii = PendingIntent.getActivity(this, 1, intent1, 0);  Notification notification1 = new Notification(R.drawable.icon, ""test"",    System.currentTimeMillis());  notification1.setLatestEventInfo(this,    ""test"", ""test"", pii);  notification1.flags |= Notification.FLAG_AUTO_CANCEL;  startForeground(NOTIFICATION_ID, notification1);</code></pre><p>thanks</p>","227129","","166476","","2011-09-08 13:38:53","2011-09-08 13:38:53","Android Notification FLAG_AUTO_CANCEL not working","<android><service><notifications>","1","2","","",""
"4561527","1","4561654","","2010-12-30 09:37:29","11","20900","<p>i want to make my app only in landscape mode but what is the issue...i have given screenOrientation = ""landscape"" even though the first page will be in landscape mode and other activity will be in portrait i giving my code plz see it tell me what is the problem..</p><p>                                                                            </p><pre><code>    &lt;/activity&gt;      &lt;activity android:name="".IntroHome""               android:label=""@string/app_name""               android:screenOrientation=""landscape""                 &gt;    &lt;/activity&gt;        &lt;activity android:name="".ObjectivesPage""               android:label=""@string/app_name""               android:screenOrientation=""landscape"" &gt;    &lt;/activity&gt;</code></pre><p></p><pre><code>    &lt;/activity&gt;&lt;/application&gt;</code></pre><p> </p><pre><code>                  **XML FILE**</code></pre><p>public class ObjectivesPage extends Activity{</p><pre><code>ImageButton  imgButton;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.objectivespage);    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);    imgButton = (ImageButton)findViewById(R.id.buttonCloseNGo);    imgButton.setOnClickListener(onClickCloseNGo);}private OnClickListener onClickCloseNGo = new OnClickListener(){    public void onClick(View v) {        Intent intent = new Intent(ObjectivesPage.this,MenuPage.class);        startActivity(intent);    }};</code></pre><p>}</p><p>please let me know what is the issue with this code...as soon as possible</p>","432559","","432559","","2010-12-30 09:55:41","2014-02-25 14:46:42","i want to make my application only in landscape in android","<android><screen-orientation>","5","1","3","",""
"4561586","1","","","2010-12-30 09:45:57","1","288","<p>Hi the above constant have no effect in Htc phone ,i have used that one in my video recording ,except Htc phone it work fine </p>","487219","","302328","","2010-12-30 09:51:27","2010-12-30 09:51:27","""android.intent.extra.durationLimit""","<android><android-intent>","1","1","","",""
"4561661","1","4561705","","2010-12-30 09:58:22","0","203","<p>I am writing an android application to make server socket and receive messages from server</p><p>when I write the same application using Thread, it works pretty well but I am unable to access UI elements in Thread</p><p>whereas in case of services, startService method hangs on while(true){ socket.accept()}</p>","548301","","","","","2010-12-30 10:13:32","android - bit confused on when to use threads & when to use services?","<java><android><android-manifest>","2","0","","",""
"4561691","1","4561708","","2010-12-30 10:03:55","1","892","<p>I need to implement a list with a custom list adapter view that contains a button. Once I add the button the onClick is not triggered.</p><p>Is there a way to make this work?</p>","102092","","","","","2010-12-30 10:08:13","Android List adapter with a button","<android>","1","2","","",""
"4561700","1","4621095","","2010-12-30 10:06:48","8","3541","<p>This is how I configure my APP's widget:</p><pre><code>&lt;appwidget-provider    xmlns:android=""http://schemas.android.com/apk/res/android""    android:minWidth=""240dp""    android:minHeight=""193dp""    android:updatePeriodMillis=""86400000""    android:initialLayout=""@layout/xyz_appwidget""    android:configure=""com.xyz.activity.Configuration""    /&gt;</code></pre><p>Therefore, the system will bring up the <code>Configuration</code> activity, once the widget has been put on the homescreen by the user. Unfortunately, without the configuration applied, this widget should not be put on the screen. </p><p>I added some debugging output. This happens when the user is selecting the widget for his homescreen. <strong>Note:</strong> This is when the Configuration activity is in front, NOT the widget.</p><pre><code>I/ActivityManager(  101): Start proc com.xyz for broadcast com.xyz/.widget.xyz.XyzWidgetProvider: pid=14371 uid=10050 gids={3003, 1015}D/XyzWidgetProvider(14371): onReceive: android.appwidget.action.APPWIDGET_ENABLEDD/XyzWidgetProvider(14371): onEnabledD/XyzWidgetProvider(14371): onReceive: android.appwidget.action.APPWIDGET_UPDATE</code></pre><p>So that means even the widget is not configured, both events (ENABLED, UPDATE) will be fired. <strong>Enabled</strong> makes sense to me, but <strong>UPDATE</strong> clearly not. Especially when the <code>Configuration</code> activity finished successfully, no additional <strong>UPDATE</strong> event is being sent.</p><p>I also read that by setting the result of the <code>Configuration</code> activity to <code>Activity.RESULT_CANCELED</code>, one is able to cancel the configuration process. But as this clearly runs asynchronous I don't know how to make the configuration process <strong>blocking</strong>? Anyone encountered this before?</p><p>My final note: I had a look in the Android Gallery Widget, which <em>somehow</em> manages this properly, so a non-configured gallery widget will not be added. But I suspect some HTC <em>magic</em> there as the logs are not very helpful.</p>","375209","","375209","","2010-12-30 10:25:23","2011-03-25 15:33:04","Widgets configured with android:configure will receive onUpdate even if configuration is unfinished","<android><android-widget>","3","3","2","",""
"4561802","1","","","2010-12-30 10:23:47","0","751","<p>I just need to play a video from URL on something like popup window or Dialog window like that.(i.e)When a button is clicked,a new small window should open.On that window i need to see video play.Is it possible?If so..Pls help me how?Rgds,Sudhir.</p>","555948","","555948","","2011-01-03 05:42:51","2011-01-03 05:49:46","Videoplay on popup window in android","<android>","1","0","","",""
"4561837","1","","","2010-12-30 10:28:17","0","1086","<p>How can I add a FrameLayout to a ListView?</p>","556163","","321697","","2010-12-30 14:17:48","2011-02-15 15:29:23","How To Add A FrameLayout To A ListView?","<android><listview><framelayout>","2","3","","",""
"4561880","1","","","2010-12-30 10:34:47","1","1020","<p>Alright, I am not typically one to ask for help as I usually prefer to find answers on my own, but unfortunately I seem unable to do that.</p><p>I am messing around with live wallpapers for android 2.1+  Things went pretty well until a ways in I started getting a OOM error:</p><pre><code>Java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code></pre><p>Ok - I did my research and found out that I surely have a memory leak somewhere.  So I read up on how to analyze such problems, opened up the DDMS and did a Heap dump.  the Heap size usually runs around 4.5-5mb in size and never more than 60% full.  This didn't make sense, because I checked the running services on my development phone, and it reported my process as using anywhere from 35-42mb of memory.</p><p>I'm not asking for anyone to find my Leak as that would require lots of code etc. Just to explain how to properly analyze my memory usage, since I seem to be utterly dumbfounded as to what is going on.</p>","558159","","","","","2010-12-31 03:29:09","Heap dumps and memory use discrepancies in android?","<java><android><memory><heap><leak>","2","0","1","",""
"4561956","1","4566345","","2010-12-30 10:46:44","0","290","<p>Many android applications have quite poor i18n-support, and for an understandable reason, as it adds much work for the developer.</p><p>From a both intuitive and cultural point of view it would be a good thing if end-users could translate the apps themself, and OTA share the translation, without reinstalling the app itself.</p><p>In concept; as wikipedia, some add content easily, others only use what's there.</p><p>It's of course important that the service is as easy as possible to use, both for app-developers, and people willing to transcribe.</p><p>To keep it simple, this is the solution I'm concidering;</p><p><strong>Developer perspective:</strong></p><ul><li><p>Developer uses a customized setContentView when open activities/layouts that will seach for thanslations of xml-entries. (below)</p></li><li><p>The customized version is provided as a free downloadable library/class..., turning the i18n feature to more or less a one liner.</p></li></ul><p><strong>User perspective:</strong></p><ul><li><p>User downloads app without any translation </p></li><li><p>As app launches, it checks locale running at phone, and will look for a translated xml-file at shared space in SD.</p></li><li><p>If no or old transcribed xml (above), try to download new from internet-service (ansync). This is all done by library above, no need for intents.</p></li></ul><p><strong>Translator perspective:</strong></p><ul><li>Separate app to provide translations for any app using the i18n service above. (Could be just a webapp), with some form of QA on translators/input.</li></ul><p><strong>QUESTION:</strong>Now, for this to work efficiently, it has to be AeasyAP for the developer to even bother, and the most fluent solution would be a customized version of setContentView, that simply loads the translated values from external xml, instead of the ones in the apk.</p><p>Is this possible at all, and if not, what's your suggested solutions?</p><p>(And of course, <em>Happy New Year, feliz ano novo, blwyddyn newydd dda, Gott Nytt År, kontan ane nouvo, szczesliwego nowego roku ...</em>)</p><p>Regards,/T</p>","247245","","","","","2010-12-30 21:18:09","How to provide i18n service for developer and end user","<java><android><internationalization><culture>","3","0","2","",""
"4562001","1","4576946","","2010-12-30 10:55:11","2","2344","<p>Is it possible to implement a thermometer in Android? How?</p><p>I know that the <code>BatteryManager</code> can give you the battery temperature with <a href=""http://developer.android.com/reference/android/os/BatteryManager.html#EXTRA_TEMPERATURE"" rel=""nofollow"">BatteryManager.EXTRA_TEMPERATURE</a>, but I'm not sure if this can be used to somewhat accurately measure the external temperature.</p>","143378","","","","","2011-01-02 03:17:11","Android thermometer","<android><battery><temperature>","2","0","3","",""
"4562010","1","4562161","","2010-12-30 10:57:49","1","597","<p>I have a requirement to display multiple linear progress bars on my UI. These will display wifi signal strengths.</p><p>If you're in a built up area, chances are you'll detect more than one wifi network, therefore I need to have a progress bar for each one which displays the signal strength.</p><p>My initial idea was to display these in a ListView, with the wifi name and the progress bar underneath.</p><p>Is this a reasonable approach, or is there a better method I should be looking at for this?</p>","155695","","","","","2010-12-30 11:22:38","Android; is a ListView the best approach to displaying multiple, independant progress bars?","<android><android-sdk-2.2><android-listview><android-progressbar>","1","0","","",""
"4562062","1","4644515","","2010-12-30 11:06:33","1","1058","<p>I want to disable the activity slide transition that occurs during activity change for API level 3 and for <code>startActivityForResult()</code> and also on return back to that activity through <code>setResult()</code> and <code>finish()</code>. How can I perform this task?</p><p>Thanks </p>","493193","","493193","","2010-12-30 13:07:29","2011-01-10 07:18:58","Disable activity slide transition change in android?","<android><animation><activity>","2","1","","",""
"4562105","1","","","2010-12-30 11:13:21","0","303","<p>In my application, i used the optionMenu by selecting those options.. Each option will display different Layout xml files and those are have some radio buttons and some are have Text Display. now when user moves to main.xml to other Xml screen that Ex: help.xml after that by pressing the Back button it will going to Mobile Home screen. </p><p>If any any body knows this how come back main.xml screen from other (Ex. help.xml) try to give me your valuable idea to overcome this.</p><p>Thanks for Reading</p>","546107","","","","","2010-12-30 11:49:07","how to come back main.xml from other xml file","<android>","1","1","","",""
"4562163","1","","","2010-12-30 11:23:08","1","178","<p>I have created a video playing script according to these sources:</p><p><a href=""http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/"" rel=""nofollow"">http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/</a>http://www.broken-links.com/2010/07/30/encoding-video-for-android/</p><p>This has worked on Android 2.0 and Android 2.1 (according to my Android simulator) but it doesn't work on Android 2.2....</p><p>is there someone out there with an actual Android device for me to test this? Even better is there someone who can figure out why this doesn't work? I have been struggling with this for over weeks now but I can't seem to get it figured out.. I believe something may be wrong with either the javascript script I created or with the encoding of the video's.. I'm not sure.. Either way it doesn't work on Android 2.2, while it has worked on Android 2.0 and 2.1 before.</p><p>This is the script + vids it is all about:<a href=""http://www.emotiontracker.com/elance/archive/html5-video/new/index.html"" rel=""nofollow"">http://www.emotiontracker.com/elance/archive/html5-video/new/index.html</a></p><p>Thanks in advance guys... I could really use some help with this, it's driving me nutts!</p>","553258","","","","","2010-12-30 11:23:08","Getting video to work in Android 2.2","<javascript><android><video>","0","2","","2011-03-08 13:06:32",""
"4562193","1","4593581","","2010-12-30 11:27:15","3","1717","<p>On older versions (&lt;2.3) there was no problem with this app. When I start the application on an Android 2.3 emulator it starts with a 'home screen' then I send the GPS coordinates. After sending the coordinates the emulator stops all his processes and tries to do a restart, but then it hangs.</p><p>If I comment the requestLocationUpdates call the emulator does not crash…</p><p>See the logcat output under this message.</p><pre><code>12-30 10:31:28.174: INFO/DEBUG(31):*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 12-30 10:31:28.185: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test-keys' 12-30 10:31:28.194: INFO/DEBUG(31): pid: 89, tid: 229  &gt;&gt;&gt; system_server &lt;&lt;&lt; 12-30 10:31:28.194: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000 12-30 10:31:28.205: INFO/DEBUG(31):  r0 00000000  r1 405155a0  r2 4128fcbc  r3 46282c74 12-30 10:31:28.205: INFO/DEBUG(31):  r4 0000012d  r5 00000000  r6 405155a0  r7 4128fcbc 12-30 10:31:28.205: INFO/DEBUG(31):  r8 84301321  r9 84302240  10 00100000  fp 00000001 12-30 10:31:28.215: INFO/DEBUG(31):  ip 82f0e7d4  sp 46282c60  lr 82f0ab37  pc 82f07d0e  cpsr 00000030 12-30 10:31:28.845: INFO/DEBUG(31):         #00  pc 00007d0e  /system/lib/libandroid_servers.so 12-30 10:31:28.845: INFO/DEBUG(31):   #01  pc 0000ab32  /system/lib/libandroid_servers.so 12-30 10:31:28.845: INFO/DEBUG(31):   #02  pc 000012ca  /system/lib/hw/gps.goldfish.so 12-30 10:31:28.855: INFO/DEBUG(31):         #03  pc 000014ae  /system/lib/hw/gps.goldfish.so 12-30 10:31:28.855: INFO/DEBUG(31):         #04  pc 00011a7c  /system/lib/libc.so 12-30 10:31:28.865: INFO/DEBUG(31):   #05  pc 00011640  /system/lib/libc.so 12-30 10:31:28.885: INFO/DEBUG(31): code around pc: 12-30 10:31:28.885: INFO/DEBUG(31): 82f07cec ab04b082 9301cb04 6f646804 b00247a0  12-30 10:31:28.885: INFO/DEBUG(31): 82f07cfc bc08bc10 4718b002 b510b40c ab04b082  12-30 10:31:28.885: INFO/DEBUG(31): 82f07d0c 6804cb04 34f89301 47a06824 bc10b002  12-30 10:31:28.885: INFO/DEBUG(31): 82f07d1c b002bc08 46c04718 b510b40c ab04b082  12-30 10:31:28.885: INFO/DEBUG(31): 82f07d2c 9301cb04 34986804 47a06824 bc10b002</code></pre><p>etc.....</p>","518663","","","","","2011-12-03 15:07:57","Android 2.3 emulator crashed after a requestLocationUpdates call","<android><android-emulator><gps><android-sdk-2.3>","1","0","1","",""
"4562201","1","","","2010-12-30 11:28:09","2","1416","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/28380/proxy-with-android-emulator"">Proxy with Android Emulator</a>  </p></blockquote><p>Android sdk 2.2 proxy with domain name is not working. </p><p>emulator -avd prakash1 -http-proxy <a href=""http://Domain/username:password@proxy:port-debug-proxy"" rel=""nofollow"">http://Domain/username:password@proxy:port-debug-proxy</a> </p><p>is not working</p><p>I tried to set proxy (Domain\username) and port in mobile network. It is not working. Please help me</p>","558210","","","","","2011-04-05 18:40:28","Android sdk 2.2 proxy with domain name is not working","<android>","1","0","","2011-04-14 11:27:24",""
"4562216","1","4562292","","2010-12-30 11:30:54","6","2720","<p>I have an application, that need to run in 2 different devices:<code>600x1024</code> &amp; <code>480x800</code>.</p><p>For these devices, I want to apply different styles (they has different ratio).How I can do it, as both of them has hdpi?, e.g. <code>values-hdpi</code>, <code>values-mdpi</code> have no effect....</p><p>P.S. <code>Android 2.2</code></p><p>Thanks,</p>","136834","","","","","2010-12-30 11:41:22","Android apply styles for different screens","<android><screen><styles><resolution><destination>","1","0","2","",""
"4562269","1","4562300","","2010-12-30 11:38:22","5","2097","<p>hiWhen my app get the ACTION_BOOT_COMPLETED it starts a service.I would like to delay that for lets say 60sec.Can i do that in the: </p><pre><code>public class StartAtBootServiceReceiver extends BroadcastReceiver {        public void onReceive(Context context, Intent intent)         {           // Delay...60sec        }}</code></pre>","538837","","473070","","2010-12-30 11:40:45","2010-12-30 13:59:38","Android app How to delay your Service start on phone boot","<java><android><delay>","2","1","1","",""
"4562344","1","","","2010-12-30 11:48:26","0","3417","<p>How to transfer a 50mb file to web server using httppost.When trying to transfer the file it shows out of memory error.can we use chuncked encoding? how? give some code snippets.</p><p>Thank you.</p><p><strong>Edit:</strong>Here's the code:</p><pre><code>InputStreamEntity reqEntity = new InputStreamEntity(new FileInputStream(f), -1);reqEntity.setContentType(""binary/octect-stream""); reqEntity.setChunked(true);httppost.setEntity(reqEntity);</code></pre>","558228","","3098","","2011-02-18 16:19:18","2012-09-22 17:57:46","android httpclient","<android><httpclient>","1","2","2","",""
"4562472","1","","","2010-12-30 12:11:09","0","2997","<p>what is the best metod to send object between Activities? I've got something like this:</p><pre><code>class dataSet {   private String name;        private String sName;        .        .   private Vector&lt;actv&gt; activities;   .        .   dataSet(){      activities = new Vector&lt;actv&gt;();   }   void setName(String v){      name = v;   }   String getName(){      return this.name;        .        . etc.   }</code></pre><p>I want to send this object to activitie class.menu , how can I do it?</p>","558250","","","","","2011-06-30 11:02:32","Sending object in putExtra()","<android>","1","1","","",""
"4562566","1","4562934","","2010-12-30 12:25:46","0","718","<p>Can anybody help me to find out, how can i find that whether the HOME key is pressed or not?I want to take action based on it....</p><p>I am using   KeyEvent.isModifierKey(KeyEvent.KEYCODE_HOME) to check whether home key is pressed or not....It always returns me false....</p><p>Can anybody help me to go ahead..</p><p>Thanks, Rakesh</p>","1386533","","","","","2011-09-20 14:10:04","Android : check whether Home key is pressed or not","<android>","1","2","","",""
"4562578","1","4562951","","2010-12-30 12:27:20","0","802","<p>I need to know how much internal space is left on device, but ""internal"" space no external SD card. </p><p>This code is used for external SD space.</p><p><a href=""http://stackoverflow.com/questions/3394765/how-to-check-available-space-on-android-device-on-mini-sd-card"" title=""how-to-check-available-space-on-android-device-on-mini-sd-card"">how-to-check-available-space-on-android-device-on-mini-sd-card</a></p><p>anyone know how to get the free internal space?</p><p>Thanks in advance.</p>","518657","","","","","2010-12-30 13:29:08","Get Internal Available Storage in Device","<java><android><eclipse><device><space>","1","2","","",""
"4562586","1","","","2010-12-30 12:28:35","-1","450","<p>I want to check if there are any network connection leaks in my android app, someone reported to me that even after closing my android app the app was somehow connecting with his wifi router till the person un-installed the app. </p><p>I close all the connections properly inside the code and sometime the user can .abort() a postRequest so perhaps some case is leading to a leak, I don't see any warning either on logcat.</p><p>This problem seems to be only with wifi and not 3G.</p><p>Is there any software or android tool through which I could debug this to be sure ? Or in another words monitor android network activity. I tried 'adb shell netstat' it returns empty</p>","550393","","550393","","2010-12-30 16:34:06","2012-11-21 14:04:34","tool for checking any wifi network leak on android","<android><networking><wifi>","1","0","","2013-05-06 06:04:25",""
"4562603","1","4563542","","2010-12-30 12:32:20","0","337","<p>when i try to open main.xml it disappeared.after that i read the following link.</p><p><a href=""http://stackoverflow.com/questions/3485454/unable-to-open-both-main-xml-files-from-layout-layout-land-at-the-same-time"">Unable to open both main.xml files from layout & layout-land at the same time?</a></p><p>from that i am able to open main.xml but when i try to <strong>drag a component to it disappears(eclipse crashes).</strong></p><p>is there anybody here to help?</p><p>thankx </p>","411359","","","","","2010-12-30 14:50:30","Android:Eclipse strange behaviour for main.xml?","<android><eclipse>","1","1","","",""
"4562614","1","","","2010-12-30 12:34:22","1","205","<p>I'm making an app for a chemical formula, and I have made it so that it returns double coefficients. For example, C6H12O6 + O2 = CO2 + H2O returns .166666667, 1.0, 1.0, and 1.0. I want to write code so that it is 1, 6, 6, and 6 (integers). Also, for another equation, like Ca(OH)2 + H3PO4 = Ca3(PO4)2 + H2O, the return is .5, .333333333, .166666667, and 1.0. It should be 3, 2, 1, and 6. Is there any way I can convert these to integer coefficients in java?</p>","558279","","","","","2010-12-30 12:47:04","Chemical Balancer(java)","<java><android><sdk><chemistry>","3","0","","",""
"4562734","1","4562804","","2010-12-30 12:52:43","28","34130","<p>I need to start a service at boot time. I searched a lot. They are listing about Broadcastreceiver. As I am new in android development, I didn't get a clear picture about services in android. Please provide me some source code.</p><p>Thanks in advance.</p>","244540","","50109","","2011-01-30 20:53:21","2014-02-27 10:04:19","Android -Starting Service at Boot Time","<android><autostart><bootcompleted>","5","3","24","",""
"4562751","1","","","2010-12-30 12:55:43","1","161","<p>Scenario:</p><pre><code>public class MyApplication extends Application{...}</code></pre><p>Three Activities, Overview, List and Map,<br>displaying the <strong>same data</strong> only providing different UI/UX.</p><p>Data fed into Contentprovider db and frequently updated externally by a SyncAdapter,<br>part of another application.</p><p>Read data from Contentprovider in to cursor.<br>Do cursor.setNotificationUri(),<br>to make the cursor listen for db/Uri changes.</p><p><strong>Alt1.</strong> Hold the cursor in MyApplication.<br>Overview, List and Map then asks MyApplication for data.<br>On a db change MyApplication holds a reference to each Activity<br>and notifies them to ask for the data again from MyApplication.  </p><p><strong>Alt2.</strong> Hold one cursor in each Activity.<br>On a db change each Activity requeries the cursor for the data again.  </p><p><strong>Where should we hold the Cursor(s) ?</strong></p>","77115","","77115","","2010-12-30 14:01:49","2010-12-30 15:40:09","Android architecture: Where should we hold the Cursor(s)?","<android>","1","1","","",""
"4562757","1","","","2010-12-30 12:56:47","3","10130","<p>I'm trying to make a Schedule.</p><p>It should run every day at 1pm or 2pm...</p><p>At the moment I can only make it run Every 10Sec or 10min...</p><pre><code>Intent myIntent = new Intent(AndroidAlarmService.this, MyAlarmService.class);pendingIntent = PendingIntent.getService(AndroidAlarmService.this, 0, myIntent, 0);AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);Calendar calendar = Calendar.getInstance();calendar.setTimeInMillis(System.currentTimeMillis());calendar.add(Calendar.SECOND, 10);alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);Toast.makeText(AndroidAlarmService.this, ""Start Alarm"", Toast.LENGTH_LONG).show();</code></pre><p>Thanks</p>","558292","","281545","","2013-03-13 13:42:46","2013-07-26 07:03:16","AlarmManager Android Every Day","<android><scheduled-tasks><alarmmanager>","3","1","9","",""
"4562763","1","","","2010-12-30 12:57:26","2","1046","<p>I want to lean OpenGL but I don't know where to star. I know there is a lot API books, but I don't want that.</p><p>I want a book, tutorial, etc. where I can see how OpenGL works. I want to star learning form scratch.</p><p>Then I'm going to use these things that I'm going to learn with <strong>OpenGL ES 2.0 with Android</strong>.</p><p>And yes, I know there is a question <a href=""http://stackoverflow.com/questions/62540/learning-opengl"">Learning OpenGL</a> that it's very similar to this question. But I think it is not the same question.</p><p>I want to find a way to learn who OpenGL works and how I must use its API.</p><p>Thanks.</p><p><strong>UPDATE</strong><br/> The question is: <strong><em>how have you learned OpenGL?</em></strong></p>","68571","","68571","","2012-02-21 06:35:54","2012-02-21 06:35:54","Learn OpenGL: where to start or how have you learned OpenGL?","<android><opengl-es><opengl-es-2.0>","4","5","1","2012-11-19 09:27:59",""
"4562812","1","4563093","","2010-12-30 13:04:13","5","4238","<p><strong>I need to open, read and insert items into an online SQLite database from an Android app</strong>.<br> I know url, username and password. In JavaSE i would do the following:</p><pre><code>Class.forName(""com.mysql.jdbc.Driver"");Connection dbConnection = DriverManager.getConnection(URL, USER, PASSWORD);</code></pre><p>I read that I can't do this in Android because there is not a JDBC Driver (there is a <code>""SQLite.JDBCDriver""</code> but it is not documented and not recommended).<br>So which is the easiest way? I asked to Google but it looks like he either doesn't know.</p>","555336","","","","","2010-12-30 13:49:36","Android - Access to online Database SQlite","<java><android><database><sqlite><jdbc>","2","1","","",""
"4562876","1","4562916","","2010-12-30 13:16:05","0","653","<p>When I installed a new version of ADT plugin, Eclipse doesn't allow me to run my project. There is a message in Problems: ""Error executing aapt. Please check aapt is present at /media/DATA/Program Files/android-sdk-linux_x86/platform-tools/aapt"", though it's there!  And also I have got such message in Console: R.java was modified manually! Reverting to generated version! But I didn't delete it.</p><p>I have installed Android SDK Tools r8 to be compatible with ADT 8.0.1.</p><p>Can anybody explain me what can I missed in the configuration of my environment? Thank you for help.    </p>","556337","","","","","2011-01-17 03:00:09","Issues with R.java after installed ADT 8.0.1","<android><aapt>","1","1","0","",""
"4562899","1","","","2010-12-30 13:19:06","2","3633","<p>I'm trying to build STLport for Android. I got the following steps, but they are not working: </p><p>1 - Clone STLport repository using:</p><p>git clone git://stlport.git.sourceforge.net/gitroot/stlport/stlport</p><p>2 - Configure environment using :</p><pre><code>./configure --target=arm-eabi --with-extra-cxxflags=""-fshort-enums""             --with-extra-cflags=""-fshort-enums"" </code></pre><p>3 - From src directory build it using</p><p>make SYSROOT""{MY NDK path}/platforms/android-5/arch-arm/"" release-static</p><p>But I got the following errors:</p><pre><code>In file included from ../stlport/stl/_alloc.h:45,                 from ../stlport/memory:29,                 from dll_main.cpp:41:../stlport/stl/_new.h:45:24: error: new: No such file or directoryIn file included from ../stlport/stl/_limits.h:36,                 from ../stlport/limits:29,                 from dll_main.cpp:48:../stlport/stl/_cwchar.h:26:30: error: cstddef: No such file or directoryIn file included from ../stlport/stl/_utility.h:35,                 from ../stlport/utility:35,                 from dll_main.cpp:40:../stlport/type_traits:889: error: 'declval' was not declared in this scope../stlport/type_traits:889: error: expected primary-expression before '&gt;' token../stlport/type_traits:889: error: expected primary-expression before ')' token../stlport/type_traits:889: error: 'declval' was not declared in this scope../stlport/type_traits:889: error: expected primary-expression before '&gt;' token../stlport/type_traits:889: error: expected primary-expression before ')' token../stlport/type_traits:889: error: ISO C++ forbids declaration of 'decltype' with no type../stlport/type_traits:889: error: ISO C++ forbids in-class initialization of non-const static member 'decltype'../stlport/type_traits:889: error: template declaration of 'int std::tr1::detail::decltype'../stlport/type_traits:942: error: ISO C++ forbids declaration of 'decltype' with no type../stlport/type_traits:942: error: ISO C++ forbids in-class initialization of non-const static member 'decltype'../stlport/type_traits:942: error: template declaration of 'int std::tr1::detail::decltype'make: *** [obj/arm-eabi-gcc/so/dll_main.o] Error 1</code></pre><p>Is there any include dir or configuration I´m missing?</p><p>Thanks,</p><p>Sergio</p>","558299","","375209","","2010-12-30 13:20:53","2011-10-13 16:33:12","Problem building STLport NDK r5/ Android","<android><android-ndk><stlport>","4","0","2","",""
"4562988","1","4563037","","2010-12-30 13:34:33","1","721","<p>I am getting the below error </p><pre><code>12-30 05:40:40.484: ERROR/AndroidRuntime(413): Uncaught handler: thread Thread-10 exiting due to uncaught exception12-30 05:40:40.494: ERROR/AndroidRuntime(413): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.ViewRoot.checkThread(ViewRoot.java:2629)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.ViewRoot.requestLayout(ViewRoot.java:545)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.View.requestLayout(View.java:7657)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.View.requestLayout(View.java:7657)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.View.requestLayout(View.java:7657)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.View.requestLayout(View.java:7657)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.View.requestLayout(View.java:7657)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.ViewGroup.addView(ViewGroup.java:1749)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.ViewGroup.addView(ViewGroup.java:1708)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at android.view.ViewGroup.addView(ViewGroup.java:1688)12-30 05:40:40.494: ERROR/AndroidRuntime(413):     at com.wwwww.shout.presentationLayer.Shout$1.run(Shout.java:137)</code></pre><p>and my code is </p><pre><code>myProgressDialog = ProgressDialog.show(Shout.this,"""",""Loading..."",true);         new Thread()          {         public void run()         {             String xml;                 xml=""&lt;spGetUserMessages&gt;&lt;SearchLocation&gt;&lt;/SearchLocation&gt;&lt;/spGetUserMessages&gt;"";                 messages =parse.GetGetUserMessages(dataparsing.ILGetUserMessages(xml));        myProgressDialog.dismiss();((LinearLayout)findViewById(R.id.LinearlayoutMessage)).addView(iiii);      }    }.start();</code></pre><p>at the time of adding views to the layout i am getting the above error.what is the wrong in this.Please give me some suggestions.Thanks in advance</p>","479027","","","","","2010-12-30 14:02:30","Getting force close when i add view to other view when a thread is running","<android>","2","0","1","",""
"4563006","1","","","2010-12-30 13:37:50","0","422","<p>I'm developing an application which will do the backup  of Application's database to the Google servers and restores the data after reinstalling the application. </p><p>I didn't find any reference to do this task. and one more thing, i tried the application given in the Android SDK, which is working only with the Shell commands but not by running the application. </p><p>Could any body is having an idea how to do the backup and restoring of the Application's database data?</p>","419389","","","","","2010-12-30 16:29:18","How to backup the application's database to the Google servers","<android>","1","0","","",""
"4563016","1","6394335","","2010-12-30 13:38:52","0","270","<p>Friends,     I am working to implement online purchasing with credit card,how can i implement it by using third party <strong>API gateway</strong>,or else is there any other best way to implement the same.Let me have sample code to implement for the same.</p><p>Looking for your valuable answers.</p><p>Thanks in advance.</p>","393953","","","","","2011-06-18 06:32:05","Android Online transaction with API Gateway","<android>","1","0","1","",""
"4563232","1","4563359","","2010-12-30 14:08:49","0","316","<p>Is it possible for a ListView to hold LinearLayouts?</p>","397991","","","","","2011-04-29 07:45:48","ListView to hold LinearLayouts","<android>","1","0","1","",""
"4563262","1","4563476","","2010-12-30 14:13:01","0","4452","<p>I have the following problem, and searched for a while but haven't got any solution from the net:   </p><p>I have a custom list view, each item has the following layout (I just post the essential):</p><pre><code>&lt;LinearLayout&gt; &lt;ImageView android:id=""@+id/friendlist_iv_avatar"" /&gt; &lt;TextView andorid:id=""@+id/friendlist_tv_nick_name"" /&gt; &lt;ImageView android:id=""@+id/friendlist_iv_status_icon"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>And I have a class FriendRowItem, which is inflated from the above layout:</p><pre><code>public class FriendRowItem extends LinearLayout{ private ImageView ivAvatar; private ImageView ivStatusIcon; private TextView tvNickName; public FriendRowItem(Context context) {  super(context);  RelativeLayout friendRow = (RelativeLayout) Helpers.inflate(context, R.layout.friendlist_row);  this.addView(friendRow);  ivAvatar = (ImageView)findViewById(R.id.friendlist_iv_avatar);  ivStatusIcon = (ImageView)findViewById(R.id.friendlist_iv_status_icon);  tvNickName = (TextView)findViewById(R.id.friendlist_tv_nick_name); } public void setPropeties(Friend friend) {  //Avatar  ivAvatar.setImageResource(friend.getAvatar().getDrawableResourceId());  //Status  Status.Type status  = friend.getStatusType();  if ( status == Type.ONLINE) {   ivStatusIcon.setImageResource(R.drawable.online_icon);  } else {   ivStatusIcon.setImageResource(R.drawable.offline_icon);  }  //Nickname  String name = friend.getChatID();  if ( friend.hasName()) {   name = friend.getName();  }  tvNickName.setText(name); }}</code></pre><p>In the main activity, I have a custom listview: lvMainListView, with an custom adapter (whose class extends ArrayAdapter  - and off course: override the method getView ), the data set of the adapter is: <code>ArrayList&lt;Friend&gt; friends</code>:</p><pre><code>private class FriendRowAdapter extends ArrayAdapter&lt;Friend&gt;  {   public FriendRowAdapter(Context applicationContext, int friendlistRow,    ArrayList&lt;Friend&gt; friends) {   super(applicationContext, friendlistRow, friends);  }  @Override  public View getView(int position,View convertView,ViewGroup parent) {   Friend friend = getItem(position);   FriendRowItem row = (FriendRowItem) convertView;   if ( row == null ) {    row = new FriendRowItem(ShowFriendsList.this.getApplicationContext());   }   row.setPropeties( friend );   return row;  } }</code></pre><ul><li>the problem is when I change the status of a friend from OFFLINE to ONLINE, then call notifyDataSetChanged(), nothing happens : the status icon of that friend doesn't change.<br>I tried debugging, and saw the code: notifyDataSetChanged() get called, but the custom getView() is not fired !  </li></ul><p>Can you please tell me, that is normal in Android, or did I do something wrong ? (I am using Android 1.5).</p><p>Thank you in advance,<br>Son</p>","424721","","","","","2010-12-31 01:50:56","getView() (for a Custom ListView ) doesn't get called on notifyDatasetChanged()","<android>","1","0","","",""
"4563291","1","4563396","","2010-12-30 14:16:30","1","1157","<p>i am trying to create an android application that saves webpages to use it in <strong>offline-browsing</strong>, i was able to save the webpage but the problem was in the contents (images, javascripts,..etc), is there a way to do so <strong>programmatically</strong>, i use eclipse and test my work on an emulator.</p>","558355","","","","","2010-12-30 15:22:19","save webpages for offline browsing","<java><android><android-webview><offline-browsing>","2","0","","",""
"4563360","1","","","2010-12-30 14:26:45","1","395","<p>I have coded a BroadcastReceiver to enable the resetting of an alarm if a user has to reboot hid device.   Is there any way to test this in the emulator, in other words what sequence of events are required to cause the emulator to kick off the BroadcastReceiver .Ron</p>","538847","","","","","2010-12-30 14:56:59","android emulating a reboot","<android>","2","0","1","",""
"4563500","1","","","2010-12-30 14:44:21","2","393","<p>I would like to know how to make an android app send a mail with a static text when i click a button for example.</p><p>Thanks</p>","557703","","","","","2011-02-17 11:35:34","Sending mail with an android app","<android><email>","1","0","","",""
"4563615","1","4563711","","2010-12-30 14:58:46","0","429","<p>I have a requirement, whereby when a user clicks a button, then an object needs to be observed. When the user clicks that button again, the observation stops.</p><p>My initial thought is to have the button bound to a method in the activity using the <code>onClick=""myMethod""</code> in the layout file.</p><p>When this method is invoke it will call <code>startService()</code> which starts observing the object. By this I mean it registers the service as an observer.</p><p>When the button is clicked for a second time, it calls the <code>stopService()</code> method which un-registers the service as an observer.</p><p>My thoughts for using a service is so the observation; and subsequent actioning is taken off the UI thread. Is this a reasonable approach or is there something in the Android SDK that could do this easier?</p>","155695","","","","","2010-12-30 15:27:51","Android; Using a Service to subscribe/unsubscribe to an Observable object, good idea?","<android><android-sdk-2.1><observer-pattern>","2","0","","",""
"4563762","1","","","2010-12-30 15:19:38","0","413","<p>Being a starter in Android programming, I would like to ask some help here regarding my idea to create an app. For example, there is a list of sign language pictures on my application from a-z, how can I put an output text on a textfield when i click on the picture..i know this is a basic question but it would be very helpful to me if someone helped me..:) thank you..and happy new year:)</p>","524021","","319618","","2010-12-30 15:24:27","2010-12-30 16:12:32","Help with Android App Idea","<android>","4","1","","",""
"4563901","1","4579672","","2010-12-30 15:36:22","1","229","<p>Probably it's a Java more than an Android programming question, anyway: there are two ways to declare the 3 standard view constructors: one is using <code>this()</code> to call the next most parametrized constructor, with <code>null</code> and <code>0</code>, as I've seen <a href=""http://stackoverflow.com/questions/2884501/android-custom-view-constructor/2888594#2888594"">here</a>, and doing all the custom init in the last constructor.</p><p>The other way is calling <code>super()</code>, calling each time a function that does the init job.</p><p>Is one way more right than the other (why?), or it's just a style choice?</p>","503900","","115145","","2010-12-30 16:42:35","2011-01-02 18:00:05","declaring custom-view constructors","<java><android><constructor><initialization><custom-view>","1","4","","",""
"4563928","1","4650160","","2010-12-30 15:40:18","6","5647","<p>I'm building an Android apk who uses some native libraries of a third party, these libs are in Static Object Code Library  (.a files) and I need to write a JNI wrapper to access in Java these functions.</p><p>Those libs are already compiled with a cross-compiler and are natively to Android.</p><p>How do I compile my JNI sources linking to the functions in the .a libs files?</p><p>This is my Android.mk</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_LDLIBS := -llogLOCAL_MODULE    := ndk1LOCAL_SRC_FILES := native.cinclude $(BUILD_SHARED_LIBRARY)</code></pre><p>When I compile, I get only the native.c file compiled.</p>","558433","","562566","","2011-09-16 13:57:42","2011-09-16 13:57:42","Linking thirdparty libs (libs.a) with NDK","<java><android><jni><android-ndk>","2","0","5","",""
"4564181","1","4733406","","2010-12-30 16:11:32","0","109","<p><br/>I have a net service in my app, for now it doesn't matter if it's a thread in the Application context or a service, what does matter is i have some trouble getting response properly.<br/>The service is working, and i do get responses, right now i work with the observer design patter which is a bitch in android :-( i have to remove the listener in on destroy and then check the network if it is all ready finished and handle different scenarios.<br/>I want to change my approach, but i'm not sure what's the right android way, it seems like activities are made for polling which is bad for my architecture and error prone :-(.</p><p>I thought of the folowing two methods but non seem to give me a real solution:</p><ol><li>create a braodcast receiver that    will send a broadcase with a flag if    response or error arrived from the    net, it's apt to the activity to    poll the right data and handle. i do    wonder about this since if i    register for broacast i basically    have to remove the listener in on    pause, so i CAN miss a broadcast,    then it's back to check the net    state in onCreate, same like what    i'm doing now - sucks...</li><li>register the activity that whats an event and sent it an intent using startActivity but here if the activity is in on pause or stop i'll bring it to the front, i don't want this kind of behavior, i only want that the activity will get the event no matter what, and starting to wonder if there's a way to do that.</li></ol><p>The landcape\portrait event are killing me, any way out of it ?</p>","312288","","508666","","2012-01-29 13:08:17","2012-01-29 13:08:17","net service in android app","<android><networking><configuration>","1","0","","",""
"4564255","1","","","2010-12-30 16:19:31","0","1341","<pre><code>@Overridepublic void onReceive(Context context, Intent intent) { Intent myIntent = new Intent(context, YourActivity.class); context.startActivity(myIntent);}</code></pre><p>I have made a class that extends BroadCastreciever. I want it to run my main class on startup, but i keep getting the ""force close"" message when i boot my device. I think the problem is located at ""YourActivity.class"".</p><p>I have tried with ""TestMain.class"" (my main class name) and ""com.test.Testmain.Class"". Did i miss something?</p><p>Thanks</p>","557703","","","","","2011-09-02 21:27:17","Android 2.2: Autostart application on boot problem","<android><broadcastreceiver><boot>","1","7","","",""
"4564272","1","4565307","","2010-12-30 16:21:53","0","549","<p>The project i am working on needs this type of behavior. The user will be presented with a UI that will give them the option to connect and disconnect to a server. I would also like this UI to show the status of the connection, 'connected or disconnected'. Whenever the user clicks connect, the application will start a thread that handles the connection to the server. The user will still be looking at the main UI. When they start that connection and while the connection remains, i would like the status of the connection to be 'connected'. If the connection is ever broken at any point i would like it to display disconnected. Listed below is what i have so far.</p><p>My question is... Am i doing the threading right? So that the phone will not be crushed by the server connection while it is connected?</p><p>Also, how do i get the main UI to reflect the connection status of the server and display when the connection is broken?</p><p>Thanks in advance! If you have any further questions, please let me know.</p><pre><code>The server connection thread.public class ConnectDevice implements Runnable {    private boolean connected;    private ObjectInputStream ois;    public void run() {        try {            InetAddress host = InetAddress.getByName(""192.168.234.1"");            Socket socket = new Socket(host.getHostName(), 7777);            connected = true;            while (connected) {                try {                    ois = new ObjectInputStream(socket.getInputStream());                    String message = (String) ois.readObject();                    System.out.println(""Message: "" + message);                }                catch (Exception e) {                    e.printStackTrace();                }            }            ois.close();        } catch (UnknownHostException e) {            e.printStackTrace();            connected = false;        } catch (IOException e) {            e.printStackTrace();            connected = false;        } /*catch (ClassNotFoundException e) {            e.printStackTrace();            connected = false;        }*/    }}The main UI and main class.public class SmartApp extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.intro);        final Button firstTimeButton = (Button) findViewById(R.id.firstTimeButton);        firstTimeButton.setOnClickListener(        new View.OnClickListener()        {            @Override            public void onClick(View v)             {                // TODO Auto-generated method stub                Intent userCreationIntent = new Intent(v.getContext(), UserCreation.class);                startActivityForResult(userCreationIntent, 0);            }        });        final Button connectDeviceButton = (Button) findViewById(R.id.connectDeviceButton);        connectDeviceButton.setOnClickListener(        new View.OnClickListener()        {               @Override            public void onClick(View v) {                // TODO Auto-generated method stub                //Intent connectDeviceIntent = new Intent(v.getContext(), ConnectDevice.class);                //startActivityForResult(connectDeviceIntent, 0);                Thread cThread = new Thread(new ConnectDevice());                cThread.start();            }        });    }}</code></pre>","427763","","","","","2010-12-30 18:45:27","Android Thread and class behavior question","<java><android><multithreading><class><sockets>","2","2","1","",""
"4564448","1","4564536","","2010-12-30 16:44:46","0","498","<p>I'm doing a standard SQL query in Android:</p><pre><code>String selection = ""SELECT phraseA, phraseB FROM TableXYZ"";        Cursor c1;        c1 = myDbHelper.myDataBase.rawQuery(selection,null);        c1.moveToNext();        while(!c1.isLast()){        toplist.add(""Phrase: ""+c1.getString(0)+"" ""+c1.getString(1);        c1.moveToNext();        }        c1.close();</code></pre><p>The table is very small and the number of returned stirngs is less than 40. Toplist is an ArrayList. It is put into a ListView.To the best of my knowledge this should show me 40ish strings. Now, what happens is the strings are shown but then another load of empty ListView fields come up. I have no idea how. I thought my iteration might be wrong, but I can't find fault with it.</p>","485498","","","","","2010-12-30 16:56:36","Android SQL query problem","<java><sql><android><sqlite>","1","1","","",""
"4564688","1","4564732","","2010-12-30 17:16:10","3","3222","<p>If necessary to keep it simple I am primarily concerned with English handsets in North America.</p><p>Specifically- when sending/recieving SMS and MMS messages, how are the characters encoded? Is there a difference?</p><p>My initial research suggested that <code>UTF-8</code> was the default, but I have also seen references to <code>US-ASCII</code> for US devices and other charsets for other locales. </p>","64301","","","","","2010-12-30 17:22:35","What is the Default Charset/Encoding of text messages on Android devices?","<android><encoding><character-encoding><sms>","1","0","","",""
"4564729","1","4607433","","2010-12-30 17:22:20","2","1134","<p>I'm integrating exact code from here: <a href=""http://labs.makemachine.net/2010/03/simple-android-photo-capture/"" rel=""nofollow"">http://labs.makemachine.net/2010/03/simple-android-photo-capture/</a></p><p>How the activity should work:  click ""button"" -> go to default camera.  Take photo.  ""Retake"" button works, ""cancel"" button works (brings back to ""button"" layout), but the ""ok"" button doesn't work (and then the image should appear above the ""button"" in the previous layout). Does this have something to do with how it's saving image to SD card?  I can't figure it out!  Also, I'm testing this app on a device.</p>","375566","","","","","2011-02-17 18:03:20","Android 2.2 SDK - PhotoCapture example not working","<android><mobile><android-emulator><android-2.2-froyo>","1","0","","",""
"4564773","1","4565030","","2010-12-30 17:28:15","1","841","<p>I am a beginner and trying to run Hello world application using developer.android.com.I am using eclipse helios, Android 2.3, latest jdk and sdk. Using window xp so 32-bit versions are there.I am unable to get output on emulator window which pop. There is no output either on pane or main screen. I am using default ddms.bat and have not make any changes. Can anyone suggest what to do.</p><p>My ddms.bat and java code are attached</p><p>vishal</p><p>ddms.bat</p><pre><code>setlocalrem Set up prog to be the path of this script, including following symlinks,rem and set up progdir to be the fully-qualified pathname of its directory.set prog=%~f0rem Change current directory and drive to where the script is, to avoidrem issues with directories containing whitespaces.cd /d %~dp0rem Check we have a valid Java.exe in the path.set java_exe=call lib\find_java.batif not defined java_exe goto :EOFset jarfile=ddms.jarset frameworkdir=if exist %frameworkdir%%jarfile% goto JarFileOk    set frameworkdir=lib\if exist %frameworkdir%%jarfile% goto JarFileOk    set frameworkdir=..\framework\:JarFileOkif debug NEQ ""%1"" goto NoDebug    set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y    shift 1:NoDebugset jarpath=%frameworkdir%%jarfile%if not defined ANDROID_SWT goto QueryArch    set swt_path=%ANDROID_SWT%    goto SwtDone:QueryArch    for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a:SwtDoneif exist %swt_path% goto SetPath    echo SWT folder '%swt_path%' does not exist.    echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.    exit /B:SetPathset javaextdirs=%swt_path%;%frameworkdir%call %java_exe% %java_debug% -Dcom.android.ddms.bindir= -classpath ""%jarpath%;%swt_path%\swt.jar"" com.android.ddms.Main %*</code></pre><p>Java code</p><pre><code>package com.example.helloandroid;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloAndroid extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView tv = new TextView(this);         tv.setText(""Hello, Android"");         setContentView(tv);        }}</code></pre>","558523","","244296","","2010-12-30 17:33:38","2012-04-13 07:33:33","Not getting output on emulator window","<android><android-emulator><emulator><ddms>","1","1","","",""
"4564812","1","","","2010-12-30 17:34:50","0","519","<p>I currently have a layout with 4 tabs, the first tab has the home screen of the app, loads 4 imageviews for the icons of other activities.  The second tab loads a webview (very basic one) as does the third tab.  The final tab loads a map.  The app loads very slow, takes about 11 seconds, and when I debug in Eclipse almost the entire time is spent on setContentView, but I can't figure out what in my layout is taking so long to load.</p><p>Here is my layout code:</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;FrameLayout             android:id=""@android:id/tabcontent""            android:layout_width=""wrap_content""             android:layout_height=""fill_parent""            android:layout_weight=""1""            &gt;            &lt;RelativeLayout                 android:id=""@+id/tab1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""@drawable/background""                &gt;                &lt;ImageView                     android:id=""@+id/HomeButtonEvents""                     android:src=""@drawable/eventsicon""                    android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                    android:layout_alignParentBottom=""true""                    android:layout_alignParentLeft=""true""                     android:paddingBottom=""95dp""                    android:clickable=""true""                     /&gt;                &lt;ImageView                     android:id=""@+id/CancelledClasses""                     android:src=""@drawable/cancelledicon""                    android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                    android:layout_alignParentBottom=""true""                    android:layout_alignParentRight=""true""                     /&gt;                &lt;ImageView                     android:id=""@+id/CourseSchedule""                     android:src=""@drawable/coursesicon""                    android:layout_width=""141dp""                     android:layout_height=""139dp""                    android:layout_alignParentTop=""true""                    android:layout_alignParentLeft=""true""                     /&gt;                &lt;ImageView                     android:id=""@+id/POTD""                     android:src=""@drawable/potdicon""                    android:layout_width=""294dp""                     android:layout_height=""247dp""                    android:paddingTop=""45dp""                     android:paddingRight=""1dp""                    android:layout_alignParentTop=""true""                    android:layout_alignParentRight=""true""                     android:layout_toRightOf=""@id/CourseSchedule""                     /&gt;&lt;!--            &lt;ImageView --&gt;&lt;!--                android:id=""@+id/potdview""--&gt;&lt;!--                android:layout_width=""wrap_content""--&gt;&lt;!--                android:layout_height=""wrap_content""--&gt;&lt;!--                android:paddingTop=""0dp"" --&gt;&lt;!--                android:paddingRight=""1dp""--&gt;&lt;!--                android:paddingBottom=""150dp"" --&gt;&lt;!--                android:layout_alignParentTop=""true""--&gt;&lt;!--                android:layout_alignParentRight=""true"" --&gt;&lt;!--                android:layout_toRightOf=""@id/CourseSchedule"" --&gt;&lt;!--                /&gt; --&gt;            &lt;/RelativeLayout&gt;            &lt;WebView                 android:id=""@+id/tab2""                 android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 /&gt;        &lt;/FrameLayout&gt;        &lt;TabWidget             xmlns:android=""http://schemas.android.com/apk/res/android""             android:id=""@android:id/tabs""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:layout_weight=""0""             /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Any ideas/suggestions?</p>","558529","","321697","","2010-12-30 20:47:59","2010-12-31 19:14:09","How can I make my layout load time more efficient?","<android><android-layout>","2","2","0","",""
"4564819","1","4565257","","2010-12-30 17:35:29","0","729","<p>the first one - 16.1 Example A Preferences</p><p><a href=""Http://www.bogotobogo.com/Android/android16Preferences.html"" rel=""nofollow"">Android tutorial</a><br>(sorry for the link)</p><p>Cant for the love of android not get this to workI want to click that CheckBox witch is connected to the autosave PreferenceActivityand at the same time clicking it I want to fire an event to a method in the Activity that started the PreferenceActivity. There i will start a service. </p><p>`` Sigh hope you understand the probl.</p>","538837","","538837","","2010-12-30 17:51:02","2010-12-30 18:37:36","In Android how to get CheckBox onCheckedChanged from other activity","<android>","1","2","","",""
"4564967","1","","","2010-12-30 17:55:02","2","341","<p>When I inserted code to display a context menu it worked fine except that the menu appeared not only after a stationary long press but also (unwanted) at the end of a drag.</p><p>I have been able to prevent this by:  adding a ScrollInProgress flag to the View,  by checking this flag at the beginning of the onCreateContextMenu(...) method,  and if the flag is set by by-passing the code which adds items to the context menu.</p><p>However, I wonder if there is a simpler way of preventing the creation of a context menu when the screen is dragged. </p>","250845","","","","","2011-04-21 15:11:53","Android: how can I prevent a drag from being interpreted as a long press","<android><contextmenu><drag>","1","3","1","",""
"4565032","1","4565097","","2010-12-30 18:04:24","2","86","<p>I have a question which bothered me for a long time. We all know Android is an open sourced project. But why so many people even developers are looking forward a new release? If it is open sourced, before Google releases Android 2.3, we cannot find any 2.3 code from repository? Thank you!</p>","547589","","","","","2010-12-30 18:13:40","Regarding Android releases","<android><release>","2","0","","",""
"4565039","1","4565336","","2010-12-30 18:05:49","0","260","<p>I am planning to create a 3rd party library for androidapplication developers. Also the main concern is I do not want theusers to make many changes to their code base. The following are themain things I want to clarify before diving into the project.</p><p>1) I want to attach my own event handlers dynamically to theapplication. As per above limitations I mentioned, I cannot makeusers  put the relevant code in their handlers as I need to supportexisting applications as well. I found out that we cannot attach morethan one event handler per one listener. For exampleButton.setOnclickListener(somelistener) .. will set one listener. Intraditional desktop applications we can add more than one handlers buthere if I do one more Button.setOnclickListener(someOtherListener)this one overwrites the previous listener. Is there any way I canattach my own listener along with application's existing listenersdynamically? Also is it really not supported on android yet?</p><p>2) Is there any 3rd party alternative that exists already thatmonitors user's interactions in androidi?</p><p>3) If this is not supported now are there any future plans to supportthis feature?</p><p>Please let me know about this as I did not get much feedback onStackoverflow. Any suggestions and workarounds would really help mecontinue with this project.</p><p>Regards,Lalith</p>","297119","","","","","2010-12-30 19:20:56","Creating 3rd party library in Android. Need suggestions!","<android><3rd-party-library>","2","0","","",""
"4565047","1","","","2010-12-30 18:06:57","1","1323","<p>I am having some trouble with saving an image from r.drawable.image1 to the phone's SD Card in a Pictures Folder, then sending a broadcast to the MediaScanner to refresh the folders so that the image appears in the gallery on the phone.</p><p>I beleive the solution is something to do with this</p><pre><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(""file://""+ Environment.getExternalStorageDirectory())));</code></pre><p>The problem now is the image does not save to sd and I do not know where to put the above code for the media scanner as the code below does nothing now after me fiddling with it for the last 3 days. Please Help...</p><pre><code>import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStream;import android.net.Uri;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.widget.Button;import android.widget.Toast;import android.media.MediaScannerConnection;import android.os.Bundle;import android.os.Environment;public class MainScreen extends Activity {     private Button btnDownload;    /** Called when the activity is first created. */    @Override         public void onCreate(Bundle savedInstanceState)     {                 super.onCreate(savedInstanceState);                 setContentView(R.layout.main);             btnDownload=(Button)findViewById(R.id.SaveButton1);        btnDownload.setOnClickListener(            new Button.OnClickListener() {                @Override                public void onClick(View v) {                    String newPicture = saveToSDCard(R.drawable.image1, ""image1.jpg"");                    startMediaScanner(newPicture);                }            }        );    }    private String saveToSDCard(int resourceID, String finalName)    {        StringBuffer createdFile = new StringBuffer();        Bitmap resourceImage = BitmapFactory.decodeResource(this.getResources(), resourceID);               File externalStorageFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), finalName);        ByteArrayOutputStream bytes = new ByteArrayOutputStream();         resourceImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);        byte b[] = bytes.toByteArray();         try         {            externalStorageFile.createNewFile();             OutputStream filoutputStream = new FileOutputStream(externalStorageFile);             filoutputStream.write(b);             filoutputStream.flush();             filoutputStream.close();            createdFile.append(externalStorageFile.getAbsolutePath());        }        catch (IOException e)        {        }        return createdFile.toString();    }    private void startMediaScanner(String fileName)    {        MediaScannerConnection.scanFile(this,            new String[] { fileName }, null,            new MediaScannerConnection.OnScanCompletedListener() {            public void onScanCompleted(String path, Uri uri)            {                Toast.makeText(MainScreen.this, ""Media scan Completed"", Toast.LENGTH_SHORT).show();             }        });    }}</code></pre>","558558","","82118","","2011-06-17 20:37:46","2011-06-17 20:37:46","Android Help with Saving an image to Sd Card and SendBroadcast to MediaScanner","<java><android><image><sd-card>","1","1","2","",""
"4565065","1","4565255","","2010-12-30 18:09:26","0","896","<p>So I am trying to invoke an intent that will attach a picture to a text message.  The following code correctly brings up a text message window with the image on the emulator, but crashed on my phone (Droid X).</p><pre><code>            String name = FILE_NAME;            Uri uri = Uri.fromFile(new File(name));            Intent intent = new Intent(Intent.ACTION_SEND);             intent.setClassName(""com.android.mms"", ""com.android.mms.ui.ComposeMessageActivity"");             intent.putExtra(Intent.EXTRA_STREAM, uri);            intent.setType(""image/png"");             startActivity(intent); </code></pre><p>.</p><pre><code>12-30 12:56:50.628: ERROR/AndroidRuntime(14603): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.mms/com.android.mms.ui.ComposeMessageActivity}; have you declared this activity in your AndroidManifest.xml?</code></pre><p>The problem is the .setClassName line.  I hardcoded the value to the class, which is probably wrong.  What should I be using here to support all phones?</p><p>Thanks all.</p>","432209","","","","","2010-12-30 18:36:54","Using an MMS intent with an image file","<java><android><sms><mms>","1","0","","",""
"4565100","1","","","2010-12-30 18:14:11","21","8545","<p>I am trying to connect from my Android device to the host using usb and ppp.</p><p>There seems to be an option ""adb ppp "" that can be used. But I can't find an explanationon how to use it. There is an old discussion here. But they ended patching adb. I can't believe this hasn't being fixed by now.</p><p><a href=""http://forum.xda-developers.com/showthread.php?p=4537323"">http://forum.xda-developers.com/showthread.php?p=4537323</a></p><p>This is the explanation of the adb command, and that is all the documentation I have been able to find.</p><pre>networking:  adb ppp  [parameters]   - Run PPP over USB. Note: you should not automatically start a PPP connection.  refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1 [parameters] - Eg. defaultroute debug dump local notty usepeerdns</pre><p>I am not clear on what the tty argument. Looking at the sources it seems to be a service such as ""shell"", ""host:version"", etc. Or it could be (as the doc says) dev:/dev/* but I don't know which to use.</p><p>Also, the command seems to fork a ppp in the host. But, I don't know how it runs on the android device.</p>","558564","","197979","","2012-05-30 14:44:27","2012-08-16 12:05:41","How to use ""adb ppp""?","<android><adb><ppp>","2","2","10","",""
"4565280","1","","","2010-12-30 18:40:48","1","437","<p>I know I'm going to need authentication within an Android app I'm working on that will control shoutcast/icecast streams through an API.</p><p>What would you recommend?</p><p>Would it be easier to store the authentication within the app itself while a session is going on or rather have the user login each time?</p>","203939","","","","","2010-12-30 20:38:34","How can I handle authentication in android for a remote website?","<php><android><mysql><authentication><codeigniter>","1","0","","",""
"4565390","1","","","2010-12-30 18:58:29","3","3213","<p>this is a re-post of a question i asked last week, got 2 answers that didn't work.</p><p>i followed a guide on <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> and then created my own EditText field and a button. the code should explain it all, my problem is i keep getting a ""HelloWebViewClient cannot be resolved to a type"" Error, any suggestions? thanks in advance!</p><pre><code>    package com.text.text;import android.app.Activity;import android.os.Bundle;import android.text.Editable;import android.view.View;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Button;import android.widget.EditText;public class test extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.alt);        final EditText edittext = (EditText) findViewById(R.id.edittext);        final Button button = (Button) findViewById(R.id.okay);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Editable text = edittext.getText();                String Tekst = text.toString();                setContentView(R.layout.main);                WebView mWebView;                mWebView = (WebView) findViewById(R.id.webview);                mWebView.getSettings().setJavaScriptEnabled(true);                mWebView.loadUrl(Tekst);                mWebView.setWebViewClient(new HelloWebViewClient());                class HelloWebViewClient extends WebViewClient {                    @Override                    public boolean shouldOverrideUrlLoading(WebView view, String url) {                        view.loadUrl(url);                        return true;                    }        };    }});}}</code></pre>","553642","","","","","2012-01-23 17:25:14","WebViewClient cannot be resolved to a type","<android><webview>","2","0","1","",""
"4565436","1","4565835","","2010-12-30 19:06:04","0","1804","<p>I have a custom dialog inside</p><pre><code>public class NewPartnerDialog extends Dialog implements OnClickListener</code></pre><p>And I call it from other class (activity)</p><pre><code>private void showCustomDialog() {    NewPartnerDialog customDialog = new NewPartnerDialog(this);    customDialog.show();}</code></pre><p>And it works (it does show), but I have a little problem. In it I have 3 EditText fields. How can I retreieve those typed values and pass them into some other class construtor. Here is the code.</p><pre><code>public class NewPartnerDialog extends Dialog implements OnClickListener {public NewPartnerDialog(Context context) {    super(context);    mainContext = context;    setContentView(R.layout.dialog_new_partner);    setTitle(""Dialog"");    finish = (Button) findViewById(R.id.finish);    cancel = (Button) findViewById(R.id.finish);    finish.setOnClickListener(this);    cancel.setOnClickListener(this);    name = (EditText) findViewById(R.id.name);    address = (EditText) findViewById(R.id.address);    city = (EditText) findViewById(R.id.city);}@Overridepublic void onClick(View v) {           if (v == finish) {        Partner.addNewPartner(mainContext, name.getText().toString(), address.getText().toString(), city.getText().toString());    } else if (v == cancel) {        dismiss();    }}private static EditText name;private static EditText address;private static EditText city;private static Context mainContext;private Button finish;private Button cancel;</code></pre><p>}</p><p>The error is obivusly here</p><pre><code>if (v == finish) {        Partner.addNewPartner(mainContext, name.getText().toString(), address.getText().toString(), city.getText().toString());    }</code></pre><p>because it says NullPointerException but how to fix it?</p>","455268","","","","","2011-01-22 20:18:57","Access EditText.getText().toString() inside some other class","<android><edittext>","1","2","","",""
"4565631","1","4565971","","2010-12-30 19:33:03","1","2260","<p>I have a problem creating a custom dialog. But I don't find the failure. Hopefully anybody can help me ... </p><pre><code>protected Dialog onCreateDialog(int id) {    Dialog dialog = null;    switch (id) {    case DIALOG_ABOUT_ID:        dialog = buildAboutDialog();        break;    default:        dialog = null;    }    return dialog;}</code></pre><p>...</p><pre><code>public Dialog buildAboutDialog() {    Context mContext = getApplicationContext();    Dialog dialog = new Dialog(mContext);    dialog.setContentView(R.layout.about_dialog);    dialog.setTitle(""About this application"");    return dialog;}</code></pre><p>Results in the following error:</p><pre><code>12-30 19:27:02.593: ERROR/AndroidRuntime(383): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</code></pre><p>I checked if the returned dialog == null - but it isn't.</p><p>I also tried the second way (inflater) described at <a href=""http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog</a></p>","247002","","","","","2013-06-04 19:15:27","Problem creating a custom dialog","<android><dialog>","3","0","1","",""
"4565642","1","4566474","","2010-12-30 19:34:27","0","891","<p>Here is the relevant code:</p><pre><code>private TasksAdapter adapter;private final TextWatcher filterer = new TextWatcher() {    @Override    public void onTextChanged(CharSequence s, int start, int before, int count) {        adapter.setFilterQueryProvider(new FilterQueryProvider() {            @Override            public Cursor runQuery(CharSequence constraint) {                if (adapter.getFilterQueryProvider() != null)                    return adapter.getFilterQueryProvider().runQuery(constraint);                StringBuffer buffer = null;                String[] args = null;                if (constraint != null) {                    buffer = new StringBuffer();                    buffer.append(""UPPER ("");                    buffer.append(Tasks.TITLE);                    buffer.append("") GLOB ?"");                    args = new String[] { constraint.toString().toUpperCase() + ""*"" };                }                Cursor c = getContentResolver().query(Tasks.CONTENT_URI,                         null, (buffer == null ? null : buffer.toString()), args,                        Tasks.DEFAULT_SORT_ORDER);                Log.v(TAG, ""Constraint is "" + constraint);                adapter.changeCursor(c);                adapter.notifyDataSetChanged();                setListAdapter(adapter);                c.moveToFirst();                return c;            }        });        adapter.getFilter().filter(newTaskField.getText().toString());    }    @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    }};public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Log.v(TAG, ""TasksList activity started."");    Cursor tasks = managedQuery(Tasks.CONTENT_URI, projection, null, null, Tasks.DEFAULT_SORT_ORDER);    adapter = new TasksAdapter(this, tasks);    setListView(adapter)            newTaskField.addTextChangedListener(filterer)    ...}</code></pre><p>My application then just crashes without an exception, I get this though:  </p><pre><code>12-30 19:25:31.718: INFO/ActivityManager(66): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mohit.geotasks/.activities.TasksList bnds=[3,136][77,215] } from pid 12812-30 19:25:32.219: INFO/ActivityManager(66): Start proc com.mohit.geotasks for activity com.mohit.geotasks/.activities.TasksList: pid=888 uid=10030 gids={1015}12-30 19:25:34.239: INFO/ActivityThread(888): Pub com.mohit.geotasks: com.mohit.geotasks.provider.TasksProvider12-30 19:25:34.428: DEBUG/dalvikvm(66): GC_CONCURRENT freed 839K, 48% free 4142K/7815K, external 2036K/2548K, paused 13ms+26ms12-30 19:25:34.818: VERBOSE/TasksList(888): TasksList activity started.12-30 19:25:35.918: INFO/ActivityManager(66): Displayed com.mohit.geotasks/.activities.TasksList: +3s737ms12-30 19:25:37.958: INFO/ActivityManager(66): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/com.android.launcher2.Launcher } from pid 6612-30 19:25:39.048: WARN/InputManagerService(66): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4071a098 (uid=10030 pid=888)12-30 19:25:40.458: INFO/ActivityManager(66): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mohit.geotasks/.activities.TasksList bnds=[3,136][77,215] } from pid 12812-30 19:25:44.728: WARN/KeyCharacterMap(888): No keyboard for id 012-30 19:25:44.738: WARN/KeyCharacterMap(888): Using default keymap: /system/usr/keychars/qwerty.kcm.bin12-30 19:25:44.858: VERBOSE/TasksList(888): Created Options menu.12-30 19:25:46.958: WARN/InputManagerService(66): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4060c1a012-30 19:25:49.358: INFO/dalvikvm(888): threadid=9: stack overflow on call to Lcom/mohit/geotasks/activities/TasksList$1;.access$0:LL12-30 19:25:49.358: INFO/dalvikvm(888):   method requires 8+20+0=28 bytes, fp is 0x42dd9318 (24 left) 12-30 19:25:49.358: INFO/dalvikvm(888):   expanding stack end (0x42dd9300 to 0x42dd9000)12-30 19:25:49.358: INFO/dalvikvm(888): Shrank stack (to 0x42dd9300, curFrame is 0x42ddbf54)12-30 19:25:49.358: WARN/dalvikvm(888): threadid=9: thread exiting with uncaught exception (group=0x40015560)12-30 19:25:49.458: DEBUG/AndroidRuntime(888): Shutting down VM12-30 19:25:49.488: WARN/dalvikvm(888): threadid=1: thread exiting with uncaught exception (group=0x40015560)12-30 19:25:49.488: INFO/Process(888): Sending signal. PID: 888 SIG: 912-30 19:25:49.558: INFO/ActivityManager(66): Process com.mohit.geotasks (pid 888) has died.12-30 19:25:49.558: INFO/WindowManager(66): WIN DEATH: Window{4060a168 com.mohit.geotasks/com.mohit.geotasks.activities.TasksList paused=false}</code></pre><p>What is the problem? I also get a StackOverFlowError at this line:</p><pre><code>return adapter.getFilterQueryProvider().runQuery(constraint);</code></pre>","200477","","200477","","2010-12-30 21:01:00","2010-12-30 21:40:12","TextWatcher not filtering ListView?","<java><android><filter><textwatcher>","1","0","","",""
"4565672","1","4565884","","2010-12-30 19:38:12","1","684","<p>i would like to use the accelerometer in an Android Handset for my Application. The data from the sensor will be saved together with a GPS Point, so the Value is only needed when the GPS Point is updated. </p><p>If i use the attached Code the values is always zero.API Level 8 Permissions: Internet, Fine LocationTesting Device: Galaxy S(i9000), Nexus One </p><p>Any Suggestions? I am stuck at this point. </p><p>Best regards from Germany, Pascal</p><pre><code>import android.app.Activity;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;import android.os.Bundle;public class AccelerometerService extends Activity{    AccelerometerData accelerometerData;    private SensorManager mSensorManager;    private float x,y,z;    private class AccelerometerData implements SensorEventListener{         public void onSensorChanged(SensorEvent event) {            x = event.values[0];            y = event.values[1];            z = event.values[2];        }        public void onAccuracyChanged(Sensor sensor, int accuracy) {}    }    @Override    protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);        mSensorManager.registerListener(accelerometerData,                mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),                SensorManager.SENSOR_DELAY_FASTEST);    }    @Override    protected void onResume() {        super.onResume();      }    @Override    protected void onStop() {        mSensorManager.unregisterListener(accelerometerData);        super.onStop();    }    public String getSensorString()    {        return (""X: "" + x+""m/s, Y: ""+ y +""m/s, Z: ""+ z +""m/s"" );    }}</code></pre>","479115","","319618","","2010-12-30 19:47:23","2010-12-30 20:14:40","Android Accessing Accelerometer: Returns always 0 as Value","<android><null><accelerometer>","1","0","","",""
"4565714","1","","","2010-12-30 19:43:48","0","319","<p>I want to represnet this sql query in Sqlite in android ?</p><pre><code>select id,name,topic from books where id=1 and topic =""art""</code></pre>","508377","","","","","2010-12-30 20:03:17","how to represtnt sqlite query in android?","<android><sqlite>","2","0","","",""
"4565883","1","4565996","","2010-12-30 20:09:04","0","69","<p>If I have a layout with two ImageViews.  Their id's are image_one and image_two.</p><p>Then I have a layout that includes the above layout two times.  Their id's can be layout_one and layout_two.</p><p>So this means that I have two image_one's and two image_two's.  How do I reference image_one in layout_two?</p>","324943","","","","","2010-12-30 20:25:42","Referencing ids for an included layout","<android><layout>","1","0","","",""
"4565931","1","4566021","","2010-12-30 20:16:34","2","400","<p>I am setting an alarm from my app, and when rebooting, I see I need to reset the alarm since it does not survive reboots. I created a broadcast receiver to receive BOOT_COMPLETED and this works so my manifest must be correct.</p><p>When I try this line of code below I get in trouble. I need to retrieve the time that I need to set the alarm to but it looks like I cannot access the prefs of my app (called S) because my app has never started. <code>NullPointerException</code> :</p><pre><code>if ( S.prefs.getBoolean(S.SCHEDULEDSTATUS, false) == true ) { }</code></pre><p>I suppose it should be obvious that I cannot read a public static final of an activity that has not been created.</p><p>Do I have to store my alarm time in a file or am I missing something here?</p>","479542","","281545","","2013-03-23 20:15:38","2013-03-23 20:15:38","Trying to read preferences upon BOOT_COMPLETED","<android>","1","2","","",""
"4566101","1","4571812","","2010-12-30 20:38:49","5","2935","<p><strong>Summary:</strong> Trying to dynamically add heading rows to a ListView via a custom adapter wrapper. ListView is having trouble keeping the scroll position in sync. Runnable demo project provided.</p><p>I would like to dynamically add items to a list based on the values in a CursorAdapter, several positions ahead of what the user is currently viewing. To do this, I have an adapter that wraps the CursorAdapter and keeps the new content indexed in a SparseArray. The ListView needs to be updated when items are added to the custom adapter, but I have met a lot of pitfalls trying to get that to work and would love some advice.</p><p>The demo project can be downloaded here: <a href=""http://dl.dropbox.com/u/15334423/DynamicSectionedList.zip"" rel=""nofollow"">DynamicSectionedList.zip</a></p><p>In the demo, the headings are added dynamically by looking ahead 10 places to find the correct position where the list items switch to the next letter. Each implementation of notifyDataSetChanged has problems as described:</p><p><strong>Demo 1</strong>This demo shows the importance of notifyDataSetChanged(). On clicking anything, the app will crash. This is due to some sanity checking in ListView... <code>mItemCount != adapter.getItemCount()</code>. Moral is, we need to notify the list that data has changed.</p><p><strong>Demo 2</strong>The natural next step is to notify the ListView of changes when changes occur. Unfortunately, doing so while the ListView is scrolling firmly breaks all touch interaction until the app switches out of touch mode. You will need to ""fling scroll"" far enough to generate new headings in order to notice this. Tapping the screen will not cause the scroll to stop, and once stopped none of the list items will be clickable. This is due to some <code>if (!mDataChanged) { /* do very important stuff */ }</code> code in AbsListView.onTouchEvent().</p><p><strong>Demo 3</strong>To fix this, Demo 3 introduces a pendingChanges flag and the custom Adapter gains a notifyDataSetChangedIfNeeded() which can be called by the ListView once it has entered a ""safe"" state for changes. The first point where changes must be notified is in ListView.layoutChildren(), so I overrode that method to first notify of changes if needed, then call through. Fling past at least one heading then click a list item.</p><p>This doesn't quite work right, though I'm not totally sure why. Tapping or selecting an item with the keyboard/trackball causes the list to refresh without properly syncing the old position. It scrolls to the top of the list which is not acceptable.</p><p><strong>Demo 4</strong>The scroll problem in Demo 3 can be conquered, at least in touch mode. By adding a call to notifyDataSetChangedIfNeeded() on touch down, the data change happens to take place at such a time that all touch interaction works as expected and the list position is properly synced.</p><p>However, I can't find an analog for that when the device is not in touch mode, not to mention the fact that it definitely seems like a hack. The list almost always scrolls back to the top, I can't find out what causes it to occasionally maintain the correct position. </p><p>Since Android is fighting me at each step of the way, I feel like there should be a better approach. Please try the demo, if any fixes can be applied to get it working that would be great!</p><p>Many thanks to anyone who can look into this, hopefully if we can get the code working it will be useful for others trying to accomplish the same optimization for lists with headings. </p>","558441","","1065868","","2013-04-05 13:16:59","2013-04-05 13:16:59","How to fix notifyDataSetChanged/ListView problems in dynamic Adapter wrapper Android","<android><android-listview><android-adapter><android-lazyadapter>","1","4","3","",""
"4566118","1","4567231","","2010-12-30 20:41:15","7","2854","<p>First let me explain my goal. I am trying to make an <code>Animation</code> that changes the properties of an <code>ArcShape</code>. An <code>ArcShape's</code> constructor takes two fields: <code>startAngle</code> and <code>sweepAngle</code>. I want to animate the <code>sweepAngle</code> so that it appears on screen as a continuously shrinking circle.</p><p>You can picture this animation by imagining PacMan. Imagine his mouth is closed. This animation would be akin to him opening his upper jaw more and more until there was no more PacMan.</p><p>Now... I have a couple of issues with implementing this. First, once an <code>ArcShape</code> is created, there are no built in methods of changing it's <code>sweepAngle</code>. This brings me to my first question: Is there any way to override <code>ArcShape</code> and implement some <code>setSweepAngle</code> method? Or will I have to create a <code>new ArcShape</code> for each <code>sweepAngle</code> I wish to display?</p><p>Now on to the second issue... Assuming I found a solution to the first issue, how could I create this <code>Animation</code>? This is the gist of what I have now:</p><pre><code>public class OpenPacman extends Animation {  public OpenPacman(float startAngle, float sweepAngle) {    mStartAngle = startAngle;    mSweepAngle = sweepAngle;  }  @Override  protected void applyTransformation(float interpolatedTime, Transformation t) {    /* This represents the current sweepAngle */    float currAngle = mStartAngle + ((mSweepAngle - mStartAngle) * interpolatedTime);    //Now I need to update the ArcShape's sweepAngle to currAngle. But HOW?  }}</code></pre>","382252","","","","","2011-05-19 16:08:45","Android custom Animation for an ArcShape","<java><android><animation>","2","0","5","",""
"4566287","1","","","2010-12-30 21:06:48","1","1375","<p>I'm trying to make it so that the user can drag a textview from one listview and then drop it into another, and I'm finding it to be very difficult.<br>The biggest problem I have found so far is that onTouchEvents seem to only be heard in the view that the ACTION_DOWN event originated in. I'll click in one list and the ACTION_DOWN is heard in there. Then I'll drag outside the list and let go over another list. But the onTouchEvent is only being called for the original list, no matter where I'm going. I thought it was going to be as simple as listening for an ACTION_UP event in the receiving list; but that's called on the original list even though I'm outside it.  </p><p>What I have so far is a bit messy. When onLongTouchEvent is called, the list tells the main activity to start dragging a draggableTextView (which has a moveTo method). Since the move events continue to be called on the original list, I have it continually setting the position of this draggableTextView. But I can't insert it into another list because I can't figure out what I'm letting go on top of.</p>","558705","","","","","2011-09-20 02:55:12","How to implement drag-and-drop between lists in android?","<java><android><listview><drag-and-drop>","1","3","","",""
"4566306","1","","","2010-12-30 21:11:08","0","794","<p>Is there a way that i can convert an mp3 file into binary code.</p><p>If this isn't possible can it be done with other audio formats?</p><p>Any ideas?</p>","412168","","","","","2010-12-30 21:11:08","convert an mp3 file into binary code in Android","<android><audio>","0","2","1","",""
"4566416","1","","","2010-12-30 21:32:03","0","1437","<p>i using the follwing Code to retrive XML element text using getElementsByTagName</p><p>this code success in 2.2 and Failed in 2.1 </p><p>any idea ? </p><pre><code>URL metafeedUrl = new URL(""http://x..../Y.xml"")URLConnection connection ;     connection= metafeedUrl.openConnection();HttpURLConnection  httpConnection = (HttpURLConnection)connection ;        int resposnseCode= httpConnection.getResponseCode() ;if (resposnseCode == HttpURLConnection.HTTP_OK) {InputStream in = httpConnection.getInputStream();DocumentBuilderFactory dbf ;dbf = DocumentBuilderFactory.newInstance();DocumentBuilder db = dbf.newDocumentBuilder();// Parse the Earthquakes entry Document dom = db.parse(in);Element docEle = dom.getDocumentElement();//ArrayList&lt;Album&gt; Albums = new ArrayList&lt;Album&gt;();/* Returns a NodeList of all descendant Elements with a given tag name, in document order.*/NodeList nl = docEle.getElementsByTagName(""entry"");if (nl!=null &amp;&amp; nl.getLength() &gt; 0) {           for (int i = 0; i &lt; nl.getLength(); i++) {Element entry = (Element)nl.item(i);/* Now on every property in Entry **/Element title =(Element)entry.getElementsByTagName(""title"").item(0);          *Here i Get an Error*String album_Title = title.getTextContent();Element id =(Element)entry.getElementsByTagName(""id"").item(0);         String album_id = id.getTextContent(); // </code></pre>","558740","","186558","","2011-01-11 20:32:03","2011-03-05 12:00:35","parser 2.1 and 2.2","<android><xml><parsing>","1","4","","",""
"4566435","1","","","2010-12-30 21:34:50","16","880","<p>Are the Linux capabilities (libcap.so) library available for use with Android? If not, how can I compile it? </p><p>I would like to use the capabilities-related API in <code>sys/capabilities.h</code>, which is included with the NDK. But when I try to call functions like <code>cap_get_proc()</code>, I get ""undefined reference"" error. </p>","440093","","1710392","","2013-05-07 20:12:31","2013-05-07 20:12:31","How to get libcap (Linux capabilities library) for Android?","<android><capability>","3","1","2","",""
"4566541","1","4566673","","2010-12-30 21:50:48","1","1709","<p>While extending a sample Android activity that fires some other activities from its menu, I came to have some menu items handled within <code>onOptionsItemSelected</code>, and some menu items (that just fired intents) handled by calling <code>setIntent</code> within <code>onCreateOptionsMenu</code>. </p><p>Basically something like: </p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu){    super.onCreateOptionsMenu(menu);    menu.add(0, MENU_ID_1, Menu.NONE, R.string.menu_text_1);    menu.add(0, MENU_ID_2, Menu.NONE, R.string.menu_text_2);    menu.add(0, MENU_ID_3, Menu.NONE, R.string.menu_text_3).        setIntent(new Intent(this, MyActivity_3.class));    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item){    super.onOptionsItemSelected(item);    switch (item.getItemId())    {        case (MENU_ID_1):            // Process menu command 1 ...            return true;        case (MENU_ID_2):            // Process menu command 2 ...            // E.g. also fire Intent for MyActivity_2             return true;        default:            return false;    }}</code></pre><p>Apparently, in this situation the Intent set on MENU_ID_3 is never fired, or anyway the related activity is never started. </p><p>Android javadoc at some point goes like &lt;&lt;[if you set an intent on a menu item] <strong>and nothing else handles the item</strong>, then the default behavior will be to [start the activity with the intent]>>.</p><p>What does it actually mean ""and nothing else handles the item""?Is it enough to return false from <code>onOptionsItemSelected</code>?I also tried not to call <code>super.onOptionsItemSelected(item)</code> at the beginning and only invoke it in the default switch case, but I had same results.</p><p>Does anyone have any suggestion? Does Android allow to mix the two type of handling?</p><p>Thanks for your time everyone.</p>","540776","","","","","2010-12-30 22:13:57","Mixing menuItem.setIntent with onOptionsItemSelected doesn't work","<android><activity><android-intent><menuitem>","1","0","","",""
"4566641","1","4566806","","2010-12-30 22:09:23","5","2413","<p>I have successfully created an Android app that calculates prices and then is able to transfer that data in a preformated fashion to an email program of the users choice. Depending upon the data the user creates in the app, a string containing the HTML is read into an intent. The code I have for this is:</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(emailText));QuoteDroid.this.startActivity(emailIntent);</code></pre><p>This is all fine and the email is <strong><em>mostly</em></strong> formated correct when I choose the Gmail app, and generally sends <strong><em>mostly</em></strong> correct. The issue I have with this is that I must send it from a non-gmail account for business purposes. When I choose the generic email app on the phone it does not process the HTML properly and when I send the email it is formated in plain text.</p><p>I've read through countless articles and forum posts, but to no avail. How do I process the string, containing the HTML, in such a way that the email -after being sent with the built in email app- is viewed properly formated by the receiver?</p>","558726","","","","","2013-05-13 08:25:19","Sending HTML formated email in Android","<java><android><html><email>","2","2","1","",""
"4566685","1","4566895","","2010-12-30 22:16:53","0","1102","<p>Is it possible to get track name while playing radio stream via MediaPlayer?</p>","468311","","1228","","2013-04-03 21:35:53","2013-04-03 21:35:53","Android Online Radio Player","<android>","1","0","2","",""
"4566717","1","4566929","","2010-12-30 22:22:30","1","724","<p>Im trying to implement inertial scrolling in my GLSurfaceView and to do that i need to figure out how to calculate velocity, but im not sure how to do so. the translation is stored in a matrix, and it is calculated by the line of code below. </p><pre><code>matrix.postTranslate(event.getX() - start.x,event.getY() - start.y);</code></pre>","385051","","127059","","2010-12-30 22:24:07","2010-12-30 22:59:45","calculating velocity","<android><scrolling><surfaceview><glsurfaceview><smooth-scrolling>","1","2","1","",""
"4566766","1","","","2010-12-30 22:29:44","3","1422","<p>I have a webview in a scrollview, when the Activity loads, it forces my scrollview to the bottom (where the webview is) once the webview finishes ""loadData"".How do I keep this from happening?I've tried this, but it jumps the screen up and down, which I don't want:</p><p>ScrollView scroll = (ScrollView)findViewById(R.id.detailsScroll);<br>   scroll.post(new Runnable()<br>   {<br>          @Override<br>          public void run()<br>          {<br>           ScrollView scroll = (ScrollView)findViewById(R.id.detailsScroll);<br>           scroll.fullScroll(ScrollView.FOCUS_UP);<br>          }<br>      });  </p>","558783","","","","","2013-04-22 18:01:07","webview is forcing my scrollview to the bottom","<android><webview><scrollview>","2","6","2","",""
"4566799","1","","","2010-12-30 22:36:34","3","292","<p>I have limited information on the new feature in 2.2: ""allow automatic updating"" option in the market app.</p><p>Is there a way to programmatically detect if an app has enabled ""allow automatic updating"" option?</p><p>I am assuming there's no API to turn on ""allow automatic updating"" value.</p>","432056","","","","","2010-12-30 22:36:34","Android: How do I detect if an app is enabled for ""allow automatic updating""","<android>","0","2","","",""
"4566893","1","","","2010-12-30 22:51:24","0","775","<p>How do I create a group of <em>radio buttons where the buttons look like nice stock android buttons</em>?</p><p>This is what I have found so far:</p><p>The look of a radio button can be replaced with 4 drawables.There is an example of this on the web.</p><hr><p>This does not work for me. So I have figured out two bad choices:</p><p>(A) Use stock buttons -do the radio logic in java. <em>Gross.</em></p><p>(B) Render the buttons to drawables set them at runtime. <em>Blah</em></p><p>Any ideas are very appreciated.</p><p>(This is my first question here. Hope it is well formulated.)</p>","558787","","558787","","2010-12-30 22:57:13","2010-12-30 23:34:01","Radio buttons: Replacing the stock round ones with built in android buttons","<android>","1","0","","",""
"4566909","1","4566927","","2010-12-30 22:54:16","3","2575","<p>I started off with <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">Fedor's ListView implementation</a>. Here's the XML for my ListView item:</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=""wrap_content""&gt;&lt;ImageView      android:id=""@+id/image""      android:layout_width=""50dip""      android:layout_height=""50dip"" android:src=""@drawable/stub"" android:scaleType=""centerCrop""/&gt;&lt;TextView      android:id=""@+id/name""      android:layout_width=""0px""      android:layout_height=""0px""      android:layout_weight=""0"" android:textSize=""20dip"" android:layout_marginLeft=""10dip""/&gt;&lt;TextView      android:id=""@+id/address""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_weight=""1""  android:textSize=""16dip"" android:layout_marginLeft=""10dip""/&gt;&lt;/LinearLayout&gt;</code></pre><p>What I'm seeing on my device is the ImageView and the two TextViews displayed sequentially from left to right.</p><p>What I want is the ImageView all the way on the right (this is already correct), the name TextView to the right of the imageview (this is correct), and the address TextView, BELOW the name TextView.  I haven't been able to figure out how to get this laid out properly.</p><p>Please note, I know I could just add a new line to the name and include the address text after that, but I want these two elements to have different font sizes, so that is not an option.  Thanks so much!</p>","216363","","","","","2010-12-30 22:59:27","Android layout -- stack two TextViews vertically, inside a ListView Row","<android><xml><android-layout><android-xml>","1","0","","",""
"4566971","1","4623467","","2010-12-30 23:08:13","0","1707","<p>Here's what I'm trying to accomplish:I want to be able to show dmesg logs and logcat output in an app I'm writing. I know that I'm supposed to use Runtime.getRuntime().exec(), however other than that, I'm pretty lost. I tried to find some examples, but couldn't.</p><p>Can someone here give me some information on how to do this? Maybe point me to some example code. Aside from doing the following in my code:</p><pre><code>Runtime.getRuntime().exec(""dmesg"");</code></pre><p>or</p><pre><code>Runtime.getRuntime().exec(""logcat"");</code></pre><p>I'm not sure what else to do to be able to read dmesg and logcat outputs.</p><p>I also want to be able to run commands like 'ls' and 'cat'</p><p>Thanks,</p>","425962","","","","","2011-01-07 07:37:43","Running adb commands like dmesg and logcat in my app in real time","<android><adb><runtime.exec>","1","0","","",""
"4566994","1","","","2010-12-30 23:13:02","0","3735","<p>What's the intended way to use a TransitionDrawable in code? Any examples?</p><p>I made a small test app to lay down some context:</p><pre><code>public class SkeletonActivity extends Activity {    private Button b;    private ImageView iv;    private TransitionDrawable transition;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Inflate our UI from its XML layout description.        setContentView(R.layout.skeleton_activity);        // Hook up button presses to the appropriate event handler.        b = ((Button) findViewById(R.id.button));        b.setOnClickListener(mButtonListener);        iv = ((ImageView) findViewById(R.id.image));        //XML-based code        transition = (TransitionDrawable)getResources().getDrawable(R.drawable.trans).mutate();        transition.setDrawableByLayerId(transition.getId(0), getResources().getDrawable(R.drawable.trans3));        transition.setDrawableByLayerId(transition.getId(1), getResources().getDrawable(R.drawable.trans4));        //Pure programmatic code        transition = new TransitionDrawable(new Drawable[] {getResources().getDrawable(R.drawable.trans3), getResources().getDrawable(R.drawable.trans4)});        transition.setCrossFadeEnabled(true);    }    OnClickListener mButtonListener = new OnClickListener() {        public void onClick(View v) {            iv.setImageDrawable(transition);            transition.startTransition(5000);        }    };}</code></pre><p>and my TransitionDrawable xml file looks like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;transition xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/trans1"" /&gt;    &lt;item android:drawable=""@drawable/trans2"" /&gt;&lt;/transition&gt;</code></pre><p>Let's first start with the XML-based code part (so that means comment out the Pure programmatic code line).</p><p>If you run this code and press the button, then you see he image change from trans1 to trans4, instead of from trans3. Why isn't the initial drawable replaced?</p><p>The whole setDrawableByLayerId() method is confusing. In the constructor you'd specify a list of Drawables that goes into a LayerDrawable. I suppose these are what is referred to as indexes. Then what is an id if it is not such an index?</p><p>I tried adding android:id attributes to the ""item"" tags. While this code builds, it does not run. So id is not this id, that you'd normally have.</p><p>Perhaps it is the resId of the current drawable in that position? That doesn't seem either.</p><p>Id seems to be just some number (maybe it matters in a LayerDrawable) that can be set with setId(index, id) and gotten with getId(index). By default no ids are assigned. And you can reserve none for layers that have not been added yet. In my code both getId() calls return -1, which is why when using setDrawableByLayerId(-1, ...) only the last one sticks. Indeed commenting out the last line gives different behavior, giving a transition from trans1 to trans3.</p><p>How can I change the first drawable layer? I have to add the following code before the setDrawableByLayerId(). Even when I don't use 50 or 51 anywhere. This makes it go from trans3 to trans4.</p><pre><code>transition.setId(0, 50);transition.setId(1, 51);</code></pre><p>What is wrong about my concepts that I have to make it this complicated to get it to work?</p><p>What I actually wanted to do in my real app was not use any xml code, I see no use for it. I'd also like to first add in the first layer, and only later, after construction, put in the second layer, but we'll continue with that later.</p><p>Let's try the pure programmatic code. It is equivalent. In fact it puts in the right Drawables right away.</p><p>Now, in this sample app it gives the same result. However, in my app (of which the relevant code is too complex to post here), I still have a problem:</p><p>If I try with preprogrammed Drawables from an xml-specified transition, I get that getResources().getDrawable(R.drawable.trans) the second time returns null:</p><pre><code>12-30 21:35:32.970: ERROR/AndroidRuntime(7457): java.lang.NullPointerException12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.LayerDrawable$LayerState.&lt;init&gt;(LayerDrawable.java:581)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.TransitionDrawable$TransitionState.&lt;init&gt;(TransitionDrawable.java:235)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.TransitionDrawable.createConstantState(TransitionDrawable.java:99)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.LayerDrawable.&lt;init&gt;(LayerDrawable.java:94)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.TransitionDrawable.&lt;init&gt;(TransitionDrawable.java:90)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.TransitionDrawable.&lt;init&gt;(TransitionDrawable.java:39)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.graphics.drawable.TransitionDrawable$TransitionState.newDrawable(TransitionDrawable.java:245)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.content.res.Resources.getCachedDrawable(Resources.java:1753)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.content.res.Resources.loadDrawable(Resources.java:1664)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at android.content.res.Resources.getDrawable(Resources.java:581)12-30 21:35:32.970: ERROR/AndroidRuntime(7457):     at net.lp.collectionista.ui.views.CoverView.updateCover(CoverView.java:78)</code></pre><p>What am I missing here? Something with missing mutate()?</p><p>I mentioned I'd also like to set the layers in two steps, and fully in code. Meaning I'd first have to do</p><pre><code>transition = new TransitionDrawable(new Drawable[] {&lt;1&gt;});</code></pre><p>with passing in only one layer. However I cannot do setId() on a new layer, so I can't add a new layer later on (although reading the documentation for setDrawableByLayerId() would lead you to believe you could).</p><p>Passing in a second layer straight away, by means of an array of 2 with second element null, is punished, so I'll just pass in the same drawable as the first layer then.</p><p>Anything I've been missing here and could have done easier?</p>","458813","","458813","","2010-12-31 00:11:41","2013-08-17 17:42:34","android UI: TransitionDrawable","<android><user-interface><transition>","1","1","","",""
"4567003","1","","","2010-12-30 23:15:15","1","2101","<p>I know that there are some questions around and I've been through them all, I guess.</p><p>My carrier is kind enough to offer 50 free SMS each month. Now I would like to make myself a little counter that runs in the background and notifies me whenever I reach that limit. (Yes, I <em>am</em> aware that there will already be apps for this). Therefore, I would like a service to be notified whenever an SMS/test msg is <strong>sent</strong>. So the way to go would be  a <code>ContentObserver</code>. I set one up (2) and register it like that (1):</p><pre><code>(1)Uri URI = Uri.parse(""content://sms/sent"");String[] columns = {""_id"", ""date""};Cursor c = context.getContentResolver().query(URI, columns, ""type=?"", new String[]{""1""}, ""_id DESC"");Observer observer = new Observer(context);c.registerContentObserver(observer);(2)private class Observer extends ContentObserver {    Context context;    public Observer(Context context) {        super(null);        this.context = context;    }    @Override    public void onChange(boolean selfChange) {        super.onChange(selfChange);        // some code here    }}</code></pre><p>After countless attempts of messing I have to admit to myself I am plain unable to make the <code>onChange()</code> only go off when an SMS is sent. Instead, it goes off upon incoming SMS as well.</p><p>So can anyone help me out on this? Sure, I could write all outgoing SMS to a DB and query to find out if the current SMS already exists but that does seem like an untidy solution and I'd like to do differently.</p><p>Thanks in advance,<br>steff</p>","289849","","","","","2010-12-30 23:15:15","Last sent SMS/text message: how to retrieve via ContentObserver?","<android><sms><contentobserver>","0","5","3","",""
"4567078","1","","","2010-12-30 23:29:26","0","1232","<p>I would like to know how to play a video file in my app. Either from the SD-card or from a source like YouTube for example. The video should play in fullscreen mode, and when the video is complete, i want to return to my app. Is there any way to accomplish this?</p><p>Thanks!</p>","557703","","","","","2011-09-07 12:51:11","Android 2.2: code for playing a video from sd card / streaming from web","<android><video>","1","0","","",""
"4567115","1","6878844","","2010-12-30 23:38:24","0","666","<p>Also what is the best place to get free sound effect files?</p><p>Thanks!</p>","396106","","","","","2011-07-29 20:46:08","Where can I download the built in Unlock.ogg and Lock.ogg sound files for Android?","<android><audio>","2","0","","",""
"4567216","1","","","2010-12-31 00:04:13","2","6734","<p>I am going out of my mind for the last two days with an <code>IllegalArgumentException</code> error I receive in Android code when trying to get a coordinates out of an address, or even reverse, get address out of longitude and latitude. This is the code, but I cannot see an error. It is a standard code snippet that is easily found on a Google search.</p><pre><code>public GeoPoint determineLatLngFromAddress(Context appContext, String strAddress) {    Geocoder geocoder = new Geocoder(appContext, Locale.getDefault());    GeoPoint g = null;     try {        System.out.println(""str addres: "" + strAddress);        List&lt;Address&gt; addresses = geocoder.getFromLocationName(strAddress, 5);        if (addresses.size() &gt; 0) {            g = new GeoPoint(               (int) (addresses.get(0).getLatitude() * 1E6),               (int) (addresses.get(0).getLongitude() * 1E6)            );        }    } catch (Exception e) {        throw new IllegalArgumentException(""locationName == null"");    }    return g; }</code></pre><p>These are the permissions from manifest.xml file:</p><pre><code>&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_MOCK_LOCATION"" /&gt;</code></pre><p>I do have the Google API key declared too: <code>&lt;uses-library android:name=""com.google.android.maps"" /&gt;</code></p><p>From the code snippet above, <code>geocoder</code> is not <code>null</code>, neither is the <code>address</code> or <code>appContext</code>, and I stumble here: <code>geocoder.getFromLocationName(strAddress, 5);</code> </p><p>I did a lot of Google searching and found nothing that worked, and the most important info I found is this: </p><blockquote>  <p>The Geocoder class requires a backend service that is not included in the core android framework.</p></blockquote><p>Sooo, I am confuzed now. What do I have to call, import, add, use in code.... to make this work?I am using Google API 2.2, API level 8.If somebody has found a solution for this, or a pointer for documentation, something that I didn't discover, please let us know.</p>","520197","","356895","","2013-10-04 19:56:55","2013-10-04 19:56:55","geocoder.getFromLocationName returns only null","<android><google-geocoder><illegalargumentexception>","2","0","3","",""
"4567233","1","","","2010-12-31 00:10:21","0","486","<p>I'm trying to parse data via XML and it's working but the only problem is it is returning the last line of the tag. I'm using Lyrics Wiki just to test out </p><p><a href=""http://lyrics.wikia.com/LyricWiki:API"" rel=""nofollow"">http://lyrics.wikia.com/LyricWiki:API</a></p><p>For the example post on their site with artist cake and song dime the return value I get is ""When a crumpled up [...]""</p><p>My code looks as such:</p><p>public class ExampleHandler extends DefaultHandler{</p><pre><code>    // ===========================================================    // Fields    // ===========================================================    private boolean in_outertag = false;    private boolean in_innertag = false;    private boolean in_mytag = false;    private ParsedExampleDataSet myParsedExampleDataSet = new ParsedExampleDataSet();    // ===========================================================    // Getter &amp; Setter    // ===========================================================    public ParsedExampleDataSet getParsedData() {            return this.myParsedExampleDataSet;    }    // ===========================================================    // Methods    // ===========================================================    @Override    public void startDocument() throws SAXException {            this.myParsedExampleDataSet = new ParsedExampleDataSet();    }    @Override    public void endDocument() throws SAXException {            // Nothing to do    }    /** Gets be called on opening tags like:     * &lt;tag&gt;     * Can provide attribute(s), when xml was like:     * &lt;tag attribute=""attributeValue""&gt;*/    @Override    public void startElement(String namespaceURI, String localName,                    String qName, Attributes atts) throws SAXException {            if (localName.equals(""LyricsResult"")) {                    this.in_outertag = true;            }else if (localName.equals(""lyrics"")) {                    this.in_mytag = true;            }    }    /** Gets be called on closing tags like:     * &lt;/tag&gt; */    @Override    public void endElement(String namespaceURI, String localName, String qName)                    throws SAXException {            if (localName.equals(""LyricsResult"")) {                    this.in_outertag = false;            }else if (localName.equals(""lyrics"")) {                    this.in_mytag = false;            }    }    /** Gets be called on the following structure:     * &lt;tag&gt;characters&lt;/tag&gt; */    public void characters(char ch[], int start, int length) {        if(this.in_mytag){            myParsedExampleDataSet.setExtractedString(new String(ch, start, length));        }</code></pre><p>}}</p><p>and...</p><p>public class ParsedExampleDataSet {    private String extractedString = null;    private int extractedInt = 0;</p><pre><code>public String getExtractedString() {        return extractedString;}public void setExtractedString(String extractedString) {        this.extractedString = extractedString;}public int getExtractedInt() {        return extractedInt;}public void setExtractedInt(int extractedInt) {        this.extractedInt = extractedInt;}public String toString(){        return this.extractedString;}</code></pre><p>}</p>","427377","","","","","2010-12-31 03:06:25","Android Java Parsing XML via Web","<java><android><xml>","1","0","","",""
"4567241","1","","","2010-12-31 00:13:57","13","10508","<p>I have an android application that utilizes another project as a project reference. i've gone into the application options, build path, and then selected the project in project references.</p><p>everything builds and deploys fine, but when i try to run the application and instantiate a class in that project, i'm getting a java.lang.NoClassDefFoundError errrrrr. </p><p>i'm no java project expert, so i assume i've cocked something simple up. any ideas?</p>","339448","","","","","2013-10-25 12:41:27","External project reference in android","<android>","8","2","3","",""
"4567251","1","4568128","","2010-12-31 00:16:35","0","330","<p>I'm currently creating a game and have a problem which I think I know why it is occurring but not entirely sure and even if I knew, don't know how to solve.I have a 2D array 10 x 10 and have a ""player"" class that takes up a tile.Now, I have created 2 instances of the player and move them around via swiping.Around the edges I have put ""walls"" that the player cannot walk through and everything works fine, until I remove a wall.Once I remove a wall and move the character/player to the edge of the screen, the player cannot go any further.The problem occurs here, where the second instance of the player is not at the edge of the screen but say 2 tiles from the first instance of ""player"" who is at the edge.If I try moving them further into the direction of the edge, I understand that the first instance of player wouldn't move or do anything but the second instance of player should still move, but it won't.</p><p>This is the code that executed when the user swipes:</p><pre><code>if (player.getArrayX() - 1 != player2.getArrayX()) {    player.moveLeft();} else if (player.getArrayX() - 1 == player2.getArrayX() &amp;&amp; player.getArrayY() != player2.getArrayY()) {    player.moveLeft();}if (player2.getArrayX() - 1 != player.getArrayX()) {    player2.moveLeft();} else if (player2.getArrayX() - 1 == player.getArrayX() &amp;&amp; player2.getArrayY() != player.getArrayY()) {    player2.moveLeft();}</code></pre><p>In the player class I have:</p><pre><code>public void moveLeft() {    if (alive) {        switch (levelMaster.getLevel1(getArrayX() - 1, getArrayY())) {        case 0:            break;        case 1:            subX(); // basically moves player left            setArrayX(getArrayX() - 1); // shifts x coord of player 1 within tilemap            Log.d(""semajhan"", ""x: "" + getArrayX());            break;        case 9:            subX();            setArrayX(getArrayX() - 1);            setAlive(false);            break;        }    }}</code></pre><p>Any help on the matter or further insight would be greatly appreciated, thanks.</p>","507007","","507007","","2010-12-31 02:15:46","2010-12-31 04:46:19","Android game logic problem","<java><android>","1","4","1","",""
"4567332","1","4567478","","2010-12-31 00:39:27","1","152","<p>I have been working on an application and I added a options menu. Prior to adding the menu everything ran fine, after adding however it will not run, the process just stops.I tried removing the menu and that did not work, it still stops. In logcat it says that there is a null pointer exception, but I cannot figure out at all why this is happening.</p><p>my numbers_menu xml file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:id=""@+id/quit""    android:title=""@string/quit_str"" &gt;&lt;/item&gt;&lt;item android:id=""@+id/instructions""       android:title=""@string/instructions_str""&gt;&lt;/item&gt;&lt;/menu&gt;</code></pre><p>methods:</p><pre><code>   @Override    public boolean onCreateOptionsMenu(Menu menu) {     MenuInflater inflater = getMenuInflater();     inflater.inflate(R.menu.numbers_menu, menu);  return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case R.id.quit:            quit();            return true;        case R.id.instructions:            return true;        default:            return super.onOptionsItemSelected(item);        }    }</code></pre><p>Here is the code leading up the the null pointer exception:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    play_game();    }public void play_game() {     //get some numbers     rolled1 = roll();     Log.d(TAG, ""rolled1 is up"");     rolled2 = roll();     Log.d(TAG, ""rolled2 is up"");        switch(rolled1) {     case 1:      rolled_id_1 = 2131034114;      break;     case 2:      rolled_id_1 = 2131034115;      break;     case 3:      rolled_id_1 = 2131034116;      break;     case 4:      rolled_id_1 = 2131034117;      break;     case 5:      rolled_id_1 = 2131034119;      break;     case 6:      rolled_id_1 = 2131034120;      break;     }        Log.d(TAG, ""rolled_id_1 is up with the value "" + Integer.toString(rolled_id_1));     switch(rolled2) {     case 1:      rolled_id_2 = 2131034114;      break;     case 2:      rolled_id_2 = 2131034115;      break;     case 3:      rolled_id_2 = 2131034116;      break;     case 4:      rolled_id_2 = 2131034117;      break;     case 5:      rolled_id_2 = 2131034119;      break;     case 6:      rolled_id_2 = 2131034120;      break;     }     Log.d(TAG, ""rolled_id_2 is up with the value "" + Integer.toString(rolled_id_2));     switch(rolled1 + rolled2) {      case 1:      rolled_sum = 2131034114;      break;     case 2:      rolled_sum = 2131034115;      break;     case 3:      rolled_sum = 2131034116;      break;     case 4:      rolled_sum = 2131034117;      break;     case 5:      rolled_sum = 2131034119;      break;     case 6:      rolled_sum = 2131034120;      break;     case 7:      rolled_sum = 2131034121;        break;     case 8:      rolled_sum = 2131034122;         break;     case 9:      rolled_sum = 2131034124;       break;     case 10:      rolled_sum = 2131034125;        break;     case 11:      rolled_sum = 2131034126;        break;     case 12:      rolled_sum = 2131034127;      break;     }     Log.d(TAG, ""rolled_id_sum is up with the value "" + Integer.toString(rolled_sum));     if(lose(rolled_id_1, rolled_id_2, rolled_sum)) {      dieShow(rolled1, rolled2);      setContentView(R.layout.main);      play_game();     }     else {          disable_flag = 0;          needDisable(rolled_id_1, rolled_id_2);             dieShow(rolled1, rolled2);         }        }public boolean lose(int rolled_id_1, int rolled_id_2, int rolled_sum) {     //check loss     Button button_check_loss_1 = (Button)findViewById(rolled_id_1);     Log.d(TAG, ""getting past first button assignment"");     Button button_check_loss_2 = (Button)findViewById(rolled_id_2);     Log.d(TAG, ""getting past second button assignment"");     Button button_check_loss_3 = (Button)findViewById(rolled_sum);     Log.d(TAG, ""getting past third button assignment"");     if((!button_check_loss_1.isClickable() || !button_check_loss_2.isClickable()) &amp;&amp; !button_check_loss_3.isClickable()) {      Toast loseText = Toast.makeText(this, ""you lose1"", Toast.LENGTH_LONG);      loseText.show();      return true;     }     if(!button_check_loss_1.isClickable() &amp;&amp; !button_check_loss_2.isClickable() &amp;&amp; !button_check_loss_3.isClickable()) {      Toast loseText = Toast.makeText(this, ""you lose2"", Toast.LENGTH_LONG);      loseText.show();      return true;     }     if(rolled_id_1 == rolled_id_2) {      if ((!button_check_loss_1.isClickable() || !button_check_loss_2.isClickable()) &amp;&amp; !button_check_loss_3.isClickable()) {          Toast loseText = Toast.makeText(this, ""you lose3"", Toast.LENGTH_LONG);          loseText.show();          return true;      }     }     return false;    }</code></pre><p>The error occurs at:</p><pre><code>if((!button_check_loss_1.isClickable() || !button_check_loss_2.isClickable()) &amp;&amp; !button_check_loss_3.isClickable())</code></pre>","558043","","","","","2010-12-31 01:23:01","Added a options menu, now the process stops","<java><android><nullpointerexception>","1","0","","",""
"4567501","1","4567526","","2010-12-31 01:29:35","1","254","<pre><code>newSubmitButton = (Button) findViewById(R.id.newPlayerSubmit);Log.v(""heeelp"",""""+newSubmitButton);</code></pre><p>Seems simple enough. I have a global <code>Button</code> variable called <code>newSubmitButton</code>. I fetch the Button from an xml file in the project (I promise, the button exists, i didn't mispell the name, etc.) I output the button in the next line, it is null. I try to give it an <code>onClickListener</code> and it throws a null pointer exception. How is this button null? I just instantiated it the line before!</p>","544007","","488830","","2010-12-31 01:33:30","2010-12-31 08:52:46","Button not fetched from XML? Null Pointer","<android><android-layout><nullpointerexception>","3","0","","",""
"4567812","1","4569137","","2010-12-31 03:05:02","7","1874","<p>I want to define a permission in my Android app, and let other third-party apps to use. This permission is used to restrict calling of my modules. That is, third-party apps must request the right permission to call my module, just like using system permissions defined by Android system, android.permission.INTERNET or so.</p><p>In my test, I defined the permission in my app, say ""my.apps.permission.my_permission"", and then install it on emulator. In some of my Activities, android:permission=""my.apps.permission.my_permission"" property is added. This property forces the apps calling my activities must have the right permission ""my.apps.permission.my_permission"". Then in a test app, request the permission in AndroidManifest.xml, <code>&lt;uses-permission android:name=""my.apps.permission.my_permission"" /&gt;</code></p><p>The problem is, in the test app, which will call my permission-required activities, when I call startActivity(), I got a SecurityException : Permission Denied. But, if I defined a permission with the same name in the test app, everything works fine.</p><p>And, the followings are my conclusions:</p><p>1) It seems that, the permission defined in my app, ""my.apps.permission.my_permission"", is not visible to other third-party apps. How to make it visible, so that other apps can use my permission just like the ones defined in Android system?</p><p>2) Even is visible, Android won't check user-defined permissions with name conflicting.(I test this by define a permission with name ""android.permission.INTERNET"" in test app and overrides the system-defined one, and require ""android.permission.INTERNET"" in my app, and still, everything works fine.) If so, every other apps can define a permission with the same name that my module requires, and cheat my app. Is that right?</p><p>Anyone can help?Thanks a lot!</p>","429224","","","","","2011-01-06 06:51:43","Define a permission for third-party apps to use in Android","<android><permissions>","1","1","1","",""
"4567850","1","4567921","","2010-12-31 03:17:29","0","1869","<p>I have a custom view <code>Dial</code>. This view has a custom animation <code>DialAnimation</code> that was written as a nested class of <code>Dial</code>. Below is the code from my <code>Activity</code> that instantiates <code>Dial</code> and attempts to perform a sequence of animations on it. When the code is run, only one of the animations is seen onscreen. What am I missing here?</p><pre><code>Dial dial = (Dial) findViewById(R.id.dial);DialAnimation anim1 = dial.new DialAnimation(0, 90, 3000);DialAnimation anim2 = dial.new DialAnimation(180, 360, 3000);anim2.setStartOffset(3500);AnimationSet set = new AnimationSet(false);set.addAnimation(anim1);set.addAnimation(anim2);dial.startAnimation(set);</code></pre>","382252","","","","","2013-04-23 08:15:05","How can I run a sequence of Animations? AnimationSet is failing me","<java><android><animation><nested-class>","3","0","","",""
"4567904","1","4567928","","2010-12-31 03:33:06","112","65528","<p>How do I send an intent using Android's ADB tools?</p>","542792","","491044","","2011-03-11 12:55:35","2014-01-04 12:42:58","How to start an application using android ADB tools?","<android><adb>","5","0","57","",""
"4567926","1","","","2010-12-31 03:39:47","0","453","<p>I am about to write an App which is customized to Macau, a city in Southern China. I am experiencing some uncertainties and would like to seek help from the fellow developers. </p><p>I have checked with Android Dev Guide and found out that we have gotta sign the App with self-generated key or a digital certificate issued from Certificate Authority. May I know whether there are any differences in the user experience when downloading and using the App for self-generated key or digital cert from CA? I heard that Symbian Apps would display alert message like ""This App is untrusted"" if the App is not formally verified. I do not want this to happen in my App, and I am worried about other tiny differences. </p><p>Moreover, I would like to ask about the requirements for digital certificate for signing the App. Is there any specification? Must the key be a .keystore file for signing? I am thinking about applying one from the Post Office for signing, but am worried whether it works. </p><p>From the Google Dev Guide, it says we need to plug the Android device to the computer using USB and run the App and perform testing using the computer. May I know more about the testing procedures from the experienced? After this debugging process how can I test the App on a standalone Android phone just like using the App normally? Can I simply sign the App with debug key in the debug mode and use it on the device? Must the device be developer device or Nexus One for performing testing? </p><p>If I publish the App to the Web server, i.e. users can download the file and use my file, would my source code be leaked out and get accessed by other people? </p><p>Last but not least, as I am developing the free App in Macau, I was stuck when I saw that Macau is not on the developer location list. I wonder whether I can publish my App on the Android Market. When I settle the Google Checkout payment, which option should I choose as my location, as neither China nor Macau is on the list. Should I choose ""Hong Kong"", my neighbouring city, or simply click ""US"" for convenience? Can the Android users in Macau download my App from the Android Market? (I cannot see Macau on the supported distribution location list...)</p><p>I would really appreciate it if you could kindly answer my loads of questions. Thank you very much!</p>","558934","","","","","2010-12-31 04:12:27","App Signing & Testing and Publishing Options","<android>","1","0","","",""
"4567962","1","","","2010-12-31 03:51:54","0","179","<p>I'm trying integrate janrain API to my android applicaion. There is an iPhone library provided by Janrain. If anybody knew how to do this, please help.</p>","541442","","244296","","2010-12-31 03:52:59","2011-10-01 02:02:59","Integrate Janrain API to android application","<android>","1","1","","",""
"4567969","1","4567989","","2010-12-31 03:53:31","13","6353","<p>Here is my custom CursorAdapter:</p><pre><code>public class TasksAdapter extends CursorAdapter implements Filterable {    private final Context context;    public TasksAdapter(Context context, Cursor c) {        super(context, c);        this.context = context;    }    /**     * @see android.widget.CursorAdapter#newView(android.content.Context, android.database.Cursor, android.view.ViewGroup)     */    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(android.R.layout.simple_list_item_checked, parent, false);                ViewHolder holder = new ViewHolder();        holder.textview = (CheckedTextView)v.findViewById(android.R.id.text1);        v.setTag(holder);        return v;    }    /**       * @see android.widget.CursorAdapter#bindView(android.view.View, android.content.Context, android.database.Cursor)     */    @Override    public void bindView(View view, Context context, Cursor cursor) {        ViewHolder holder = (ViewHolder)view.getTag();        int titleCol = cursor.getColumnIndexOrThrow(Tasks.TITLE);        int completedCol = cursor.getColumnIndexOrThrow(Tasks.COMPLETED);        String title = cursor.getString(titleCol);        boolean completed = Util.intToBool(cursor.getInt(completedCol));        holder.textview.setText(title);        holder.textview.setChecked(completed);    }    /**     * @see android.widget.CursorAdapter#runQueryOnBackgroundThread(java.lang.CharSequence)     */    @Override    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {        StringBuffer buffer = null;        String[] args = null;        if (constraint != null) {            buffer = new StringBuffer();            buffer.append(""UPPER ("");            buffer.append(Tasks.TITLE);            buffer.append("") GLOB ?"");            args = new String[] { ""*"" + constraint.toString().toUpperCase() + ""*"" };        }        Cursor c = context.getContentResolver().query(Tasks.CONTENT_URI,            null, (buffer == null ? null : buffer.toString()), args,            Tasks.DEFAULT_SORT_ORDER);        c.moveToFirst();        return c;    }    /**     * @see android.widget.CursorAdapter#convertToString(android.database.Cursor)     */    @Override    public CharSequence convertToString(Cursor cursor) {        final int titleCol = cursor.getColumnIndexOrThrow(Tasks.TITLE);        String title = cursor.getString(titleCol);        return title;    }    static class ViewHolder {        CheckedTextView textview;    }}</code></pre><p>Does this fall into the constraints of the ViewHolder pattern? I wasn't sure because this was a CursorAdapter, where there was no <code>getView</code>. If there are any problems or suggestions, could you please point them out.</p>","200477","","","","","2013-05-07 10:14:45","ViewHolder pattern correctly implemented in custom CursorAdapter?","<java><android><adapter>","2","0","7","",""
"4567972","1","4641035","","2010-12-31 03:55:15","13","14594","<p>I know there are a lot of these topics around but none seem to help in my case, nor describe it exactly. The best similar one is <a href=""http://stackoverflow.com/questions/4386392/aapt-not-found-under-the-right-path"">aapt not found under the right path</a>.</p><p>My problem is that I can be using Eclipse for a whole evening programming, compiling and using my device, and then suddenly I get ""error executing aapt"" for my current project and ofcourse R.java isn't (properly)  generated anymore. I then restart Eclipse and everything goes away. I'm seeing this once a day on average however.</p><p>I've recently switched to amd64 and installed the latest Android-2.3 SDK and matching tools. I know that there is now a platform-tools folder that has an aapt version that should work SDK version independently. At first I had added this directory to my PATH, as instructed on the SDK website. I've also tried not adding it to my path and making a link platforms/android-9/tools so that every SDK version might use it's own old copy. Needless to say, platform-tools/aapt is there and has the right permissions, and I have been able to execute it on the command-line at any time.</p><p>When I do write a faulty xml file or sorts, and appropriately get an error, I see an extra line that says ""aapt: /lib32/libz.so.1: no version information available"". I'm running a recent Gentoo linux system. I have everything installed to support x86 on amd64, but have re-emerged emul-linux-x86-baselibs and zlib just to be sure. The problem persists. I do see some <a href=""http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=431124"">pages</a> that spell horror over some zlib bugs, but I'm not sure if that's related. I realize I'm not on the reference Ubuntu platform, but surely the difference cannot be that great?</p><p>It might very well be a bug in aapt or the tools itself. Why would it suddenly stop working? I also experience that the ids in R.java were incorrect, namely that simple findViewById() code would give ClassCastExceptions because of mixed ids the one time, and then work perfectly without any changes bu only a ""clean project"", in the aftermath of a failing aapt.</p><p>Finally, I've run a few commands on aapt, that don't seem to add any extra information:</p><pre><code>#ldd aapt./aapt: /lib32/libz.so.1: no version information available (required by ./aapt) linux-gate.so.1 =&gt;  (0xffffe000) librt.so.1 =&gt; /lib32/librt.so.1 (0x4f864000) libpthread.so.0 =&gt; /lib32/libpthread.so.0 (0x4f849000) libz.so.1 =&gt; /lib32/libz.so.1 (0xf7707000) libstdc++.so.6 =&gt; /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32/libstdc++.so.6 (0x415e9000) libm.so.6 =&gt; /lib32/libm.so.6 (0x4f876000) libgcc_s.so.1 =&gt; /lib32/libgcc_s.so.1 (0x4fac6000) libc.so.6 =&gt; /lib32/libc.so.6 (0x4f5ed000) /lib/ld-linux.so.2 (0x4f5ca000)#file aaptaapt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped</code></pre><p>Can anybody tell anything wrong with my configuration? Does it smell like a bug perhaps (otherwise let's report it (again))?</p><p><strong>Update 2010-01-06:</strong></p><p>I've gained some more knowledge. When I recently was trying to export a signed apk, I ran into another error message (full details from the Eclipse error view) regarding aapt I hadn't seen before. Note here too, that I can just restart Eclipse and can export apks again without problems, at least for a little while.</p><p>I'm starting to think it is related to lack of memory on my system. The message ""onvoldoende geheugen beschikbaar"" means ""insufficient memory available"".</p><p>I have also been seeing insufficient memory errors in DDMS when I'm dumping HPROF files.</p><p>Here is the error log (shortened):</p><pre><code>!ENTRY com.android.ide.eclipse.adt 4 0 2011-01-05 23:11:16.097!MESSAGE Export Wizard Error!STACK 1org.eclipse.core.runtime.CoreException: Failed to export application at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(Unknown Source) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)Caused by: com.android.ide.eclipse.adt.internal.build.AaptExecException: Error executing aapt. Please check aapt is present at /opt/android-sdk/android-sdk-linux_x86-1.6_r1/platform-tools/aapt at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeAapt(Unknown Source) at com.android.ide.eclipse.adt.internal.build.BuildHelper.packageResources(Unknown Source) ... 5 moreCaused by: java.io.IOException: Cannot run program ""/opt/android-sdk/android-sdk-linux_x86-1.6_r1/platform-tools/aapt"": java.io.IOException: error=12, Onvoldoende geheugen beschikbaar...Caused by: java.io.IOException: java.io.IOException: error=12, Onvoldoende geheugen beschikbaar...!SUBENTRY 1 com.android.ide.eclipse.adt 4 0 2011-01-05 23:11:16.098!MESSAGE Failed to export application!STACK 0com.android.ide.eclipse.adt.internal.build.AaptExecException: Error executing aapt. Please check aapt is present at /opt/android-sdk/android-sdk-linux_x86-1.6_r1/platform-tools/aapt at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeAapt(Unknown Source) at com.android.ide.eclipse.adt.internal.build.BuildHelper.packageResources(Unknown Source) at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(Unknown Source) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(Unknown Source) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)Caused by: java.io.IOException: Cannot run program ""/opt/android-sdk/android-sdk-linux_x86-1.6_r1/platform-tools/aapt"": java.io.IOException: error=12, Onvoldoende geheugen beschikbaar...Caused by: java.io.IOException: java.io.IOException: error=12, Onvoldoende geheugen beschikbaar</code></pre>","458813","","458813","","2011-01-07 00:35:16","2014-03-06 22:12:46","error executing aapt, all of the sudden","<android><aapt><libz>","3","0","3","",""
"4568095","1","4568183","","2010-12-31 04:38:02","1","1927","<p>I am trying to make four rows of three buttons each, and at the bottom of the buttons are two text views. I would like for them all to be spaced evenly but they aren't and I am not sure why.</p><p>Here is the code in my main.xml file.</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=""wrap_content""   android:layout_height=""wrap_content""&gt;&lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button01""   android:text=""@string/str_1""/&gt; &lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button02""   android:text=""@string/str_2""/&gt; &lt;Button android:onClick=""button_click""  android:layout_weight=""1""  android:id=""@+id/Button03""   android:text=""@string/str_3""/&gt;&lt;Button android:onClick=""button_click""  android:layout_weight=""1""   android:id=""@+id/Button04""   android:text=""@string/str_4""/&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow02""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;Button android:onClick=""button_click""  android:layout_weight=""1""   android:id=""@+id/Button05""    android:text=""@+string/str_5""/&gt;&lt;Button android:onClick=""button_click""  android:layout_weight=""1""  android:id=""@+id/Button06""   android:text=""@+string/str_6""/&gt;&lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button07""   android:text=""@+string/str_7""/&gt;&lt;Button android:onClick=""button_click""  android:layout_weight=""1""   android:id=""@+id/Button08""    android:text=""@+string/str_8""/&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow03""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button09""   android:text=""@+string/str_9""/&gt;&lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button10""   android:text=""@+string/str_10""/&gt;&lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button11""   android:text=""@+string/str_11""/&gt;&lt;Button android:onClick=""button_click""   android:layout_weight=""1""  android:id=""@+id/Button12""   android:text=""@+string/str_12""/&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/TableRow04""     android:layout_width=""wrap_content""     android:layout_height=""fill_parent""&gt;&lt;TextView android:text=""@+id/TextView01""     android:layout_weight=""1""     android:id=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;TextView android:text=""@+id/TextView02""    android:layout_weight=""1""     android:id=""@+id/TextView02""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>My text views have the following code:</p><pre><code> TextView t = (TextView)findViewById(R.id.TextView01); TextView t2 = (TextView)findViewById(R.id.TextView02); t.setTextSize(24); t2.setTextSize(24);</code></pre><p>When I run my program I get:</p><p><img src=""http://i.stack.imgur.com/taPES.png"" alt=""alt text""></p>","558043","","","","","2010-12-31 05:42:25","layout_weight with buttons and text views in table row","<java><android><layout><button><weight>","1","0","","",""
"4568149","1","4568329","","2010-12-31 04:53:12","1","2449","<p>Admob is not showing up on my emulator or on the device it self.I tried with testing mode on and off.Relevant Manifest data:permissions:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt; &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_INTERNAL_STORAGE"" /&gt;</code></pre><p>meta data:</p><pre><code>&lt;meta-data android:value=""true"" android:name=""AD_REQUEST"" /&gt;&lt;meta-data android:value=""false"" android:name=""TEST_MODE"" /&gt;&lt;meta-data android:value=""xxxxxxxxxxxxxxxx"" android:name=""ADMOB_PUBLISHER_ID"" /&gt;</code></pre><p>The x's are actually my ID.</p><p>My whole main.xml:</p><pre><code>&lt;com.admob.android.ads.AdView       android:id=""@+id/ad""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" android:visibility=""visible"" android:layout_alignParentTop=""true""/&gt;</code></pre><p> </p><p>Hopefully I can get this solved soon...</p>","558961","","223391","","2010-12-31 04:59:16","2010-12-31 05:37:24","Android Admob is not Showing Up","<java><android><mobile><admob>","1","0","","",""
"4568224","1","4568390","","2010-12-31 05:13:44","0","1430","<p>How do I find all child controls in an Activity. I want to get an enumeration of all EditTexts, Spinnners and Checkboxes at runtime.</p><p>Thanks</p>","161633","","161633","","2010-12-31 05:20:11","2010-12-31 05:53:31","How to find all child controls in an Activity (Android)","<android>","1","1","","",""
"4568239","1","4568477","","2010-12-31 05:16:03","-1","147","<p>I am a new android programmer, are there any links about developing applications for practice on the android platform.</p>","523529","","488830","","2010-12-31 05:19:33","2010-12-31 06:19:42","I am new Android Programmer","<android>","3","1","","2012-08-02 00:25:37",""
"4568267","1","4568358","","2010-12-31 05:24:58","203","82904","<p>When it comes to developing applications for Android, what is the difference between Min and Target SDK version? Eclipse won't let me create a new project unless Min and Target versions are the same!</p>","557855","","815724","","2013-02-04 02:28:06","2013-11-19 20:24:15","Android Min SDK Version vs. Target SDK Version","<android><eclipse>","5","5","105","",""
"4568274","1","4568308","","2010-12-31 05:26:06","0","1601","<p>I have an activity A, which invokes Activity B And then upon clicking buttons It goes to Activity C and D. </p><p>In activity C and D there is a button called Back. And on click of back button, activity A should come on front with same data that was shown previously. </p><p>More Detail: When Activity A is first called it receives some bundles to fetch title and user name to show on the screen, remaining values on textviews on screen is fetched based on these two values.</p><p>Now the question is:</p><p>Is it possible to put Activity A on front with calling intent and without putting extras on it?? Is there any OS(2.1 onwards) supported mechanism  that shows me last bundle data if there is no new bundle passed??</p>","246942","","","","","2010-12-31 05:58:24","Android: Get already displayed activity on front, not by calling finish() on current activities","<android><android-layout><android-intent>","1","0","","",""
"4568420","1","","","2010-12-31 05:59:58","0","530","<p>Currently I am busy with designing keyboard maximum functionality of the keyboard has been completed at that time i am facing a problem regard setting of this key board like Speed of typing, spell checking, suggestion box and other think i know this is control by Preference.But i don't know about how to add preference in android setting.Means user control this keyboard setting by these following step.</p><p>Settings >Language and Keyboard  >My Keyboard name > Setting of this Keyboard.</p><p>Can any one told me hoe can it possible thanks in advance.</p>","549771","","","","","2011-06-14 07:40:22","How to add preference in setting in android","<android>","2","0","","",""
"4568468","1","4734984","","2010-12-31 06:12:11","3","10495","<p>Can anybody please give me an example of ActivityGroup. I have heard that by making use of ActivityGroup we can change the nested activities maintaining the TabHost as it is.</p><p>Any help would be greatly appreciated.</p><p>Thanks,david brown</p>","422859","","","","","2011-11-15 22:58:42","ActivityGroup Example","<android><activitygroup>","1","0","3","",""
"4568494","1","4644485","","2010-12-31 06:19:00","7","4245","<p>I have an activity group containing 3 activities. When a button is pressed, I enter into this activity group and show the 1st activity. From the 1st activity I can goto 2nd activity and from 2nd activity I can goto 3rd activity.</p><p>I have a spinner in this 3rd activity layout. Problem is I am not able to click on that spinner. Error gets displayed showing:</p><pre><code>12-31 11:29:41.082: ERROR/AndroidRuntime(474): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@43791b18 is not valid; is your activity running?</code></pre><p>How can I solve this issue? Can anyone plz help...</p><p>Hi,</p><p>Please find the code for spinner attached:</p><pre><code>setContentView(R.layout.requestinfo);Spinner spinner = (Spinner) findViewById(R.id.spinner);ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(            PGDealerInfoRequestActivity.this, R.array.request_options, android.R.layout.simple_spinner_item);    spinner.setAdapter(adapter);</code></pre><p>Inside requestinfo.xml,</p><pre><code>&lt;Spinner android:id=""@+id/spinner"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:textColor=""@android:color/darker_gray""            android:textSize=""12sp"" android:textStyle=""bold""            android:layout_marginLeft=""10dp"" android:layout_marginTop=""8dp"" /&gt;</code></pre>","504162","","504162","","2010-12-31 09:07:37","2012-04-06 08:02:59","Error while placing a spinner inside Activity Group","<android>","4","2","7","",""
"4568495","1","","","2010-12-31 06:19:01","0","388","<p>I want to capture network packages on android phones.At first i choose tcpdump to achieve this function,and it did on HTC phones because HTC contains tcpdump under system folder. But when i install on the Samsung phones,the function failed, becase Samsung phones don't have tcpdump under system folder. So, can somebody provide some ways to achieve this function by generial ways.(I mean that without building new img to reflash devices)</p><p>So, plz help!</p>","558998","","","","","2011-06-01 22:41:21","How to capture network packages on Android phones","<android><networking><packages><capture>","1","2","","",""
"4568529","1","","","2010-12-31 06:27:14","0","2846","<p>as3 air for android using flash CS5</p><p>my problem:  testing an AIR app on my droid 2 global (with slide out keyboard)using stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, handleOrientationChange);this is only fired when the i slide the keyboard out and not when I rotate the phone.I have tried this with the auto orientation on and off and with the aspect to portrait and landscape.</p><p>actually the auto orientation option does not seem to make a difference on or off.</p><p>I need the orientation to change when i rotate the phone. I know i can use the accelerometer to do this but the problem with that is when I click on a textField with the keyboard closed only the vertical keyboard pops up and i need the other one to pop up when holding the phone sideways. </p>","559041","","","","","2011-02-28 06:51:54","air for android - stage.setOrientation deprecated in AIR 2.5 so how do I do it now?","<android><air><adobe><orientation>","2","0","","",""
"4568536","1","","","2010-12-31 06:28:44","2","1111","<p>I am developing android application using titanium developer. I want to know the apk generated from titanium is a signed or unsigned apk ? and also i want to know is it  generated in the debug mode or release mode. These information i need for releasing my app into market.</p><p>If its unsigned then how do I sign the application?</p><p>If its in debug mode then how do I change into releasing mode?</p>","450596","","450596","","2010-12-31 06:35:40","2012-10-23 12:48:22","I want to know whether the apk generated from titanium is a signed or unsigned apk?","<android><titanium>","3","0","","",""
"4568558","1","","","2010-12-31 06:33:31","3","13072","<p>I am creating an Android app in which I'm drawing a view on a canvas. When the device's orientation changes, the activity restarts. I don't want it to.</p><p>How can I avoid restarting the activity when the orientation changes?</p>","559045","","23897","","2010-12-31 06:38:07","2013-02-08 11:28:16","How to avoid restarting activity when orientation changes on Android","<android><rotation><screen>","5","0","0","",""
"4568567","1","","","2010-12-31 06:36:02","0","916","<p>When I am sending real time audio from udp socket then there is an exception throw java.net.BindException : cannot assign requested address. Why?</p>","559047","","","","","2011-01-02 10:39:37","java.net.BindException","<android>","1","0","","",""
"4568571","1","","","2010-12-31 06:36:50","0","568","<p>I know this has been asked a ton, so my apologies. I have the following code, and cannot get the location, always a null response. I am trying to avoid a LocationListener in this instance because I am already using an update Service, and the location really doesn't have to be that fine, so the last known location is good enough. Thanks for the help.</p><pre><code>LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);String providers[] = {""gps"", ""network"", ""passive""};Location loc = null;for(String x : providers) {      loc = lm.getLastKnownLocation(x);    if(loc != null) break;  }if(loc != null) {    // do something, never reached}</code></pre>","559048","","","","","2011-07-11 15:03:56","Getting the location in Android programatically","<android><location>","2","0","1","",""
"4568586","1","","","2010-12-31 06:40:15","0","112","<p>I am creating a sample application using shared preference.I have 3 edittext,2 Buttons,I want to save data in database of android stimulator.How can i do it.Can anybody tell me.Thanks in advance......</p>","475349","","","","","2010-12-31 06:55:27","regarding saving values in database in android","<android>","1","2","","",""
"4568588","1","","","2010-12-31 06:40:54","2","4246","<p>I'm attempting to run python on a system that doesn't allow me to set environment variables.  Is there a commandline flag to python that will set PYTHONHOME?  I looked here: <a href=""http://docs.python.org/release/2.3.5/inst/search-path.html"" rel=""nofollow"">http://docs.python.org/release/2.3.5/inst/search-path.html</a> but didn't see anything.</p><p>So, hopefully something like this:</p><pre><code>python -magical_path_flag /my/python/install test.py</code></pre><p><strong>EDIT</strong></p><p>Thanks for the responses everyone.  I'm embarrassed to say I actually meant PYTHONHOME, not PYTHONPATH.  (That's what I deserve for asking a question at 1:30 AM.)  I've edited my quesiton.</p><p>Here's some more info.  I'm trying to get python running on Android.  I can run python -V no problem, but if I try and execute a script, I get:</p><pre><code>I/ControlActivity(18340): Could not find platform independent libraries &lt;prefix&gt;I/ControlActivity(18340): Consider setting $PYTHONHOME to &lt;prefix&gt;[:&lt;exec_prefix&gt;]</code></pre><p>Unfortunately when using the ProcessBuilder and changing the environment variables on Android, it says that they're not modifiable and throws an exception.  I'm able to pass all the command line flags I want, so I was hoping I could set PYTHONHOME that way.</p><p>I've tried creating a wrapping shell script which exports PYTHONHOME and then calls python but that didn't work.  (Got the same error as before.)</p><p>Thanks,</p><p>Gabe</p>","146446","","146446","","2010-12-31 15:11:13","2010-12-31 15:11:13","Is there a commandline flag to set PYTHONHOME?","<python><android>","3","1","3","",""
"4568611","1","","","2010-12-31 06:47:33","1","113","<p>a while ago I had a developer make an Android application for me. Now, there are some users reporting a bug. I've google'd a little and read something about a keystore. Is it possible for another developer rather than the original one to update this application?</p>","506151","","","","","2010-12-31 07:04:32","Updating Android Application","<android>","1","0","","",""
"4568623","1","4568881","","2010-12-31 06:51:10","2","2447","<p>I am newbie to android (on mac using eclipse). Please let me know how to create a view dynamically and add it to main view. </p><p>Context:</p><p>Actually I want to show a view of processing on the main screen when user has performed any action.</p>","419894","","995926","","2012-06-11 07:31:44","2012-06-11 07:31:44","How to dynamically create a view and add on main view in android?","<android>","1","0","2","",""
"4568632","1","4568659","","2010-12-31 06:53:09","22","9956","<p>I'm trying to create a custom attribute called Tag for all editable elements. I added the following to attrs.xml</p><pre><code>&lt;declare-styleable name=""Spinner""&gt;    &lt;attr name=""tag"" format=""string"" /&gt;&lt;/declare-styleable&gt;&lt;declare-styleable name=""EditText""&gt;    &lt;attr name=""tag"" format=""string"" /&gt;&lt;/declare-styleable&gt;</code></pre><p>I get an error saying ""Attribute tag has already been defined"" for the EditText. Is it not possible to create a custom attribute of the same name on different elements?</p>","161633","","","","","2014-02-06 10:42:08","Custom Attributes in Android","<android><custom-attributes>","2","0","3","",""
"4568674","1","","","2010-12-31 07:04:12","0","299","<p>I want to implement geo chat in my android application. Can anybody tell me how to implement geo chat in Android?</p><p>Please give me any reference documents or examples.</p>","416143","","23897","","2010-12-31 07:06:38","2012-04-20 14:40:09","How can I implement geochat in an Android application?","<android><android-widget>","0","4","","",""
"4568676","1","4571844","","2010-12-31 07:04:26","0","131","<p>When i created project before i could see the .java file on project file a cross mark is displayed and it is showing errors.Once I executed 'hello world' it ran successfully.</p>","497421","","","","","2010-12-31 19:03:28","Error in newly created android project","<android><android-emulator>","1","2","","",""
"4568686","1","","","2010-12-31 07:05:58","0","184","<p>I recently bought a domain on webfaction. I want to be able to perform third party requests from my Android phone to the hosting website. The code was running fine on my local machine, but when I try to use the production site I keep on getting the error: <code>405 - Not Allowed</code>.So my question is, do I need to provide the username and password for my website when I send the request from my Android device? I am using Django 1.2.4, so I know about the CSRF middleware, which I commented out, but I still get the error.</p>","522559","","23897","","2010-12-31 07:08:13","2011-01-16 18:12:32","webfaction third party requests","<android><django><third-party><webfaction>","1","0","","",""
"4568696","1","","","2010-12-31 07:08:23","-1","942","<ul><li>First get the Android SDK and unzip it somewhere on your hard drive</li><li>Add SDK_ROOT to your system variables pointing to /tools folder under the sdk</li><li>Run the emulator</li><li>Copy the apk file to /tools folder</li></ul><p>i followed above this procedure but i didn't get result ,what can i do ?</p>","559068","","47550","","2010-12-31 07:10:42","2010-12-31 08:17:06","how to run apk file in android","<android><apk>","1","2","0","",""
"4568708","1","4569910","","2010-12-31 07:11:45","0","194","<p>I want to insert images into my SDCard.So I used below code</p><p>m_cImagePath = ""/sdcard/""+ String.format(""%d.jpg"", System.currentTimeMillis());</p><pre><code>        FileOutputStream lObjOutStream = null;        try {            lObjOutStream = new FileOutputStream(m_cImagePath);            if (null != lObjOutStream &amp;&amp; null != finalBitmap) {                finalBitmap.compress(Bitmap.CompressFormat.JPEG, 85, lObjOutStream);                lObjOutStream.close();            }catch(FileNotFoundException fe){fe.printStackTrace();}</code></pre><p>Sometimes it is giving FileNotFoundException even my SDCard had memory.When I remove some images from sdcard again it is working smoothly.Why this Happend?How can i know that file is inserted successfully in SDCard and Is there any functionality in Java1.5 to know available space of the SDCard like java 1.6?How can i know file length which is not before inserting into the SDCard(I searched in google and found that </p><blockquote>  <p>""when the file is not physically there  then file.length() always gives 0""</p></blockquote><p>).But before inserting i want to know the length of the file.Then Comparing this space to available SDCard space is simple.</p><p>Note :I had an idea to use Unix command </p><blockquote>  <p>df sdcard</p></blockquote><p>using in </p><blockquote>  <p>Runtime class</p></blockquote><p>to found SDCard space.</p><p>Please give me an idea in this problem.</p><p>Regards,Android Developer</p>","486216","","","","","2010-12-31 11:50:22","FileNotFoundExcecption while inserting image into SDCard","<android>","1","0","","",""
"4568730","1","","","2010-12-31 07:18:25","0","211","<p>I am developing an app in and i have a html page on the webView in android. that html page would have lots of lines of text, no images. when i circle a particular part of  that text, the text within that circle should be highlighted and i need to find the co-ordinates of the circle. how do i do that in android. pls help me out.</p>","557038","","","","","2011-03-02 20:02:07","Circling and selecting a text","<android><circle>","1","0","","",""
"4568809","1","","","2010-12-31 07:35:48","1","2679","<p>i have displayed the images in grid view..but unable to connect to another screen by clicking the image..</p>","559076","","","","","2012-05-23 08:28:07","how to display new screen onclick event of images in grid view?","<android>","3","0","1","",""
"4568827","1","","","2010-12-31 07:40:17","0","90","<p>How can I add application preference in device setting. I want to my preference setting be part of device setting opinion. My application setting can be appeared or displayed in device setting list.</p><p>Any API i need to use or keyword?</p>","549771","","","","","2010-12-31 11:45:04","I add application preference in device setting","<android>","1","0","","",""
"4568871","1","","","2010-12-31 07:53:19","0","102","<p>I am having a simple list. I want on click of any view in a list.An animation should start.How can i do this??</p>","475349","","","","","2010-12-31 07:53:19","animations on click of a view in android","<android>","0","2","","",""
"4568872","1","4728401","","2010-12-31 07:53:19","3","604","<p>In the following Android sample, I have a set of JSON objects(referred to as templates) and I'm doing a sort of inheritance processing on them. If a JSON object has a key ""extends"", the corresponding value will refer to another JSON object. I just copy the mappings in the referred JSON object to the current one. Each property (referred to as component in the code) will have sub properties, so each sub property is copied individually.All the JSON objects are stored in a HashMap.EDIT: Posting sample code which demonstrates the issue.</p><pre><code>package com.trial;import java.util.HashMap;import java.util.Iterator;import org.json.JSONException;import org.json.JSONObject;import android.app.Activity;import android.os.Bundle;public class Trial extends Activity {    HashMap&lt;String, JSONObject&gt; templates = new HashMap&lt;String, JSONObject&gt;();    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            templates.put(""entity"", new JSONObject(""{\""Health\"":{\""health\"":50,\""maxHealth\"":100}}""));            templates.put(""unit"", new JSONObject(""{\""Health\"":{\""health\"":70},\""extends\"":\""entity\""}""));            Iterator&lt;String&gt; templatesIterator = templates.keySet().iterator();            while (templatesIterator.hasNext()) {                String templateName = templatesIterator.next();                JSONObject template = templates.get(templateName);                 if (template.has(""extends""))                    templates.put(templateName, processInheritance(template));            }        } catch (JSONException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    private JSONObject processInheritance(JSONObject template) throws JSONException {        if (template.has(""extends"")) {            //If current template extends from another template            String parentTemplateName = template.getString(""extends"");            template.remove(""extends"");            JSONObject parentTemplate = processInheritance(templates.get(parentTemplateName));            //Create a clone of the parent to which child properties/components can be added            JSONObject processedTemplate = new JSONObject(parentTemplate.toString());            Iterator&lt;String&gt; it = template.keys();            while (it.hasNext()) {                String componentName = it.next();                if (processedTemplate.has(componentName)) {                    //Component is already present. Loop through Component properties and make                    //specific replacements                    JSONObject componentData = template.getJSONObject(componentName);                    Iterator&lt;String&gt; it2 = componentData.keys();                    JSONObject processedComponentData = processedTemplate.getJSONObject(componentName);                     while (it2.hasNext()) {                        String propertyName = it2.next();                        processedComponentData.put(propertyName, componentData.get(propertyName));                    }                    processedTemplate.put(componentName, processedComponentData);                } else {                    //Component is not already present. Simply copy                    processedTemplate.put(componentName, template.get(componentName));                }            }            return processedTemplate;        } else {            return template;        }    }}</code></pre><p>On debugging I noticed that the code executes fine until after the while loop. Soon after the while loop, it jumps across the if/else and returns ""template"" instead of ""processedTemplate"". Even the resulting object indicates that ""template"" is being returned. I've tried clearing the binaries, recreating the emulator, and executing it on the actual device. The weird behavior persists. Could you someone tell me why this happens?</p><p>EDIT: The correct object IS being returned. My earlier comment that ""template"" was being returned was because of a bug where I was not saving the returned process object back into the HashMap. I was simply doing</p><pre><code>if (template.has(""extends""))    processInheritance(template));</code></pre><p>However the control still seems to jump across. An problem with Eclipse, I suppose.</p>","200821","","200821","","2011-01-20 20:43:18","2011-01-20 20:43:18","Weird problem with Android/Java method. Control seems to jump across if/else block","<java><android><recursion>","5","14","0","",""
"4568911","1","","","2010-12-31 08:02:42","3","623","<p>After googling I successfully get the <code>incoming_number</code> when there is an incoming call.But I still cannot find how to detect if the call is forwarded(redirected).</p><p>Is there some flag or something ?</p><p>Best Regards,Ivan</p>","559091","","1318946","","2014-02-12 04:49:04","2014-02-12 04:49:04","Android - How to detect if the incoming call is redirected?","<android><redirect><call><forward>","0","1","2","",""
"4568931","1","5239230","","2010-12-31 08:09:42","2","1538","<p>I have different images, say 100 images or so. Now, I want to apply animation on them. I want my ImageView to get each image after specified interval but when the change of image occurs, each image should FadeIn or FadeOut. I place my images in @drawable/[list_of_images].xml file as:</p><pre><code>&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android""android:oneshot=""false""&gt;&lt;item android:drawable=""@drawable/a1"" android:duration=""1000""/&gt;&lt;item android:drawable=""@drawable/a2"" android:duration=""2000""/&gt;&lt;item android:drawable=""@drawable/a3"" android:duration=""3000""/&gt;&lt;item android:drawable=""@drawable/a4"" android:duration=""500""/&gt;</code></pre><p></p><p>and then I can successfully change these images depending on their time interval in ImageView by using:</p><pre><code>public class AnimTest extends Activity{   AnimationDrawable myAnim;   public void onCreate(Bundle savedInstanceState)   {       super.onCreate(savedInstanceState);       setContentView(R.layout.anim);       ImageView myIV = (ImageView) findViewById(R.id.image_view);       myIV.setBackgroundResource(R.drawable.list_of_images.xml);       myAnim = (AnimationDrawable) myIV.getBackground();   }  public boolean onTouchEvent(MotionEvent event)  {      if (event.getAction() == MotionEvent.ACTION_DOWN)      {         myAnim.start();         return true;      }     return super.onTouchEvent(event);  }</code></pre><p>}</p><p>The problem is that I can't figure out on how to apply fade effect on every single image, while they are getting changed by the above animation. I can apply fade animation on whole list of images but cannot do this on every image. Am i going to the right direction to achieve this functionality? If not, please guide me to the right path.</p><p>Regards,Khawar</p>","559090","","","","","2011-03-08 22:36:43","Animation of different images in list","<android>","1","0","","",""
"4568940","1","4568992","","2010-12-31 08:12:43","1","2289","<p>i am getting chunks of bytes from server and i need to write them in a file without overwriting the old chunk. how can i do that? i am doing it this way..</p><pre><code>private void createMapFile(String fileName, byte mapBytes[]) throws IOException    {               File filePath = new File(Environment.getExternalStorageDirectory()+""/map/""+fileName);        PrintWriter pw = new PrintWriter(new FileOutputStream(filePath, true));          pw.print(mapBytes);          pw.flush();          pw.close(); }</code></pre><p>my this method takes the file name and chunk of bytes as argument. anytime i get new chunk from server this method gets called. by this method i cannot write the all chunks in a file.</p><p>any help will be appreciative.thanks</p>","397901","","","","","2010-12-31 08:30:55","how to write bytes in a file without overwriting it","<android><file><io>","2","0","1","",""
"4569102","1","4569582","","2010-12-31 08:56:36","2","2403","<p>I'm trying to play an audio in background from a WebView. This audio is given by a URL. I approached this by overriding the url loading. And it starts playing the audio, but many times the Media Player just stops. This happens around 30% of times, and this audio files are never longer than 30 seconds.</p><p>I tried with MP3, OGG and WAV, and it happens with any of them.</p><p>I also tried but first downloading the file and then playing it, instead of stream it, but doesn't work either.</p><p>This is a piece of code... to show you how it works:</p><pre><code>public boolean shouldOverrideUrlLoading(WebView view, String url) {    if (url.endsWith("".ogg"")){        AudioLoader audioLoader = new AudioLoader(url);        audioLoader.start();        return true;    }    else if (url.endsWith("".wav"")){        Uri tempPath = Uri.parse(url);        MediaPlayer player = MediaPlayer.create(interfazWeb, tempPath);        if (player != null){            player.start();        } else {            Log.e(TAG, ""No se puede abrir el audio:"" + url);        }        return true;    }    else if (url.endsWith("".mp3"")){        AudioLoader audioLoader = new AudioLoader(url);        audioLoader.start();        return true;    }else{        return super.shouldOverrideUrlLoading(view, url);    }}</code></pre><p>I've checked the audio file saved by ""AudioLoader"", and it's totally fine. And the WAV case is using my first attemp, play it with streaming.</p><p>Also tried SoundPool and AsyncPlayer... nothing works!!</p><p>So... this far I don't think is a communication, codec or buffer issue. My only tips are these log entries, which repeats for every time tha the problem happens, with all formats and all approaches:</p><pre><code>12-31 09:41:49.284: WARN/AudioFlinger(59): write blocked for 160 msecs, 20 delayed writes, thread 0xd7a812-31 09:41:49.554: WARN/TimedEventQueue(59): Event 6 was not found in the queue, already cancelled?</code></pre><p>Does anybody please have some clue? Or I'm just facing a bug/missfunction.</p><p>Have a happy 2011, specially if you're able to help me :P</p><p>Regards, Manuel.</p>","467900","","","","","2010-12-31 10:39:26","MediaPlayer not playing audio properly","<android><media-player>","1","0","","",""
"4569104","1","4569120","","2010-12-31 08:57:01","1","2755","<p>Is there a way to protect Android apk file so that the source codecannot be regenerated? Also, there are a number of network sniffersthat allow HTTP monitoring, is there a way to bypass these such thatthe incoming/outgoing network traffic could not be monitored?</p><p>I have read that code obfuscation, to some extent, is possible usingSourceForge's Proguard(<a href=""http://stackoverflow.com/questions/2531187/android-and-obfuscation"">Reference</a>).</p><p>What are other alternatives that I can look into?</p><p>Please advise.</p><p>Thanks. </p>","236128","","","","","2010-12-31 08:59:58","Protecting Android apk to prevent decompilation, network sniffing etc","<android><security><obfuscation><network-monitoring>","1","0","3","",""
"4569133","1","6091229","","2010-12-31 09:03:41","1","1941","<p>I have an app where the user saves a bunch of bitmaps in a folder on the SD card. I would like to add a feature where the user can export said bitmaps as a .gif file that is viewable say, in a text message. How can I accomplish this? </p>","413488","","321731","","2014-03-11 18:37:34","2014-03-11 18:37:34","Android make .Gif out of Bitmaps","<android><bitmap><save><export><gif>","1","0","2","",""
"4569160","1","4569235","","2010-12-31 09:09:48","0","606","<p>I want to set an array adapter, and cursor adapter, for one spinner. Is it possible?</p>","555910","","643977","","2012-04-13 22:43:06","2012-04-13 22:43:06","Is it possible to set two adapters for single spinner in Android?","<android>","2","0","","",""
"4569174","1","4659713","","2010-12-31 09:12:20","0","1445","<p>I am parsing KML with SAX and only first 2 attributes of Placemark tag are read correctly (name and description). The other 2 (style, coordinates) are empty or null. My test KML file looks like this:</p><pre><code>enter code here&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;kml xmlns=""http://www.opengis.net/kml/2.2"" xmlns:gx=""http://www.google.com/kml/ext/2.2""                  xmlns:kml=""http://www.opengis.net/kml/2.2"" xmlns:atom=""http://www.w3.org/2005/Atom""&gt;&lt;Document&gt;&lt;name&gt;Zaseden&lt;/name&gt;&lt;Style id=""msn_1""&gt;    &lt;IconStyle&gt;        &lt;Icon&gt;            &lt;href&gt;http://maps.google.com/mapfiles/kml/paddle/1.png&lt;/href&gt;        &lt;/Icon&gt;    &lt;/IconStyle&gt;&lt;/Style&gt;&lt;Style id=""msn_2""&gt;    &lt;IconStyle&gt;        &lt;Icon&gt;            &lt;href&gt;http://brandonkopp.com/DC_Photo_Project/DC_Photo_Project_files/green_placemark.jpg&lt;/href&gt;        &lt;/Icon&gt;        &lt;/IconStyle&gt;&lt;/Style&gt;&lt;Placemark&gt;    &lt;name&gt;Busy car 1&lt;/name&gt;    &lt;description&gt;Test car position&lt;/description&gt;    &lt;styleUrl&gt;#msn_1&lt;/styleUrl&gt;    &lt;Point&gt;        &lt;coordinates&gt;14.50316902804375,46.05190525505257,0&lt;/coordinates&gt;    &lt;/Point&gt;&lt;/Placemark&gt;&lt;Placemark&gt;    &lt;name&gt;Busy car 2&lt;/name&gt;    &lt;description&gt;Test car position 2&lt;/description&gt;    &lt;styleUrl&gt;#msn_1&lt;/styleUrl&gt;    &lt;Point&gt;        &lt;coordinates&gt;14.491353,46.080227,0&lt;/coordinates&gt;    &lt;/Point&gt; &lt;/Placemark&gt;&lt;Placemark&gt;    &lt;name&gt;Free car 1&lt;/name&gt;    &lt;description&gt;Test car position&lt;/description&gt;    &lt;styleUrl&gt;#msn_2&lt;/styleUrl&gt;    &lt;Point&gt;        &lt;coordinates&gt;14.529891,46.065087,0&lt;/coordinates&gt;      &lt;/Point&gt; &lt;/Placemark&gt;</code></pre><p></p><p>My parser class:</p><pre><code>package com.spremljaj.me;  public class Parser extends DefaultHandler{ public  static List&lt;Placemark&gt; placemarks; private Placemark currentPlacemark;   boolean inName;   boolean inDesc;   boolean inStyle;   boolean inCoor;   boolean inPoint;@Overridepublic void startDocument() throws SAXException {    Log.d(""XML"",""startDocument"");    placemarks = new ArrayList&lt;Placemark&gt;();}@Overridepublic void endDocument() throws SAXException {    Log.d(""XML"",""endDocument"");    //Log.d(""Velikost lista: "",Integer.toString(placemarks.size()));    Spremljaj.setList(placemarks); }/** Gets called on opening tags like:   * &lt;tag&gt;   * Can provide attribute(s), when xml was like:   * &lt;tag attribute=""attributeValue""&gt;*/ @Overridepublic void startElement(String uri, String localName, String qName,        Attributes attributes) throws SAXException {    super.startElement(uri, localName, qName, attributes);    // TODO Auto-generated method stub    if (localName.equalsIgnoreCase(""Placemark"")){        this.currentPlacemark = new Placemark();    }    else if (localName.equalsIgnoreCase(""name"") &amp;&amp; currentPlacemark != null){ //drugi pogoj je za primer zacetka kmlja kjer je opis stilov a je tudi tag z imenom name        Log.d(""XML"",""nameTag"");        inName=true;    }    else if (localName.equalsIgnoreCase(""description"")){        Log.d(""XML"",""descTag"");        inDesc=true;    }    else if (localName.equalsIgnoreCase(""styleUrl"")) {        inStyle=true;        Log.d(""XML"",""styleTag"");    }    else if(localName.equalsIgnoreCase(""coordinates"")){        inCoor=true;        Log.d(""XML"",""coorTag"");    }}/** Gets called on closing tags like:   * &lt;/tag&gt; */ @Overridepublic void endElement(String uri, String localName, String qName)        throws SAXException {    super.endElement(uri, localName, qName);    if (this.currentPlacemark != null){        if(localName.equalsIgnoreCase(""Placemark"")){ //ce pridemo do konca dodamo objekt v list            placemarks.add(currentPlacemark);                       }        if(localName.equalsIgnoreCase(""coordinates"")){ //samo za debug tale if            Log.d(""konecTaga"",""coor"");                      }    }    }@Overridepublic void characters(char[] ch, int start, int length) // method called with the text contents in between the start and end tags of an XML document element.        throws SAXException {    // TODO Auto-generated method stub    super.characters(ch, start, length);      String s = (new String(ch).substring(start, start + length));    if(inName) {        //Log.d(""textSize"",Integer.toString(s.length()));        currentPlacemark.setName(s);        inName=false;        //Log.d(""XML"",""Prebran tekst ""+s);          }    else if (inDesc) {        currentPlacemark.setDescription(s);                     inDesc=false;    }    else if (inStyle) {        currentPlacemark.setStyle(s);        inPoint=false;        //Log.d(""XML"",""Prebran tekst v stilu ""+s); TLE LAHK DA JE PROBLEM    }    else if (inCoor) {        //Log.d(""XML"",""Prebran tekst ""+s);         currentPlacemark.setCoordinates(s);        inCoor=false;        Log.d(""XML"",""dolzina koor ""+Integer.toString(s.length()));      }    //Log.d(""XML"",""Prebran tekst ""+s);}</code></pre><p>}</p><p>I have no idea what is going wrong, because i am doing the same thing for all four attributes of Placemark.</p>","324417","","","","","2011-02-21 11:40:42","Problem with parsing KML file with SAX","<android><parsing><sax><kml>","1","1","0","",""
"4569187","1","5061422","","2010-12-31 09:15:39","0","2671","<p>is it possible to play .swf file and .flv files in android?? if yes then please provide code for that</p>","432559","","","","","2011-07-31 14:17:45","is it possible to play .swf file and .flv files in android?? if yes then please provide code for that","<android>","3","0","","2012-08-18 05:45:22",""
"4569194","1","","","2010-12-31 09:18:13","1","862","<p>I am new on Android development and meet with a tough problem when trying to implement a graphic drawing on a View.</p><p>What I want to do is drawing a chart in a View. I put a View in a ScrollView and override the onDraw method of View and do drawing in onDraw. The most important thing is that the chart needs scroll functions. The View's onDraw method I override includes the coordinate calculation and many necessary elements drawing (line, dot, axis, label, etc) in a chart. As you can imagine, I calculate and draw the whole chart not only the visible area but the whole area including offscreen. Now the problem is that onDraw method get called again and again when I scroll the ScrollView, so that it causes a performance issue and the scroll view running very slow. I was trying to find a way to prevent the calling of onDraw after first call but no lucky. I have to calculate the same thing again and again once onDraw get called which is not necessary.</p><p>Do you guys have any answer? Thanks.</p>","559104","","","","","2010-12-31 09:30:36","View's onDraw method get called again and again on Android 2.2","<android><charts><ondraw>","1","0","","",""
"4569250","1","","","2010-12-31 09:28:03","4","2683","<p>I am using a ListView with custom adapter it simply has one TextView</p><pre><code>&lt;TextView   xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/list_item_content""   android:background=""@drawable/list_item1""   android:layout_width=""fill_parent"" android:layout_height=""""wrap_content"" /&gt;</code></pre><p>Heres my selector background:</p><pre><code>&lt;selector  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true"" android:state_enabled=""false""    android:state_pressed=""true""    android:drawable=""@drawable/draw_list_item1"" /&gt;&lt;item android:state_focused=""true"" android:state_enabled=""false""    android:drawable=""@drawable/draw_list_item_focused"" /&gt;&lt;item android:state_focused=""true"" android:state_pressed=""true""    android:drawable=""@drawable/draw_list_item_selected"" /&gt;&lt;item android:state_focused=""false"" android:state_pressed=""true""    android:drawable=""@drawable/draw_list_item_selected"" /&gt;&lt;item android:state_focused=""true""    android:drawable=""@drawable/draw_list_item_focused"" /&gt;&lt;item android:drawable=""@drawable/draw_list_item1""/&gt;&lt;/selector&gt;</code></pre><p>The problem is when I am setting <code>TextView</code> properties:<code>android:clickable=""true""</code> and <code>android:focusable=""true""</code></p><p>It is then I see my focused version of background, but setting these causes list items to no more respond to clicks and long clicks. When these 2 properties are removed all ListItems respond to clicks and long clicks.</p><p>What should be done which would make focusable background visible and click responds both to work.</p><p>I have tried calling <code>getListView().setItemsCanFocus(true)</code> but problems still persists.</p>","447238","","","","","2010-12-31 09:45:50","Android ListView when Items are Focusable,disables clicks","<android><listview><background><click><focusable>","1","0","2","",""
"4569308","1","4624512","","2010-12-31 09:37:21","0","529","<p>I had tested my Android application in Samsung GT 15801 device using Eclipse. One day I needed to reinstall samsung Kies. After that I tried to install application using Eclipse it is not in the ""connected device"" list anymore.</p><p>Kies shows it's product number (GT 15801) but still I cannot access it inside Eclipse.</p><p>(I am using Windows 7)</p>","482604","","35060","","2010-12-31 09:42:34","2011-01-07 10:21:06","Samsung GT 15801 is not recognised by Eclipse","<android><eclipse>","1","0","","",""
"4569309","1","4569885","","2010-12-31 09:37:40","0","33","<p>In the AndroidManifest.xml, I can add the priority attributes in , I want to know if I can get the value of priority use code</p>","233618","","3383428","","2014-03-18 08:41:32","2014-03-18 08:42:05","how to get the proritity in java code","<android><android-manifest>","2","0","","",""
"4569381","1","","","2010-12-31 09:52:01","2","267","<p>Is there any callback mechanism on the Android SDK that will notify my application when I insert/remove a microSD card?</p><p>Thanks in advance,Parth</p>","532340","","","","","2010-12-31 10:06:37","Android : Callback on insertion of microSD","<android>","1","0","","",""
"4569388","1","4677943","","2010-12-31 09:53:33","0","232","<p>I want to add image buttons in a table layout at run time.My table contains 100 rows and 20 columns so i also want to add scroll in that screen.I want to scroll that images at Horizontally and vertically also because my rows and columns are high.After every 20 rows i want to add button with full width of the screen.So how can i do that.Please help me. </p>","537819","","","","","2011-01-13 08:07:43","Android TableLayout","<android><android-layout>","1","0","","",""
"4569397","1","4569481","","2010-12-31 09:55:36","0","369","<p>I have created a table layout in xml. At runtime, i am using a condition where in first case i am filling table layout. However in second case i am again adding contents to the same layout. And they get added up at the end of layout. However i need to clear the previous contents of layout i.e. of first case by contents of second case. Any suggestions ???</p><p>Regards</p>","541786","","","","","2010-12-31 10:15:22","Override contents of table layout at runtime","<android>","1","0","1","",""
"4569421","1","","","2010-12-31 10:02:04","0","1516","<p>public int read (byte[] audioData, int offsetInBytes, int sizeInBytes).</p><p>This method reads audio data from the audio hardware for recording into a buffer.</p><p>Its Parameters are :   audioData the array to which the recorded audio data is written.  offsetInBytes index in audioData from which the data is written expressed in bytes.  sizeInBytes the number of requested bytes.</p><p><strong>It Returns   the number of bytes that were read</strong> or or ERROR_INVALID_OPERATION if the object wasn't properly initialized, or ERROR_BAD_VALUE if the parameters don't resolve to valid data and indexes. The number of bytes will not exceed sizeInBytes. </p><p>I have written this method in my code like this :int num;byte[] buf = new byte[160];num = record.read(buf, 0, 160);</p><p>The problem is that it always returns 160 (i.e. the requested byte to be read) not less than 160 even if the data is not available. what's the problem? help me. Thanks in advance.</p>","549929","","1534123","","2012-10-26 15:44:17","2013-08-23 07:51:30","problem of read method in AudioRecord class","<android><android-audiorecord>","2","5","2","",""
"4569437","1","4569878","","2010-12-31 10:05:50","0","707","<p>This might be a really stupid question, but I can't find any information regarding this.</p><p>I have 4 Layouts inside a view flipper, and I switch between them manually, using the setDisplayedChild. This is working perfectly, and exactly what I need.</p><p>My question is, is there a built-in way of managing which is the next &amp; previous views? I could use the built-in methods of the ViewFlipper, to move to the next/previous child. However there will be the case when I want to move from child 1, directly to child 4.</p><p>I have some code in place, which manages it quite well, just curious if the SDK has something built in?</p>","383035","","","","","2010-12-31 11:41:56","Managing Views inside ViewFlipper?","<android>","1","0","","",""
"4569460","1","","","2010-12-31 10:11:53","0","623","<p>Whether system.gc will avoid android's out of memory exception for bitmap?</p>","1131639","","260990","","2010-12-31 10:14:05","2010-12-31 10:14:05","android out of memory","<java><android><garbage-collection>","1","2","","",""
"4569671","1","","","2010-12-31 11:00:05","3","1463","<p>I've been trying to debug an android crash that is occurring without a Java Stack Trace... Java Stack Trace bugs are very easy for me to fix... but this bug I'm getting seems to be crashing inside the ""NDK"" or whatever it is the deep internals of Android are called... I've made no modifications to the NDK btw... I just dunno what else to call that layer hehe.</p><p>Anyway I'm mainly looking for advice on deep-debug methods, rather than help with this specific problem... because I doubt I can post all the source code involved... so really I just need to know how to set breakpoints at the deep layers or whatever other methods there are to trace deep-crashes to their source... so I will briefly describe the bug and then post a LogCat.</p><p>I have an app with 7 Activities</p><pre><code>Activity_INTROActivity_EULAActivity_MAINActivity_ContactActivity_NewsActivity_LibraryActivity_More</code></pre><p>INTRO is the initiating one... it fades in some company logos... after displaying them for a set time it jumps to the EULA activity... after the user accepts the EULA, it jumps to MAIN... MAIN then creates a TabHost and populates it with the 4 remaining activities</p><p>now heres the thing... when I click on say, the More tab of the TabHost, the app pauses for a few seconds and then hard-crashes... no java stack trace, but an actual ASM level trace with the registers and IP and stack... the same thing occurs no matter which tab I select, Contact, News, Library, More... all of them crash with the same hard-crash</p><p>if however I set the manifest to start the app at Activity_MAIN, bypassing the INTRO and EULA, then these crashes do not occur... so something is lingering from those opening activities that is somehow hosing the TabHost'ed Activities... and I'm wondering what the hell that could be... because I'm using finish() on those activites when they need to jump... in fact here is how I'm doing it let me know if you see any bugs:</p><p>when jumping from INTRO to EULA I do:</p><pre><code>//Display the EULAIntent newIntent = new Intent (avi, Activity_EULA.class);startActivity (newIntent);finish();and EULA to MAIN:Intent newIntent = new Intent (this, Activity_Main.class);startActivity (newIntent);finish();</code></pre><p>anyway, here is the hard crash log... please let me know if there is some way I can reverse engineer either<code>/system/lib/libcutils.so</code> or <code>/system/lib/libandroid_runtime.so</code>, because I think the crash is happening in one of them... i think its happening in the libandroid_runtime in fact.... anyway on to the log:</p><pre><code>12-25 00:56:07.322: INFO/DEBUG(551): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***12-25 00:56:07.332: INFO/DEBUG(551): Build fingerprint: 'generic/sdk/generic/:1.5/CUPCAKE/150240:eng/test-keys'12-25 00:56:07.362: INFO/DEBUG(551): pid: 722, tid: 723  &gt;&gt;&gt; com.killerapps.chokes &lt;&lt;&lt;12-25 00:56:07.362: INFO/DEBUG(551): signal 11 (SIGSEGV), fault addr 0000000412-25 00:56:07.362: INFO/DEBUG(551):  r0 00000004  r1 40021800  r2 00000004  r3 ad3296c512-25 00:56:07.372: INFO/DEBUG(551):  r4 00000000  r5 00000000  r6 ad342da5  r7 41039fb812-25 00:56:07.372: INFO/DEBUG(551):  r8 100ffcb0  r9 41039fb0  10 41e014a0  fp 0000107112-25 00:56:07.382: INFO/DEBUG(551):  ip ad35b874  sp 100ffc98  lr ad3296cf  pc afb045a8  cpsr 0000001012-25 00:56:07.552: INFO/DEBUG(551):          #00  pc 000045a8  /system/lib/libcutils.so12-25 00:56:07.572: INFO/DEBUG(551):          #01  lr ad3296cf  /system/lib/libandroid_runtime.so12-25 00:56:07.582: INFO/DEBUG(551): stack:12-25 00:56:07.582: INFO/DEBUG(551):     100ffc58  00000000  12-25 00:56:07.592: INFO/DEBUG(551):     100ffc5c  001c5278  [heap]12-25 00:56:07.602: INFO/DEBUG(551):     100ffc60  000000da  12-25 00:56:07.602: INFO/DEBUG(551):     100ffc64  0016c778  [heap]12-25 00:56:07.602: INFO/DEBUG(551):     100ffc68  100ffcc8  12-25 00:56:07.602: INFO/DEBUG(551):     100ffc6c  001c5278  [heap]12-25 00:56:07.612: INFO/DEBUG(551):     100ffc70  427d1ac0  12-25 00:56:07.612: INFO/DEBUG(551):     100ffc74  000000c1  12-25 00:56:07.612: INFO/DEBUG(551):     100ffc78  40021800  12-25 00:56:07.612: INFO/DEBUG(551):     100ffc7c  000000c2  12-25 00:56:07.612: INFO/DEBUG(551):     100ffc80  00000000  12-25 00:56:07.612: INFO/DEBUG(551):     100ffc84  00000000  12-25 00:56:07.622: INFO/DEBUG(551):     100ffc88  00000000  12-25 00:56:07.622: INFO/DEBUG(551):     100ffc8c  00000000  12-25 00:56:07.622: INFO/DEBUG(551):     100ffc90  df002777  12-25 00:56:07.632: INFO/DEBUG(551):     100ffc94  e3a070ad  12-25 00:56:07.632: INFO/DEBUG(551): #00 100ffc98  00000000  12-25 00:56:07.632: INFO/DEBUG(551):     100ffc9c  ad3296cf  /system/lib/libandroid_runtime.so12-25 00:56:07.632: INFO/DEBUG(551):     100ffca0  100ffcd0  12-25 00:56:07.642: INFO/DEBUG(551):     100ffca4  ad342db5  /system/lib/libandroid_runtime.so12-25 00:56:07.642: INFO/DEBUG(551):     100ffca8  410a79d0  12-25 00:56:07.642: INFO/DEBUG(551):     100ffcac  ad00e3b8  /system/lib/libdvm.so12-25 00:56:07.652: INFO/DEBUG(551):     100ffcb0  410a79d0  12-25 00:56:07.652: INFO/DEBUG(551):     100ffcb4  0016bac0  [heap]12-25 00:56:07.662: INFO/DEBUG(551):     100ffcb8  ad342da5  /system/lib/libandroid_runtime.so12-25 00:56:07.662: INFO/DEBUG(551):     100ffcbc  40021800  12-25 00:56:07.662: INFO/DEBUG(551):     100ffcc0  410a79d0  12-25 00:56:07.662: INFO/DEBUG(551):     100ffcc4  afe39dd0  12-25 00:56:07.662: INFO/DEBUG(551):     100ffcc8  100ffcd0  12-25 00:56:07.662: INFO/DEBUG(551):     100ffccc  ad040a8d  /system/lib/libdvm.so12-25 00:56:07.672: INFO/DEBUG(551):     100ffcd0  41039fb0  12-25 00:56:07.672: INFO/DEBUG(551):     100ffcd4  420000f8  12-25 00:56:07.672: INFO/DEBUG(551):     100ffcd8  ad342da5  /system/lib/libandroid_runtime.so12-25 00:56:07.672: INFO/DEBUG(551):     100ffcdc  100ffd48  12-25 00:56:07.852: DEBUG/dalvikvm(722): GC freed 367 objects / 15144 bytes in 210ms12-25 00:56:08.081: DEBUG/InetAddress(722): www.akillerapp.com: 74.86.47.202 (family 2, proto 6)12-25 00:56:08.242: DEBUG/dalvikvm(722): GC freed 62 objects / 2328 bytes in 122ms12-25 00:56:08.771: DEBUG/dalvikvm(722): GC freed 245 objects / 11744 bytes in 179ms12-25 00:56:09.131: INFO/ActivityManager(577): Process com.killerapps.chokes (pid 722) has died.12-25 00:56:09.171: INFO/WindowManager(577): WIN DEATH: Window{43719320 com.killerapps.chokes/com.killerapps.chokes.Activity_Main paused=false}12-25 00:56:09.251: INFO/DEBUG(551): debuggerd committing suicide to free the zombie!12-25 00:56:09.291: DEBUG/Zygote(553): Process 722 terminated by signal (11)12-25 00:56:09.311: INFO/DEBUG(781): debuggerd: Jun 30 2009 17:00:5112-25 00:56:09.331: WARN/InputManagerService(577): Got RemoteException sending setActive(false) notification to pid 722 uid 10020</code></pre>","219470","","130929","","2010-12-31 11:49:03","2010-12-31 11:49:03","how to debug ""deep"" crashes in Android?","<android>","2","0","0","",""
"4569676","1","","","2010-12-31 11:00:55","0","953","<p>I have to configure a APN from my application directly. The inputs are hardcoded and the application will automatically configure and connect without any user intervention.</p><p>Is it possible to do in android?Could you please help with a sample code?</p><p>Thanks !!</p>","544631","","","","","2012-01-24 19:00:06","How to configure a APN from an application?","<android>","0","3","1","",""
"4569683","1","4569792","","2010-12-31 11:03:04","13","3951","<p>I'm setting up an auto build server, and need to install an Android SDK. I'm working over SSH, of course. But <code>tools/android update sdk</code> wants to start a Java GUI. Any other way to install an SDK?</p>","163697","","2050","","2014-03-24 00:20:15","2014-03-24 00:20:15","How to install Android SDK on Linux using CLI only?","<android><linux><command-line><continuous-integration>","3","0","1","",""
"4569697","1","4569855","","2010-12-31 11:05:55","1","121","<p>I'm working on an Android project using maven. I searched unsuccessfully on the known public repositories. Would appreciate if someone can let me know about this.</p>","559204","","36007","","2011-06-15 22:56:43","2011-06-15 22:56:43","Is the Android SDK available in any Maven public repositories?","<android><maven>","2","0","","",""
"4569705","1","","","2010-12-31 11:08:10","0","184","<p>I have created the TabHost in my application and I have four tabs in it. I have already created four different classes for the four tabs of the TabHost. All the four tabs are supposed to show the different views when you select( or Click) them.</p><p>In one of the Tab(Tab number 4) named ""Info"" of TabHost, I just want to open the WebPage that displays the Information of the application I am developing. </p><p>I have the URL for that webpage but I don't know how should I open that WebPage by clicking or selecting the forth Tab.</p><p>If anyone knows it, please tell me.</p><p>Thanks,david</p>","422859","","","","","2010-12-31 11:14:10","opening the WebPage on clicking the TabHost","<android><webpage><android-tabhost>","1","0","","",""
"4569717","1","4569849","","2010-12-31 11:10:37","1","3303","<p>Is there a way to use the startManagingCursor() within a service instead of an activity, with the same results (as shown <a href=""http://developer.android.com/reference/android/app/Activity.html#startManagingCursor%28android.database.Cursor%29"" rel=""nofollow"">here</a>)?</p><p>More specifically, i would like to manage a given Cursor's lifecycle based on a service's lifecycle. For example, when the service is destroyed, it will automatically call deactivate() on the given Cursor. Also, when the service is created/starts again, it will call requery() method.</p><ul><li>Is it feasible by using an otherappropriate method implemented in theService.class?</li><li>Is it feasible in some other way?</li><li>Or, is it pointless at all?</li></ul>","485328","","","","","2010-12-31 11:35:25","startManagingCursor() in a service?","<android><sqlite><service><activity><cursor>","1","0","1","",""
"4569751","1","4613804","","2010-12-31 11:17:35","3","3667","<p>I using listviews and expandedviews that has dividers and I can set them but on spinner its looks like it is no divider between items.</p><p>Someone that has a idea of how to fix this?</p>","553770","","321731","","2013-10-31 17:58:59","2013-10-31 17:58:59","How to show divider between spinner items?","<android><android-layout><android-spinner><divider>","2","0","","",""
"4569842","1","","","2010-12-31 11:34:27","0","556","<p>I am using a ListActivity and this throws Null Pointer Exception</p><pre><code>private ContextWrapper ctx;return ctx.getContentResolver().query(                Data.CONTENT_URI,                new String[] {                    Data.DATA1                },                Data.RAW_CONTACT_ID + ""="" + this.getId() + "" AND "" + Data.MIMETYPE + ""= '"" + mimetype                        + ""'"", null, null);</code></pre><p>ctx is not initialized , what should be initialized to ?</p>","557072","","","","","2010-12-31 18:56:31","Null pointer Exception in ContextWrapper","<android>","1","0","","",""
"4569887","1","","","2010-12-31 11:44:17","0","154","<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: Permission denied: connect</p>","559225","","","","","2010-12-31 11:56:02","SDK problem with installation","<android>","1","0","","",""
"4569924","1","4570565","","2010-12-31 11:52:40","0","1370","<p>Is it possible to open a URL without having the browser open up the link?</p><p>I have followed a few tutorials but cannot manage this task</p><p>The url i'am opening is a media content url (.dd) so i do not need to have the browser display anything, only access the url to then trigger the download.</p><p>Here is the code which opens the url in a browser window then performs the download, but how do i open the URL without opening a browser window, almost like it is opening in the background?</p><p>Hope someone can show me how?</p><p>Thankyou, Lucy</p><pre><code>Button openURLLButton = (Button) findViewById(R.id.save); // Retrieve the button from the XML file    openURLButton.setOnClickListener(new View.OnClickListener() {  //Add a listener for when the button is pressed        public void onClick(View v) {            openUrl();                  }    });}protected void openUrl() {    String url = ""http://domain.com/download.dd"";     Intent i = new Intent(Intent.ACTION_VIEW); // Create a new intent - stating you want to 'view something'    i.setData(Uri.parse(url));  // Add the url data (allowing android to realise you want to open the browser)    startActivity(i); // Go go go!}</code></pre><p>}</p>","558558","","558558","","2010-12-31 14:20:13","2010-12-31 17:42:06","Android: Open URL with button for downloadable media but without Opening a browser window. How?","<android><uri>","1","2","","",""
"4569935","1","7047155","","2010-12-31 11:54:19","2","1039","<p>When I try to use a SlidingDrawer in the horizontal orientation I get a space between the handler and the content. Any idea how I can get rid of it? In the vertical orientation I do not get a space.</p><pre><code>&lt;SlidingDrawer    android:id=""@+id/module_trafic_map_drawer""    android:layout_width=""wrap_content""    android:layout_height=""match_parent""    android:orientation=""horizontal""    android:topOffset=""0dp""    android:bottomOffset=""0dp""    android:handle=""@+id/module_trafic_map_handle""    android:content=""@+id/module_trafic_map_content""&gt;    &lt;ImageView        android:id=""@id/module_trafic_map_handle""        android:layout_width=""wrap_content""        android:layout_height=""match_parent""         android:src=""@drawable/trafic_info_popup_right""    /&gt;    &lt;WebView        android:id=""@+id/module_trafic_map_content""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""                /&gt;&lt;/SlidingDrawer&gt;</code></pre>","551492","","551492","","2011-01-07 09:21:49","2011-08-12 22:52:58","Space between handler and content in a SlidingDrawer","<android><slidingdrawer><android-sdk-1.6>","1","3","","",""
"4570018","1","","","2010-12-31 12:10:57","2","562","<p>I am an experienced Flex and Air Developer and love Android having owned a G1, a milestone (Droid), a Nexus One, a Galaxy S and now a Nexus S. Understandably I am interested in developing Flex applications for Android.</p><p>I have just started working through the flex for android in 90 mins tutorial here:</p><p><a href=""http://coenraets.org/flexandroid90/FlexAndroid90Minutes.pdf"" rel=""nofollow"">http://coenraets.org/flexandroid90/FlexAndroid90Minutes.pdf</a></p><p>The very first step says that I have to create a Flex Mobile Project.</p><p>I was under the impression that the whole point of Air is that the same application could run on many different platforms. I was intending on creating an air app with different skins that could be swapped in and out depending on the platform it was running on. This seems to imply that I will have to compile my Air app once for desktop and once for mobile.</p><p>This isn't the end of the world but it's not quite how I expected it to work. I suppose that if I am creating mobile specific skins then I may as well create a mobile specific app.</p><p>Is it possible to create one Air app that will run on both mobile and desktop? Is this a good idea?</p>","151770","","","","","2010-12-31 17:20:50","Developing Air (Flex) Applications for Android and Desktop","<android><flex><air>","2","0","","",""
"4570035","1","4571808","","2010-12-31 12:15:13","1","874","<p>instead of  sqlite openhelper we can able to create,delete,update database in android then what is the purpose of sqlite openhelper can any body explain please.</p>","555910","","","","","2010-12-31 18:52:28","what is the purpose of openhelper in android sqlite?","<android><sqlite>","1","0","","",""
"4570084","1","","","2010-12-31 12:29:04","1","2709","<p>I am new to android application development, I am finding it difficult to debug my program I am always getting some abstract message like ""your application stopped working"" I need to know exactly. I have read there are many ways to debug. What I need to know is the way which will be easy for beginners like me.</p>","553670","","","","","2010-12-31 12:44:05","How to debug android application using android sdk?","<android>","2","2","","",""
"4570107","1","4570171","","2010-12-31 12:34:48","1","390","<p>Here's something that's got me a bit stumped but intrigued all the same. In my Android game I have various Levels that extend the superclass Level. What I am trying to do is build a levelDirectory (based on the Singleton DP) that essentially is an object that has a HashMap object within it that stores all the Level subclasses. Here is my question:</p><p>We're all familiar with the enhanced for loop, but how can I write something that would be the equivalent of</p><pre><code>for(Level l : An Array Of Every Level Subclass In My Project that is an Extension of the Level Superclass){HashMap.put(l.name, l);}</code></pre><p>I am trying to build a system that can dynamically update itself when I add more and more level subclasses. I know having a method in Level that submitted itself to the static Directory and was called in the Level's constructor is an option, But I'm just wondering whether there is a way of doing what I said above in that enhanced for loop?</p><p>Many thanks</p>","300037","","300037","","2010-12-31 12:43:55","2010-12-31 14:55:19","A Way Of Saying ""For All Subclasses In My Project That Extend This Superclass""?","<java><android>","6","1","","",""
"4570127","1","","","2010-12-31 12:39:57","0","1812","<pre><code>   I have designed a custom listview. In that view i have one textview and two edittext fields. when i am clicking on the individual rows in listview that perform another activity(i.e another page will open). But i cannot perform onclick action on my listview.</code></pre><p>i have wrote some code but its not working. i have shown that code as below.</p><pre><code>public void onCreate(Bundle savedInstanceState){       super.onCreate(savedInstanceState);       setContentView(R.layout.sharefolioedit);       getList();           lv.setAdapter(new EfficientAdapter(this));            lv = getListView();    lv.setClickable(true);             lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {      public void onItemClick(AdapterView&lt;?&gt; parentView, View childView,      int position, long id) {      Intent intent = new Intent(CategoryList.this,AddSubCategoryList.class);      startActivity(intent);      }       }</code></pre>","552978","","","","","2012-10-11 11:37:46","how can i perform onclick action on listview?","<android><listview><edittext>","1","2","1","",""
"4570146","1","","","2010-12-31 12:43:29","1","1039","<p>How to add libgdx.zip file in eclipse for my android game application using libgdx framework.</p>","392339","","","","","2010-12-31 17:36:23","add libgdx.zip file in eclipse","<android>","1","0","","",""
"4570162","1","","","2010-12-31 12:45:49","0","981","<p>I want to create a pocket reference application. So, much of the content would be texts, linkbuttons and images. </p><ul><li><p>I wonder where is a good place to put all of the contents. I could place it hard-coded on the source code, So, when a user click a linkbutton, a new view will be opened and in the source code I specify the TextView and setText, etc. But I think it's not a good idea. Can I put the content in an xml file or in a database? Which one is better for this case?</p></li><li><p>I see that we are encouraged to put layout in main.xml. But, from what I read, the xml layout is static, what if I want to put some TextView, but I don't know how many TextView would be displayed, because the content would be loaded dynamically/programmatically?</p></li></ul><p>Thank you. </p>","559255","","","","","2013-07-03 04:41:35","Android Dynamic Content Design","<android>","2","0","","",""
"4570236","1","4570977","","2010-12-31 12:59:18","6","28792","<p>I have situation where I want to change layout of activity after 3 seconds. Ho can I do that?For example application starts with splashscreen that will run for 3 seconds then automatically switch layout to application's first screen layout. This should happen in the same activity, any ideas?</p><p>Thanks</p>","340002","","","","","2013-07-26 13:10:37","Android change layout dynamically","<android><activity>","5","0","9","",""
"4570456","1","4570528","","2010-12-31 13:50:14","3","567","<p>Who knows what is this widget Twitter application uses? How to create one?</p><p><img src=""http://i.stack.imgur.com/VdnVN.png"" alt=""alt text""></p>","397991","","397991","","2010-12-31 15:03:40","2011-01-01 05:22:10","Twitter UI control","<android>","1","3","4","",""
"4570471","1","4570509","","2010-12-31 13:54:31","0","693","<p>I have been killing myself trying to develop an algorithm to determine the positions of the cells in a grid by which row or column they are in.</p><p>For example, I have an 8x8 grid and I need to determine all of the positions of the cells in row 3.</p><p>The issue that I have is that, without alot of loops, I need to figure out a way to map the position clicked to the row and column that contain that cell.</p><p>Here is what I did to create an ArrayList of the cells:</p><pre><code>public class GameBoard {public ArrayList&lt;Row&gt; rows = new ArrayList&lt;Row&gt;();public ArrayList&lt;Column&gt; columns = new ArrayList&lt;Column&gt;();private int maxPositions;public GameBoard(int rowCount, int colCount) {    this.maxPositions = (rowCount * colCount) - 1;    for(int x = 0;x &lt; rowCount;x++){        Row row = new Row(x);        row.cells.addAll(this.getRowCells(x, colCount));        rows.add(row);    }    for(int x = 0;x &lt; colCount;x++){        Column column = new Column(x);        column.cells.addAll(getColumnCells(x, colCount));        columns.add(column);    }}private ArrayList&lt;Cell&gt; getRowCells(int rowId, int colCount) {    ArrayList&lt;Cell&gt; row_cells = new ArrayList&lt;Cell&gt;();    int first_position  = ((rowId * colCount) -1);    Cell cell = new Cell();    cell.id = first_position;    row_cells.add(cell);    int x = 1;    while(x &lt; colCount) {        cell = new Cell();        cell.id = first_position + x;        row_cells.add(cell);        x++;    }    return row_cells;       }private ArrayList&lt;Cell&gt; getColumnCells(int columnId, int rowCount) {    ArrayList&lt;Cell&gt; col_cells = new ArrayList&lt;Cell&gt;();    int first_position  = columnId;    Cell cell = new Cell();    cell.id = first_position;    col_cells.add(cell);    int x = 1;    while(x &lt; rowCount) {        cell = new Cell();        cell.id = rows.get(x).cells.get(columnId).id;        col_cells.add(cell);        x++;    }    return col_cells;}public Cell getColumnNextCell(int position, int columnId) {    Cell cell = null;    if ((position &gt; -1) &amp;&amp; (position &lt;= maxPositions)) {        cell = columns.get(columnId).cells.get(position + 1);    }    return cell;}public Cell getColumnPreviousCell(int position, int columnId) {    Cell cell = null;    if ((position &gt; 0) &amp;&amp; (position &lt;= maxPositions)) {        cell = columns.get(columnId).cells.get(position - 1);    }    return cell;}public Cell getRowNextCell(int position, int rowId) {    Cell cell = null;    if ((position &gt; -1) &amp;&amp; (position &lt;= maxPositions)) {        cell = rows.get(rowId).cells.get(position + 1);    }    return cell;}public Cell getRowPreviousCell(int position, int rowId) {    Cell cell = null;    if ((position &gt; 0) &amp;&amp; (position &lt;= maxPositions)) {        cell = rows.get(rowId).cells.get(position - 1);    }    return cell;}</code></pre><p>}</p><p>As you can see with the methods like getColumnNextCell() through getRowPreviousCell() the logic is a mess and I am stuck on how to determine the column and row of the clicked cell (as I explained). Any help would be greatly appreciated.</p><p>For clarification the Row and Column objects are identical. They look like this.</p><pre><code>public class Column {public int id;public ArrayList&lt;Cell&gt; cells = new ArrayList&lt;Cell&gt;();public Column(int idx) {    this.id = idx;}</code></pre><p>}</p>","386654","","","","","2012-01-06 22:44:25","Algorithm help needed - rows/columns in a grid","<android>","2","0","","",""
"4570476","1","","","2010-12-31 13:55:10","0","323","<p>Can someone explain me how to control one application from another application? I'm running a music player in an app1 using service class. And I want to stop that music player from another app.,i.e app2. But, I'm fallin short o the concept.</p>","540315","","1108213","","2012-03-16 09:33:27","2012-03-16 09:33:27","accessing one app from another app","<android><android-sdk-2.2>","2","0","","",""
"4570560","1","4570670","","2010-12-31 14:18:03","0","77","<p>I have the following problem:</p><p>I have a RawContactID and want to get every information about this contact. I run a query like this:<pre><code>String selection = ContactsContract.RawContactsEntity.RAW_CONTACT_ID +"" = ?"";String[] selectionArgs = new String[]{contacts[0].get(0)};Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, selection, selectionArgs, null);</pre></code></p><p>After that I run the cursor through a lot of elseif-Statemens to distinguish betweene the different MIME-Types and read the informations. Works fine, besides that it is very much code only to read informations about one contact, but ok.</p><p>The problem is that the MIME-Type for Mobilephonenumber and Telephonenumber are the <em>same</em> (vnd.android.cursor.item/phone_v2)??</p><p>How can i distinguish between those to different informations?</p><p>Any hint is highly appreciated!</p>","539884","","","","","2010-12-31 14:45:09","How to distinguish between Telephonenumber and Mobilephonenumber","<android><contactscontract>","1","0","","",""
"4570660","1","","","2010-12-31 14:44:14","0","609","<p>I'm a .NET developer and have a website that runs ASP.NET with a SQL Server database. I'm wanting to get into Android development. Particularly interested in developing an Android application that will allow basic features of the website.</p><p>I want the Android application to communicate with my website, which will fetch data from the SQL Server database. Is this something that is doable? Would I be able to create an asmx web service on my server, and then code the Android application to communicate with this web service?</p><p>I don't want the Android application to store any data, it will simply fetch data from the primary database server.</p><p>Any examples of how this could work would be great.</p>","125137","","","","","2013-11-08 08:27:20","Android Application Basics - Concerning Data","<asp.net><android><service>","0","3","","",""
"4570743","1","4571547","","2010-12-31 14:58:38","6","13228","<p>I see the following error in DDMS when trying to use a CheckBox on my MyActivity"" activity to start a service called ""MyService"":</p><pre><code>W/ActivityManager(   73): Unable to start service Intent { cmp=com.example.android.myprogram/.MyService }: not found</code></pre><p>I used the tutorial <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"">http://developer.android.com/resources/tutorials/views/hello-formstuff.html</a> and added the provided code to the end of my onCreate() method. I have the classes specified separately in MyActivity.java and MyService.java.</p><pre><code>package com.example.android.myprogram;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.CheckBox;public class MyActivity extends Activity {    private static final String TAG = ""MyActivity"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final CheckBox checkbox = (CheckBox) findViewById(R.id.checkbox);        checkbox.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks, depending on whether it's now checked                if (((CheckBox) v).isChecked()) {                    // TODO: Add code to START the service                    Log.d(TAG, ""startService from checkbox"");                         startService(new Intent(MyActivity.this, MyService.class));                } else {                    // TODO: Add code to STOP the service                    Log.d(TAG, ""stopService from checkbox"");                         stopService(new Intent(MyActivity.this, MyService.class));                }            }        });    }}</code></pre><p>My manifest file does have the following in which I've also tried the full namespace, short name, using an intent-filter per another search, etc. I'm not saying what is there is correct. I just left it at a stopping point.</p><pre><code>&lt;service android:name="".MyService""&gt;   &lt;intent-filter&gt;&lt;action android:name=""com.example.android.myprogram.MyService""&gt;&lt;/action&gt;   &lt;/intent-filter&gt;&lt;/service&gt;</code></pre><p>And lastly, my service which I've decided to break down to it's bare minimum:</p><pre><code>package com.example.android.myprogram;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.util.Log;public class MyService extends Service {    private static final String TAG = ""MyService"";    @Override    public IBinder onBind(Intent intent) {        return null;    }    @Override    public void onCreate() {        Log.d(TAG, ""onCreate"");        //code to execute when the service is first created    }    @Override    public void onDestroy() {        Log.d(TAG, ""onDestroy"");        //code to execute when the service is shutting down    }    @Override    public void onStart(Intent intent, int startid) {        Log.d(TAG, ""onStart"");        //code to execute when the service is starting up    }}</code></pre><p>I'm very, very, very new to Java/Android programming and programming in general (but learning) so I'm sure this is user error and probably common sense to everyone else. Any suggestions would be great.</p>","558929","","558929","","2010-12-31 16:41:23","2012-02-17 05:07:28","""Unable to start service Intent"" error when starting service from an Activity in Android","<android><service><activity><android-intent>","4","2","3","",""
"4570838","1","4570871","","2010-12-31 15:22:39","2","907","<p>What is of these ways is better for onClick's methods implementation: - Using android:onClick attribute in xml- Implementing and defining onClickListener?</p>","397991","","","","","2012-08-10 12:20:57","Any disadvantage of android:onClick attribute usage?","<android>","7","0","","",""
"4570900","1","","","2010-12-31 15:35:12","2","637","<p>I'm trying to run a sub process on Android (see <a href=""http://stackoverflow.com/questions/4568588/is-there-a-commandline-flag-to-set-pythonhome"">this question</a>) which requires that the PYTHONHOME environment variable be set.  I tried to do so with the following code:</p><pre><code>    ProcessBuilder pbuilder = new ProcessBuilder(""python/bin/python"", ""test.py"");    pbuilder.directory(getFilesDir());    Map&lt;String, String&gt; env = pbuilder.environment();    env.put(""PYTHONHOME"", ""python"");    Process process = pbuilder.start();</code></pre><p>but I get this exception:</p><pre><code>E/AndroidRuntime(25857): FATAL EXCEPTION: mainE/AndroidRuntime(25857): java.lang.UnsupportedOperationException: Can't modify environmentE/AndroidRuntime(25857):    at java.lang.SystemEnvironment.put(System.java:740)E/AndroidRuntime(25857):    at java.lang.SystemEnvironment.put(System.java:688)E/AndroidRuntime(25857):    at my codeE/AndroidRuntime(25857):    at android.view.View.performClick(View.java:2408)E/AndroidRuntime(25857):    at android.view.View$PerformClick.run(View.java:8816)E/AndroidRuntime(25857):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(25857):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(25857):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(25857):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(25857):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(25857):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(25857):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(25857):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(25857):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Does anyone have any advice?  I've tried wrapping the call to python in a shell script which exports PYTHONHOME but that didn't do the trick.</p><p>Gabe</p>","146446","","146446","","2011-01-01 07:28:31","2011-06-24 08:35:23","How to get around java.lang.UnsupportedOperationException: Can't modify environment?","<android>","1","0","","",""
"4570929","1","5198944","","2010-12-31 15:39:56","9","5520","<p>This question is linked with the answers in the following question:</p><p><a href=""http://stackoverflow.com/questions/4259851/error-removing-bitmapsandroid/4260269#4260269"">Error removing Bitmaps[Android]</a></p><p>Is there any advantage of using Drawable over Bitmap in Android in terms of memory de-allocation ?</p><p>I was looking at Romain Guy project Shelves and he uses SoftReference for images caches but I'm unable to search where is the code which is de-allocating these Drawables when SoftReference automatically reclaims the memory for Bitmap. As far as I know .recycle() has to be explicitly called on the Bitmap for it to be de-allocated.</p>","550393","","550393","","2011-01-01 09:45:13","2014-03-11 07:37:20","Drawable advantage over bitmap for memory in android","<android><bitmap><memory-allocation><drawable>","3","0","3","",""
"4571014","1","","","2010-12-31 15:58:00","1","956","<p>One simple question, what are the ways to format some email body? Especially I would need something like</p><pre><code>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code></pre><p>tags. But as for now, I couldn't find a way to achieve this (besides <b>bold</b>,<i>italic</i>...)).</p><p>Are there any alternatives besides HTML? For final result I would just need some simple table.</p><p><b>EDIT: @EJB @jondavidjohn</b></p><p>This is for Android :)</p><p>@EJB</p><pre><code>&lt;!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd""&gt;&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;title&gt;Untitled Document&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;Something&lt;/td&gt;&lt;td&gt;Something&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Something&lt;/td&gt;&lt;td&gt;Something&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</code></pre>","455268","","455268","","2011-01-01 12:23:07","2012-09-03 12:25:50","Formatting e-mail body (HTML?)","<android><email><table><html-email>","4","0","","",""
"4571079","1","4571254","","2010-12-31 16:14:51","22","9588","<p>I have a fairly complex android app, the contents of the 'layout' folder is becoming increasingly large. I've tried to organise the individual layout xml files into sub folders e.g. layout/buttons/, layout/activity/, layout/views/ etc. This doesn't seem to work, the content of the folders in not parsed into the R. class. </p><p>Is there a way to do this?</p><p>Thanks!</p>","119203","","","","","2014-02-04 13:46:48","Android Organise Layouts into Sub Folders","<android><layout>","3","0","1","",""
"4571085","1","","","2010-12-31 16:16:15","3","1060","<p>I want to communicate to the adb service on my android phone (via USB) from my c/c++ application.</p><p>It has to be ""fast"", so going out to the shell to run a Java program is out of the question.</p><p>Are there any examples anywhere of this being done, and the API for this type of connection?</p><p>Thanks.</p>","545974","","","","","2010-12-31 20:03:29","Android ADB API from C/C++ Applications","<c++><android><c><adb>","1","2","","",""
"4571113","1","4571219","","2010-12-31 16:22:26","2","860","<p>I'd would like to implement multi-touch in my app.  Multi touch support wasn't available until API version 5.  However, I would also like my app to be backwards compatible until API level 4.  Is there a way to get around this, other than creating two separate .apk's in which I remove the multi touch code from the level 4 version?</p><p>Thanks all.</p>","432209","","","","","2012-02-23 17:32:32","Android - How do you support older API's without having 2 compiled .apk files when you use methods from newer API's?","<android><api>","2","1","2","",""
"4571117","1","4571206","","2010-12-31 16:23:11","0","1189","<p>I am using WSDL web service which has a method accepting a string array as an argument. I have tried ksoap2 library but unable to find out how to pass array as an argument to that method. There are options to add parameter,values but my webservice require as an argument to function not as separate parameter,values.We can also use simple HTTP client and send a soap request as well. But I am unable to build that exact soap request for wsdl which will take array of strings as argument.</p><p>Is there any way I can build that SOAP request ? Array is of type string of size 2.</p>","315619","","","","","2010-12-31 16:44:27","How to pass array of string as parameter to function in WSDL webservice from Android?","<android><web-services><wsdl><webservice-client><android-ksoap2>","1","1","","",""
"4571238","1","","","2010-12-31 16:50:29","1","237","<p>I have written this piece of code to break an image into 9 pieces and it gives me runtime error. There is no error in LogCat and I am stuck. The error comes at line 7 line from bottom (Bitmap.createBitmap(...);). </p><pre><code>public Bitmap[] getPieces(Bitmap bmp) {        Bitmap[] bmps = new Bitmap[9];        int width = bmp.getWidth();        int height = bmp.getHeight();        int rows = 3;        int cols = 3;        int cellHeight = height / rows;        int cellWidth = width / cols;        int piece = 0;        for (int x = 0; x &lt;= width; x += cellWidth) {            for (int y = 0; y &lt;= height; y += cellHeight) {                Bitmap b = Bitmap.createBitmap(bmp, x, y, cellWidth,                        cellHeight, null, false);                bmps[piece] = b;                piece++;            }        }        return bmps;    }</code></pre>","355507","","385897","","2010-12-31 16:57:57","2010-12-31 18:07:28","What's wrong with this Java code for Android?","<java><android><image-manipulation>","3","3","","",""
"4571299","1","","","2010-12-31 17:02:12","0","3644","<p>I've got Android 2.2 on my phone and I'm doing some DB development. I've been trying to query my DB using sqlite3, but it looks like sqlite3 is missing from my phone. So then I tried a few other commands (su, find etc) and they ALL seem to be missing. </p><p>Can anyone tell me where they have gone please? I read somewhere that sqlite3 at least might have been accidentally left out of 2.2, but surely they can't all have been missed off can they?</p><p>Thanks</p>","559376","","","","","2013-06-30 14:33:02","Android ADB commands missing","<android>","3","1","","",""
"4571352","1","6864840","","2010-12-31 17:14:23","11","25935","<p>I tried <a href=""https://github.com/sugree/twitter-android-sdk"">https://github.com/sugree/twitter-android-sdk</a>, but could not get it work....I am not even sure what CALLBACK_URI should I set to....I am working on a native android APP so very confused here.</p><p>I have used Facebook sdk and was able to update my status from my app successfully...now I try to do the same with twitter...why twitter does not even release an Android SDK ?</p>","359535","","","","","2013-08-16 07:42:10","Is there any Twitter API SDK for Android?","<android><twitter><sdk>","4","0","1","",""
"4571401","1","4571791","","2010-12-31 17:24:55","5","4868","<p>I have a list of countries in a database.  I have created a select country activity that consists of a edit box for filtering and a list which displays the flag and country name.</p><p>When the activity starts the list shows the entire list of countries sorted alphabetically - works fine.  When the customer starts typing into the search box I want the list to be filtered based on their typing.  My database query was previously working in an AutoCompleteView (I just want to switch to a separate text box and list) so I know my full query and my constraint query are working.  What I did was add a TextWatcher to the EditText view and every time the text is changed I invoke the list's SimpleCursorAdapter runQueryOnBackgroundThread with the edit boxes text as the constraint.  The trouble is the list is never updated.  I have set breakpoints in the debugger and the TextWatcher does make the call to runQueryOnBackgroundThread and my FilterQueryProvider is called with the expected constraint.  The database query goes fine and the cursor is returned.</p><p>The cursor adapter has a filter query provider set (and a view binder to display the flag):</p><pre><code>    SimpleCursorAdapter adapter = new SimpleCursorAdapter (this,            R.layout.country_list_row, countryCursor, from, to);    adapter.setFilterQueryProvider (new CountryFilterProvider ());    adapter.setViewBinder (new FlagViewBinder ());</code></pre><p>The FitlerQueryProvider:</p><pre><code>private final class CountryFilterProvider implements FilterQueryProvider {    @Override    public Cursor runQuery (CharSequence constraint) {        Cursor countryCursor = myDbHelper.getCountryList (constraint);        startManagingCursor (countryCursor);        return countryCursor;    }}</code></pre><p>And the EditText has a TextWatcher:</p><pre><code>    myCountrySearchText = (EditText)findViewById (R.id.entry);    myCountrySearchText.setHint (R.string.country_hint);    myCountrySearchText.addTextChangedListener (new TextWatcher() {        @Override        public void afterTextChanged (Editable s) {            SimpleCursorAdapter filterAdapter = (SimpleCursorAdapter)myCountryList.getAdapter ();            filterAdapter.runQueryOnBackgroundThread (s.toString ());        }        @Override        public void onTextChanged (CharSequence s, int start, int before, int count) {            // no work to do        }        @Override        public void beforeTextChanged (CharSequence s, int start, int count, int after) {            // no work to do        }    });</code></pre><p>The query for the database looks like this:</p><pre><code>public Cursor getCountryList (CharSequence constraint)  {    if (constraint == null  ||  constraint.length () == 0)  {        //  Return the full list of countries        return myDataBase.query (DATABASE_COUNTRY_TABLE,                 new String[] { KEY_ROWID, KEY_COUNTRYNAME, KEY_COUNTRYCODE }, null, null, null,                 null, KEY_COUNTRYNAME);    }  else  {        //  Return a list of countries who's name contains the passed in constraint        return myDataBase.query (DATABASE_COUNTRY_TABLE,                 new String[] { KEY_ROWID, KEY_COUNTRYNAME, KEY_COUNTRYCODE },                 ""Country like '%"" + constraint.toString () + ""%'"", null, null, null,                 ""CASE WHEN Country like '"" + constraint.toString () +                 ""%' THEN 0 ELSE 1 END, Country"");    }}</code></pre><p>It just seems like there is a missing link somewhere.  Any help would be appreciated.</p><p>Thanks,</p><p>Ian</p>","199818","","","","","2011-01-31 21:46:43","Trying to filter a ListView with runQueryOnBackgroundThread but nothing happens - what am I missing?","<android><listview>","2","2","2","",""
"4571461","1","","","2010-12-31 17:39:25","12","7746","<p>I'm trying to make an app that detects when a user takes a photo. I set up a broadcast receiver class and registered it in the manifest file by:</p><pre><code>&lt;receiver android:name=""photoReceiver"" &gt;  &lt;intent-filter&gt;    &lt;action android:name=""com.android.camera.NEW_PICTURE""/&gt;      &lt;data android:mimeType=""image/*""/&gt; &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>No matter what I try to do the program won't receive the broadcast. Here is my receiver class:</p><pre><code>public class photoReceiver extends BroadcastReceiver {  private static final String TAG = ""photoReceiver"";@Overridepublic void onReceive(Context context, Intent intent) {    CharSequence text = ""caught it"";    int duration = Toast.LENGTH_LONG;    Log.d(TAG, ""Received new photo"");    Toast toast = Toast.makeText(context, text, duration);    toast.show(); }}</code></pre><p>If I remove the mimeType line in the manifest and in my activity I send my own broadcast using</p><pre><code>Intent intent = new Intent(""com.android.camera.NEW_PICTURE"");sendBroadcast(intent);</code></pre><p>then I successfully receive the broadcast and can see the log and toast window. Am I approaching this the right way? Is there any thing that I need to add? Thanks in advance for the help!</p>","559393","","","","","2014-03-08 03:42:53","broadcast receiver wont receive camera event","<android><android-manifest><android-camera><android-camera-intent>","5","8","16","",""
"4571704","1","4571869","","2010-12-31 18:31:03","0","932","<p>How can I set a height and width of a imageView?I doenst work with maxheight and maxwidth...</p><p>Here my code:</p><pre><code> &lt;ImageView                  android:adjustViewBounds=""true""                 android:id=""@+id/weatherIcon""                 android:src=""@drawable/weather_rain""                 android:paddingLeft=""39pt""                 android:paddingTop=""4pt""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                        android:scaleType=""fitXY""                 /&gt;</code></pre>","512870","","473070","","2010-12-31 18:39:56","2010-12-31 19:09:23","set image height and width","<java><android><imageview>","1","0","","",""
"4571761","1","4572119","","2010-12-31 18:43:02","0","134","<p>Could someone please point me in the right direction. My project involves a database where users enter their address and other info from my website. This database is then referenced in my android application to show the locations of these addresses in my database.</p><p>I have yet to start and just came up with this idea. My question is, what would be the best method to create a database easily modified through my website (mySQL, php, etc), and also easily referenced easily through Android and the Google Maps API? I need some ideas on the languages I will need to use to create this database and website so I can go buy the necessary books to start reading up. </p><p>Thanks so much</p>","554464","","","","","2011-01-01 03:49:09","Whats the best solution for a database used in conjunction with Maps in Android?","<android><database><google-maps>","2","0","","",""
"4571799","1","","","2010-12-31 18:48:57","1","190","<p>I was wondering what some common events were that would cancel a recurring alarm.  I am catching them so I can reset the alarm when needed.  What are some other common one's that I may not be handling?  Here is what I am currently handling:</p><ul><li>PACKAGE_REPLACED/CHANGED/REMOVED/DATA_CLEARED</li><li>BOOT_COMPLETED</li></ul>","408079","","","","","2010-12-31 18:48:57","Common events that will cancel a recurring alarm","<android><broadcastreceiver><alarmmanager><recurring><android-alarms>","0","0","2","",""
"4571942","1","4571987","","2010-12-31 19:28:06","9","2251","<p>I am wondering if there is a syntax to print out something in the eclipse console windows. This is just like NSLog in xcode. Thank you</p>","321983","","","","","2011-11-24 03:21:12","NSLog equivalent for Android dev using Eclipse","<android>","2","0","0","",""
"4571959","1","4579831","","2010-12-31 19:33:52","11","3269","<p>I have PDF files I need to prepare for viewing on mobile devices. The worse case would be ~50 pages, with lots full color images and vector art, file size approx. 40MB. This is acceptable for PC viewing on broadband, but not great for mobile viewing due to long download times and very laggy scrolling on mobile (At least on my overclocked Droid). Are there any tools or libraries for processing the files to simply the vector stuff, downsample/recompress the images, that sort of thing? </p><p>Output in pdf format is not absolutely essential, but it needs to be something readable on android and iOS devices without software downloads.</p>","527227","","","","","2011-01-11 01:10:38","Processing PDFs to reduce file size / and or complexity","<android><pdf><ios><mobile><publishing>","5","3","6","",""
"4572082","1","","","2010-12-31 20:03:20","0","1299","<p>I have 3 1.6 emulators that continue to crash a few minutes after I start them (Note my 2.1 and 2.2 emulators work fine).  I made a brand new one today (without the market enabled or SD card support) and it still had the same problem.  The strange thing is they crash without using them.  I just start them up, walk away for 5 minutes and boom, the emulator is gone from the DDMS devices view in Eclipse.  It is still visible on screen, and I can run the standard apps it comes with, but Eclipse no longer recognizes it to run/debug any apps on it.</p><p>The log is enormous from start up to crash and it has what looks to be a ton of faults, so I'm going to try to post some individual logs rather than the whole darn thing.</p><p>Any thoughts what I could do?  Thanks all</p><p>Error list:</p><pre><code>    12-31 14:32:26.592: ERROR/MemoryHeapBase(67): error opening /dev/pmem: No such file or directory    12-31 14:32:26.592: ERROR/SurfaceFlinger(67): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake    12-31 14:32:26.692: ERROR/libEGL(67): couldn't load &lt;libhgl.so&gt; library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)    12-31 14:32:27.222: ERROR/libEGL(78): couldn't load &lt;libhgl.so&gt; library (Cannot load library: load_library[984]: Library 'libhgl.so' not found)    12-31 14:32:49.081: ERROR/BatteryService(67): Could not open '/sys/class/power_supply/usb/online'    12-31 14:32:49.081: ERROR/BatteryService(67): Could not open '/sys/class/power_supply/battery/batt_vol'    12-31 14:32:49.081: ERROR/BatteryService(67): Could not open '/sys/class/power_supply/battery/batt_temp'    12-31 14:32:49.851: ERROR/EventHub(67): could not get driver version for /dev/input/mouse0, Not a typewriter    12-31 14:32:49.851: ERROR/EventHub(67): could not get driver version for /dev/input/mice, Not a typewriter    12-31 14:32:50.122: ERROR/System(67): Failure starting core service    12-31 14:32:50.122: ERROR/System(67): java.lang.SecurityException    12-31 14:32:50.122: ERROR/System(67):     at android.os.BinderProxy.transact(Native Method)    12-31 14:32:50.122: ERROR/System(67):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)    12-31 14:32:50.122: ERROR/System(67):     at android.os.ServiceManager.addService(ServiceManager.java:72)    12-31 14:32:50.122: ERROR/System(67):     at com.android.server.ServerThread.run(SystemServer.java:162)    12-31 14:32:50.122: ERROR/AndroidRuntime(67): Crash logging skipped, no checkin service    12-31 14:33:02.751: ERROR/ActivityThread(141): Failed to find provider info for com.google.settings    12-31 14:33:06.832: ERROR/ActivityThread(141): Failed to find provider info for com.google.settings    12-31 14:33:02.868: ERROR/ActivityThread(119): Failed to find provider info for android.server.checkin    12-31 14:33:05.538: ERROR/ActivityThread(119): Failed to find provider info for android.server.checkin    12-31 14:33:06.150: ERROR/ActivityThread(119): Failed to find provider info for android.server.checkin    12-31 14:33:06.740: ERROR/ActivityThread(119): Failed to find provider info for android.server.checkin    12-31 14:33:06.890: ERROR/ActivityThread(119): Failed to find provider info for android.server.checkin    12-31 14:33:07.859: ERROR/ApplicationContext(67): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml    12-31 14:33:12.489: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)</code></pre><p>Warn list:</p><pre><code>12-31 14:32:26.711: WARN/HAL(67): load: module=/system/lib/hw/copybit.goldfish.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/copybit.goldfish.so' not found12-31 14:32:26.711: WARN/HAL(67): load: module=/system/lib/hw/copybit.default.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/copybit.default.so' not found12-31 14:32:26.721: WARN/HAL(67): load: module=/system/lib/hw/copybit.goldfish.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/copybit.goldfish.so' not found12-31 14:32:26.721: WARN/HAL(67): load: module=/system/lib/hw/copybit.default.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/copybit.default.so' not found12-31 14:32:26.721: WARN/HAL(67): load: module=/system/lib/hw/overlay.goldfish.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/overlay.goldfish.so' not found12-31 14:32:26.721: WARN/HAL(67): load: module=/system/lib/hw/overlay.default.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/overlay.default.so' not found12-31 14:32:26.832: WARN/EntropyService(67): unable to load initial entropy (first boot?)12-31 14:32:26.832: WARN/EntropyService(67): java.io.FileNotFoundException: /data/system/entropy.dat12-31 14:32:26.832: WARN/EntropyService(67):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:231)12-31 14:32:26.832: WARN/EntropyService(67):     at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:80)12-31 14:32:26.832: WARN/EntropyService(67):     at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:135)12-31 14:32:26.832: WARN/EntropyService(67):     at com.android.server.RandomBlock.fromFile(RandomBlock.java:44)12-31 14:32:26.832: WARN/EntropyService(67):     at com.android.server.EntropyService.loadInitialEntropy(EntropyService.java:88)12-31 14:32:26.832: WARN/EntropyService(67):     at com.android.server.EntropyService.&lt;init&gt;(EntropyService.java:75)12-31 14:32:26.832: WARN/EntropyService(67):     at com.android.server.ServerThread.run(SystemServer.java:97)12-31 14:32:27.422: WARN/PackageManager(67): Running ENG build: no pre-dexopt!12-31 14:32:29.541: WARN/dalvikvm(91): DexOpt: resolve class illegal access: Landroid/text/PackedIntVectorTest; -&gt; Landroid/text/PackedIntVector;12-31 14:32:29.582: WARN/dalvikvm(91): DexOpt: resolve class illegal access: Lcom/android/internal/os/LoggingPrintStreamTest$TestPrintStream; -&gt; Lcom/android/internal/os/LoggingPrintStream;12-31 14:32:43.822: WARN/PackageParser(67): Intent filter for activity ActivityIntentInfo{438019c8 com.android.camera.ReviewImage} defines no actions12-31 14:32:44.802: WARN/PackageParser(67): Intent filter for activity ActivityIntentInfo{438ba948 com.example.android.apis.media.MediaPlayerDemo_Audio} defines no actions12-31 14:32:44.802: WARN/PackageParser(67): Intent filter for activity ActivityIntentInfo{438c4680 com.example.android.apis.media.MediaPlayerDemo_Video} defines no actions12-31 14:32:48.231: WARN/PackageManager(67): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone12-31 14:32:48.241: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts12-31 14:32:48.241: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts12-31 14:32:48.241: WARN/PackageManager(67): Unknown permission com.google.android.providers.gmail.permission.WRITE_GMAIL in package com.android.settings12-31 14:32:48.241: WARN/PackageManager(67): Unknown permission com.google.android.providers.gmail.permission.READ_GMAIL in package com.android.settings12-31 14:32:48.241: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.google.android.providers.enhancedgooglesearch12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.OTHER_SERVICES in package com.google.android.providers.enhancedgooglesearch12-31 14:32:48.251: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.browser12-31 14:32:48.262: WARN/PackageManager(67): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts12-31 14:32:48.632: WARN/ActivityManager(67): Unable to start service Intent { act=android.accounts.IAccountsService cmp=com.google.android.googleapps/.GoogleLoginService }: not found12-31 14:32:48.632: WARN/AccountMonitor(67): Couldn't connect to Intent { act=android.accounts.IAccountsService cmp=com.google.android.googleapps/.GoogleLoginService } (Missing service?)12-31 14:32:49.174: WARN/HAL(67): load: module=/system/lib/hw/lights.goldfish.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/lights.goldfish.so' not found12-31 14:32:49.181: WARN/HAL(67): load: module=/system/lib/hw/lights.default.so error=Cannot load library: load_library[984]: Library '/system/lib/hw/lights.default.so' not found12-31 14:32:49.431: WARN/SettingsProvider(67): Unable to add bookmark: com.google.android.gm/com.google.android.gm.ConversationListActivityGmail12-31 14:32:49.431: WARN/SettingsProvider(67): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.google.android.gm/com.google.android.gm.ConversationListActivityGmail}12-31 14:32:49.431: WARN/SettingsProvider(67):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:32:49.431: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:498)12-31 14:32:49.431: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:526)12-31 14:32:49.431: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.onCreate(DatabaseHelper.java:124)12-31 14:32:49.431: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:32:49.431: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)12-31 14:32:49.431: WARN/SettingsProvider(67):     at com.android.providers.settings.SettingsProvider.query(SettingsProvider.java:197)12-31 14:32:49.431: WARN/SettingsProvider(67):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:32:49.431: WARN/SettingsProvider(67):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:32:49.431: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService.initInThread(PowerManagerService.java:408)12-31 14:32:49.431: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService$1.onLooperPrepared(PowerManagerService.java:374)12-31 14:32:49.431: WARN/SettingsProvider(67):     at android.os.HandlerThread.run(HandlerThread.java:59)12-31 14:32:49.441: WARN/SettingsProvider(67): Unable to add bookmark: com.android.providers.im/com.android.providers.im.LandingPage12-31 14:32:49.441: WARN/SettingsProvider(67): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.android.providers.im/com.android.providers.im.LandingPage}12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:498)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:526)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.onCreate(DatabaseHelper.java:124)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.SettingsProvider.query(SettingsProvider.java:197)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService.initInThread(PowerManagerService.java:408)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService$1.onLooperPrepared(PowerManagerService.java:374)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.os.HandlerThread.run(HandlerThread.java:59)12-31 14:32:49.441: WARN/SettingsProvider(67): Unable to add bookmark: com.android.calendar/com.android.calendar.LaunchActivity12-31 14:32:49.441: WARN/SettingsProvider(67): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.android.calendar/com.android.calendar.LaunchActivity}12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:498)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:526)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.onCreate(DatabaseHelper.java:124)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.providers.settings.SettingsProvider.query(SettingsProvider.java:197)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService.initInThread(PowerManagerService.java:408)12-31 14:32:49.441: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService$1.onLooperPrepared(PowerManagerService.java:374)12-31 14:32:49.441: WARN/SettingsProvider(67):     at android.os.HandlerThread.run(HandlerThread.java:59)12-31 14:32:49.451: WARN/SettingsProvider(67): Unable to add bookmark: com.google.android.apps.maps/com.google.android.maps.MapsActivity12-31 14:32:49.451: WARN/SettingsProvider(67): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.google.android.apps.maps/com.google.android.maps.MapsActivity}12-31 14:32:49.451: WARN/SettingsProvider(67):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:32:49.451: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:498)12-31 14:32:49.451: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:526)12-31 14:32:49.451: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.onCreate(DatabaseHelper.java:124)12-31 14:32:49.451: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:32:49.451: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)12-31 14:32:49.451: WARN/SettingsProvider(67):     at com.android.providers.settings.SettingsProvider.query(SettingsProvider.java:197)12-31 14:32:49.451: WARN/SettingsProvider(67):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:32:49.451: WARN/SettingsProvider(67):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:32:49.451: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService.initInThread(PowerManagerService.java:408)12-31 14:32:49.451: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService$1.onLooperPrepared(PowerManagerService.java:374)12-31 14:32:49.451: WARN/SettingsProvider(67):     at android.os.HandlerThread.run(HandlerThread.java:59)12-31 14:32:49.482: WARN/SettingsProvider(67): Unable to add bookmark: com.google.android.youtube/com.google.android.youtube.HomeActivity12-31 14:32:49.482: WARN/SettingsProvider(67): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.google.android.youtube/com.google.android.youtube.HomeActivity}12-31 14:32:49.482: WARN/SettingsProvider(67):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:32:49.482: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:498)12-31 14:32:49.482: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.loadBookmarks(DatabaseHelper.java:526)12-31 14:32:49.482: WARN/SettingsProvider(67):     at com.android.providers.settings.DatabaseHelper.onCreate(DatabaseHelper.java:124)12-31 14:32:49.482: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:32:49.482: WARN/SettingsProvider(67):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)12-31 14:32:49.482: WARN/SettingsProvider(67):     at com.android.providers.settings.SettingsProvider.query(SettingsProvider.java:197)12-31 14:32:49.482: WARN/SettingsProvider(67):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:32:49.482: WARN/SettingsProvider(67):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:32:49.482: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService.initInThread(PowerManagerService.java:408)12-31 14:32:49.482: WARN/SettingsProvider(67):     at com.android.server.PowerManagerService$1.onLooperPrepared(PowerManagerService.java:374)12-31 14:32:49.482: WARN/SettingsProvider(67):     at android.os.HandlerThread.run(HandlerThread.java:59)12-31 14:32:50.372: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f06000012-31 14:32:50.372: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f06000112-31 14:32:50.421: WARN/ResourceType(67): Failure getting entry for 0x7f060000 (t=5 e=0) in package 0: 0xffffffb512-31 14:32:50.891: WARN/ActivityManager(67): Unable to start service Intent { cmp=com.google.android.server.checkin/.CheckinService }: not found12-31 14:32:50.891: WARN/SystemServer(67): Using fallback Checkin Service.12-31 14:32:51.031: WARN/GpsLocationProvider(67): Could not open GPS configuration file /etc/gps.conf12-31 14:32:51.181: WARN/AudioService(67): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg12-31 14:32:51.181: WARN/AudioService(67): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg12-31 14:32:51.191: WARN/AudioService(67): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg12-31 14:32:51.191: WARN/AudioService(67): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg12-31 14:32:51.191: WARN/AudioService(67): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg12-31 14:32:51.191: WARN/HeadsetObserver(67): This kernel does not have wired headset support12-31 14:32:51.421: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f03002f12-31 14:32:51.472: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f03000012-31 14:32:51.491: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f03000312-31 14:32:51.501: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f03000e12-31 14:32:51.511: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f03000912-31 14:32:51.682: WARN/ResourceType(67): No package identifier when getting value for resource number 0x0000000012-31 14:32:51.682: WARN/StatusBar(67): Icon not found in &lt;system&gt;: 012-31 14:32:57.011: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f06000012-31 14:32:57.032: WARN/ResourceType(67): No package identifier when getting value for resource number 0x7f06000112-31 14:33:01.292: WARN/UsageStats(67): Unexpected resume of com.android.launcher while already resumed in com.android.sdksetup12-31 14:33:01.631: WARN/ActivityManager(67): Unable to start service Intent { act=com.android.ussd.IExtendedNetworkService }: not found12-31 14:33:02.270: WARN/SystemClock(119): Unable to set rtc to 1293823982: Invalid argument12-31 14:33:02.868: WARN/Checkin(119): Can't update stat PHONE_GSM_REGISTERED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats12-31 14:33:05.538: WARN/Checkin(119): Can't update stat PHONE_GPRS_ATTEMPTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats12-31 14:33:06.150: ERROR/ActivityThread(119): Failed to find provider info for android.server.checkin12-31 14:33:06.150: WARN/Checkin(119): Can't update stat PHONE_GPRS_CONNECTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats12-31 14:33:06.740: WARN/Checkin(119): Can't update stat PHONE_GPRS_ATTEMPTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats12-31 14:33:06.890: WARN/Checkin(119): Can't update stat PHONE_GPRS_CONNECTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats12-31 14:33:07.449: WARN/ActivityManager(67): Unable to start service Intent { act=android.accounts.IAccountsService cmp=com.google.android.googleapps/.GoogleLoginService }: not found12-31 14:33:07.470: WARN/AccountMonitor(141): Couldn't connect to Intent { act=android.accounts.IAccountsService cmp=com.google.android.googleapps/.GoogleLoginService } (Missing service?)12-31 14:33:08.688: WARN/SurfaceFlinger(67): timeout expired mFreezeDisplay=1, mFreezeCount=012-31 14:33:08.799: WARN/WindowManager(67): App freeze timeout expired.12-31 14:33:08.799: WARN/WindowManager(67): Force clearing freeze: AppWindowToken{43908b48 token=HistoryRecord{4388a4d0 com.android.launcher/.Launcher}}12-31 14:33:11.049: WARN/SQLiteDirectCursorDriver(67): Found SQL string that ends in ; -- PRAGMA table_info(favorites);12-31 14:33:11.380: WARN/LauncherProvider(141): Unable to add favorite: com.google.android.apps.maps/com.google.android.maps.MapsActivity12-31 14:33:11.380: WARN/LauncherProvider(141): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.google.android.apps.maps/com.google.android.maps.MapsActivity}12-31 14:33:11.380: WARN/LauncherProvider(141):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider$DatabaseHelper.addShortcut(LauncherProvider.java:562)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider$DatabaseHelper.loadFavorites(LauncherProvider.java:534)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider$DatabaseHelper.onCreate(LauncherProvider.java:243)12-31 14:33:11.380: WARN/LauncherProvider(141):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider.query(LauncherProvider.java:103)12-31 14:33:11.380: WARN/LauncherProvider(141):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:33:11.380: WARN/LauncherProvider(141):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherModel.updateShortcutLabels(LauncherModel.java:652)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherModel.access$900(LauncherModel.java:50)12-31 14:33:11.380: WARN/LauncherProvider(141):     at com.android.launcher.LauncherModel$DesktopItemsLoader.run(LauncherModel.java:759)12-31 14:33:11.380: WARN/LauncherProvider(141):     at java.lang.Thread.run(Thread.java:1060)12-31 14:33:11.472: WARN/LauncherProvider(141): Unable to add favorite: com.android.vending/com.android.vending.AssetBrowserActivity12-31 14:33:11.472: WARN/LauncherProvider(141): android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.android.vending/com.android.vending.AssetBrowserActivity}12-31 14:33:11.472: WARN/LauncherProvider(141):     at android.app.ApplicationContext$ApplicationPackageManager.getActivityInfo(ApplicationContext.java:1670)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider$DatabaseHelper.addShortcut(LauncherProvider.java:562)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider$DatabaseHelper.loadFavorites(LauncherProvider.java:534)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider$DatabaseHelper.onCreate(LauncherProvider.java:243)12-31 14:33:11.472: WARN/LauncherProvider(141):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherProvider.query(LauncherProvider.java:103)12-31 14:33:11.472: WARN/LauncherProvider(141):     at android.content.ContentProvider$Transport.query(ContentProvider.java:129)12-31 14:33:11.472: WARN/LauncherProvider(141):     at android.content.ContentResolver.query(ContentResolver.java:152)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherModel.updateShortcutLabels(LauncherModel.java:652)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherModel.access$900(LauncherModel.java:50)12-31 14:33:11.472: WARN/LauncherProvider(141):     at com.android.launcher.LauncherModel$DesktopItemsLoader.run(LauncherModel.java:759)12-31 14:33:11.472: WARN/LauncherProvider(141):     at java.lang.Thread.run(Thread.java:1060)</code></pre>","432209","","","","","2011-01-01 02:55:30","Android 1.6 emulator crash","<android><eclipse><crash><emulator>","1","0","","",""
"4572090","1","4572287","","2010-12-31 20:04:34","19","11503","<p>Does anybody know what this means?</p><pre><code>12-31 20:55:45.861: ERROR/AndroidRuntime(12478): Caused by: java.lang.IllegalArgumentException: the bind value at index 1 is null12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:234)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:48)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.providers.ProductContentProvider.query(ProductContentProvider.java:350)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.content.ContentProvider$Transport.query(ContentProvider.java:163)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.content.ContentResolver.query(ContentResolver.java:245)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.providers.FacadeContentProvider.query(FacadeContentProvider.java:563)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.content.ContentProvider$Transport.query(ContentProvider.java:163)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.content.ContentResolver.query(ContentResolver.java:245)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.util.ScanAddTask.existsProduct(ScanAddTask.java:164)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.util.ScanAddTask.&lt;init&gt;(ScanAddTask.java:71)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.util.ItemScanAddTask.&lt;init&gt;(ItemScanAddTask.java:34)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow$MusicCDItemScanAddTask.&lt;init&gt;(CDCollectionViewWindow.java:147)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow.restoreLocalState(CDCollectionViewWindow.java:1044)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow.onRestoreInstanceState(CDCollectionViewWindow.java:966)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.app.Activity.performRestoreInstanceState(Activity.java:815)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096)12-31 20:55:45.861: ERROR/AndroidRuntime(12478):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2641)</code></pre>","458813","","179850","","2013-03-11 12:31:51","2013-09-20 10:09:08","IllegalArgumentException: the bind value at index 1 is null","<android><database><sqlite><android-contentprovider>","2","1","0","",""
"4572145","1","4572243","","2010-12-31 20:16:58","2","4807","<p>I'm trying to make an android game using sprites, (or very pixelated characters, backgrounds etc.). I draw them on the canvas like so...</p><p><code>matrix.preScale(xrat,yrat);</code></p><p><code>canvas.drawBitmap(img, matrix, null);</code></p><p>Where img is the Bitmap and the xrat and yrat are the scales.</p><p>My problem is that when I test, the Bitmap is blurry or anti-aliased, is there a way to prevent this? The rigid-blocky art style of the game will be ruined if the blocks are blurry.</p><p>Any (ANY) help appreciated!</p>","559475","","","","","2011-01-01 07:35:30","Android Canvas.DrawBitmap without blurring/AntiAliasing?","<java><android>","1","0","1","",""
"4572290","1","4572942","","2010-12-31 21:02:42","2","1344","<p>My app's main View displays a graphical Canvas. The onCreate method of the main Activity contains the command <code>registerForContextMenu(mapview);</code> so when the user does a long press on this View a context menu is opened whose contents are defined in the Activity's <code>onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)</code> method.</p><p>I would like to vary the menu's contents according to the location of the press, but I can't see how to find out that location. None of the arguments supplied to onCreateContextMenu seem to supply that information.</p>","250845","","","","","2011-01-01 01:54:48","Android: how do I determine the screen coordinates of a long press which opens a Context Menu","<android><contextmenu><coordinates>","1","0","","",""
"4572297","1","4572570","","2010-12-31 21:04:47","25","23306","<p>Is it possible to make a phone number clickable in HTML so that when a user clicks on the number it is called?</p>","18149","","1105417","","2013-10-16 08:24:01","2013-10-24 07:24:45","Is there a way to make a phone number clickable on an iphone or android phone to make a call in HTML?","<android><html><iphone><webkit><mobile-safari>","3","4","3","",""
"4572338","1","4605973","","2010-12-31 21:17:12","7","15579","<p>I'm trying to share two ArrayLists across the various activities in my application, using the scheme explained here: <a href=""http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables"">Android: How to declare global variables?</a>. </p><p>Here's my application subclass:</p><pre><code>public class GlobalVars extends Application{ ArrayList&lt;Player&gt; players = new ArrayList&lt;Player&gt;();   ArrayList&lt;String&gt; playerNames = new ArrayList&lt;String&gt;();  public ArrayList&lt;Player&gt; getPlayers(){   return players;  }  public ArrayList&lt;String&gt; getPlayerNames(){   return playerNames;  }  public void setPlayers(ArrayList&lt;Player&gt; p){   players = p;  }  public void setPlayerNames(ArrayList&lt;String&gt; pn){   playerNames = pn;  }}</code></pre><p>And used the code:</p><pre><code> GlobalVars gv = (GlobalVars)getApplicationContext();        players = gv.getPlayers();        playerNames = gv.getPlayerNames();</code></pre><p>To access these variables. The first line there where I define gv throws a classcastexception. Anyone know why?</p><p>Here's the code I added to the manifest:</p><pre><code>&lt;application android:name=""com.myname.GlobalVars"" android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;/application&gt;</code></pre><p>edit:for clarification, here is my entire 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.myname.bpstattracker"" android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".BPStatTracker"" 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="".BPSTAdd""&gt;&lt;/activity&gt;        &lt;activity android:name="".OneOrThree""&gt;&lt;/activity&gt;        &lt;activity android:name="".SixOrTen""&gt;&lt;/activity&gt;    &lt;/application&gt;    &lt;application android:name=""com.myname.GlobalVars""        android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;/application&gt;&lt;/manifest&gt; </code></pre>","544007","","544007","","2011-01-01 17:31:49","2013-09-30 11:21:46","Extending Application to share variables globally","<android><global-variables>","2","1","3","",""
"4572360","1","","","2010-12-31 21:21:48","1","1207","<p>just a quick question about Android 2.3.</p><p>I've been receiving reports from people using my app that it crashes on startup in Android 2.3. It works absolutely fine on the other SDK versions as far as I can tell. Since I don't have a phone running Android 2.3 I can't test out where the error is, which makes it very frustrating to deal with! </p><p>Has anyone got any ideas what might have changed in Android 2.3 to mean the app crashes? Has anyone else had a similar problem?</p><p>The following are ideas I've had for what might be causing it...</p><ol><li>Splash screen - on my main activity I trigger this in onCreate and it displays for 3 secs before finishing</li><li>I'm using the GPS capability of Android, has this vastly changed in 2.3 to mean that something's going wrong? </li><li>There's been a fundamental change in application startup in 2.3 that I'm not aware of.</li></ol><p>Any feedback would be much appreciated!</p><p>** SOME MORE INFORMATION! **</p><p>With the help of someone running it on the Nexus S I've tracked down the problem to the following method:</p><pre><code>final AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setMessage(""GPS functionality is required for this app. Would you like to      enable it?"")           .setCancelable(false)           .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {               public void onClick(final DialogInterface dialog, final int id) {                   launchGpsOptions();                }           })           .setNegativeButton(""No"", new DialogInterface.OnClickListener() {               public void onClick(final DialogInterface dialog, final int id) {                    dialog.cancel();               }           });    final AlertDialog alert = builder.create();    alert.show();</code></pre><p>Does anyone know why this suddenly won't work on Android 2.3 and/or how to fix it?</p><p>Many thanks!</p>","455141","","455141","","2011-01-01 16:58:13","2013-04-04 22:43:53","Why does my app not work on Android 2.3?","<android><crash><gps><splash-screen><android-sdk-2.3>","2","5","","",""
"4572496","1","4572519","","2010-12-31 22:02:11","7","7386","<p>The optimum layout for controls might depend on the orientation.   If I have a set of checkboxes or radio buttons they might fit well if I stack them vertically when the user holds the phone in a vertical orientation.  But if the user flips to horizontal it might be better to arrange them into two shorter stacks side-by-side, instead of forcing the user to scroll.</p><p>Does Android have any UI guidelines that address whether it's acceptable to use different layouts for vertical and horizontal?     And if so, how would I implement it to use the same controls, i.e., the same ID's for both layouts? </p><p>Thanks in advance!  </p>","424690","","","","","2014-02-20 20:07:39","Different Layouts for Horizontal and Vertical for an Android app?","<android>","1","0","","",""
"4572564","1","4573564","","2010-12-31 22:30:29","4","3947","<p>I am opening a png image into a Bitmap, making some modifications to it and then saving it to disk as a jpg.  In the case where the png has some transparent areas, they are saved as black.  Is there a way to change this default behavior so the image is saved with a  different color background such as white? </p><p>Thanks</p>","445348","","","","","2011-01-01 08:29:25","How to change the background color of a saved transparent bitmap","<android><bitmap><transparency>","1","0","1","",""
"4572658","1","4572917","","2010-12-31 23:11:10","1","470","<p>I know there's a <a href=""http://www.upcdatabase.com/"" rel=""nofollow"">http://www.upcdatabase.com/</a> website that allows you to lookup barcodes. This website however does not return anything for thousands of normal household items. I have seen free apps on mobile phones that can do this and list the exact product name along with price comparison. </p><p>Does anyone know of good websites (even commercial ones) that have a good/reliable database that one could use for lookups?</p>","189924","","","","","2011-01-01 01:35:40","Is there a website to lookup barcodes?","<iphone><android><nokia><barcode><qr-code>","2","1","2","2011-01-01 20:45:48",""
"4572711","1","4894301","","2010-12-31 23:38:31","3","267","<p>Can the Android API provide all the details required to make an AVD?</p><p>Premise being, if it can, could an Android create an AVD of itself?</p>","4857","","213269","","2011-03-22 08:30:26","2011-03-22 08:30:26","Android: An Application Activity to create an AVD","<android><avd>","4","0","","",""
"4572965","1","4572983","","2011-01-01 02:10:28","0","616","<p>Issue #1: In the tutorials, that I've looked at, a lot of folks place this line of code:</p><pre><code>AdManager.setTestDevices( new String[] {AdManager.TEST_EMULATOR});</code></pre><p>into the onCreate override of the activity.  And sure enough, the test ad shows up.</p><p>Am I supposed to leave this line when I actually submit my app to the App Store?Won't it show a test ad when the users actually use my app?</p><p>Issue #2: I've also seen some examples where the code manually requests the ad:</p><pre><code>AdView adView = (AdView) findViewById(R.id.ad);adView.requestFreshAd();</code></pre><p>Do I actually need these lines?</p><p>Unfortunately I don't have a device handy and can't test any of these assumptions?</p>","9382","","","","","2011-01-01 02:18:54","AdMob Android Integration","<android><android-emulator><admob>","1","0","0","",""
"4573019","1","","","2011-01-01 02:42:04","0","6544","<p>I am trying to get a development environment setup and having some problems with adb.  I have eclipse installed and can create android projects and run/debug them in the emulator.  But if I attached my device (HTC Evo) and try running on it, adb crashes.  My device shows up so adb sees it.  Everything is updated to the latest version.  I even went and reinstalled my system so I had a clean start.  It would still crash when I connect to the device.  I restart adb but it just shuts right back down.</p><p>Anyone have any suggestions on what I can do to fix this?  Running on Windows 7.</p>","559592","","","","","2011-05-09 06:48:17","ADB crashes when device attached with eclipse","<android><eclipse><adb>","2","0","0","",""
"4573074","1","4573083","","2011-01-01 03:17:20","1","2510","<p>I can't figure this out at all. I did:</p><pre><code>int num = ((month-1)*30+day)%134;              //a,b,c are just for the Log        String a = String.valueOf(num);        String b = String.valueOf(month);        String c = String.valueOf(day);        Log.v(""variables"",a+"",""+b+"",""+c);        num ++;// don't want zero        String stringnum = String.valueOf(num);        Log.v(""Index"",stringnum);</code></pre><p>month is todays month, day is today (i.e. december 31st = 12,31). In ANdroid this is taken from CALENDAR.Now this program was working fine until today. Jan 1st. What happens is the DB searches for a string of index num, taken from the date. The problem isnt in the DB, its in this code. Jan 1st is month=0, day = 1, naturally, but after mod 134 I get, courtesy of LogCat:</p><pre><code>01-01 12:07:38.554: VERBOSE/variables(6917): -29,0,1</code></pre><p>But 1mod134 != -29. I can't understand where  -29 comes from.</p>","485498","","","","","2011-01-01 03:22:59","Modulo Arithmetic in Java, Android problem","<java><android><date><modulo>","2","0","","",""
"4573172","1","","","2011-01-01 04:24:35","4","566","<p>I have a list adapter and im using <code>holder.text.setTypeface(TYPEFACE)</code> to set the type face and I have a string of names that im using assign each <code>ListView</code> button its text. But im wondering how to set just one individual list item a custom font. Basically say I have the 3 ListAdapter buttons, Button 1, Button 2, and Button 3. I want Button 2 to be a custom font while Button 1 and Button 3 Stay regular. How can this be done?</p>","559635","","557179","","2011-08-14 19:09:19","2011-08-14 19:09:19","Trying to set a custom font to each individual ListAdapter button","<java><android><listview><listadapter>","2","1","1","",""
"4573175","1","6174403","","2011-01-01 04:27:49","8","1786","<p>I used the code below to fetch the image from a url but it doesn't working for large images.</p><p>Am I missing something when fetching that type of image?</p><pre><code>imgView = (ImageView)findViewById(R.id.ImageView01);  imgView.setImageBitmap(loadBitmap(""http://www.360technosoft.com/mx4.jpg""));  //imgView.setImageBitmap(loadBitmap(""http://sugardaddydiaries.com/wp-content/uploads/2010/12/how_do_i_get_sugar_daddy.jpg""));     //setImageDrawable(""http://sugardaddydiaries.com/wp-content/uploads/2010/12/holding-money-copy.jpg"");  //Drawable drawable = LoadImageFromWebOperations(""http://www.androidpeople.com/wp-content/uploads/2010/03/android.png"");  //imgView.setImageDrawable(drawable); /* try {     ImageView i = (ImageView)findViewById(R.id.ImageView01);     Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(""http://sugardaddydiaries.com/wp-content/uploads/2010/12/holding-money-copy.jpg"").getContent());     i.setImageBitmap(bitmap);    } catch (MalformedURLException e) {     System.out.println(""hello"");   } catch (IOException e) {    System.out.println(""hello"");   }*/    } protected Drawable ImageOperations(Context context, String string,   String string2) {  // TODO Auto-generated method stub  try {   InputStream is = (InputStream) this.fetch(string);   Drawable d = Drawable.createFromStream(is, ""src"");   return d;  } catch (MalformedURLException e) {   e.printStackTrace();   return null;  } catch (IOException e) {   e.printStackTrace();   return null;  } }</code></pre>","554830","","234175","","2011-08-13 08:11:57","2011-11-29 04:28:38","How can I fetch a large image from a url?","<android>","4","1","1","",""
"4573208","1","4573725","","2011-01-01 04:58:44","10","4312","<p>I want to make a form and put a divider between each form element, and I want the divider to have to same style as what is default for the ListView on the platform.</p><p>Can I somehow access information about the default divider for ListView and use it for my form?</p>","559644","","","","","2014-02-12 02:06:54","How can I get the default divider?","<android>","4","0","7","",""
"4573213","1","4573262","","2011-01-01 05:00:41","1","1363","<p>In the various videos on the AdMob integration, I've seen that only permission to access the internet is asked for:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>Not that I am an expert in advertising, but wouldn't AdMob need the user's geographic location as well, so that they can serve location specific ads?  Or avoid serving certain ads based on a location, like maybe not offering me a Big Mac if I am in India or not adverting a ham sandwich if I am in an Arab country?</p><p>If AdMob needs those permissions, how do I ask for them?</p>","9382","","","","","2011-01-01 07:23:51","AdMob Android integration - what permissions to ask for?","<java><android><permissions><advertising><admob>","2","2","","",""
"4573214","1","4573404","","2011-01-01 05:01:13","0","1239","<p>I have a RelativeLayout which currently has a fixed size.  Widths, heights, margins, font heights of child views are specified so everything looks just right.</p><p>I now want to scale the layout (to fit screen size).  The layout should scale as if it was a flat image, so everything gets smaller in proportion (fonts, margins etc.)</p><p>I made a simplified example, below.  Scaled to 0.5, this would display the text ""ONE QUARTER"" with margin left 200dip and margin top 120dip.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout     android:id=""@+id/RelativeLayout01""    android:layout_width=""1600dip""     android:layout_height=""960dip""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView     android:text=""ONE QUARTER""     android:id=""@+id/TextView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_marginLeft=""400dip""    android:layout_marginTop=""240dip""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>Of course, I'm not asking anyone to help me hand code an algorithm to scale all these values: just wondering if there's some simple way to achieve this...</p><p>Thanks!</p>","559634","","559634","","2011-01-01 05:19:17","2011-01-01 06:57:54","Apply scale to layout in android","<android><android-layout>","1","0","1","",""
"4573344","1","","","2011-01-01 06:21:53","0","281","<p>I just made an app where a friend list is being updated in real time depending on if you get blocked or deleted by one of your friends, so I refresh the list on the screen. However, I was wondering what would be appropriate as the time interval for updates using threads? right now I am using 1 second but I think it's a bit exaggerated.</p>","522559","","244296","","2011-01-01 07:20:54","2011-01-01 07:20:54","Android: real-time friend list update","<android><multithreading><time><refresh>","1","0","","",""
"4573392","1","4573447","","2011-01-01 06:48:22","4","4345","<p>I am trying to use an IV with AES so that the encrypted text is unpredictable. However, the encrypted hex string is always the same.</p><p>I have actually tried a few methods of attempting to add some randomness by passing some additional parameters to the cipher init call:</p><p>1) Manual IV generation</p><pre><code>byte[] iv = generateIv();IvParameterSpec ivspec = new IvParameterSpec(iv);</code></pre><p>2) Asking cipher to generate IV</p><pre><code>AlgorithmParameters params = cipher.getParameters();params.getParameterSpec(IvParameterSpec.class);</code></pre><p>3) Using a PBEParameterSpec</p><pre><code>byte[] encryptionSalt = generateSalt();PBEParameterSpec pbeParamSpec = new PBEParameterSpec(encryptionSalt, 1000);</code></pre><p>All of these seem to have no influence on the encrypted text.... help!!!</p><p>My code:</p><pre><code>package com.citc.testencryption;import java.security.NoSuchAlgorithmException;import java.security.SecureRandom;import javax.crypto.Cipher;import javax.crypto.SecretKey;import javax.crypto.SecretKeyFactory;import javax.crypto.spec.IvParameterSpec;import javax.crypto.spec.PBEKeySpec;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class Main extends Activity { public static final int SALT_LENGTH = 20; public static final int PBE_ITERATION_COUNT = 1000; private static final String RANDOM_ALGORITHM = ""SHA1PRNG""; private static final String PBE_ALGORITHM = ""PBEWithSHA256And256BitAES-CBC-BC""; private static final String CIPHER_ALGORITHM = ""PBEWithSHA256And256BitAES-CBC-BC""; private static final String TAG = Main.class.getSimpleName(); @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  try {   String password = ""password"";   String plainText = ""plaintext message to be encrypted"";   // byte[] salt = generateSalt();   byte[] salt = ""dfghjklpoiuytgftgyhj"".getBytes();   Log.i(TAG, ""Salt: "" + salt.length + "" "" + HexEncoder.toHex(salt));   PBEKeySpec pbeKeySpec = new PBEKeySpec(password.toCharArray(), salt, PBE_ITERATION_COUNT);   SecretKeyFactory keyFac = SecretKeyFactory.getInstance(PBE_ALGORITHM);   SecretKey secretKey = keyFac.generateSecret(pbeKeySpec);   byte[] key = secretKey.getEncoded();   Log.i(TAG, ""Key: "" + HexEncoder.toHex(key));   // PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, ITERATION_COUNT);   Cipher encryptionCipher = Cipher.getInstance(CIPHER_ALGORITHM);   // byte[] encryptionSalt = generateSalt();   // Log.i(TAG, ""Encrypted Salt: "" + encryptionSalt.length + "" "" + HexEncoder.toHex(encryptionSalt));   // PBEParameterSpec pbeParamSpec = new PBEParameterSpec(encryptionSalt, 1000);   // byte[] iv = params.getParameterSpec(IvParameterSpec.class).getIV();   // Log.i(TAG, encryptionCipher.getParameters() + "" "");   byte[] iv = generateIv();   IvParameterSpec ivspec = new IvParameterSpec(iv);   encryptionCipher.init(Cipher.ENCRYPT_MODE, secretKey, ivspec);   byte[] encryptedText = encryptionCipher.doFinal(plainText.getBytes());   Log.i(TAG, ""Encrypted: "" + HexEncoder.toHex(encryptedText)); // &lt;== Why is this always the same :(   Cipher decryptionCipher = Cipher.getInstance(CIPHER_ALGORITHM);   decryptionCipher.init(Cipher.DECRYPT_MODE, secretKey, ivspec);   byte[] decryptedText = decryptionCipher.doFinal(encryptedText);   Log.i(TAG, ""Decrypted: "" + new String(decryptedText));  } catch (Exception e) {   e.printStackTrace();  } } private byte[] generateSalt() throws NoSuchAlgorithmException {  SecureRandom random = SecureRandom.getInstance(RANDOM_ALGORITHM);  byte[] salt = new byte[SALT_LENGTH];  random.nextBytes(salt);  return salt; } private byte[] generateIv() throws NoSuchAlgorithmException {  SecureRandom random = SecureRandom.getInstance(RANDOM_ALGORITHM);  byte[] iv = new byte[16];  random.nextBytes(iv);  return iv; }}</code></pre>","396106","","","","","2013-02-21 09:41:55","AES Cipher not picking up IV","<android><aes><salt><initialization-vector>","1","0","3","",""
"4573438","1","4574416","","2011-01-01 07:13:51","0","3550","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1114287/good-book-for-beginning-android-development"">Good book for beginning android development</a>  </p></blockquote><p>I've been working with J2ME for four months, developing mobile applications. Now my organization has moved me to Android development, about which I know nothing. Please refer me to some good beginner Android books.</p>","385138","","23897","","2011-01-01 07:38:13","2011-01-01 14:56:10","What are good Android books for beginners?","<android><mobile><mobile-application>","3","1","1","2011-01-02 01:38:33",""
"4573548","1","","","2011-01-01 08:20:11","0","545","<p>What is the best way to initiate the internet connection from a background service?</p><p>My app is running periodically each 30 mins (with alarm manager triggering an alarm and that triggers a background service), from the background service, I need a working internet connection. But since the phone is in sleep mode, the wifi service is also sleeping. My question is, how to initiate / activate the internet connection (wifi/mobile) from my code? I can keep looping waiting for a valid connection but I wonder what is the bast practice for this. </p><p>I haven't been able to find any reference in the google samples regarding this.</p>","321098","","","","","2011-04-08 13:25:00","Requesting for internet connection initiation for background service","<android>","2","0","1","",""
"4573667","1","4582701","","2011-01-01 09:29:18","17","6448","<p>How to mute MediaPlayer in android</p>","545951","","190309","","2013-10-31 05:30:07","2014-01-17 07:29:17","How to mute MediaPlayer in android","<android><android-mediaplayer>","4","0","2","",""
"4573676","1","4575603","","2011-01-01 09:33:58","2","6310","<p>I am developing paint app and i save my drawing as png image. For drawing i used canvas that created with a bitmap. it works but image was corrupted. Can any one help me. I didn't check it with a real phone but on the emulator. Is that problem with emulator. I think it has very small processing ability. Am i right? Thank you.</p>","559715","","372551","","2011-01-01 14:51:24","2011-01-01 20:21:52","Saving as a png image in android","<android><canvas><bitmap><android-emulator><save>","1","0","","",""
"4573711","1","4573748","","2011-01-01 09:53:49","1","1033","<p>I am trying to schedule a timer using the timertask. I want to freeze the UI when the task is running using the ProgressDialog. I am using AsyncTask with TimerTask to achieve the desired results. But when I add Progress Dialog code to TimerTask Runnable, it throws Runtime Exception. Below is the code for TimerTask, Any help would be appreciated. Thanks in advance.</p><p>public class MyTimerTask extends TimerTask {     Context contxt;    public MyTimerTask(Context cn){        contxt=cn;</p><pre><code>}public void run() { try { pd=ProgressDialog.show(contxt, ""Searching For Records"", ""Please wait..."", true, true); reqtype=""GO""; _getRecords=new InitTask(); _getRecords.execute(contxt);} catch (Exception e) { Log.e(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Error executing MyAsyncTask: "", e.getMessage(), e); } } } </code></pre>","492458","","","","","2011-01-01 10:13:36","Android TimerTask throws RuntimeException if Show ProgressDialog is added in run()","<android><android-asynctask><progressdialog><timertask>","1","0","","",""
"4573728","1","4654416","","2011-01-01 10:04:28","1","3827","<p>I have seen few questions similar to this one, but I wanted to make sure..I fail running video on my emulator. Is it consistent? Does anyone succeeded running a video on the emulator?</p><p>The following is the code I use:</p><pre><code>import android.app.Activity;import android.net.Uri;import android.os.Bundle;import android.widget.MediaController;import android.widget.VideoView;public class TTTTest extends Activity {    /** Called when the activity is first created. */ private MediaController mc; VideoView vd;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        vd = (VideoView) findViewById(R.id.VideoView);        Uri uri = Uri.parse(""android.resource://"" + getPackageName() + R.raw.samplevideo);        mc = new MediaController(this);        vd.setMediaController(mc);        vd.setVideoURI(uri);        vd.start();    }}</code></pre><p>""samplevideo"" is either mp4 or 3gp (in both cases its not working)</p><p>main.xml 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt; &lt;VideoView android:layout_height=""fill_parent""  android:layout_width=""fill_parent""  android:id=""@+id/VideoView""&gt;&lt;/VideoView&gt;&lt;/LinearLayout&gt;</code></pre><p>and the manifest is the default one.Can anyone please tell me if I have a problem with my code?p.s. I am running the emulator using android 2.2 environment.</p>","495967","","196844","","2011-01-01 18:04:34","2011-01-11 05:11:34","Why can't I see video in emulator?","<android><video><emulator>","1","3","","",""
"4573761","1","6026313","","2011-01-01 10:20:23","3","9922","<p>i am developing an app in which i need to trasfer data in file between two devices.</p><hr><p>i have seen tutorial regaring bluetooth chat but cant figure out what stuff needed for file transfer.if anyone do it already pls help me.</p>","544537","","","","","2013-05-10 15:32:25","bluetooth file transfer in android","<android><file><bluetooth><transfer>","4","0","1","",""
"4573781","1","4624272","","2011-01-01 10:26:20","1","1838","<p>Good day.</p><p>I have three layouts: first is the root, second and third lie in first. I try add TextView object in third layout and objects had been added in third layout (I saw it in debage mode) but this objects didn't showed on screen. </p><p>May be someone know where is the problem?</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;LinearLayout        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:orientation=""horizontal""&gt;        &lt;Button            android:id=""@+id/addJokeButton""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""@string/app_name""        /&gt;        &lt;EditText            android:id=""@+id/newJokeEditText""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""        /&gt;    &lt;/LinearLayout&gt;        &lt;LinearLayout        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:orientation=""vertical""&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;    protected void initLayout() {    setContentView(R.layout.advanced);    LinearLayout linearLayout = (LinearLayout) getLayoutInflater().inflate(            R.layout.advanced, null);    m_vwJokeEditText = (EditText) findViewById(R.id.newJokeEditText);    m_vwJokeButton = (Button) findViewById(R.id.addJokeButton);    m_vwJokeLayout = (LinearLayout) linearLayout.getChildAt(1);}    protected void addJoke(Joke joke) {    m_arrJokeList.add(joke);    LayoutParams lparams = new LayoutParams(LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT);    TextView textView = new TextView(this);    setColor(textView);    textView.setLayoutParams(lparams);    textView.setText(joke.getJoke());    m_vwJokeLayout.addView(textView);}</code></pre>","559730","","","","","2011-01-07 09:50:34","How do I show TextView's in LinearLayout that layed on other Layout?","<java><android><layout><show>","2","0","","",""
"4573801","1","9151674","","2011-01-01 10:37:19","11","9331","<p>As a new developer with Android I miss a component showcase or a visual guide like <a href=""http://download.oracle.com/javase/tutorial/ui/features/compWin.html"">that for swing</a> in the documentation.There is one in someplace?Normally what I do is use google images with the component name but a visual guide will be nicer.</p>","269454","","269454","","2011-01-01 10:45:34","2012-02-05 18:13:16","Android components showcase / visual guide","<android>","4","0","2","",""
"4573812","1","","","2011-01-01 10:41:08","8","42392","<p>How to convert <code>.apk</code> files to java in android.</p>","555910","","944657","","2012-11-05 08:20:09","2014-01-10 07:30:01","How to convert .apk files to java","<java><android><apk>","3","0","5","",""
"4573971","1","","","2011-01-01 11:55:42","2","1587","<p>I am writing a simple android application that talks to a restful web-service hosted on google app engine. The web service is developed using the Restlet framework. Here are the details of my environment:</p><ul><li>Server Side: Restlet v2.0.3 for GAE</li><li>Android Side: Restlet v2.0.3 for</li><li>Android Android: v2.2 API Level 8</li></ul><p>I am placed the following permission in my AndroidManifest.xml:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt; </code></pre><p>At first, when I was developing the web service on my local development server, I was able to access this web service from within the Restlet client of my android app without any issues.</p><p>A few days back, I uploaded my service to the GAE's appspot and recompiled my android app with this new url. However, this time my app does not seem to connect to this web service at all. It attempts to connect and blocks for about a minute or so and throws up this error in the logcat:</p><pre><code>12-27 15:14:52.856: ERROR/MyActivity(362): Internal Connector Error (1002) - The calling thread timed out while waiting for a response to unblock it.12-27 15:14:52.856: ERROR/MyActivity(362):     at org.restlet.resource.ClientResource$1.invoke(ClientResource.java:1648)12-27 15:14:52.856: ERROR/MyActivity(362):     at $Proxy7.getAvailableItems(Native Method)12-27 15:14:52.856: ERROR/MyActivity(362):     at com.example.activities.MyActivity$1.run(MyActivity.java:94)</code></pre><p>I am calling the following web service method on GAE:</p><pre><code>@GetGetItemsResponse getAvailableItems(ItemCategory itemCategory);</code></pre><p>Moreover, I am doing this on the android side to bind to the web service:</p><pre><code>    ClientResource clientResource = new ClientResource(myServiceUri);    return clientResource.wrap(ItemsResource.class);</code></pre><p>Note that the appspot-based web service is working fine. I am able to access the service from the browser outside. It also properly serves a .jsp file that is part of my application war and I'm able to use it.</p><p>On the other hand, during the time when the android app tries to connect to this service, I do not even see any incoming request log in my appspot dashboard. Seems like the android request isn't even reaching GAE for some reason.</p><p>Here's how I make the web service call on the android side...</p><ol><li>The call to the web service occurs on a <em>Thread</em> with default priority.</li><li>This thread is spawned &amp; started inside the <em>onStart</em> method of my main activity.</li><li>Meanwhile, I render a progress dialog on the UI thread.</li><li>Once the thread receives any response from the web service, it updates the <em>SharedPreferences</em> with a certain value. If the call returns any error, it logs this error and then updates <em>SharedPreferences</em> with a default value.</li><li>This causes my <em>SharedPreferences</em> listener to be invoked. It then cancels the progress dialog and renders the main UI.</li></ol><p>Ever since I moved this service to appspot, the thread always returns with the exception I mentioned above.</p><p>Am I doing something wrong here ? Why does the call to this service fail when I access it from appspot ? Please let me know if you need more information. </p><p>-Kalyan Akella</p>","559750","","","","","2011-05-27 08:39:11","Restlet for Android: Internal Connector Error (1002) - Calling thread time out error","<java><android><google-app-engine><restlet>","2","0","","",""
"4573996","1","","","2011-01-01 12:09:38","1","865","<p>I need to display an image to read from right to left (Manga). So I want Webview scroll to right most when page is load. I know that scrollTo(int x,int y) may help but i dont know how to indicate the ""right most"".</p><p>Thanks,</p>","559756","","","","","2011-01-01 20:00:25","How to scroll to right most of WebView in Android","<android><webview><scroll>","1","0","","",""
"4574013","1","4575289","","2011-01-01 12:15:57","1","1490","<p>All I am looking to do is run some function 5 seconds after the app starts.  However i keep getting a ""force close"" after 5 sec.  Is timerTask even the correct function to be using in a situation like this? How about if i want to press a button later in the program, and have an event occur 5 seconds after user presses the button?</p><pre><code>package com.timertest;import java.util.Timer;import java.util.TimerTask;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class timerTest extends Activity {Timer timer = new Timer();TextView test;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    test = (TextView)findViewById(R.id.test);    timer.schedule(task, 5000);}TimerTask task = new TimerTask() {    @Override    public void run() {        test.setText(""task function run"");    }};}</code></pre>","486086","","486086","","2011-01-04 05:26:18","2011-01-04 05:26:18","struggling with timer in android","<java><android><timer>","2","0","","",""
"4574054","1","","","2011-01-01 12:34:36","11","3361","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3503114/after-orientation-change-buttons-on-a-widget-are-not-responding"">After orientation change buttons on a widget are not responding</a>  </p></blockquote><p>Hello I'm facing a problem with an appwidget that has one ImageView inside the xml layout for which I register a pendingintent that is handled in OnReceive method .Everything works okay until I change phone orientation. At this point the widget doesn't work anymore, I click on the image but nothings happens.This problem is exactly as the one here : <a href=""http://stackoverflow.com/questions/3503114/after-orientation-change-buttons-on-a-widget-are-not-responding"">After orientation change buttons on a widget are not responding</a></p><p>What's is the problem and how can be resolved ?Thanks.</p>","467780","","","","","2012-03-20 05:36:31","After orientation change buttons on a widget are not responding","<android><button><widget><orientation><phone>","5","4","3","2012-07-22 01:31:17",""
"4574131","1","4575472","","2011-01-01 13:04:14","2","1745","<p>How do i enable multiple select for simple adapter list ?i did this </p><pre><code>list=this.getListView();list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);</code></pre><p>But i am still not able to multi select </p>","366346","","","","","2011-09-28 19:31:08","Multiple Select for simple adapter in listactivity","<android>","1","0","","",""
"4574143","1","4574413","","2011-01-01 13:09:06","1","1650","<p>I'm puzzled as to why the button called ""btnAdd"" doesn't show when I use this layout. I've tried both a LinearLayout and the current RelativeLayout but it's invisible in both.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:padding=""5dp""&gt;  &lt;RelativeLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;      &lt;TextView        android:id=""@+id/lblName""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginBottom=""5dp""        android:text=""@string/category"" /&gt;      &lt;AutoCompleteTextView         android:id=""@+id/txtName""        android:layout_marginRight=""5dp""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/lblName""        android:textColor=""#000000""        android:singleLine=""true""/&gt;      &lt;Button          android:id=""@+id/btnAdd""         android:layout_width=""100dip""         android:layout_height=""wrap_content""         android:layout_alignParentRight=""true""         android:layout_toRightOf=""@id/txtName""         android:text=""@string/add""/&gt;  &lt;/RelativeLayout&gt;  &lt;TextView          android:id=""@+id/android:empty""        android:layout_marginTop=""4dp""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""@string/current_categories""        /&gt;  &lt;LinearLayout      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:layout_marginTop=""2dp""&gt;    &lt;ListView        android:id=""@+id/android:list""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""/&gt;    &lt;TextView          android:id=""@+id/android:empty""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""@string/recipe_uncategorized""        /&gt;  &lt;/LinearLayout&gt;  &lt;/LinearLayout&gt;</code></pre>","30512","","1765573","","2013-07-25 10:15:33","2013-07-25 10:15:33","Android: Button does not show in layout","<android><layout><position><android-linearlayout><android-button>","2","0","","",""
"4574155","1","4610798","","2011-01-01 13:16:38","2","438","<p>I'm using the Android MediaProvider application to get information regarding the resources registered in the media library. The only way I found to do this is to use the ContentProvider class provided by the MediaProvider application.Unfortunately, it seems to me this is quite a limitation, isn't it? Is it possible this way to create complex queries with subqueries and using other functions of SQLite?I thought that it may be possible using the SQLiteDatabase class, but it seems it is not possible to open the database directly with its path, and anyway, the query method seems not to allow subqueries. Any solution to this?Thanks!</p>","427544","","76337","","2011-01-01 13:47:18","2011-01-06 00:49:33","Making complex queries through SQLiteDatabase","<android><android-contentprovider><android-sdk-2.2>","1","0","","",""
"4574530","1","4575139","","2011-01-01 15:33:30","2","602","<p>In an Android app, is there a standard way to determine whether a user prefers <a href=""https://secure.wikimedia.org/wikipedia/en/wiki/Simplified_Chinese_characters"" rel=""nofollow"">simplified</a> or <a href=""https://secure.wikimedia.org/wikipedia/en/wiki/Traditional_Chinese_characters"" rel=""nofollow"">traditional</a> Chinese characters?</p><p>I know next to nothing about Chinese, but I do know from Wikipedia that simplified Chinese is used in mainland China (locale zh_CN) and Singapore whereas traditional Chinese is used in Taiwan (locale zh_TW), Hong Kong, and Macau. Differentiating on the country code might be acceptable for the initial choice, but it would be problematic for someone in mainland China who prefers traditional characters, or someone in Hong Kong who prefers simplified characters. Is there a global setting for this preference?</p><p>If I must resort to an app-specific setting, is there an <em>ad hoc</em> standard way of sharing this information with other apps?</p>","196844","","1079354","","2012-05-04 22:17:23","2012-05-04 22:17:23","How to determine if the user prefers simplified or traditional Chinese characters","<java><android><localization><internationalization><cjk>","1","4","","",""
"4574564","1","4574661","","2011-01-01 15:46:12","0","1307","<p>In my main activity I have a button which I make clickable or non clickable according to a given state.   However I discover that the onClickListener automatically makes it clickable again!  So how to disable a button?</p>","538847","","","","","2012-07-02 00:29:52","setClickable() thwarted by onClickListener","<android>","2","0","","",""
"4574644","1","","","2011-01-01 16:12:22","0","1186","<p>i connect to restful web service from android . I need to use httpPost toadd information. But it takes to long and i get exception.java.net.SocketException: The operation timed out</p><p>on the other hand i can make httpGet , i don't take any exception</p><p>the code is here.</p><p>ip equals to my computer's ip  at local are network. ip=10.80.20.20 </p><pre><code>   HttpClient httpclient = new DefaultHttpClient();           String url=""http://""+ip+""/projectt/source/applySurvey"";             HttpPost httppost = new HttpPost(url);             String strSurveyId=new Long(surveyId).toString();             try {                   // Add your data                   List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);                   nameValuePairs.add(new BasicNameValuePair(""surveyId"",strSurveyId));                   nameValuePairs.add(new BasicNameValuePair(""questionId"", ""4""));                   httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));                   // Execute HTTP Post Request                   HttpResponse response = httpclient.execute(httppost);                 HttpEntity entity = response.getEntity();             } catch (ClientProtocolException e) {                   e.printStackTrace();                 // TODO Auto-generated catch block               } catch (IOException e) {                   // TODO Auto-generated catch block                   e.getCause();</code></pre><p>My manifest file is here</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.mobil.survey.project""      android:versionCode=""1""      android:versionName=""1.0""&gt;      &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".categoryList""                  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="".firmsList"" android:label=""@string/app_name""&gt;&lt;/activity&gt;         &lt;activity android:name="".surveiesList"" android:label=""@string/app_name""&gt;&lt;/activity&gt;          &lt;activity android:name="".survey"" android:label=""@string/app_name""&gt;&lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Which restful web service is defined web.xml is here</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt; &lt;web-app xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://java.sun.com/xml/ns/javaee"" xmlns:web=""http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"" xsi:schemaLocation=""http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"" id=""WebApp_ID"" version=""2.5""&gt;        &lt;display-name&gt;projectt&lt;/display-name&gt;       &lt;servlet&gt;              &lt;servlet-name&gt;FormValidator&lt;/servlet-name&gt;              &lt;servlet-class&gt;com.project.servlets.FormValidator&lt;/servlet-class&gt;        &lt;/servlet&gt;        &lt;servlet-mapping&gt;                 &lt;servlet-name&gt;FormValidator&lt;/servlet-name&gt;                      &lt;url-pattern&gt;/FormValidator&lt;/url-pattern&gt;       &lt;/servlet-mapping&gt;         &lt;servlet&gt;        &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;        &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;        &lt;init-param&gt;            &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;            &lt;param-value&gt;com.project.resources&lt;/param-value&gt;        &lt;/init-param&gt;        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;    &lt;/servlet&gt;    &lt;servlet-mapping&gt;        &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;        &lt;url-pattern&gt;/source/*&lt;/url-pattern&gt;    &lt;/servlet-mapping&gt;       &lt;welcome-file-list&gt;            &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;          &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;            &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;            &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;             &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;           &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;       &lt;/welcome-file-list&gt;        &lt;/web-app&gt;</code></pre><p>and the uri resource I connected is here</p><pre><code>@Path(""/applySurvey"")public class AppliedSurveyResource  {    @GET    @Produces( MediaType.APPLICATION_JSON)    public List&lt;WSCategory&gt; getCategories() {        List&lt;WSCategory&gt; categories = new ArrayList&lt;WSCategory&gt;();        categories.addAll( CategoryProvider.instance.getModel() );        return categories;     }   @POST    @Produces(MediaType.TEXT_HTML)    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)    public void newTodo(            @FormParam(""surveyId"") Long surveyId,            @FormParam(""questionId"") Long questionId,            @FormParam(""cellId"") String cellId,            @Context HttpServletResponse servletResponse    ) throws IOException {        PRAppliedSurvey appliedSurvey=new PRAppliedSurvey();        appliedSurvey.setSurveyId(surveyId);        appliedSurvey.setQuestionId(questionId);        appliedSurvey.setCellId(cellId);        java.util.Date today = new java.util.Date();        System.out.println(new java.sql.Timestamp(today.getTime()));        appliedSurvey.setApplyDt(new java.sql.Timestamp(today.getTime()));        try {            appliedSurvey.store();        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        /*Todo todo = new Todo(id,summary);        if (description!=null){            todo.setDescription(description);        }        TodoDao.instance.getModel().put(id, todo);        URI uri = uriInfo.getAbsolutePathBuilder().path(id).build();        Response.created(uri).build();        servletResponse.sendRedirect(""../create_todo.html"");        */    }}}</code></pre>","559836","","244296","","2011-01-01 16:22:02","2011-01-01 16:58:35","httpPost takes to long and get this exception : java.net.SocketException: The operation timed out","<android><rest><service><http-post>","1","2","","",""
"4574690","1","4574997","","2011-01-01 16:26:37","1","4833","<p>I'm trying to access a webservice in Android via Ksoap2 for android. </p><p>The SoapObject is created ok, the S.o.p of the bodyOut outputs the desired strings. But when I do a <strong>requestDump</strong> of the HttpTransportSE object I create to make the call, a NullPointerException happens. In other words, the transport object is null. How can this happen?</p><p>Web Service is at <a href=""http://srilanka.lk:9080/services/CropServiceProxy?wsdl"" rel=""nofollow"">http://srilanka.lk:9080/services/CropServiceProxy?wsdl</a> </p><p><strong>This service works very well with SoapUI.</strong> </p><p>SoapUI Request</p><pre><code>&lt;soap:Envelope xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" xmlns:v1=""http://schemas.icta.lk/xsd/crop/handler/v1/""&gt;   &lt;soap:Header/&gt;   &lt;soap:Body&gt;      &lt;v1:getCropDataList&gt;         &lt;v1:code&gt;ABK&lt;/v1:code&gt;      &lt;/v1:getCropDataList&gt;   &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>SoapUI Response</p><pre><code>&lt;soapenv:Envelope xmlns:soapenv=""http://www.w3.org/2003/05/soap-envelope""&gt;   &lt;soapenv:Body&gt;      &lt;ns1:getCropDataListResponse xmlns:ns1=""http://schemas.icta.lk/xsd/crop/handler/v1/""&gt;         &lt;ns1:cropInfo&gt;            &lt;ns1:name&gt;Ambul Kesel&lt;/ns1:name&gt;            &lt;ns1:price&gt;35.0&lt;/ns1:price&gt;            &lt;ns1:location&gt;Dambulla&lt;/ns1:location&gt;         &lt;/ns1:cropInfo&gt;         &lt;ns1:cropInfo&gt;            &lt;ns1:name&gt;Ambul Kesel&lt;/ns1:name&gt;            &lt;ns1:price&gt;40.0&lt;/ns1:price&gt;            &lt;ns1:location&gt;Dambulla&lt;/ns1:location&gt;         &lt;/ns1:cropInfo&gt;      &lt;/ns1:getCropDataListResponse&gt;   &lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</code></pre><p>Client Side Complex Type KvmSerializable implementation</p><pre><code>public class CropInfo implements KvmSerializable { private String name; private float price; private String location; @Override public Object getProperty(int arg0) {  switch (arg0){  case 0:   return name;  case 1:   return price;  case 2:   return location;  default:    return null;  } } @Override public int getPropertyCount() {  return 3; } @Override public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {  switch (arg0){  case 0:   arg2.type = PropertyInfo.STRING_CLASS;   arg2.name = ""Name"";   break;  case 1:   arg2.type = Float.class;   arg2.name = ""Price"";   break;  case 2:   arg2.type = PropertyInfo.STRING_CLASS;   arg2.name = ""Location"";   break;  default:    break;  } } @Override public void setProperty(int arg0, Object arg1) {  switch(arg0){  case 0:   name = arg1.toString();   break;  case 1:   price = Float.parseFloat(arg1.toString());  case 2:   location = arg1.toString();  default:   break;  } }}</code></pre><p>Web Service Call</p><pre><code>public void btnOnClick(View v){     String NAMESPACE = ""http://schemas.icta.lk/xsd/crop/handler/v1/"";  String URL = ""http://220.247.225.202:9080/services/CropServiceProxy.CropServiceProxyHttpSoap12Endpoint"";  String method_name = ""getCropDataList"";  String SOAP_ACTION = ""http://schemas.icta.lk/xsd/crop/handler/v1/getCropDataList"";  SoapObject soap_request = new SoapObject(NAMESPACE, method_name);  soap_request.addProperty(""code"", ""ABK"" );  SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);  envelope.setOutputSoapObject(soap_request);  envelope.addMapping(NAMESPACE, ""cropInfo"", CropInfo.class);  //envelope.dotNet=true;  Marshal floatMarshal = new MarshalFloat();  floatMarshal.register(envelope);  System.out.println(""body out : "" + envelope.bodyOut.toString());  //AndroidHttpTransport http_transport = new AndroidHttpTransport(URL);  HttpTransportSE http_transport  = new HttpTransportSE(URL);  try {                    //NullPointerException HERE   System.out.println(http_transport.requestDump);   http_transport.call(SOAP_ACTION, envelope);   //because we should expect a vector, two kinds of prices are given   Vector&lt;CropInfo&gt; result_array = (Vector&lt;CropInfo&gt;)envelope.getResponse();   if(result_array != null){    for (CropInfo current_crop: result_array){     System.out.println(current_crop.getName());     System.out.println(Float.toString(current_crop.getPrice()));    }   }  } catch (Exception e) {   e.printStackTrace();   answer.setText(""error caught"");   //System.out.println(http_transport.responseDump);  }  // String result_string[] = (String[])result;  //answer.setText(""returned"");    }</code></pre><p>Can anyone explain this?</p>","169174","","779408","","2012-06-16 12:39:27","2012-06-16 12:39:27","HttpTransportSE requestDump gives NullPointerException","<android><ksoap2><ksoap><httptransportse>","1","0","","",""
"4574743","1","","","2011-01-01 16:42:06","1","381","<p>can any one please suggest a webservice apt like WolfRam Alpha, which is free for personal use? I wolud like to develop an android app with it.</p>","559848","","","","","2011-01-01 16:42:06","Free WEBSERVICE API like WOLFRAM|ALPHA for android apps?","<android><api>","0","1","","2011-01-02 01:27:55",""
"4574843","1","4574917","","2011-01-01 17:12:51","1","714","<p>I wish to launch an activity (GameActivity) from my homescreen activity, but I'd like to check that there isn't already an instance of it before doing so.  If there is already an instance, I'd like to call finish() on it, and then proceed with starting my new GameActivity.</p><p>This - <a href=""http://stackoverflow.com/questions/1624338/android-return-to-previous-activity-without-calling-finish"">Android: Return to previous activity without calling finish()</a> - suggested creating a static method in the Activity to kill any existing instances, but I'm not sure what this method would look like (crucially - how does it find and act upon the existing instance of the Activity?).</p><p>Thanks a lot - hope someone can help!</p>","559861","","","","","2011-01-01 23:57:50","Checking for existing instance of activity before launching","<android>","1","0","","",""
"4574848","1","4576429","","2011-01-01 17:13:53","0","486","<p>I have a button which is supposed to open a new activity:</p><pre><code> @Override public void onClick(View view) {  switch (view.getId()) {  case R.id.Button01:   Intent myIntent = new Intent(LFSQL02.this, ManageFilms.class);   startActivity(myIntent);   break;  } }</code></pre><p>When pressed, it leads to an unexpected stop. The manifest does list .ManageFilms class. Where is the location of the error? Thanks</p>","547931","","","","","2011-01-02 00:03:34","button click stops app unexpectedly","<android><activity><onclick><stop>","1","4","","",""
"4575060","1","","","2011-01-01 18:08:49","2","380","<p>I am playing a stream I got from a UDP socket using AudioTrack inside of a service. It works fine with acceptable latency when screen is on but as soon as screen turns off, the latency increase to somewhere around 5-10 seconds. I've looked through Android documentation and also searched a lot on Google but so far couldn't find the reason for this.</p><p>Does anyone have a solution for this?</p>","541330","","15168","","2013-10-02 04:00:50","2013-10-02 04:00:50","Absurd audio latency with AudioTrack when display is off","<android><audio><latency>","0","2","","",""
"4575132","1","","","2011-01-01 18:26:13","0","482","<p>I'm just starting with Android. I've been able to successfully display a list and handle clicks on any particular item. What I want to do is have a new list appear based on what item is clicked.</p><p>For example..</p><pre><code>FloridaGeorgia....</code></pre><p>User clicks Florida and a new list is displayed...</p><pre><code>MiamiTampa..</code></pre><p>Should I create a new Activity and handle it that way? For some reason I just can't quite find sample code that covers this scenario.</p>","559904","","334849","","2011-01-01 18:28:17","2011-01-01 20:29:36","Displaying a new list after selecting an item from a ListView in Android?","<android><listview>","2","0","","",""
"4575153","1","","","2011-01-01 18:32:46","0","458","<p>I have a simple program that displays an image. I load the image in the onCreate method but when I attach the debugger I notice that the image is only shown on the screen when the onCreate method has finished. Unfortunately I want to reload the image continuously so I added a loop. Now no image is shown on the screen (because onCreate doesn't finish). I've already tried to set the visibility of the imageview to visible but that didn't change anything. Is there a set* that I have to call or is it a bad idea to loop in the onCreate Method?Thanks! </p>","559909","","","","","2011-01-02 16:09:51","Image is only shown when OnCreate Activity has finished","<android><refresh><imageview>","2","0","","",""
"4575155","1","4575420","","2011-01-01 18:33:07","2","10838","<p>I have a TableLayout with a button at the bottom.   My problem is that the button stretches to fill the entire width of the column even though I don't want it that wide. </p><p><img src=""http://i.stack.imgur.com/jeNcq.jpg"" alt=""alt text""></p><p>The XML looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:stretchColumns=""*""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;   &lt;TableRow android:layout_height=""wrap_content""        android:layout_width=""fill_parent""&gt;      &lt;CheckBox android:id=""@+id/check1""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""       android:text=""Some text 1""/&gt;     &lt;CheckBox android:id=""@+id/check2""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Some text 1""/&gt;   &lt;/TableRow&gt;   &lt;TableRow android:layout_height=""wrap_content""        android:layout_width=""fill_parent""&gt;       &lt;CheckBox android:id=""@+id/check3""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""       android:text=""Even some more text 2""/&gt;     &lt;CheckBox android:id=""@+id/check4""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Even some more text 2""/&gt;   &lt;/TableRow&gt;    &lt;TableRow android:layout_height=""wrap_content""        android:layout_width=""fill_parent""&gt;      &lt;CheckBox android:id=""@+id/check5""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""       android:text=""An even longer line of text 3""/&gt;     &lt;CheckBox android:id=""@+id/check6""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""Another longer line of text 3""/&gt;    &lt;/TableRow&gt;   &lt;EditText      android:id=""@+id/myEditText1""      android:layout_width=""fill_parent""       android:layout_height=""wrap_content""      android:inputType=""textMultiLine""      android:singleLine=""false""      android:text=""Enter some text""    /&gt;   &lt;TableRow&gt;    &lt;Button android:id=""@+id/SaveButton""      android:layout_width=""wrap_content""       android:layout_height=""wrap_content""      android:text=""Save""&gt;  &lt;/Button&gt;   &lt;/TableRow&gt;       &lt;/TableLayout&gt;</code></pre><p>Even if I set an explicit width to the button it ignores it.  For example if I have:</p><pre><code>   &lt;Button android:id=""@+id/SaveButton""      android:layout_width=""100sp""      android:layout_height=""100sp""      android:text=""Save""&gt;  &lt;/Button&gt; </code></pre><p>... the button gets taller but the width still stretches to fill the column.</p><p>I'd like the button to be about half its current width, centered in the column.   <strong>Thanks in advance!!</strong></p>","424690","","","","","2011-01-01 21:05:33","Button width in Android TableLayout","<android>","2","0","2","",""
"4575167","1","4577449","","2011-01-01 18:35:55","7","3367","<p>I'd like to copy my whole emulator install to another computer with a desktop shortcut which will start it so that my friend can test my app. Has anyone done this?</p>","317033","","","","","2013-04-10 06:04:29","Android - How to copy the emulator to a friend for testing","<android><emulator>","4","2","5","",""
"4575284","1","","","2011-01-01 19:05:13","1","927","<p>I have a Gallery view, the view is loaded with 10 images.  The situation I'm struggling with is when the user scrolls to the end of the gallery how do I load the next 10 images?</p><p>I added a ""Next"" button to fetch the next 10 images the problem with this solution is when I switch the phones orientation to landscape gallery view wont scroll anymore. Plus I read <a href=""http://stackoverflow.com/questions/2285536/question-on-creating-a-gallery-view-containing-buttons"">here</a> that you cannot put interactive controls in Gallery view.  </p><p>If I implement the onScroll() or onFling() methods then I will be fetching the next 10 images without knowing if the user has reached the end of the first 10 in the view.</p><p>Your advice would be much appreciated.</p>","553486","","","","","2011-06-23 22:20:02","How to handle paging in Gallery view?","<android>","1","0","","",""
"4575355","1","","","2011-01-01 19:21:48","9","3508","<p>I thought that the method ""onTouchEvent()"" of a ""ScaleGestureDetector"" instance was supposed to return ""true"" <strong>only if it really handles the touch event</strong>, i. e. if it detects a multi-touch scaling gesture (with two fingers). Otherwise I tought that it was supposed to return ""false"" in order to let other handlers handle the event, e. g. a long press for triggering a context menu.</p><p>I observed something different: scaleGestureDetector.onTouchEvent() always returns ""true"" in my case. The following code snippet of my MyView class:</p><pre><code>public boolean onTouchEvent(MotionEvent event) {  boolean retval = scaleGestureDetector.onTouchEvent(event);   Log.v(""MyView.onTouchEvent()"", ""Action: "" + event.getAction() +         ""; PointerCount: "" + event.getPointerCount() +         ""; scaleGestureDetector.onTouchEvent() RetVal: "" + retval);   return(retval);}</code></pre><p>produced the follwing log output after I touched the view for approx 1 second with one finger, then performed a scale gesture with 2 fingers:</p><pre><code>01-01 19:09:54.484: VERBOSE/MyView.onTouchEvent()(5930): Action: 0; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:54.510: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:54.541: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:54.580: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:54.820: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:54.910: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:55.050: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:55.350: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:55.400: VERBOSE/MyView.onTouchEvent()(5930): Action: 1; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:09:57.160: INFO/BatteryStatsImpl(96): notePhoneSignalStrengthLocked: 4-&gt;301-01 19:10:00.060: ERROR/ClockWidget(215): weatherClock onReceive~ mUseAnimation:false01-01 19:10:00.060: ERROR/ClockWidget(215): handleUiMessage~ in pause. msg:3686701-01 19:10:00.070: ERROR/ClockWidget(215): weatherClock onReceive~ mUseAnimation:false01-01 19:10:00.090: INFO/PI.Alarms(699): Update Alarms start01-01 19:10:00.090: INFO/PI.Alarms(699): Task Notifications: Already displaying the same alarms, no update01-01 19:10:00.100: INFO/PI.Alarms(699): Event Notifications: Already displaying the same alarms, no update01-01 19:10:00.830: VERBOSE/MyView.onTouchEvent()(5930): Action: 0; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:00.840: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:00.870: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:00.900: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:00.922: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:00.931: VERBOSE/MyView.onTouchEvent()(5930): Action: 261; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:00.950: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.002: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.030: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.060: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.090: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.120: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.140: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.172: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.200: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.230: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.252: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.280: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.310: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.342: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.370: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.390: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.424: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.450: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.480: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.510: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.530: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.580: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.690: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.780: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.815: VERBOSE/MyView.onTouchEvent()(5930): Action: 2; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.830: VERBOSE/MyView.onTouchEvent()(5930): Action: 262; PointerCount: 2; scaleGestureDetector.onTouchEvent() RetVal: true01-01 19:10:01.840: VERBOSE/MyView.onTouchEvent()(5930): Action: 1; PointerCount: 1; scaleGestureDetector.onTouchEvent() RetVal: true</code></pre><p>As I said: The return value is always ""true""! Is this a bug of ScaleGestureDetector.onTouchEvent()? What can I do to let other handlers handle all non-scale-gesture events (e. g. long press with 1 finger)? Please help!</p><p>Nemax</p>","559916","","","","","2013-11-10 00:04:07","ScaleGestureDetector.onTouchEvent always returns 'true'","<android>","3","0","4","",""
"4575357","1","","","2011-01-01 19:22:04","5","1010","<p>I'm trying to write an Android app that analyzes content from the user's music library.  Let's assume that these are mp3 files on the SD drive, for starters.  I'm able to find Java algorithms to analyze music files, but I can't find an API to read and decode the files (not play them.  There's an API to play the files, and even classes for audio effects, but I don't see any way for an app to get to the decoded data from a music file.  I can read from microphone.</p><p>J2SE has a class AudoInputStream,but it's not part of Android.  Any suggestions?</p>","559380","","","","","2011-01-06 21:20:15","Need Android equivalent of AudioInputStream","<android><mp3><signal-processing><audio-streaming><tempo>","1","0","1","",""
"4575455","1","5108693","","2011-01-01 19:45:11","2","1095","<p>I have a Archos a28 internet tablet running Android Froyo 2.2. I have a HID Input class device that I would like to get working on Android.  The tablet itself is already capable of handling a mouse and USB Flash drive out of the box.</p><p>I would like to my USB device with the a28. It is a custom designed device.  I need to be able to read and write the raw USB input and output reports to and from the device.  </p><p>How can I accomplish this? I have heard that it might be possible to create a module to do this.</p>","516126","","516126","","2011-02-11 18:29:49","2011-02-24 18:10:21","USB Input device on Archos a28: Read and Write directly to device","<java><android><usb><hid><archos>","2","3","1","",""
"4575585","1","4576104","","2011-01-01 20:16:10","0","367","<p>Among other things, my app displays photos in an ImageView in a popup Dialog. These images come out of a database that is created on the user's PC. Before storing them in the database, I resize them for max dimensions of 320x320 pixels.</p><p>So, in almost all cases, on the Android device I simply display the photos at their ""natural"" dimension, which fits nicely on almost all screens. However, I have at least one customer with an HTC Wildfire which, even though its screen is 3.2"", has only QVGA dimensions (240x320). With my current code, the photos do seem to be resized by the system to display within the screen boundaries, but the rest of the views in the dialog (caption, buttons, etc.) get ""pushed off the screen"" and are not visible or usable.</p><p>Obviously I need to handle this case by setting some specific dimensions on the ImageView when running on a QVGA device, but what is the best approach? Should I use DisplayMetrics to discover the dimensions and adjust accordingly? This would work, but seems like it might be too low-level of an approach. Could I put dimension the image in the XML in some way using ""dips""? </p>","446874","","","","","2011-01-01 22:26:05","Resizing image for low-res screen","<android><android-widget>","1","0","","",""
"4575592","1","","","2011-01-01 20:17:30","2","2860","<p>I'm trying to access a Web Service which is hosted here</p><p><a href=""http://srilanka.lk:9080/services/CropServiceProxy?wsdl"" rel=""nofollow"">http://srilanka.lk:9080/services/CropServiceProxy?wsdl</a></p><p>Works in SoapUI ok. I get the proper response in it. </p><p><strong>SoapUI Request</strong></p><pre><code>&lt;soap:Envelope xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"" xmlns:v1=""http://schemas.icta.lk/xsd/crop/handler/v1/""&gt;   &lt;soap:Header/&gt;   &lt;soap:Body&gt;      &lt;v1:getCropDataList&gt;         &lt;v1:code&gt;ABK&lt;/v1:code&gt;      &lt;/v1:getCropDataList&gt;   &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p><strong>SoapUI Response</strong></p><pre><code>&lt;soapenv:Envelope xmlns:soapenv=""http://www.w3.org/2003/05/soap-envelope""&gt;   &lt;soapenv:Body&gt;      &lt;ns1:getCropDataListResponse xmlns:ns1=""http://schemas.icta.lk/xsd/crop/handler/v1/""&gt;         &lt;ns1:cropInfo&gt;            &lt;ns1:name&gt;Ambul Kesel&lt;/ns1:name&gt;            &lt;ns1:price&gt;35.0&lt;/ns1:price&gt;            &lt;ns1:location&gt;Dambulla&lt;/ns1:location&gt;         &lt;/ns1:cropInfo&gt;         &lt;ns1:cropInfo&gt;            &lt;ns1:name&gt;Ambul Kesel&lt;/ns1:name&gt;            &lt;ns1:price&gt;40.0&lt;/ns1:price&gt;            &lt;ns1:location&gt;Dambulla&lt;/ns1:location&gt;         &lt;/ns1:cropInfo&gt;      &lt;/ns1:getCropDataListResponse&gt;   &lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</code></pre><p>But in Ksoap2 for android the soap response is an error. Following are the requestDump and responseDump respectively.</p><p><strong>requestDump</strong></p><pre><code>&lt;v:Envelope xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:d=""http://www.w3.org/2001/XMLSchema"" xmlns:c=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:v=""http://schemas.xmlsoap.org/soap/envelope/""&gt;&lt;v:Header /&gt;&lt;v:Body&gt;&lt;n0:getCropDataList id=""o0"" c:root=""1"" xmlns:n0=""http://schemas.icta.lk/xsd/crop/handler/v1/""&gt; &lt;code i:type=""d:string""&gt;CNT&lt;/code&gt;&lt;/n0:getCropDataList&gt;&lt;/v:Body&gt;&lt;/v:Envelope&gt;</code></pre><p><strong>responseDump</strong></p><pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/""&gt;&lt;soapenv:Header xmlns:wsa=""http://www.w3.org/2005/08/addressing""&gt;&lt;wsa:Action&gt;http://www.w3.org/2005/08/addressing/soap/fault&lt;/wsa:Action&gt;&lt;wsa:RelatesTo&gt;urn:uuid:3257ABC779195052D01293913466558&lt;/wsa:RelatesTo&gt;&lt;/soapenv:Header&gt;&lt;soapenv:Body&gt;&lt;soapenv:Fault&gt;&lt;faultcode&gt;VersionMismatch&lt;/faultcode&gt;&lt;faultstring&gt;Only SOAP 1.1 or SOAP 1.2 messages are supported in the system&lt;/faultstring&gt;&lt;detail /&gt;&lt;/soapenv:Fault&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</code></pre><p>Here is my code. </p><pre><code>public void btnOnClick(View v){        String NAMESPACE = ""http://schemas.icta.lk/xsd/crop/handler/v1/"";        String URL = ""http://220.247.225.202:9080/services/CropServiceProxy.CropServiceProxyHttpSoap12Endpoint"";        String METHOD_NAME = ""getCropDataList"";        String SOAP_ACTION = ""http://schemas.icta.lk/xsd/crop/handler/v1/getCropDataList"";        SoapObject soap_request = new SoapObject(NAMESPACE, METHOD_NAME);        soap_request.addProperty(""code"", ""ABK"" );        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);        envelope.setOutputSoapObject(soap_request);        envelope.addMapping(NAMESPACE, ""cropInfo"", CropInfo.class);        envelope.dotNet=false;        Marshal floatMarshal = new MarshalFloat();        floatMarshal.register(envelope);        System.out.println(""body out : "" + envelope.bodyOut.toString());        AndroidHttpTransport http_transport = new AndroidHttpTransport(URL);        //HttpTransportSE http_transport  = new HttpTransportSE(URL);        http_transport.debug = true;        try {            http_transport.call(SOAP_ACTION, envelope);                     //because we should expect a vector, two kinds of prices are given            Vector&lt;CropInfo&gt; result_array = (Vector&lt;CropInfo&gt;)envelope.getResponse();            if(result_array != null){                for (CropInfo current_crop: result_array){                    System.out.println(current_crop.getName());                    System.out.println(Float.toString(current_crop.getPrice()));                }            }        } catch (Exception e) {            e.printStackTrace();            answer.setText(""error caught"");            System.out.print(""REQUEST: "");            System.out.println(http_transport.requestDump);            System.out.print(""RESPONSE: "");            System.out.println(http_transport.responseDump);        }    }</code></pre><p>How can I get a proper response in Ksoap2 for this? </p>","169174","","","","","2012-06-18 18:24:03","Soap Fault VersionMismatch KSOAP2 for Android","<android><soap><soapui><ksoap2>","3","4","1","",""
"4575614","1","4575685","","2011-01-01 20:24:04","5","1255","<p>Currently readying an app for release onto the marketplace. The big wigs want to charge a subscription for the app and this is proving troublesome to implement for android.</p><p>We don't want to do ""99 cents buys the app forever"" since there is an ongoing server usage for this app and so we want to charge a subscription. </p><p>Seems that Android Licensing Server doesn't support this - all that does is ""did I buy this app or not"" to help reduce piracy.</p><p>I also do not want to go down the route of having extra versions installed that act as the purchase. Otherwise the user would be buying an app every year.</p><p>Is there some solution I am missing ?</p>","2048448","","","","","2012-09-15 01:23:17","Android Subscription based Licensing","<android>","7","0","1","",""
"4575736","1","","","2011-01-01 20:56:36","1","43494","<p>I am new in Android environment and I have started writing some code to execute some queries on a database. When I have to handle exceptions I don't know what the appropriate way is to do it - out of Android I used to use <code>throws</code> declaration on methods but it seems that <code>throws</code> isn't allowed in android? Just <code>try-catch</code>? I say this because eclipse doesn't suggest me adding <code>throws</code> declaration like when I am out of Android environment, I guess that it is related to <code>extends Activity</code>.So what is the appropriate way to handle exceptions in android? Surrounding every sentence with <code>try-catch</code> makes my code look terrible and that's not really what I want to do.</p>","559972","","2000012","","2013-07-09 12:43:08","2013-07-09 12:43:08","Throws,try and catch on Android","<java><android><exception-handling>","3","3","","",""
"4575904","1","4575953","","2011-01-01 21:39:42","0","890","<p>HelloI am trying to do a javascript function compatible on android and ipad, but i notice that android doesnt support ongesture*<em>*</em> events? 1.It's really true?</p><pre><code>.ongesturestart=function(e){.ongesturechange=function(e){.ongestureend=function(e){</code></pre><p>2.Since I cant buy niether an Android system nor a Ipad, is there any Android/Ipad simulator for pc/windows/linux around the web? I need them for developenig and simulating web application based on touch/gestures events.</p><p>3.Is there possible that google hasnt develop chrome for android platform? and firefox for android/Ipad?Thanks</p>","354881","","487669","","2011-01-01 21:48:08","2011-01-01 21:52:33","Javascript on mobile os, android and ipad","<javascript><android><ios><mobile>","1","0","","",""
"4576067","1","","","2011-01-01 22:16:48","0","272","<p>I have just installed android SDK on my system. After that i created a project. However as i create my project an error message comes on my screen ""progaurd.cfg missing"". I searched net and found that this file is related to default.properties which is missing in my project. Also, when i check my projcet's properties, i found that there is no libraries or JAR's in my project. Have i missed something during installation.Help in this regard will be appriciable.Thanks and regards.</p>","541786","","","","","2013-11-08 08:30:23","default.properties missing in my project","<android>","0","3","1","",""
"4576080","1","4581693","","2011-01-01 22:19:57","5","3284","<p>The goal is to implement a Gallery whose adapter returns ListViews (in other words, vertically scrolling ListViews embedded in a horizontally scrolling Gallery).  It sort of works after a bit of work, but when attempting to scroll horizontally, the ListView looks very jittery, like there is some stickiness to it being centered.  I have not observed this kind of behavior with any other type of View embedded in a Gallery.</p><p>Here is what I have tried:</p><p>Initially, I found that the ListView squashed touch events, so the gesture listener on the Gallery never gets fired.</p><p>So in the onCreate() method of the Activity, I created a GestureDetector:</p><p><code>galleryGestureDetector = new GestureDetector(this, gallery);</code></p><p>Then, inside the getView() method of the Gallery adapter, after the ListView has been inflated and configured, I have some code like this:</p><pre><code>listView.setOnTouchListener(new OnTouchListener() {    public boolean onTouch(View v, MotionEvent event) {        galleryGestureDetector.onTouchEvent(event);        return true;    }});</code></pre><p>In this case I have even gone to the extreme step of returning true from the OnTouchListener to ensure that the onTouchEvent() method of the listView is never actually called.  The same jittery behavior occurs.  As a result, I think I can rule out competing onTouchEvent() implementations between the two views.</p><p>I tried abusing the TouchDelegate concept as well by extending the Gallery's touch rectangle to include the ListView and then forcing the ListView to delegate to it, but this was a futile effort as well.</p><p>I would throw up my hands and say it isn't possible currently, but the Social Networking app that packs with the DroidX somehow accomplishes it!</p>","510017","","510017","","2011-11-17 18:43:39","2012-01-04 13:34:49","Embedding ListView inside Gallery","<java><android><listview><gallery><ontouchlistener>","1","6","2","",""
"4576124","1","4684977","","2011-01-01 22:31:06","0","423","<p>Steps:</p><ol><li>I start my Android app.</li><li>I press the Menu button and select Preferences => preferences screen appears.</li><li>I make a preference and then press the Back button => the application's main activity appears again.</li><li>I press the Back buttton => Home screen.</li><li>I press the Home button and select my app => Preferences screen appears...why??</li></ol><p>Main activity</p><pre><code>@Overrideprotected void onResume(){   startService();   super.onResume();}private void startService() {   ...   preferences = PreferenceManager.getDefaultSharedPreferences(this);      startService(new Intent(MainActivity.this, WeatherService.class));   ...}@Overrideprotected void onPause(){   unbindService();   super.onPause();}private void onPreferences() {   Intent i = new Intent(MainActivity.this, Preferences.class);   startActivity(i);}</code></pre><p>Preference activity</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);   addPreferencesFromResource(R.xml.preferences);}</code></pre><p>Cheers,Christian</p>","360674","","360674","","2011-01-02 09:25:16","2011-01-13 20:36:21","How come the preferences activity is launched when selecting my app from the menu displayed when pressing the Home button?","<android>","1","2","0","",""
"4576218","1","4577279","","2011-01-01 23:04:13","0","630","<p>So I can't figure out why my app wont load... There are no errors.</p><p><a href=""http://pastebin.com/ssXXhiWw"" rel=""nofollow"">Link to onCreate (Its kinda big)</a></p><p>Maybe it has to do with tabhost? new to that, first attempt...</p><p>Hopefully someone can help.</p><p>Thanks,Brandon</p>","558961","","","","","2011-01-02 05:30:41","Unexpected Error","<android>","1","7","","",""
"4576219","1","4576377","","2011-01-01 23:04:38","9","19428","<p>I'm doing an application for Android and something I need is that it shows a list of all files and directories in the SD Card and it has to be able to move through the different directories. I found <a href=""http://www.anddev.org/viewtopic.php?t=67"" rel=""nofollow"">a good tutorial in anddev</a>. I modified a few things so the application moves in the SD Card and not in Android root Directories but the rest is mostly the same.</p><p>This is my xml file for the activity:</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/android:list""           android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView         android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;&lt;/ListView&gt;</code></pre><p>And this is the code for the Activity:</p><pre><code>    import hackreatorz.cifrador.R;import java.io.File;import java.util.ArrayList;import android.app.ListActivity;import android.content.res.Configuration;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;public class ArchivosSD extends ListActivity {    private ArrayList&lt;String&gt; directoryEntries = new ArrayList&lt;String&gt;();    private File currentDirectory = new File(""/sdcard/"");    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        browseToSD();    }    @Override    public void onConfigurationChanged(Configuration newConfig) {        super.onConfigurationChanged(newConfig);    }    private void browseToSD() {        browseTo(new File(""/sdcard/""));    }    private void upOneLevel() {         if(this.currentDirectory.getParent() != null)             this.browseTo(this.currentDirectory.getParentFile());    }    private void browseTo(final File directory) {        if (directory.isDirectory()) {                this.currentDirectory = directory;                fill(directory.listFiles());        } else {                Toast.makeText(ArchivosSD.this, this.directoryEntries.get(this.getSelectedItemPosition()), Toast.LENGTH_SHORT).show();                }    }    private void fill(File[] files) {        this.directoryEntries.clear();        this.directoryEntries.add(getString(R.string.current_dir));        if(this.currentDirectory.getParent() != null)            this.directoryEntries.add(getString(R.string.up_one_level));            int currentPathStringLength = (int) this.currentDirectory.getAbsoluteFile().length();            for (File file : files) {                this.directoryEntries.add(file.getAbsolutePath().substring(currentPathStringLength));                       }        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.archivos_sd, this.directoryEntries));    }       @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        int selectionRowID = (int) this.getSelectedItemPosition();        String selectedFileString = this.directoryEntries.get(selectionRowID);        if (selectedFileString.equals(""."")) {            this.browseToSD();        } else if(selectedFileString.equals("".."")) {            this.upOneLevel();        } else {            File clickedFile = null;            clickedFile = new File(this.currentDirectory.getAbsolutePath() + this.directoryEntries.get(selectionRowID));            if(clickedFile != null)                this.browseTo(clickedFile);            }    }}</code></pre><p>I don't get any errors in Eclipse, but I get a Force Close when running the application on my phone  and when I look at Logcat I see the following:</p><p><em>01-01 23:30:29.858: ERROR/AndroidRuntime(14911): FATAL EXCEPTION: main</em>*01-01 23:30:29.858: ERROR/AndroidRuntime(14911): java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView*</p><p>I don't have a clue what to do, I've looked up in Google and I didn't find anything and I did the same at stackoverflow. This is my first aplication in Java and for Android so I'm a real n00b and if the answer was there, I didn't understand it so I would really appreciate if you could explain what I should do to fix this error and why.</p><p>Thanks for everything in advance.</p>","559947","","-1","","2012-08-14 17:56:54","2013-06-19 23:59:10","Logcat error: ""addView(View, LayoutParams) is not supported in AdapterView"" in a ListView","<android><listview><adapter><android-adapterview>","2","0","3","",""
"4576281","1","7331916","","2011-01-01 23:23:20","5","10186","<p>Is there a decent date time picker that works well on mobile devices? Everything I have found seems to be very clunky on a phone.</p><p>The other option is the four drop down selects for day, month, hour and minute. just seems like there must be a better solution out there.</p>","19839","","114029","","2011-01-01 23:35:50","2013-09-28 06:35:07","jQuery Date Time picker that works well on iOS/Android","<javascript><jquery><android><ios><datepicker>","3","0","1","",""
"4576330","1","4576362","","2011-01-01 23:39:05","53","27914","<p>I am new to android development and keep coming across references to Inflating views from a layout xml file.  I googled and searched the development guide but still wasn't able to pick up a sense for what it means.  If someone could provide a very simple example, it'd be much appreciated.</p>","546901","","","","","2011-01-01 23:54:45","What does it mean to inflate a view from an xml file?","<android><android-inflate>","2","0","26","",""
"4576351","1","4576615","","2011-01-01 23:43:02","0","1176","<p>I'm running into problems trying to assign a 2d array to a 3d array, so I thought i'd ask a question about 3d and 2d arrays.</p><p>Say I have a masterArray[][][] and wanted to put childArray1[][] and childArray2[][] into it.This is how I have done it and was wondering if that is the correct way of applying it:</p><pre><code>private int[][][] masterArray;private int[][] childArray1 = {        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 0, 0, 1, 0, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 0, 1, 1, 1, 1, 1, 1, 0, 1},        {1, 0, 1, 1, 1, 1, 0, 1, 0, 1},        {1, 0, 1, 1, 0, 1, 0, 1, 0, 1},        {1, 0, 1, 1, 0, 1, 1, 1, 0, 1},        {1, 0, 1, 1, 1, 1, 1, 1, 0, 1},        {1, 0, 1, 1, 0, 1, 1, 1, 0, 1},        {1, 0, 1, 1, 0, 1, 8, 1, 0, 1},        {1, 0, 7, 1, 1, 1, 0, 1, 0, 1},        {1, 0, 1, 1, 1, 1, 0, 1, 0, 1},        {1, 0, 1, 1, 1, 1, 1, 1, 0, 1},        {1, 0, 0, 0, 0, 0, 0, 9, 0, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}};private int[][] childArray2 = {        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {0, 0, 0, 0, 0, 0, 0, 0, 1, 1},        {1, 1, 1, 1, 7, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 0, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 0, 0, 0, 1, 1, 1},        {1, 1, 1, 9, 1, 1, 8, 0, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},        {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},};</code></pre><p>Ok, so in my init method I use these some methods to set the child arrays into the master array. What I was curious about was how this exactly works. I assumed the following:</p><pre><code>    masterLevel = new int[MAX_LEVELS][MAP_WIDTH][MAP_HEIGHT];    for (int x = 0; x &lt; MAP_WIDTH; x++) {        for (int y = 0; y &lt; MAP_HEIGHT; y++) {            masterArray[currentLevel][x][y] = childArray1[x][y];        }    }</code></pre><p>Would that work?In my application things aren't working so I picking out code that I am not 100% sure on.</p>","507007","","","","","2013-02-20 05:07:18","Android java assigning 2d array to 3d array","<java><android><arrays><multidimensional-array>","3","0","","",""
"4576388","1","","","2011-01-01 23:53:49","0","1103","<p>I am trying to write a java function that will change 1 byte in a large file. How can I read in and write to a specific address in a file with java on android? I have tried fis.read(byte b[], int off, int len) and I get a force close every time.</p>","560052","","","","","2011-01-02 00:07:34","Changing a specific byte in a file","<java><android><file-io><byte>","1","1","","",""
"4576441","1","4576466","","2011-01-02 00:06:06","5","12900","<p>I'm using a custom font throughout my application (which, incidentally, I've frustratingly found out that you have to apply programmatically by hand to EVERY control!), and I need to apply it to a listview.  The problem is that I can't see where I'd set the textview used in the list's font to my custom font (as I never instantiate it - that's all taken care of by the adapter).</p><p>What I'd ideally like is to be able to use an adapter like this:</p><pre><code>new ArrayAdapter(Context context, TextView textView, List&lt;T&gt; objects)</code></pre><p>That way I could do: textView.setTypeface before populating my list.  Does anyone know if there's a way to do something along these lines?</p>","559861","","","","","2013-10-21 18:21:18","custom font in android ListView","<android><listview><fonts><typeface>","7","1","5","",""
"4576493","1","4576721","","2011-01-02 00:21:29","15","21630","<p>The Android game <a href=""http://www.appbrain.com/app/my-paper-plane-2-%283d%29/com.wavecade.mypaperplane_x"">My Paper Plane</a> is a great example of how to implement tilt controls, but I've been struggling to understand how I can do something similar.</p><p>I have the following example that uses <a href=""http://developer.android.com/reference/android/hardware/SensorManager.html"">getOrientation()</a> from the SensorManager. The whole thing is on <a href=""http://pastebin.com/c1MNT5x7"">pastebin here</a>. It just prints the orientation values to text fields. Here is the most relevant snippet:</p><pre><code>private void computeOrientation() {    if (SensorManager.getRotationMatrix(m_rotationMatrix, null,                                        m_lastMagFields, m_lastAccels)) {        SensorManager.getOrientation(m_rotationMatrix, m_orientation);        /* 1 radian = 57.2957795 degrees */        /* [0] : yaw, rotation around z axis         * [1] : pitch, rotation around x axis         * [2] : roll, rotation around y axis */        float yaw = m_orientation[0] * 57.2957795f;        float pitch = m_orientation[1] * 57.2957795f;        float roll = m_orientation[2] * 57.2957795f;        /* append returns an average of the last 10 values */        m_lastYaw = m_filters[0].append(yaw);        m_lastPitch = m_filters[1].append(pitch);        m_lastRoll = m_filters[2].append(roll);        TextView rt = (TextView) findViewById(R.id.roll);        TextView pt = (TextView) findViewById(R.id.pitch);        TextView yt = (TextView) findViewById(R.id.yaw);        yt.setText(""azi z: "" + m_lastYaw);        pt.setText(""pitch x: "" + m_lastPitch);        rt.setText(""roll y: "" + m_lastRoll);    }}</code></pre><p>The problem is that the values this spits out look like nonsense, or at least there's no way to isolate which type of motion the user performed. I've drawn a diagram to indicate the 2 types of motion that I'd like to detect - 1. ""tilt"" for pitch and 2. ""rotate"" for roll/steering:</p><p><img src=""http://i.stack.imgur.com/ylWJb.png"" alt=""Figure 1. Pitch and roll""></p><p>(That's an isometric-ish view of a phone in landscape mode, of course)</p><p>When I tilt the phone forwards and backwards along its long axis - shown by 1. - I expected only 1 of the values to change much, but all of them seem to change drastically. Similarly, if I rotate the phone about an imaginary line that comes out of the screen - shown in 2. - I'd hope that only the roll value changes, but all the values change a lot.</p><p>The problem is when I calibrate my game - which means recording the current values of the angles x, y and z - I later don't know how to interpret incoming updated angles to say ""ok, looks like you have tilted the phone and you want to roll 3 degrees left"". It's more like ""ok, you've moved the phone and you're a-tiltin' and a-rollin' at the same time"", even if the intent was only a roll. Make sense?</p><p>Any ideas? I've tried using remapCoordinateSystem to see if changing the axis has any effect. No joy. I think I'm missing something fundamental with this :-(</p>","4596","","","","","2011-01-02 01:54:13","How can I use SensorManager.getOrientation for tilt controls like ""My Paper Plane""?","<android><screen-orientation><tilt>","1","0","8","",""
"4576529","1","4576586","","2011-01-02 00:34:42","0","129","<p>I have created a class (InputControl) which extends the view of my main class (Main), and takes focus of the screen. I have a button on the main xml layout which calls control() and sets up my InputControl view, from there I capture user input. </p><p>How can I return back to the xml layout from the InputControl view class?</p><pre><code>public class Main extends Activity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    InputControl = new InputControl(this);}//......SNIP!public void control(){setContentView(InputControl);    InputControl.requestFocus();}}public class InputControl extends View implements OnTouchListener {public InputControl(Context context) {    super(context);    setFocusable(true);    setFocusableInTouchMode(true);    this.setOnTouchListener(this);}public boolean onTouch(View view, MotionEvent event) {//...I AM CAPTURING USER TOUCH EVENTS HERE}}</code></pre>","560065","","248432","","2011-01-02 00:51:12","2011-01-02 00:54:02","Android; Confused by views?","<android><view><extend>","1","0","","",""
"4576547","1","","","2011-01-02 00:40:42","4","4263","<p>Is there any way to programm C++ applications on Android? I mean - using your Android device for programming and compiling projects.</p>","560069","","1053","","2011-01-02 00:49:28","2011-01-02 10:42:58","Android C++ programming","<c++><android>","2","10","1","",""
"4576606","1","","","2011-01-02 01:02:25","0","377","<p>I would like to know have 2 layouts in one layout/activity, like a ""Frame"" system.Is it possible with Android ?</p>","560076","","244296","","2011-01-02 01:10:31","2011-01-02 01:20:19","A frame in my activity","<android><layout><activity><frame>","1","0","","",""
"4576642","1","4576656","","2011-01-02 01:16:23","8","1491","<p>What are the good patterns to use in developing android games?<br>And if it is a simple 2D side scrolling game, do you still need to use OpenGL?</p>","24391","","","","","2012-12-05 12:32:22","Patterns for Android Game Development?","<android><design-patterns><opengl-es>","3","0","7","2013-02-03 15:45:07",""
"4576757","1","","","2011-01-02 02:11:16","1","210","<p>I am having problems with MediaRecorder. I can create a new MediaRecorder without error however as soon as I call one of the member functions to initialise the object such as setAudioSource I get ""The application (app name) has stopped unexpectedly. Please try again."".</p><p>I have tried an app that simply has a button that calls setAudioSource from a global MediaRecorder and I have also tried using a wrapper class off the net that is stated as working but as soon it tries calling setAudioSource it does the same thing.</p><p>I am probably doing something really daft but am at a loss. Can someone please help me out with this?</p>","560098","","213269","","2011-08-15 20:49:22","2011-08-15 20:49:22","Any MediaRecorder Call = The application has stopped unexpectedly","<android><mediarecorder>","0","1","","",""
"4576764","1","","","2011-01-02 02:13:55","0","106","<p>Trying to program a connect4 style game in Android and running into issues with the views. I have worked with Java AWT and am trying to get the same functionality out of Android. A simple drawing system by which I can update the game board and have the screen remain until a button press causes a change to the game board.I have tried looking at a few tutorials but most tend to go the XML route which I am less familiar with, and also it seems it would be harder to update each of the game board locations using XML.Any easy to understand tutorials or specific instructions would be really helpful.Really just looking for a way to specify locations within a view by pixel location since that makes the most sense in my mind. if there are far easier ways those would be appreciated.</p>","560094","","","","","2011-05-12 15:35:53","non-xml Android views","<android><views>","1","1","","",""
"4576788","1","4576803","","2011-01-02 02:26:54","2","3966","<p>Ubuntu 10.04 64-bit looks promising as a development environment for Android. I now have it up and running but I am stuck at the following decision point:</p><ol><li>Synaptic Package Manager has'<strong>default-jdk</strong>' (""Standard Java orJava compatible Development Kit"").</li></ol><p>sun.com has two ""Java SE Development Kit 6u23 for Linux x64, Multi-language"":</p><ol><li>Java SE Development Kit 6u23:jdk-6u23-linux-x64-rpm.bin</li><li>Java SE Development Kit 6u23:jdk-6u23-linux-x64.bin</li></ol><p>Which one is the right one for Android development using eclipse-SDK-3.6.1-linux-gtk-x86_64.tar.gz?</p>","418055","","","","","2011-01-02 15:30:12","Which JDK for Android Development on Ubuntu 10.04 64-bit?","<android><64bit><ubuntu-10.04><jdk1.6><openjdk>","3","0","","",""
"4576848","1","","","2011-01-02 02:43:46","0","1546","<p>I was wondering if there is a way to dynamically create an additional linear layout with a textview within a predefined liner layout. THis is my code so you get the gist of what I am asking:</p><pre><code>LinearLayout MainLL= (LinearLayout) findViewById(R.id.myLayoutId);   for(int i=0; i&lt;5; i++)  {   LinearLayout childLL= new LinearLayout(this);   childLL.setOrientation(LinearLayout.VERTICAL);     childLL.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));     childLL.setGravity(Gravity.LEFT); TextView text = new TextView(this);   text.setText(""The Value of i is :""i);   text.setTextSize(12);     text.setGravity(Gravity.LEFT);   text.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));childLL.addView(text);MainLL.addView(childLL);}</code></pre><p>My problem is that I am only getting ""The Value of i is :0"" as the output, i.e. the first instance. </p><p>Any help would be much appreciated</p>","560109","","","","","2011-01-02 12:06:46","Creating Linear Layout with TextViews using a for loop","<java><android><textview><android-linearlayout>","3","0","","",""
"4576909","1","4577249","","2011-01-02 03:05:38","38","15488","<p>I'm struggling to understand the process of drawing to <code>SurfaceView</code> and therefore the whole <code>Surface</code>/<code>Canvas</code>/<code>Bitmap</code> system, which is used in Android.</p><p>I've read all articles and API documentation pages, which I was able to find on android-developers site, a few tutorials of android graphics, LunarLander source code and <a href=""http://stackoverflow.com/questions/3370212/relationship-between-surface-and-canvas-android"">this question</a>.</p><p>Please tell me, which of these statements are true, which are not, and why.</p><ol><li><code>Canvas</code> has its own <code>Bitmap</code> attached to it. <code>Surface</code> has its own <code>Canvas</code> attached to it.</li><li>All <code>View</code>'s of window share the same <code>Surface</code> and thus share the same <code>Canvas</code>.</li><li><code>SurfaceView</code> is subclass of <code>View</code>, which, unlike other <code>View</code>'s subclasses and <code>View</code> itself, has its own <code>Surface</code> to draw in.</li></ol><p>There is also one additional question:</p><ul><li>Why is there a need for a <code>Surface</code> class, if there is already a <code>Canvas</code> for high-level operations with bitmap. Give an example of a situation where <code>Canvas</code> is non-suitable for doing work which <code>Surface</code> can do.</li></ul>","402534","","518116","","2014-01-26 23:18:36","2014-01-26 23:18:36","Understanding Canvas and Surface concepts","<android><android-canvas><surface>","2","0","40","",""
"4577043","1","","","2011-01-02 03:58:38","1","2384","<p>I'm trying to get a class extending ItemizedOverlay to startActivity but there is a problem, it just won't compile.I have a MapView that uses the ItemizedOverlay class to draw overlays but i want to start and activity when i tap on the screen.</p><p>Any idea how to solve this problem? Thanks</p><pre><code>protected boolean onTap(int index) {     OverlayItem item = overlays.get(index);     String split_items = item.getSnippet();     Intent intent = new Intent();     intent.setClass(mainmenu,poiview.class);     startActivity(intent);     return true;   }</code></pre>","560133","","","","","2012-04-19 08:50:05","Start Activity from ItemizedOverlay class","<android>","3","0","","",""
"4577091","1","4664936","","2011-01-02 04:16:12","2","6877","<p>I followed the <a href=""http://developer.android.com/resources/tutorials/testing/helloandroid_test.html#CreateSetUp"" rel=""nofollow"">Hello, Testing tutorial</a> to the letter.</p><p>Yet, the following line produces a ""com.example.helloandroid.R.id cannot be resolved"" error:</p><pre><code>  mView = (TextView) mActivity.findViewById(com.example.helloandroid.R.id.textview);</code></pre><p>Eclipse amazingly suggests 2 quick fixes:</p><ol><li>Create field 'id' in type 'R'</li><li>Create constant 'id' in type 'R'</li></ol><p>Can you help me understand what these fixes mean? Are these really the correct fixes? (why didn't the tutorial provide them, too?)</p>","418055","","","","","2014-04-03 20:31:26","com.example.helloandroid.R.id cannot be resolved","<android><unit-testing>","5","2","1","",""
"4577268","1","16857477","","2011-01-02 05:23:21","11","19278","<p>Are IPtables inbuilt in android kernel? If they are, how to use them in our android application? </p>","545643","","1271432","","2012-07-27 14:01:22","2013-10-24 06:50:49","iptables in android","<android><networking><iptables>","6","4","5","",""
"4577360","1","4577666","","2011-01-02 06:02:10","1","413","<p>Nothing about how to implement ads via admob into an application or anything. I'm just new to ads and it's pretty confusing to get a good grasp on how it works. I've been wanting to put out an app with ads in it but have been reading you need to initially pay at least $50 to get started? I thought it was free to ad whatever ads to display on YOUR app. Or is the $ for adding your own advertising on OTHER people's apps? I'm so confused. Someone please enlighten me, thanks!</p>","507007","","","","","2011-01-02 08:05:34","Android admob questions","<android><advertising><admob>","2","0","1","",""
"4577601","1","4577640","","2011-01-02 07:44:50","0","1196","<p>i have created the login screen but i am unable to verify the data in the edit box..i have tried for simple verification using following function that checks whether the username and password are same..</p><pre><code>protected boolean isValid(String string1,String string2) {</code></pre><p>if(string1.equals(string2))   return true;  else  return false;</p><p>}</p><p>but it is not working properly...</p>","559076","","","","","2012-06-19 05:59:59","how to do simple login verification in android?","<android>","1","1","","",""
"4577644","1","4577669","","2011-01-02 07:58:02","12","22073","<p>I have <code>TableRows</code> created dynamically in the code and I want to set margins for these <code>TableRows</code>.</p><p>My <code>TableRows</code> created as follow:</p><pre><code>// Create a TableRow and give it an ID        TableRow tr = new TableRow(this);               tr.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));          Button btnManageGroupsSubscriptions = new Button(this);        btnManageGroupsSubscriptions.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 40));        tr.addView(btnManageGroupsSubscriptions);        contactsManagementTable.addView(tr);</code></pre><p>How do I dynamically set the margins for these?</p>","501560","","571593","","2011-02-25 10:30:44","2011-02-25 10:30:44","Programmatically set margin for TableRow","<android>","1","0","3","",""
"4577656","1","","","2011-01-02 08:01:22","0","264","<p>I want to create a ListView with categorized list items.</p><p>Same as in the case of Contacts application:</p><p>I categorizes according to the Initials.</p><p>I would have to create my own adapter thats for sure with some logic.</p><p>But can anyone tell me any best practice or a small tutorial to get me started. I have started to learn the default contacts application.</p><p>Heres what I want:<img src=""http://i.stack.imgur.com/sNbab.png"" alt=""alt text""></p>","514553","","","","","2011-01-02 08:30:31","ListView with cateogarized disabled items","<android><listview><categories>","1","0","","",""
"4577698","1","","","2011-01-02 08:21:26","15","6932","<p>I have been researching for 2 days and I haven't found a similar problem anywhere on the internet!</p><p>From the main activity, I'm trying to open a new activity containing a webview that will show an html page (about.html) in the android_asset folder.</p><p>I'm able to launch the new activity (test.java) with the webview properly displayed but the webpage content just doesn't show up. Even the webview's vertical scrollbar is displayed (as the page content is relatively long) and I can scroll the page up and down but with no content in it!</p><pre><code>package com.example.test;import android.app.Activity;import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.net.ConnectivityManager;import android.net.NetworkInfo;import android.net.Uri;import android.os.Bundle;import android.view.KeyEvent;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.TextView;public class test extends Activity {private TextView apppagetitle;private WebView browser_rn;@Overridepublic void onCreate(Bundle saveInstanceState) {    super.onCreate(saveInstanceState);    setContentView(R.layout.test);    browser_rn=(WebView)findViewById(R.id.webkit);    browser_rn.getSettings().setJavaScriptEnabled(true);    browser_rn.getSettings().setPluginsEnabled(true);    browser_rn.setScrollBarStyle(0);           final AlertDialog alertDialog = new AlertDialog.Builder(this).create();    apppagetitle=(TextView)findViewById(R.id.apppagetitle);    browser_rn.setWebViewClient(new WebViewClient() {        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return false;        }        public void onPageFinished(WebView view, String url) {                           apppagetitle.setText(browser_rn.getTitle());                        }        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {            if (!isInternetOn()) {                alertDialog.setTitle(""Connection Error"");                alertDialog.setMessage(""You need to be connected to the internet."");            } else {                alertDialog.setTitle(""Error"");                alertDialog.setMessage(description);            }            alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int which) {                    return;                }            });            alertDialog.show();        }    });    browser_rn.loadUrl(""file:///android_asset/about.html"");}public boolean onKeyDown(int keyCode, KeyEvent event)  {    if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {        browser_rn.clearCache(true);        browser_rn.clearHistory();        this.finish();        return true;    }    return super.onKeyDown(keyCode, event);}}</code></pre><p>The weird thing is that the new activity (test.java) can successfully get and display the webpage title in the textview when I call webview.gettitle() but the html content just doesn't render in the webview. All I see is a blank screen with scrollbars. I suspect it is the boolean ""shouldOverrideUrlLoading"" that might be causing it.</p><h3>Update:</h3><p>Thanks for replying.</p><p><strong>test.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/com.example.test""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:background=""@drawable/green""&gt;&lt;TextView   android:id=""@+id/apppagetitle""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textColor=""#ffffff""android:text=""Odd News""android:textSize=""25px""android:padding=""10px""/&gt; &lt;/LinearLayout&gt;&lt;LinearLayout  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;&lt;WebView  android:id=""@+id/webkit""android:layout_width=""fill_parent"" android:layout_height=""0px""android:layout_weight=""1""/&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>about.html</strong> is as simple as what is below.</p><pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset=""utf-8"" /&gt; &lt;title&gt;About&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h3 style=""color:#0066dd""&gt;About&lt;/h3&gt;  &lt;p&gt;Some text here...&lt;/p&gt;&lt;/body&gt; &lt;/html&gt;</code></pre><p>Oh yes, and I forgot to mention earlier that with the same piece of code, the about.html would sometimes show up if I force-stop and restart the app on my phone. However, it would then not appear in subsequent launches. On occasions when it successfully shows up about.html and I press the back button to return to the main activity, it will disappear again when I re-launch the activity from the main activity. I'm lost but I have a strong feeling it is ""shouldOverrideUrlLoading"" that I'm not doing correctly.</p>","560227","","15168","","2013-09-08 19:16:44","2013-09-08 19:16:44","Opening new android activity with a webview shows a blank (white) screen instead of the html content","<android><webview>","9","2","2","",""
"4577736","1","","","2011-01-02 08:35:09","0","418","<p>I am new to Android Application development. I am trying to build a RSS Feed parser using rssutil.jar.The piece of the code is:</p><pre><code>private void ReadRSS() {String tag = ""READRSS"";try { //Create Parser RssParser parser = RssParserFactory.createDefault(); //Parse out URL URL url = new URL(""http://www.espncricinfo.com/rss/content/story/feeds/0.xml""); Rss rss = parser.parse(url); if(rss.getChannel() ==null) {  tv.append(""NULL"");  return; } Collection items = rss.getChannel().getItems(); if(items!=null &amp;&amp; !items.isEmpty()) {  for(Iterator i = items.iterator();i.hasNext();)  {   Item item = (Item)i.next();   tv.append(""Title:""+item.getTitle());   tv.append(""Link:"" + item.getLink());   tv.append(""Description:""+item.getDescription());  } }} catch (RssParserException e) { // TODO Auto-generated catch block Log.v(tag, ""RSSParserException""); e.printStackTrace();} catch (MalformedURLException e) { // TODO Auto-generated catch block Log.v(tag, ""MalformedURLException""); e.printStackTrace();} catch (IOException e) { // TODO Auto-generated catch block Log.v(tag, ""IOException""); e.printStackTrace();}</code></pre><p>}</p><p>This code works good when executed as a java application but when I try to execute in Android phone or emulator then I get rss.getChannel() as null, can anyone please let me know why there is a difference in operation between java and android in this case? what should i do to make it work for android phone?</p><p>Thanks.</p>","560231","","","","","2011-11-28 14:32:21","RSS Parsing using rssutil.jar is not working on Android","<android><rss>","1","2","","",""
"4577775","1","","","2011-01-02 08:56:49","1","605","<p>I have an Android settings screen (i.e. using classes related to the Preference class) where the user can configure 3 different colors. Each color is stored as an integer using the shared preferences functionality.</p><p>I want to let users save and restore the colors chosen (i.e. color schemes). At the top of the settings screen, I want a button that pops up a list of all current saved color schemes. Picking a color scheme would set the 3 color settings to the colors for that color scheme. If the user chooses to save the current colors, they are asked to name the color scheme and this color scheme will then appear in the color scheme selection list.</p><p>What's the simplest way to implement this functionality?</p>","483701","","","","","2011-01-02 09:30:29","Saving and restoring a list of preferences in Android","<java><android><mobile>","1","0","","",""
"4577804","1","","","2011-01-02 09:13:48","13","18644","<p>I'm running into an issue when i try to use the HttpClient connectingto a url. The http connection is taking a longer time to timeout, even after i seta connection timeoout.</p><pre><code>int timeoutConnection = 5000;HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);int timeoutSocket = 5000;HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);</code></pre><p>It works perfect most of the time. However, every once in while, the http  connection runs for ever and ignore the <code>setconnectiontimeout</code>, especailly when the phone is connected to wifi, and the phone was idling.</p><p>So after the phone is idling, the first time i try to connect, the http connection ignores the <code>setconnectiontimeout</code> and runs forever, after i cancel it and try again, it works like charm everytime. But that one time that doesn't work it creates a <code>threadtimeout</code> error, i tried using a different thread, it works, but i know that the thread is running for long time.</p><p>I understand that the wifi goes to sleep on idle, but i dont understand why its ignoring the <code>setconnectiontimeout</code>.</p><p>Anyone can help, id really appreciated.</p>","560243","","21234","","2012-05-18 18:21:58","2013-11-17 13:16:49","http connection timeout issues","<java><android><timeout><apache-httpclient-4.x>","10","2","4","",""
"4577926","1","4580847","","2011-01-02 09:59:38","5","2000","<p>I need to check WiFi is pass through web page login or not, but I don't know how to do.</p><p>So I need someone can help me or explain how to wifi via web page login. thanks.</p>","369296","","","","","2011-01-05 00:41:10","How to check WiFi is pass through web page login?","<iphone><android><login><wifi>","1","1","2","",""
"4577979","1","","","2011-01-02 10:19:53","1","957","<p>I am creating one datagram socket in my application like below:</p><pre><code>DatagramSocket socket = new DatagramSocket(60000,                        InetAddrByName(""192.168.1.72""));</code></pre><p>This datagram constructor returns with exception</p><pre><code>java.net.BindException: The requested address could not be bound.</code></pre><p>I have added the android.permission.INTERNET to my manifest file. I am using iMac and Eclipse 3.4.2. I checked that port 60000 is free. Also 192.168.1.72 is my ip address. So what could be the problem?</p>","406486","","19750","","2011-01-02 14:09:45","2011-01-02 14:09:45","java.net.BindException when creating datagram socket in Android on Mac","<java><android>","2","0","","",""
"4578056","1","","","2011-01-02 10:48:56","1","442","<p>I am using LVL to add licensing to my app. I was wondering if i can check if the person that purchased the app is still able to get a refund (is using the app within 15 minutes of the purchase). Anyone got some examples or directions he can give me for this sort of thing?</p><p>Or maybe an alternative: to check when the app was installed on the phone.i found this link -> <a href=""http://stackoverflow.com/questions/2831333/how-to-get-app-install-time-from-android/2832419#2832419"">installTime</a></p><p>But something was unclear:</p><p>the app source directory is never modified after install?</p><p>What about after update? </p><p>also found this comment in the licensing/ServerManagedPolicy.java:</p><pre><code> * These values will vary based on the the way the application is configured in * the Android Market publishing console, such as whether the application is * marked as free or is within its refund period, as well as how often an...</code></pre>","448192","","321731","","2014-04-15 20:11:58","2014-04-15 20:11:58","android lvl check if purchased app is in the refund period","<android><android-lvl>","1","0","","",""
"4578162","1","4578243","","2011-01-02 11:23:28","1","3128","<p>I am trying to use the facebook sdk for android, <a href=""https://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">available here</a>. I  have two questions: </p><p><strong>Problem 1:</strong> From the instructions...Step 1.Pull the repository from GitHub:git clone git://github.com/facebook/facebook-android-sdk.git</p><p>Does this simply mean download the files?</p><p><strong>Problem 2:</strong>I downloaded the files and opened the samples as a New Android Project (from existing source).  The project files do not have anything in the gen folder.I have tried</p><ul><li>Choosing Project >Build</li><li>Choosing Project > Clean</li><li>editing Java file (Example.java) and resaving it</li><li>checking the Java commpliance level is 1.6 (Project > Properties > Java Compiler)</li><li>deleting the gen folder and rebuilding (Project > Build)</li><li>putting my Facebook App ID in the example.java file</li></ul><p>Any help would be appreciated.</p>","560283","","","","","2011-01-02 11:56:05","Installing facebook sdk for android, installation procedure, gen folder missing","<android><facebook><sdk>","1","0","","",""
"4578235","1","","","2011-01-02 11:53:05","0","524","<p>as I need to get a specific Frame from a Website I want to display in an WebView, I decided to grab the .html from the net and save it under file:///data/data//files/file.html. Stroed there I can edit it using regex or String methods. </p><p>Now two questions:Is there a way to bind this file to an resource. e.g. to /res/raw/file.html and get it updated dynamically as i edit it? Or can i write the File directly to the resources?</p><p>Is this whole stuff I do there any good or performant at all? I mean maybe there is a better way to get the .html code between two tags from a Webpage and display it via WebView.</p><p>Kind regardsMarkus</p>","560294","","560294","","2011-01-02 12:07:28","2011-01-03 11:05:27","Writing Resources from filesystem in Android","<android><resources>","1","0","","",""
"4578261","1","","","2011-01-02 12:03:12","0","550","<p>I have a DB  helper class that helps me insert and delete records of pieces of information in Android 1.6.</p><p>When I delete a record and insert a new one just after that, i get the following error</p><p>Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d63338 on t_forms that has not been deactivated or closed</p><p>I have gone through the web searching for an answer, and most forum posts say that a cursor is not closed.In fact the operations I am executing aren't really returning recordset data, so I am a little stumped on why logcat would throw this error...</p><p>So these are the 2 functions that get called one after the other..</p><pre><code>//---deletes a particular form---public boolean deleteForm(int formID) {   return db.delete(DATABASE_TABLE, KEY_FORM_ID + ""="" + formID, null) &gt; 0;}//---insert a form into the database---public long insertForm(int form_id, String lform_name, String lform_description, String sdcardPath) {    ContentValues initialValues = new ContentValues();    initialValues.put(KEY_FORM_ID, form_id);    initialValues.put(KEY_FORM_NAME, lform_name);    initialValues.put(KEY_FORM_DESC, lform_description);    initialValues.put(KEY_SDCARDPATH, sdcardPath);    return db.insert(DATABASE_TABLE, null, initialValues);}</code></pre><p>What could be the problem?</p>","527541","","180538","","2011-08-09 12:11:40","2011-08-09 12:15:30","Android: Error , Ljava/lang/IllegalStateException;: Finalizing cursor , t_forms that has not been deactivated or closed","<android><sqlite>","1","1","","",""
"4578375","1","4578397","","2011-01-02 12:33:34","0","2122","<p>Using Android (write own app) I would like to download an XML file</p><pre><code>&lt;magazines&gt;&lt;magazine&gt;    &lt;title&gt;Hello&lt;/title&gt;    &lt;downloadlink&gt;http://example.com/pdf1.pdf&lt;/downloadlink&gt;&lt;/magazine&gt;&lt;magazine&gt;    &lt;title&gt;Hello2&lt;/title&gt;    &lt;downloadlink&gt;http://example.com/pdf2.pdf&lt;/downloadlink&gt;&lt;/magazine&gt;&lt;magazine&gt;    &lt;title&gt;Hello3&lt;/title&gt;    &lt;downloadlink&gt;http://example.com/pdf3.pdf&lt;/downloadlink&gt;&lt;/magazine&gt;&lt;magazine&gt;    &lt;title&gt;Hello4&lt;/title&gt;    &lt;downloadlink&gt;http://example.com/pdf4.pdf&lt;/downloadlink&gt;&lt;/magazine&gt;</code></pre><p></p><p>Then fill an Android ListView with the title and download link.</p><p>How would I go about doing this? (Would be breese with c#)</p>","335216","","","","","2011-09-28 19:26:25","Android download XML and fill a list with specific values from the XML?","<android><xml><listview>","1","0","","",""
"4578377","1","7802316","","2011-01-02 12:33:55","4","684","<p>I am building a application which takes a backup of calendar &amp; restores it on demand.</p><p>How can I achieve this in Android? Are there any api's which imports/exports contacts just like for Contacts ?</p><p>Thanks in advance and Happy New Year !!</p><p>Cheers,Prateek</p>","481314","","","","","2011-10-18 04:08:51","Calendar Backup and Restore","<android><calendar>","1","2","1","",""
"4578390","1","4578789","","2011-01-02 12:37:03","0","4147","<p>I'm looking now a few days for a solution for clickable items in a listView.</p><p>First I came across this:<strong>developer.android.com/resources/articles/touch-mode.html</strong>and found that it's doesn't have the ""normal"" onListItemClick() behavouir.</p><p>Then I came across of <strong>this code</strong>:<a href=""http://www.androidsnippets.org/snippets/125/"" rel=""nofollow"">http://www.androidsnippets.org/snippets/125/</a></p><pre><code>// LINE 296-321    @Override      protected ViewHolder createHolder(View v) {          // createHolder will be called only as long, as the ListView is not filled          // entirely. That is, where we gain our performance:          // We use the relatively costly findViewById() methods and          // bind the view's reference to the holder objects.          TextView text = (TextView) v.findViewById(R.id.listitem_text);          ImageView icon = (ImageView) v.findViewById(R.id.listitem_icon);          ViewHolder mvh = new MyViewHolder(text, icon);          // Additionally, we make some icons clickable          // Mind, that item becomes clickable, when adding a click listener (see API)          // so, it is not necessary to use the android:clickable attribute in XML          icon.setOnClickListener(new ClickableListAdapter.OnClickListener(mvh) {              public void onClick(View v, ViewHolder viewHolder) {                  // we toggle the enabled state and also switch the icon                  MyViewHolder mvh = (MyViewHolder) viewHolder;                  MyData mo = (MyData) mvh.data;                  mo.enable = !mo.enable; // toggle                  ImageView icon = (ImageView) v;                  icon.setImageBitmap(                          mo.enable ? ClickableListItemActivity.this.mIconEnabled                                  : ClickableListItemActivity.this.mIconDisabled);              }          });  </code></pre><p>While debugging I noticed the parameter <strong>View v</strong> is a <strong>TextView</strong> and not a ""normal"" View and then of course:</p><pre><code>TextView text = (TextView) v.findViewById(R.id.listitem_text);</code></pre><p>returnes <strong>null</strong> and I get a NullPointerException...</p><p>Any ideas why? And how I can solve this?</p><p>Thanks in advance! :)</p>","560297","","560297","","2011-01-24 13:05:17","2011-01-24 13:05:17","Clickable ListView","<java><android><listview><nullpointerexception>","2","0","","",""
"4578488","1","4578824","","2011-01-02 13:08:53","2","1137","<p>How can I diagnose apk install issues? I have an app that compiles and runs in the emulator without any issues. But as soon as I export and try to load on my phone, it fails to install with no error to point me in the right direction.</p>","330368","","","","","2011-01-02 14:37:37","App won't install but runs fine in emulator","<android>","4","3","1","",""
"4578504","1","","","2011-01-02 13:13:53","0","280","<p>i want to send my MapView geolocation and user data from my android to a website using Google maps.</p><p>How can i send my data in an XML file to my server? or is there other ways better than sending it?</p>","560133","","560133","","2011-01-03 06:19:15","2011-01-03 06:19:15","Sending an XML format data to google map from android","<android><networking>","2","0","","",""
"4578624","1","4578803","","2011-01-02 13:42:07","1","1785","<p>In my onCreateOptionsMenu() I have basically the following:</p><pre><code>public boolean onCreateOptionsMenu(Menu menu) {        menu.add(Menu.NONE, MENU_ITEM_INSERT, Menu.NONE, R.string.item_menu_insert).setShortcut('3',                'a').setIcon(android.R.drawable.ic_menu_add);        PackageManager pm = getPackageManager();        if(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) &amp;&amp; pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)){            menu.add(Menu.NONE, MENU_ITEM_SCAN_ADD, Menu.NONE, ((Collectionista.DEBUG)?""DEBUG Scan and add item"":getString(R.string.item_menu_scan_add))).setShortcut('4',                    'a').setIcon(android.R.drawable.ic_menu_add);        }        ...}</code></pre><p>And in onPrepareOptionsMenu among others the following:</p><pre><code>final boolean scanAvailable = ScanIntent.isInstalled(this);final MusicCDItemScanAddTask task = new MusicCDItemScanAddTask(this);          menu.findItem(MENU_ITEM_SCAN_ADD).setEnabled(scanAvailable &amp;&amp; (tasks == null || !existsTask(task)));</code></pre><p>As you see, two options items have the same drawable set (android.R.drawable.ic_menu_add). Now, if in onPrepareOptionsMenu the second menu item gets disabled, its label and icon become gray, but also the icon of the first menu item becomes gray, while the label of that first menu item stays black and it remains clickable. What is causing this crosstalk between the two icons/drawables? Shouldn't the system handle things like mutate() in this case?</p><p>I've included a screenshot:</p><p><img src=""http://i.stack.imgur.com/dAJg6.png"" alt=""top menu item icon should not be gray"" title=""The top menu item icon should not be gray.""></p>","458813","","458813","","2011-01-03 18:45:06","2011-01-03 18:45:06","Android: changing drawable states of option menu items seems to have side-effects","<android><menuitem><drawable><options-menu>","3","0","","",""
"4578753","1","","","2011-01-02 14:21:25","1","568","<p>On my app, when I first press ctrl+F12 the screen changes to Landscape from Portrait. However, when I press ctrl+F12 or ctrl+F11 again, the screen does not revert back to Portrait, but the actual emulator changes orientation. How do I fix this?</p>","558279","","","","","2011-01-02 14:21:25","Auto-rotate in android sdk doesn't work","<java><android><sdk><orientation><screen-orientation>","0","2","1","",""
"4578865","1","","","2011-01-02 14:48:51","1","1428","<p>When one should take care of Bitmap memory management or recycling bitmap in android ?</p><p>For example , there are few ways to create a bitmaps in android like following </p><pre><code> Bitmap.createBitmap Bitmap.createScaledBitmap BitmapFactory</code></pre><p>But when android allocate memory for bitmap which must be cleared so that in future application we won't face running out of memory error problem</p>","405383","","405383","","2011-01-02 15:01:37","2014-02-07 08:54:10","Recycling Bitmap in android","<android><bitmap>","2","4","3","",""
"4578874","1","","","2011-01-02 14:50:25","0","115","<p>How could I implement a sub item where the item would have a parent to that of the same item. For example, I have a database that holds tasks/todos. Each todo has a title(<code>TEXT</code>), completed(<code>INTEGER</code> [1 if true, 0 if false]), and due date(<code>TEXT</code>) column. I would like to add functionality to have subtasks, where a task could possibly have a parent task. How would I implement this in SQLite for Android? <strong>NOT IN SQL!</strong> So no foreign keys (triggers are allow, though)! Could I just have a separate table (subtask) and have a foreign key trigger to link subtask(<code>INTEGER parent</code>) to task(<code>INTEGER PRIMARY KEY AUTOINCREMENT _id</code>)? Or should I add a column to my original task table(<code>INTEGER parent</code>)? How could I implement this?</p>","200477","","","","","2011-06-16 13:00:13","Implement subitem in SQLite","<android><sqlite><triggers>","2","0","","",""
"4578913","1","4578979","","2011-01-02 14:59:22","2","2487","<p>I forsee that my application will require the existence of a sdcard storage device.How do I query the device for a manifest of storage options ?</p>","450278","","","","","2011-01-02 15:15:43","How to detect if the device possess an sdcard?","<android>","1","0","2","",""
"4578934","1","","","2011-01-02 15:06:01","0","409","<p>I'm trying to implement a <code>CountDownTimer</code> in the .java of an Android app's activity. This <code>CountDownTimer</code> needs to be able to count down from several different pre-set timings that is specified by the user's selection, that which I have solved by using <code>sharedPreferences()</code>.</p><p>In order to connect the <code>sharedPreferences</code> and the <code>CountDownTimer</code>'s timing, below are two method's I've tried that do not work:</p><p>1) <code>getInt</code> from the <code>sharedPreferences</code> and then defining an string array and substituting <code>long milliseconds</code> (for the <code>CountDownTimer</code>) with a <code>long</code> value from the array by using <code>array[int]</code> and thereafter <code>valueof()</code> to that obtained string.</p><p>2) By using <code>{if(sharedPreferences == 123) {int timing = 5000;}}</code>, but this fails due to the braces that contain the value of <code>int timing</code> such that <code>CountDownTimer</code> cannot read it as it lies outside of that pair of braces that contain the <code>if</code>. Worth mentioning is that it is not possible to move the <code>CountDownTimer</code> into the braces.</p><p>Quite simply, I'm looking for a solution to an editable <code>CountDownTimer</code>. While I'm not asking for a whole tutorial right here on Stackoverflow, it would be nice if you could point me in the right direction.</p><p>Thanks in advance.</p>","539397","","","","","2011-01-02 16:00:57","Android Editable CountDownTimer Issue","<java><android><countdown><editable>","1","0","","",""
"4578946","1","4578976","","2011-01-02 15:08:10","0","651","<p>I am gonna to implement a application, to list all the networks and manually select one of them( similar to the stock one ), can some one what kind of api can I use or what documentation should I refer to , or any reference sites ?</p><p>Thanks in advance !</p>","140899","","","","","2011-01-02 16:15:12","List all networks in android?","<android>","2","0","","",""
"4578969","1","4579172","","2011-01-02 15:13:27","2","92","<p>I'm just beginning to learn OpenGL on Android and I just noticed that some of gl calls, such as glTexCoordPointer(...) or glVertexPointer(...), accept data only in Buffer objects, others, such as glDrawTexvOES(), glTexParameteriv(), accept a float[] too. </p><p>I'm curious why is that so? :)</p>","258848","","","","","2011-01-02 16:04:42","Why some gl calls accept arrays while other accept only Buffers on Android","<android><opengl-es>","1","0","","",""
"4579009","1","4583115","","2011-01-02 15:23:51","0","278","<p>I am trying to read the contact list using the following code: </p><pre><code>ContentResolver cr = getContentResolver();Cursor cur = cr.query(People.CONTENT_URI,null, null, null, null);if (cur.getCount() &gt; 0) {while (cur.moveToNext()) {    String id = cur.getString(cur.getColumnIndex(People._ID));       Cursor personCur = cr.query(Contacts.Phones.CONTENT_URI,                 null,                 Contacts.Phones.PERSON_ID +""= ?""+                                     Contacts.Phones.NUMBER_KEY ,                     new String[]{id}, null);            String phoneKey = """";            while (personCur.moveToNext()) {                phoneKey = personCur.getString(personCur.getColumnIndex(Contacts.Phones.NUMBER_KEY));            } </code></pre><p>The problem is that phoneKey return in reverse order meaning if the phone number is 054-123-4567 the value is 7654321450</p><p>I could not find any documentation on this issue.Any idea how to fix it? or is it the expected result?</p><p>thanks-Z</p>","449466","","","","","2011-01-03 09:55:42","Android : Why NUMBER_KEY return the number in reverse order","<android>","1","0","","",""
"4579048","1","4579266","","2011-01-02 15:31:36","0","3553","<p>I have a dialog which performs some validation (below). Thee problem is, the dialog is dismissed after the Toast is displayed, without me calling dismiss. I need to show the toast and keep the dialog open to correct the error.</p><pre><code>final EditText txtName = new EditText(this);AlertDialog.Builder dlgAdd = new AlertDialog.Builder(this)    .setTitle(R.string.create_category)    .setMessage(R.string.name)    .setView(txtName)    .setPositiveButton(R.string.ok, new OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            String newCatName = txtName.getText().toString().trim(); // Converts the value of getText to a string.            if (newCatName != null &amp;&amp; newCatName .length() ==0)            {                  Toast.makeText(ManageCategories.this, R.string.err_name_required, 3500).show();            } else {                try {                    boolean alreadyExists = mDatabaseAdapter.getCategoryIDs(newCatName).length &gt; 0;// ids of cats with this name                    if(alreadyExists) {                        Toast.makeText(ManageCategories.this, R.string.categoryAlreadyExists, 3500).show();                    } else {                        mDatabaseAdapter.addCategory(newCatName);                    }                }catch(Exception ex){                    Toast.makeText(ManageCategories.this, R.string.error+':'+ ex.getLocalizedMessage(), 3500).show();            }            }        }    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int id) {                dialog.cancel();           }});dlgAdd.show();</code></pre>","30512","","","","","2011-01-18 19:54:05","Android: Dialog dismisses without calling dismiss","<android><validation><dialog><alert>","2","0","","",""
"4579178","1","","","2011-01-02 16:02:43","2","3888","<p>I am currently working on using GPS in android application. In android docs I saw the following line</p><pre><code>LocationProvider locationProvider = LocationManager.NETWORK_PROVIDER; // Or, use GPS location data: // LocationProvider locationProvider = LocationManager.GPS_PROVIDER; locationManager.requestLocationUpdates(locationProvider, 0, 0, locationListener);</code></pre><p>but LocationProvider is an abstract class how come we instantiate LocationProvider, also the first line returns a String to the object locationProvider. Can anyone clear my doubt whether document is wrong or this involves some other explanation</p>","553670","","65060","","2012-12-21 15:22:38","2012-12-21 15:22:38","Using GPS in android application","<android>","3","0","","",""
"4579212","1","","","2011-01-02 16:10:38","0","416","<p>Is there a way that i can see the resources from my app within my library? </p><p>I tried </p><p><code>Class res = Class.forName( extras.getString( R.string.getClass() ) ); &lt;- apps' R class<br/>final Field[] fields = res.getFields(); &lt;- returns nothing<br/>for(final Field field:fields){<br/>....<br/>}<br/></code></p><p>Thanks</p><p><strong>Update</strong> The app could see the whole list by just getting R of the library, but now i cant get string value from the app</p>","258648","","258648","","2011-01-02 17:37:26","2011-09-18 18:18:41","Load resource file from app inside a library in android","<android>","1","0","","",""
"4579272","1","","","2011-01-02 16:25:57","0","289","<p>I'm using SAX and XML reader to read XML weather info from the web and it works fine if the page exists. But if for instance the user inputs an invalid city, zip etc the XML page that gets read from is empty and the app force closes with nullpointerexception. The area that generates the error is here right at open inputstream. Any suggestions?:</p><pre><code>            SAXParserFactory spf = SAXParserFactory.newInstance();            SAXParser sp = null;            try {                sp = spf.newSAXParser();            } catch (ParserConfigurationException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (SAXException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            /* Get the XMLReader of the SAXParser we created. */            XMLReader xr = null;            try {                xr = sp.getXMLReader();            } catch (SAXException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            /* Create a new ContentHandler and apply it to the XML-Reader*/            WeatherHandler myExampleHandler = new WeatherHandler();            xr.setContentHandler(myExampleHandler);            /* Parse the xml-data from our URL. */            try {                     xr.parse(new InputSource(url.openStream()));                    parsedWeatherDataSet =                        myExampleHandler.getParsedData();                           } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (SAXException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            return parsedWeatherDataSet.toString(); </code></pre>","427377","","","","","2011-01-03 19:56:54","Android Java error handling XML file","<java><android><xml>","3","0","","",""
"4579299","1","4579565","","2011-01-02 16:31:27","1","3249","<p>I just noticed the strange thing - looks like my GlSurfaceView.Renderer::onDrawFrame() gets called really rarely. At least I'd expect it to be the other way:</p><p>Current renderer's renderMode is set to RENDER_CONTINUOUSLY (in fact, i didn't modify the default). By inserting some time measuring code I observe the following:</p><p>GLSurfaceView.Renderer::onDrawFrame() is called 100 times in about 15 seconds.And these 100 frames actually take only about 0.13s to draw.</p><p>I wonder where this slowness is coming from and where this 15s-0.13s time is being spent? I would expect the GLSurfaceView to be calling my onDrawFrame like mad, but it looks like it doesn't :)</p><p>Am I doing something wrong, or simply I don't know something? Just beginning to learn OpenGL ES...</p>","258848","","","","","2011-02-23 10:13:34","The calling rate of GLSurfaceView.Renderer::onDrawFrame() is too low","<android><opengl-es>","1","0","","",""
"4579305","1","4579357","","2011-01-02 16:32:54","9","25512","<p>I have read we can only instantiate an abstract class by inheriting it, but we cannot instantiate it directly.<br>However, I saw we can create an object with the type of an abstract class by calling a method of another class.<br>For example - <code>LocationProvider</code> is an abstract class, and we can instantiate it by calling <code>getProvider()</code> function in the <code>LocationManager</code> class:</p><pre><code>LocationManager lm = getSystemService(Context.LOCATION_PROVIDER);LocationProvider lp = lm.getProvider(""gps"");</code></pre><p>How is the abstract class instantiate here?</p>","553670","","7586","","2012-12-02 20:59:34","2013-06-07 19:11:14","Can we instantiate an abstract class?","<java><android>","3","3","1","2013-08-26 08:12:22",""
"4579355","1","","","2011-01-02 16:43:40","0","1007","<p>I'm building a widget which displays some text. By widget I mean the kind which lies on the desktop.</p><p>The problem is that I want to change text's font at runtime. There is several textview I would like, at runtime, to set the first as bold, the second blue and italic for example, etc.</p><p>I came up with this : </p><pre><code>TextView tv = new TextView(context);tv.setText(stringToDisplay);tv.setTextColor(0xa00050ff);  // exampletv.setTextSize(30);           // exampleBitmap b = loadBitmapFromView(tv);updateViews.setImageViewBitmap(R.id.id_of_the_imageview, b);</code></pre><p>with</p><pre><code>private static Bitmap loadBitmapFromView(View v){ Bitmap b = Bitmap.createBitmap(v.getLayoutParams().width, v.getLayoutParams().height,      Bitmap.Config.ARGB_8888);Canvas c = new Canvas(b);v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height);v.draw(c);return b;}</code></pre><p>but it wont work (NullPointerException on first line of loadBitmap), until I replace <code>v.getLayoutParams().width, v.getLayoutParams().height</code> by fixed sizes like 250, 50</p><pre><code>Bitmap b = Bitmap.createBitmap(250, 50, Bitmap.Config.ARGB_8888);// ...v.layout(0, 0, 250, 50);</code></pre><p>But that's not a good solution ...</p><p>so I tried this : </p><pre><code>  LayoutInflater li = (LayoutInflater)    context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  View row = li.inflate(R.layout.widget_text, null);  TextView tv = (TextView) row.findViewById(R.id.id_of_the_textview);</code></pre><p><code>widget_text</code> being a layout similar to the displayed one but with TextViews instead of ImageViews, in the hope to get some size information out of it ..</p><p>but it's not working and I get this exception :</p><pre><code>01-02 17:35:06.001: ERROR/AndroidRuntime(11025): Caused by: java.lang.IllegalArgumentException: width and height must be &gt; 0</code></pre><p>on the call to <code>Bitmap.createBitmap()</code></p><p>so, someone could point me in the right direction?</p>","560451","","604905","","2011-12-11 13:15:00","2011-12-11 13:15:00","rendering a TextView in a Bitmap for an android widget","<android><android-widget>","2","0","","",""
"4579416","1","4580746","","2011-01-02 16:57:48","0","856","<p>The <a href=""http://developer.android.com/guide/appendix/media-formats.html"" rel=""nofollow"">Android Supported Media Formats</a> page mentions:</p><blockquote>  <p>Note that any given mobile device may provide support for additional formats or file types not listed in the table.</p></blockquote><p>Is there a way to obtain a complete list of all image formats that an Android device supports?</p>","196844","","","","","2011-01-03 19:11:42","Obtaining a list of all image formats that an Android device supports","<android><image><media><file-format>","1","0","","",""
"4579499","1","4579687","","2011-01-02 17:16:53","2","10698","<p>I am reading an image from disk and displaying it inside of a row in a <code>ListView</code>.  The image files are larger than what needs to be displayed inside the <code>ImageView</code> of the rows.  Since I need to cache the <code>bitmaps</code> in RAM for faster access I would like them to only be as large as the <code>ImageView</code>s (85x85 dip)</p><p>Right now I am reading in the file with </p><blockquote>  <p>bitmap = BitmapFactory.decodeFile(file);</p></blockquote><p>and the ImageView is responsible for scaling and cropping it</p><blockquote>  <p>android:scaleType=""centerCrop""</p></blockquote><p>AFAIK this is keeping the entire bitmap in memory (because I cached it XD) and that is bad</p><p>How can I remove this responsibility from the ImageView and do the crop + scale while loading the file? All the bitmaps will be displayed at 85x85 dip and need to be 'centerCrop' </p>","413575","","","","","2012-03-17 11:11:45","Crop and resize an image in Android","<java><android><image><bitmap>","1","0","1","",""
"4579544","1","","","2011-01-02 17:26:36","10","3409","<p>I'm creating a simple typing game in Android. I have no problem getting input from the physical keyboard, but now I'm trying to get the soft keyboard to appear without the EditText. So far, I've tried the following:</p><p><strong>1.</strong> EditText with visibility=""invisible"" and this line:</p><pre><code>((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(keyboard_edittext, InputMethodManager.SHOW_FORCED); // SHOW_IMPLICIT also failed</code></pre><p><strong>2.</strong> This line in the <code>onCreate()</code>: </p><pre><code>this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);</code></pre><p>This method actually displayed an empty white box across the bottom 10% of the screen but not the keyboard, although when I run it now it does nothing.</p><p><strong>3.</strong> Another two lines in the <code>onCreate()</code>:</p><pre><code>InputMethodManager m = (InputMethodManager)this.getSystemService (Context.INPUT_METHOD_SERVICE); m.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);</code></pre><p>No luck on any of these. Is it even possible to display the soft keyboard (and then use <code>onKeyUp</code>/<code>onKeyDown</code>) without focusing on an EditText?</p><p>Right now, the only way I can see is to approach this is to create my own implementation of the soft keyboard (i.e. build it from scratch). Not looking forward to that!</p>","527454","","33204","","2013-04-14 04:56:14","2013-04-14 04:56:14","Can I use the soft keyboard without an EditText?","<android><edittext><android-softkeyboard>","5","1","3","",""
"4579573","1","5007242","","2011-01-02 17:35:19","21","13100","<p>I haven't found a clear explanation on how the Android graphics system works, specifically, does it use a display server, is it based on DirectFB or X11, etc.</p><p>From what I've managed to piece together, Android depends on the <a href=""http://source.android.com/porting/display_drivers.html"">Linux frame buffer</a>. I haven't found much on what sort of display server or <a href=""http://developer.android.com/reference/android/view/WindowManager.html"">window manager</a> Android uses to multiplex access to the framebuffer though, so any pointers would be much appreciated!</p><p>Finally, from what I understand the ARM instruction set provides instructions to accelerate OpenGL, but how this integrates with the display server isn't clear, ie. do client applications negotiate a shared memory buffer into which the client writes directly?</p><p>Are the OpenGL libraries for the platform accelerator open source? I've found some references suggesting they're closed source binaries. Again, any pointers would be appreciated.</p>","144873","","149841","","2012-02-22 23:40:33","2013-03-08 05:34:51","Android Graphics Internals","<android><graphics><framebuffer><skia>","3","1","9","",""
"4579647","1","4579721","","2011-01-02 17:52:55","4","10637","<p>On Android, how do I save an image file as a JPEG at 30% quality?</p><p>In standard Java, I would use <code>ImageIO</code> to read the image as a <code>BufferedImage</code>, then save it as a JPEG file using an <code>IIOImage</code> instance: <a href=""http://www.universalwebservices.net/web-programming-resources/java/adjust-jpeg-image-compression-quality-when-saving-images-in-java"" rel=""nofollow"">http://www.universalwebservices.net/web-programming-resources/java/adjust-jpeg-image-compression-quality-when-saving-images-in-java</a>. It appears, however, that Android lacks the <code>javax.imageio</code> package.</p>","196844","","","","","2011-03-17 23:40:35","How to save a JPEG image on Android with a custom quality level","<java><android><jpeg><lossy-compression>","2","0","6","",""
"4579667","1","","","2011-01-02 17:58:07","0","369","<p>for my Android app need a selector that onclick or on pull-down show a dropdown list( not a dialog window), is possible to customize spinner to do this?</p>","220853","","","","","2011-01-03 20:22:38","Is possible to create an android spinner with pull-down like notification bar?","<java><android>","1","0","","",""
"4579700","1","4579942","","2011-01-02 18:06:33","0","955","<p>I have a simple application that views comics and allows the user to mark some as ""Favorites"" which can be accessed later (it does more than that, but that's all that's relevant here).  When the user marks a comic as Favorite, a String is put to shared preferences with the format key = ""# of Comic"" Value = ""title of Comic"".  The SharedPreferences contains nothing but Key/Value pairs associated with Favorite comics.  This functionality works fine.  The problem arises with a menu button I implemented that I intended to show a ListView containing the Values of all of the Favorites stored in the SharedPreferences file.  Here is the code for the actions performed when the user clicks on the Favorites button in the popup menu</p><pre><code>case R.id.favorites:        Log.i(""Step 1"", ""Favorites"");        favVector.clear(); //Clears string Vector that I want to use to hold the titles        Map&lt;String, ?&gt; allprefs = xkfav.getAll(); //gets map of all Shared Preferences        for (Map.Entry&lt;String, ?&gt; entry : allprefs.entrySet()) {            favVector.add((String) entry.getValue());        }        Log.i(""Step 2"", ""Favorites"");        setContentView(R.layout.favlist); //loads Layout with ListView (and nothing else)        Log.i(""Step 3"", ""Favorites"");        ListView menuList;        menuList = (ListView) findViewById(R.id.FavListView);        String[] items = new String[favVector.size()]; //creates array with size of Vector        favVector.copyInto(items); //Copies Vector into array        ArrayAdapter&lt;String&gt; adapt = new ArrayAdapter&lt;String&gt;(this, R.layout.fav_item, items);        menuList.setAdapter(adapt); //Puts array contents into list</code></pre><p>Every time I run this, I get a Force Close.  I never even see ""Step 2"" appear in the log.  Ignoring the fact that this probably is not beautiful or efficient code, why do I get the Force Close error when the user clicks this button?</p>","324977","","","","","2011-01-03 07:24:49","Android: Problem populating listview with items from Shared Preferences","<android><listview><layout><menu><sharedpreferences>","1","0","1","",""
"4579741","1","4581181","","2011-01-02 18:15:22","0","2457","<p>I have been using the following code to query one table:</p><pre><code>public Cursor fetchFilteredItemsNearSortedByDistance(String strTable, String[] strArrayFields, String strField, String strCriterion, double dblCentreEasting, double dblCentreNorthing, double dblRadius) {  String strSQL = ""Easting &gt; "" + Double.toString(dblCentreEasting-dblRadius);  strSQL += "" AND Easting &lt; ""  + Double.toString(dblCentreEasting+dblRadius);  strSQL += "" AND Northing &gt; ""  + Double.toString(dblCentreNorthing-dblRadius);  strSQL += "" AND Northing &lt; ""  + Double.toString(dblCentreNorthing+dblRadius);  strSQL += "" AND "" + strField + "" LIKE '%"" + strCriterion + ""%'"";  strSQL += "" ORDER BY "";  strSQL += ""((Easting - "" + Double.toString(dblCentreEasting)+"")"";  strSQL += "" * (Easting - "" + Double.toString(dblCentreEasting)+"")"";  strSQL += "" + (Northing - "" + Double.toString(dblCentreNorthing)+"")"";  strSQL += "" * (Northing - "" + Double.toString(dblCentreNorthing)+""))"";  strSQL += "" COLLATE NOCASE"";  return myDbHelper.myDataBase.query(strTable, strExtendedArrayFields, strSQL, null, null, null, null);     }</code></pre><p>The above code has been working satisfactorily. However, I now want to extend the idea to a UNION of two or more tables, and have tried the following code:</p><pre><code>public Cursor fetchFilteredPOIsNearSortedByDistance(String strTable, String[] strArrayFields, String strField, String strCriterion, double dblCentreEasting, double dblCentreNorthing, double dblRadius) {  String strSQL = ""SELECT * FROM TableA "";  strSQL += ""UNION SELECT * FROM TableB "";  strSQL += ""WHERE ( Easting &gt; "" + Double.toString(dblCentreEasting-dblRadius);  strSQL += "" AND Easting &lt; ""  + Double.toString(dblCentreEasting+dblRadius);  strSQL += "" AND Northing &gt; ""  + Double.toString(dblCentreNorthing-dblRadius);  strSQL += "" AND Northing &lt; ""  + Double.toString(dblCentreNorthing+dblRadius);  strSQL += "" AND "" + strField + "" LIKE '%"" + strCriterion + ""%' ) "";  strSQL += "" ORDER BY "";  strSQL += ""((Easting - "" + Double.toString(dblCentreEasting)+"")"";  strSQL += "" * (Easting - "" + Double.toString(dblCentreEasting)+"")"";  strSQL += "" + (Northing - "" + Double.toString(dblCentreNorthing)+"")"";  strSQL += "" * (Northing - "" + Double.toString(dblCentreNorthing)+""))"";  strSQL += "" COLLATE NOCASE"";  return myDbHelper.myDataBase.rawQuery(strSQL, null);}</code></pre><p>However, this produces a ""SQLiteException: 1st ORDER BY term does not match any column in the result set"" error.</p><p>The full error in LogCat is:</p><pre><code>ERROR/AndroidRuntime(11444): Caused by: android.database.sqlite.SQLiteException: 1st ORDER BY term does not match any column in the result set: , while compiling: SELECT * FROM TableA UNION SELECT * FROM TableB WHERE ( Easting &gt; 594378.8427734375 AND Easting &lt; 663822.8427734375 AND Northing &gt; 127586.046875 AND Northing &lt; 197030.046875 AND Name LIKE '%%' )  ORDER BY ((Easting - 629100.8427734375) * (Easting - 629100.8427734375) + (Northing - 162308.046875) * (Northing - 162308.046875)) COLLATE NOCASE</code></pre><p>Can anyone help me onto the right track, please?</p>","250845","","","","","2011-01-04 09:58:36","Android SQLite ""order by"" calculated column in union query","<sql><android><sqlite><union><calculated-columns>","3","4","","",""
"4579754","1","12777724","","2011-01-02 18:19:02","6","800","<p>In <a href=""https://github.com/pilhuhn/ZwitscherA"" rel=""nofollow"">Zwitscher</a> I have a <code>ListView</code> that displays a number of tweets. The user can then reload the timeline and if there are new tweets, the new list is loaded into the list adapter (plus some old ones) and I scroll to the end of the list via</p><pre><code>listView.setSelection(x); </code></pre><p>where <code>x</code> is the number of the oldest tweets of the freshly loaded ones. This works very well.But unfortunately this ""disables"" the <code>onItemClick()</code> and <code>onItemLongClick()</code> handlers on the view. If I then (e.g. from a button) call </p><pre><code>listView.setSelection(0);</code></pre><p>The handlers for <code>onItemClick()</code> and <code>onItemLongClick()</code> are ""enabled"" again. </p><p>I've verified that the handlers are still set on the listView after the call to <code>setSelection(x)</code>. And disabling that call to <code>setSelection(x)</code> also does not ""disable"" the handlers.</p><p>Any idea what I am doing wrong?</p><p>The full source is here: <a href=""https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/TweetListActivity.java"" rel=""nofollow"">https://github.com/pilhuhn/ZwitscherA/blob/master/src/de/bsd/zwitscher/TweetListActivity.java</a> and the lines in question are in <code>onPostExecute()</code> on line 417</p>","100957","","810368","","2012-10-04 07:24:53","2012-10-08 08:15:11","ListView no longer reacts to onclick after a call to setSelection()","<android><listview><android-listview>","1","1","1","",""
"4579766","1","","","2011-01-02 18:21:00","0","2205","<p>I have my standard code for ContextMenu (long press on ListView item) but I created this class (helper Dialog) and it doesn't register</p><pre><code>onContextItemSelected</code></pre><p>method, I have no idea why. Where is the problem? =/In my layout XML I have regular ListView with <b>@+id/list</b> (I'm not extending ListActivity).</p><pre><code>public class CheckListDialog extends Dialog implements OnClickListener {public CheckListDialog(Context context) {    super(context);    requestWindowFeature(Window.FEATURE_NO_TITLE);    mainContext = context;    setContentView(R.layout.dialog_check_list);    list = (ListView) findViewById(R.id.list);    registerForContextMenu(list);    list.setOnItemClickListener(new AdapterView.OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {            doSomething(); // This IS working.        }               });}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {  if (v == list) {    // This IS working.    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;    menu.setHeaderTitle(""Something"");    String[] menuItems = mainContext.getResources().getStringArray(R.array.menu);    for (int i = 0; i&lt;menuItems.length; i++) {      menu.add(Menu.NONE, i, i, menuItems[i]);    }  }}// This IS NOT working! (Method isn't called at all)@Overridepublic boolean onContextItemSelected(MenuItem item) {  AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();  int menuItemIndex = item.getItemId();  String[] menuItems = mainContext.getResources().getStringArray(R.array.menu);  String menuItemName = menuItems[menuItemIndex];  if (menuItemName.equals(""Delete"")) {      doSomething();  }  return true;}@Overridepublic void onContextMenuClosed(Menu menu) {    doSomething();}private ListView list;</code></pre><p>}</p>","455268","","","","","2013-06-26 06:32:36","ContextMenu in Dialog","<android><dialog><contextmenu>","3","0","","",""
"4579837","1","4580693","","2011-01-02 18:36:56","1","2272","<p>Hi im trying to use a searchable activity in my application but when the search button is pressed nothing happens</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.test.test"" android:versionCode=""1"" android:versionName=""1.0.0"" android:configChanges=""keyboardHidden|orientation""&gt;        &lt;uses-sdk android:minSdkVersion=""7""/&gt;        &lt;application android:icon=""@drawable/icon"" android:label=""Test""&gt;            &lt;activity android:name="".Test"" android:label=""Test"" android:debuggable=""true"" android:theme=""@android:style/Theme.NoTitleBar"" android:launchMode=""singleTask""&gt;                &lt;intent-filter&gt;                    &lt;action android:name=""android.intent.action.MAIN""/&gt;                    &lt;category android:name=""android.intent.category.LAUNCHER""/&gt;                &lt;/intent-filter&gt;            &lt;/activity&gt;            &lt;activity android:name="".Searchable""&gt;                &lt;intent-filter&gt;                    &lt;action android:name=""android.intent.action.SEARCH"" /&gt;                    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;                &lt;/intent-filter&gt;                &lt;meta-data android:name=""android.app.searchable"" android:resource=""@xml/searchable""/&gt;            &lt;/activity&gt;            &lt;meta-data android:name=""android.app.default_searchable"" android:value="".Searchable""/&gt;        &lt;/application&gt;    &lt;/manifest&gt;</code></pre><p>Searchable.xml (res/xml/searchable.xml)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;searchable xmlns:android=""http://schemas.android.com/apk/res/android"" android:label=""Search"" android:hint=""Perform Search""&gt;    &lt;/searchable&gt;</code></pre><p>Searchable.java (src/com/test/test/Searchable.java)</p><pre><code>package com.test.test;import android.app.Activity;import android.app.SearchManager;import android.content.Intent;import android.os.Bundle;public class Searchable extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        handleIntent(getIntent());    }    @Override    protected void onNewIntent(Intent intent) {        setIntent(intent);        handleIntent(intent);    }    private void handleIntent(Intent intent) {        if (Intent.ACTION_SEARCH.equals(intent.getAction())) {            String query = intent.getStringExtra(SearchManager.QUERY);        }    }}</code></pre><p>TIA,</p><p>ng93</p>","364727","","","","","2011-01-02 21:48:12","android searchable not opening","<android><search><searchable>","1","1","","",""
"4579885","1","4626258","","2011-01-02 18:48:16","9","8650","<p>I need to determine if a mediaplayer is using the opencore media framework, so that I can disable seeking for my streams. The opencore framework appears to fail silently with seeking, which I am having a hard time believing they allowed into production, but that seems the case nonetheless.</p><p>I wish it were as simple as determining their SDK version, but droid phones that have api 8 seem to use opencore still, so doesn't seem to be a good option. Any ideas?</p><p>EDIT:</p><p>After the response from Jesus, I came up with this code. It seems to work well in my tests so far. If anybody doesn't think it is a sound method for seeking streams, let me know</p><pre><code>    if (Build.VERSION.SDK_INT &lt; 8) //2.1 or earlier, opencore only, no stream seeking        mStreamSeekable = false;    else { // 2.2, check to see if stagefright enabled        mStreamSeekable = false;        try {                FileInputStream buildIs = new FileInputStream(new File(""/system/build.prop""));                if (CloudUtils.inputStreamToString(buildIs).contains(""media.stagefright.enable-player=true""))                    mStreamSeekable = true;            } catch (IOException e) { //problem finding build file                e.printStackTrace();            }        }    } </code></pre>","415422","","415422","","2011-08-16 07:51:47","2011-08-16 07:51:47","Determine opencore or stagefright framework for mediaplayer?","<android><media-player>","4","3","8","",""
"4580002","1","4580151","","2011-01-02 19:12:00","0","823","<p>I have an application about debts to user and user's debts.Main activity is TabActivity for switching two activities with custom lists.</p><hr><p>It looks like (screenshot):<a href=""http://i.stack.imgur.com/qts1f.png"" rel=""nofollow"">http://i.stack.imgur.com/qts1f.png</a></p><p>The code is:</p><pre><code>public class MainActivity extends TabActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // Resource object to get Drawables        TabHost tabHost = getTabHost();  // The activity TabHost        TabHost.TabSpec spec;  // Resusable TabSpec for each tab        Intent intent;  // Reusable Intent for each tab        TextView tv = (TextView)findViewById(R.id.newDebtHeader);        tv.setBackgroundResource(R.drawable.grad);        tv.setTextColor(Color.BLACK);        tv.setFadingEdgeLength(3);        intent = new Intent().setClass(this, DebtsToMeList.class);        spec = tabHost.newTabSpec(""debts_to_me"").setIndicator(null, res.getDrawable(R.drawable.ic_tab_debts_to_me)).setContent(intent);        tabHost.addTab(spec);        intent = new Intent().setClass(this, MyDebtsList.class);        spec = tabHost.newTabSpec(""my_debts"").setIndicator(null, res.getDrawable(R.drawable.ic_tab_my_debts)).setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(2);    }}</code></pre><p>main.xml is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""1dp""&gt;    &lt;TextView         android:id=""@+id/newDebtHeader""         android:layout_height=""24dip""        android:layout_width=""fill_parent""        android:gravity=""center_vertical|center_horizontal""        android:textStyle=""bold""        android:textSize=""16dip""         android:text=""??????""&gt;    &lt;/TextView&gt;     &lt;TabHost         android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            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;&lt;/LinearLayout&gt;enter code here</code></pre><p>But I don't like TabActivity, I want change this two lists by horizontal finger drag.Could you please help me change my code?</p>","560510","","","","","2013-06-19 09:20:45","How to make a horizontal-switchable activities","<android><uiscrollview><uiswitch>","2","0","","",""
"4580006","1","4580223","","2011-01-02 19:13:14","7","4192","<p>If I store bitmaps in a hashmap using SoftReference, will SoftReference call .recycle() on the Bitmap ? And if it doesn't then what would be a way to clear the bitmap properly from memory under the given situation (when bitmaps are inside a HashMap) ?</p>","550393","","244296","","2011-01-02 20:02:59","2012-10-02 05:54:14","Does SoftReference calls .recycle() on Bitmap object","<android><image><memory>","4","0","1","",""
"4580068","1","","","2011-01-02 19:26:30","0","646","<p>I'm the author of <a href=""http://www.sqlitemanager.org"" rel=""nofollow"">SQLiteManager</a> And i want to code same application for android.In your opinion, what language should I use?Thanks</p>","560557","","","","","2011-01-02 19:27:49","SQlite admin for android","<android><sqlite>","1","0","","",""
"4580088","1","4580282","","2011-01-02 19:30:23","7","6934","<p>I would like to add wireless printing to my android 2.2 application which is targeted for the Galaxy tablet.  I see that the internet browser has a print option so I am assuming that an activity hook must exist, and I was hoping that someone has figured this out.  I have found a possibility using the PrinterShare application from Mobile Dynamix, but my preference would be to no require a 3rd party.</p><p>Here is the code example that they provide, just for reference.   </p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW);i.setPackage(""com.dynamixsoftware.printershare"");i.setDataAndType(data_uri, data_type);startActivity(i);</code></pre><p>Where:</p><p>data_uri - Uri of the object to print, such as ""file:///sdcard/something.pdf"" or ""content://something""</p><p>data_type - Mime type. The following mime types are supported:""application/pdf""""text/html""""text/plain""""image/png""""image/jpeg""</p>","560547","","1099571","","2012-02-02 21:29:45","2012-02-02 21:29:45","Android Printing API on Galaxy Tab","<android><printing><tablet><galaxy>","1","1","4","",""
"4580195","1","4580738","","2011-01-02 19:56:01","1","1120","<p>Im trying to load an image that has background transparency that will be layered over another texture. When i try and load it, all i get is a white screen. The texture is 512 by 512, and its saved in photoshop as a 24 bit PNG (standard PNG specs in the Photoshop Save for Web and Devices config window). Any idea why its not showing? The texture without transparency shows without a problem. Here is my loadTextures method:</p><pre><code>public void loadGLTexture(GL10 gl, Context context) {    //Get the texture from the Android resource directory    Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.m1);    Bitmap normalScheduleLines = BitmapFactory.decodeResource(context.getResources(), R.drawable.m1n);    //Generate texture pointers...    gl.glGenTextures(3, textures, 0);    //...and bind it to our array    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]);    //Create Nearest Filtered Texture    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_GENERATE_MIPMAP, GL11.GL_TRUE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    bitmap.recycle();    //Bind our normal schedule bus map lines    gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);    //Create Nearest Filtered Texture    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_GENERATE_MIPMAP, GL11.GL_TRUE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, normalScheduleLines, 0);    normalScheduleLines.recycle();}</code></pre>","385051","","385051","","2011-01-02 20:15:10","2011-01-02 22:49:36","problem loading texture with transparency with OpenGL ES and Android","<iphone><android><opengl-es><transparency><textures>","1","2","","",""
"4580235","1","4786956","","2011-01-02 20:05:28","0","630","<p>I recently updated my eclipse installation with which I develop my Android apps.Soon I found my layout files have lost the up and down arrows associated with each VIEW and LAYOUT which helps to organize my layouts.</p><p>I don't know whatelse the update, if anything, has messed up but I wonder and would appreciate any information on how to fix this issue so I can get my developments back on track, please.</p><p>Thanks</p>","504612","","","","","2011-01-24 20:42:40","Eclipse updates ruins Android XML layout editing","<android><eclipse><adt>","1","4","","",""
"4580254","1","","","2011-01-02 20:08:14","7","12613","<p>I would like to know if there is a way to reboot the device through code. Ive tried:</p><pre><code>Intent i = new Intent(Intent.ACTION_REBOOT); i.putExtra(""nowait"", 1); i.putExtra(""interval"", 1); i.putExtra(""window"", 0); sendBroadcast(i);</code></pre><p>And added permissions for <code>REBOOT</code> but it still doesnt work.</p><p>Thanks</p>","557703","","35060","","2011-01-02 20:13:36","2013-06-27 09:39:28","Android 2.2: Reboot device programmatically","<android><reboot>","3","2","4","",""
"4580302","1","4580674","","2011-01-02 20:15:48","1","1150","<p>I've been using <code>WifiInfo.getMacAddress</code> string as seen on my nexus one or any other mobile device I've been able to use, i.e. in the format of <code>01:02:03:04:05:06</code></p><p>But one of the users of my app just reported a crash on a <code>Toshiba Folio100</code>, my MAC address parsing failed. Since I've not any log files and the report is anonymous, I cannot contact that man, so I ask here if you know how it's encoded in such kind of device.</p><p>I suppose it could be like <code>010203040506</code> but I'm not so confident.</p>","528469","","35060","","2011-01-02 20:27:26","2011-01-02 21:42:42","Android WifiInfo.getMacAddress on Toshiba Folio","<android><network-programming><android-networking>","1","0","1","",""
"4580383","1","4580519","","2011-01-02 20:31:45","2","855","<p>I want to set colors for clicking instead of images.  Doing so doesn't give any errors except for force-closing at runtime.  Is it even possible to do this or can selector only be used for images?</p><p>Code I'm trying below:</p><p></p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true"" android:state_pressed=""true"" android:background=""#00C0FF"" /&gt;    &lt;item android:state_focused=""true"" android:state_pressed=""false"" android:background=""#0060FF"" /&gt;    &lt;item android:state_focused=""false"" android:state_pressed=""true"" android:background=""#00C0FF"" /&gt;    &lt;item android:state_focused=""false"" android:state_pressed=""false"" android:background=""#FFFFFF"" /&gt;&lt;/selector&gt;</code></pre>","324943","","","","","2011-01-02 21:07:12","Using colors in a selector xml","<android><layout><coding-style>","2","0","","",""
"4580411","1","","","2011-01-02 20:39:26","3","1671","<p>I have a Samsung vibrant and I am connecting to to my car using bluetooth. In the samsung music app there is a button to route the audio to via bluetooth or via phone.</p><p>Anyone know how there were able create this functionality. I looked at the sdk and I see </p><blockquote>  <p>ROUTE_BLUETOOTH_A2DP</p>    <p>This constant is deprecated. Do not  set audio routing directly, use  setSpeakerphoneOn(),  setBluetoothScoOn() methods instead.</p>    <p>Routing audio output to bluetooth A2DP  Constant Value: 16 (0x00000010)</p></blockquote><p>but as you can see it is listed as ""deprecated"", i see the option for setBluetoothScoOn, but not an equivalent to for setting a2dp on.</p><p>My end goal would be to create a widget that allows me to turn on and off outing to the a2dp. So I can turn it on when I want to stream music and turn it off when I want to use navigator, but listen to music or the radio at the same time.</p>","560584","","","","","2011-08-15 17:57:23","On android how to reroute audio from a2dp","<android>","1","0","","",""
"4580449","1","4585043","","2011-01-02 20:47:44","6","1803","<p>I am wondering what the difference (if any) there is in OpenGl ES for Android and OpenGl ES for iOS</p>","560587","","44729","","2011-05-26 15:44:19","2012-02-20 12:54:36","Difference in iOS OpenGl ES and Android OpenGl Es","<android><ios><opengl-es>","2","0","0","",""
"4580467","1","","","2011-01-02 20:51:42","3","1050","<p>Folks, please advice where can I change text color for the output in LogCat using Eclipse. Text color for exceptions is that I can't see it.</p>","397991","","397991","","2011-01-02 21:01:18","2013-10-20 18:50:32","Change text color for exceptions in LogCat","<android><eclipse>","3","1","","",""
"4580485","1","4580934","","2011-01-02 20:58:29","1","2403","<p>I am an automotive photographer and would like to turn some of my pics into wallpaper packages to put on the Android market place.  I couldn't find anything on Google that explains how to go about this...I know someone on here knows though!</p><p>Thanks</p>","166117","","","","","2012-01-20 04:59:28","How do I put custom wallpapers on Android market place?","<android><google-play><wallpaper>","1","0","","",""
"4580506","1","4580589","","2011-01-02 21:03:14","1","147","<p>In the application I'm doing, I'm trying to make it do something different depending on the text so I have a code which supposedly retrieves the texto of the row I clicked and then with an if else it tells the program to do something different depending on the code.</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    int selectionRowID = (int) this.getSelectedItemId();    String selectedFileString = this.directoryEntries.get(selectionRowID);    if (selectedFileString.equals(""."")) {        this.browseToSD();    } else if(selectedFileString.equals("".."")) {        this.upOneLevel();    } else {        File clickedFile = null;        clickedFile = new File(this.currentDirectory.getAbsolutePath() + this.directoryEntries.get(selectionRowID));        if(clickedFile != null)            this.browseTo(clickedFile);        }}</code></pre><p>But it doesn't work, this: ""selectedFileString.equals(""."")"" is always TRUE so it always does browseToSD, but sometimes the text is "".."" and most of the times it's something completely different so the app doesn't do what it's suppose to do. I tried to change the code to this:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    ListView lv = getListView();    ListAdapter list_adapter = lv.getAdapter();    TextView var_x = (TextView) list_adapter.getView(0,null,null);    if (var_x.equals(""."")) {        this.browseToSD();    } else if(var_x.equals("".."")) {        this.upOneLevel();    } else {        File clickedFile = null;        clickedFile = new File(this.currentDirectory.getAbsolutePath() + this.directoryEntries.get(selectionRowID));        if(clickedFile != null)            this.browseTo(clickedFile);        }}</code></pre><p>But this doesn't work either, ""var_x.equals(""."")"" and ""var_x.equals("".."")"" are always false. I'm really new to programming with Java and Android so I don't have a clue why it doesn't work, any ideas?</p>","559947","","","","","2011-01-02 21:57:06","Put the text of a row of a listview in a variable","<android><android-listview>","1","0","1","",""
"4580510","1","4580568","","2011-01-02 21:03:45","1","300","<p>In my app I'm using a spinners to let the user select an item from a list. Everything works fine but I'm not really happy with the look of the spinner. As you can see in the image below it has the same design as a normal button. </p><p><img src=""http://i.stack.imgur.com/oxm37.png"" alt=""alt text""></p><p>What I want is a spinner which looks more like a normal text field. So I browsed a little bit through the drawable folder of the Android sources and found out that the spinner background should normally look quite different. I append an image of a spinner with the background image as I found it in the drawable folder. Although the spinner in the image is focused, I think you can see the difference between both spinners. </p><p><img src=""http://i.stack.imgur.com/arWsQ.png"" alt=""alt text""> </p><p>Now I'm wondering why the my spinner (first one) doesn't have the same design as the second one as II didn't changed any attributes which are related to the design of it. Where does this button like design come from?</p>","19601","","","","","2011-12-19 08:49:49","Android: Why does my Spinner haven't got the standard design?","<android><design><spinner>","2","0","","",""
"4580567","1","4580763","","2011-01-02 21:17:53","2","1169","<p>How do I set a checkbox's drawable in XML? In code I'm using</p><pre><code>fbox.setButtonDrawable();</code></pre><p>But I don't see an XML attribute that does the same thing.</p>","375874","","","","","2011-01-02 22:07:44","Setting a checkbox's drawable in xml","<android><xml><checkbox><drawable>","2","0","","",""
"4580595","1","4580630","","2011-01-02 21:25:40","20","15844","<p>The golden rule is to set debuggable option to off prior to releasing your Android application to the public. </p><p>What would happen if I leave (forget to turn off) this option on? I mean, how would it manifest to a user?</p><p>I tested and saw no difference.</p>","437039","","","","","2011-11-24 14:06:38","What would happen if Android app is released with debuggable on?","<android><debugging>","5","0","12","",""
"4580601","1","","","2011-01-02 21:27:28","0","992","<p><br>I'm creating an Android Project using Eclipse. When I first open Eclipse an error shows under the console tab at the bottom of the screen:  </p><p>""Project has no default.properties file! Edit the project properties to set one.""  </p><p>I'm not quite sure what this means or how to do it. If there is any code I should add to the question in order to make it more clear let me know.<br>Any help is GREATLY appreciated! Thanks!  </p>","516633","","19405","","2011-01-02 21:38:52","2011-01-02 21:42:00","Eclipse Android Project Error","<android><eclipse>","2","2","","",""
"4580622","1","","","2011-01-02 21:31:24","0","942","<p>I'm building a very small app to send data from the cellphone to a computer. I've read a couple of examples and got the server and client code working. But when i try to connect them, got a ""network unreachable"" error. Any idea what am i doing wrong??</p><p>This is the Server Code:</p><pre><code>import java.net.*;import java.awt.BorderLayout;import java.awt.Dimension;import java.awt.event.WindowAdapter;import java.awt.event.WindowEvent;import java.io.*;import javax.swing.JFrame;import javax.swing.JLabel;public class Server {    static BufferedReader in = null;    static Socket clientSocket = null;    static ServerSocket serverSocket = null;    public static void main(String[] args) throws IOException {         JFrame frame = new JFrame(""FrameDemo"");         frame.addWindowListener(new WindowAdapter()         {                public void windowClosing(WindowEvent e)                {                    try {                        if (in != null)                            in.close();                        if (serverSocket.isClosed())                            {}                        else                            serverSocket.close();                    } catch (IOException e1) {                        e1.printStackTrace();                    }                }         });         JLabel Label = new JLabel("""");         Label.setPreferredSize(new Dimension(175, 100));         frame.getContentPane().add(Label, BorderLayout.CENTER);         //Display the window.         frame.pack();         frame.setVisible(true);         Label.setText(""Empezo"");        serverSocket = null;        try {            serverSocket = new ServerSocket(4444);        } catch (IOException e) {            System.err.println(""Could not listen on port: 4444."");            System.err.println(e.getMessage());            System.exit(1);        }        Integer puerto = serverSocket.getLocalPort();        Label.setText(""&lt;html&gt;Puerto Abierto: "" + puerto.toString() + ""&lt;br&gt;IP Servidor: "" + serverSocket.getInetAddress().toString() + ""&lt;/html&gt;"");        clientSocket = null;        try {            clientSocket = serverSocket.accept();            Label.setText(""Conection Accepted"");        } catch (IOException e) {            System.err.println(""Accept failed."");            System.exit(1);        }        in = new BufferedReader(                new InputStreamReader(                clientSocket.getInputStream()));        while ((in.readLine()) != null) {            System.out.println(""Mensaje: "" + in.readLine());        }    }}</code></pre><p>And the Cliente part</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;import java.io.IOException;import java.io.PrintWriter;import java.net.Socket;public class PruebaSocket extends Activity {    /** Called when the activity is first created. */    Socket Skt;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button Enviar =(Button)findViewById(R.id.OK);        Button Salir = (Button)findViewById(R.id.SALIR);        final TextView IP = (TextView)findViewById(R.id.IP);        Skt = new Socket();        Enviar.setOnClickListener(new OnClickListener(){            public void onClick(View v) {                try{                    Skt = new Socket(""192.168.1.101"",4444);                    CharSequence errorMessage = ""Coneccted"";                    Toast.makeText(PruebaSocket.this, errorMessage, Toast.LENGTH_SHORT).show();                }                catch(Exception E)                {                    CharSequence errorMessage = E.getMessage();                    Toast.makeText(PruebaSocket.this, errorMessage, Toast.LENGTH_SHORT).show();                    if (Skt.isConnected())                        try {                            Skt.close();                        } catch (IOException e) {                            // TODO Auto-generated catch block                            e.printStackTrace();                        }                }            }        });        Salir.setOnClickListener(new OnClickListener(){            @Override            public void onClick(View arg0) {                try {                    Skt.close();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        }        );    }}</code></pre><p>192.168.1.101 it's the IP of the server.</p>","611363","","244296","","2011-01-02 21:36:31","2011-01-02 21:37:13","Problem opening a Socket","<android><sockets>","1","0","","",""
"4580644","1","4585500","","2011-01-02 21:35:52","1","894","<p>I want to modify FingerPaint application and add undo and redo features to it. It basically draws Path's to the canvas at onDraw method and draws same paths to a bitmap too. Anyway my first thought was to save bitmaps as files but there might be some more efficient way . I am waiting for suggestions.</p>","458678","","","","","2011-01-03 15:00:09","Adding undo redo feature to the FingerPaint application ( one of the google's sample application )","<android><path><canvas><undo-redo>","1","0","","",""
"4580664","1","4580689","","2011-01-02 21:39:16","5","722","<p>Simple but little tricky, if I have</p><pre><code>list.setAdapter(new ArrayAdapter&lt;String&gt;(this,R.layout.double_row, R.id.doubleRow, articleItemsHelper));</code></pre><p>it works if <b>articleItemsHelper</b> is <b>String</b>, but I wanna have HTML formatting in there so when <b>articleItemsHelper</b> is type <b>Spanned</b> this (adapter) doesn't work.</p><pre><code>ArrayList&lt;Spanned&gt; articleItemsHelper = new ArrayList&lt;Spanned&gt;();</code></pre><p>What's the solution?</p><p>EDIT: here is the solution - <b>custom adapter</b></p><pre><code>private static class SpannedAdapter extends BaseAdapter {     private LayoutInflater mInflater;     private ArrayList&lt;Spanned&gt; mArticleList;     public SpannedAdapter(Context context, ArrayList&lt;Spanned&gt; articleList) {        mInflater = LayoutInflater.from(context);        mArticleList = articleList;     }     public int getCount() {         return mArticleList.size();     }     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.single_row, null);             holder = new ViewHolder();             holder.text = (TextView) convertView.findViewById(R.id.singleRow);             convertView.setTag(holder);         } else {             holder = (ViewHolder) convertView.getTag();         }         holder.text.setText(mArticleList.get(position));         return convertView;     }     static class ViewHolder {         TextView text;     }}</code></pre><p>Then just regularly call</p><pre><code>list.setAdapter(new SpannedAdapter(this, articleItemsHelper));</code></pre><p>where</p><pre><code>articleItemsHelper</code></pre><p>is</p><pre><code>ArrayList&lt;Spanned&gt;</code></pre>","455268","","455268","","2011-01-02 21:57:34","2011-01-02 21:57:34","How put <Spanned> into list.setAdapter?","<android><list><listview><arraylist><spanned>","1","0","3","",""
"4580683","1","","","2011-01-02 21:46:11","9","38785","<p>I have a strange problem I've come across. My app can write a simple textfile to the SD Card and sometimes it works for some people but not for others and I have no idea why. </p><p>For some people, it force closes if they put some characters like <code>...</code> in the File and such. I cannot seem to reproduce it as I've had no troubles but this is the code which handles the File writing. Can anyone think of something that may lead to problems or a better to way to do it?</p><pre><code>public void generateNoteOnSD(String sFileName, String sBody){    try    {        File root = new File(Environment.getExternalStorageDirectory(), ""Notes"");        if (!root.exists())         {            root.mkdirs();        }        File gpxfile = new File(root, sFileName);        FileWriter writer = new FileWriter(gpxfile);        writer.append(sBody);        writer.flush();        writer.close();        Toast.makeText(this, ""Saved"", Toast.LENGTH_SHORT).show();    }    catch(IOException e)    {         e.printStackTrace();         importError = e.getMessage();         iError();    }}   </code></pre>","427377","","198356","","2012-08-26 22:41:42","2012-09-19 17:27:57","Writing Text File to SD Card fails","<android><android-sdcard><android-file>","5","1","4","",""
"4580813","1","5339101","","2011-01-02 22:17:24","1","5484","<p>Evening,</p><p>I've just started programming with android and made a few programs and everything so I'm still kind of a novice but im trying to understand it all.</p><p>So here's my problem, I'm trying to play a video, the thing is, I got it working when I Stream it from an URL with VideoView over the internet or when i place in on my sdcard.</p><p>What I want to do now is play a video I've got in my res/raw folder, but it only plays audio and I don't understand why, it doesn't give any error in my logcat as far as I can see, also couldn't really find a solution with google since most of the answers are about VideoView and just put the video on your SDCard.</p><p>Now someone told me I had to use setDisplay (SurfaceHolder) and I've also tried that but I still only get the audio.</p><p>I hope somebody can help me to find a solution to this problem.</p><p>VideoDemo.java</p><pre><code>package nl.melvin.videodemo; import android.app.Activity; import android.os.Bundle; import android.media.MediaPlayer; import android.view.SurfaceHolder; import android.view.SurfaceView; public class videodemo extends Activity {     public SurfaceHolder holder;     public SurfaceView surfaceView;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main);         MediaPlayer mp = MediaPlayer.create(this, R.raw.mac);         mp.setDisplay(holder);         mp.start();       } } </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:id=""@+id/LinearLayout01""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent"" &gt;     &lt;SurfaceView         android:id=""@+id/surfaceview""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""&gt;      &lt;/SurfaceView&gt;&gt; &lt;/LinearLayout&gt;</code></pre><p>I've also tried Uri.parse but it says it can't play the video (.mp4 format).</p>","560609","","","","","2012-10-20 07:31:47","Play Video From Raw Folder","<android>","3","0","1","",""
"4580861","1","4581246","","2011-01-02 22:28:51","0","1489","<p>I'm trying to do the following, on a button click toggle the Overlays on and off.</p><pre><code>List&lt;Overlay&gt; savedOverlays;Button testButton;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);MapView mapView = (MapView) findViewById(R.id.mapview);testButton = (Button) findViewById(R.id.TestButton);testButton.setOnClickListener(testButtonClickListener);mapView.setBuiltInZoomControls(true);setOverlays(mapView);}private void setOverlays(MapView mapView) {    List&lt;Overlay&gt; mapOverlays = getOverlays(mapView);Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable, this);GeoPoint point = new GeoPoint(19240000,-99120000);OverlayItem overlayitem = new OverlayItem(point, ""Hola, Mundo!"", ""I'm in Mexico City!"");GeoPoint point2 = new GeoPoint(35410000, 139460000);OverlayItem overlayitem2 = new OverlayItem(point2, ""Sekai, konichiwa!"", ""I'm in Japan!"");itemizedoverlay.addOverlay(overlayitem);itemizedoverlay.addOverlay(overlayitem2);mapOverlays.add(itemizedoverlay);}private List&lt;Overlay&gt; getOverlays(MapView mapView) {    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    return mapOverlays;}private void toggleOverlays(MapView mapView){    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    if (mapOverlays.isEmpty())    {        setOverlays(mapView);    }    else    {        mapOverlays.removeAll(getOverlays(mapView));    }}private OnClickListener testButtonClickListener = new OnClickListener() {    public void onClick(View V){        toggleOverlays((MapView) findViewById(R.id.mapview));    }};</code></pre><p>Now the toggle off part works but it doesn't seem to want to bring them back, am I missing something?</p>","257250","","","","","2011-01-03 00:14:21","Toggling Android MapView Overlays","<android><android-maps>","1","0","","",""
"4580932","1","","","2011-01-02 22:46:16","2","658","<p>I have a ListView with custom adapter. In each row there is a checkbox and couple of textviews. I want user to give option to delete the check marked items, so as soon as soon clicks on one of the checkbox, I want a button bar to slide in from the bottom and stay at the bottom regardless of listview scroll. This is something like the email app behavior of Motorola Cliq and to some extent gmail app itself.</p><p>I have tried adding a relativelayout (containing buttons) below the listview, which has visibility set to gone initially, but as soon as user checks a button, the visibility changes to ""visible"". I have added a slide-in animation to it too. It is working but problem is that it is overlapping the last element of the listview which user can not checkmark if the button bar has already become visible. So I tried to set the bottom margin of the listview equal to the height of the button bar when I'm changing the button bar visibility, which solves the problem of overlap, but now the checkbox behavior has gone weird. Clicking on one checkmark tries to checkmark another checkmark in the list for some weird reason. I noticed that this happens because as soon as I change the listview margin, list redraws itself, and during this new call to getView() method of adapter, things mess up.</p><p>I wanted to ask if anyone has done something like this. What is the best method to add such button bar below list while keeping the slide-in animation intact. Also, What is the footer-view of listview and can that solve my problem?</p>","553267","","437","","2012-05-01 17:58:05","2012-05-01 17:58:05","Adding a button bar at the bottom of ListView upon checkbox select (as in Gmail app)?","<android><listview><button>","0","1","","",""
"4580933","1","4580949","","2011-01-02 22:46:57","0","1465","<p>In my Android app, I want to use a single variable for the log name in multiple files. At the moment, I'm specifying it separately in each file, e.g.</p><pre><code>public final String LOG_NAME = ""LogName"";Log.d(LOG_NAME, ""Logged output);</code></pre><p>I've tried this:</p><pre><code>public final String LOG_NAME = (String) getText(R.string.app_name_nospaces);</code></pre><p>And while this works in generally most of my files, Eclipse complains about one of them:</p><blockquote>  <p>The method getText(int) is undefined  for the type DatabaseManager</p></blockquote><p>I've made sure I'm definitely importing android.content.Context in that file. If I tell it exactly where to find getText:</p><blockquote>  <p>Multiple markers at this line<br>    - Cannot make a static reference to the non-static method getText(int)  from the type      Context<br>    - The method getText(int) is undefined for the type DatabaseManager</p></blockquote><p>I'm sure I've committed a glaringly obvious n00b error, but I just can't see it! Thanks for all help: if any other code snippets would help, let me know.</p>","369074","","","","","2011-01-03 02:37:30","Android: Referring to a string resource when defining a log name","<java><android>","2","0","","",""
"4580952","1","4643708","","2011-01-02 22:52:34","8","3387","<p>So I get this stack trace:</p><p><code>java.lang.NullPointerException</p><pre><code>   at android.telephony.SmsMessage$SubmitPdu.&lt;init&gt;(SmsMessage.java:132)   at android.telephony.SmsMessage.getSubmitPdu(SmsMessage.java:551)   at android.telephony.SmsManager.sendTextMessage(SmsManager.java:228)   at android.telephony.SmsManager.sendTextMessage(SmsManager.java:107)   at com.emergency.button.SMSSender.safeSendSMS(SMSSender.java:91)   at com.emergency.button.EmergencyActivity$EmergencyThread.sendSMS(EmergencyActivity.java:294)   at com.emergency.button.EmergencyActivity$EmergencyThread.sendMessages(EmergencyActivity.java:386)   at com.emergency.button.EmergencyActivity$EmergencyThread.run(EmergencyActivity.java:266)</code></pre><p></code></p><p>And this is how I call sendTextMessage, I don't verify message length or phone number validity:</p><p><code>sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);</code></p><p>This error seems to only occur on HTC Desire or HTC Wildfire with android version 2.2 or 2.21 so I dug up the android platform source (which is actually not as easy to do as I expected) and found:</p><p><a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=telephony/java/android/telephony/SmsMessage.java;h=0617dada43e6119ab009cc917f11e1284ff09580;hb=5c1207be90fdf296c1b83034b7c68915e1749284"">SmsMessage.java once upon a time</a> though this might not be relevant as I see some of the line numbers don't line up.</p><p>The <a href=""http://code.google.com/p/emergencybutton/"">emergency button project</a> is open source so you can check the code out for reference. I should probably note that I can't test this myself, I don't have either phone model.</p>","177498","","244296","","2011-01-02 22:56:02","2013-11-08 07:55:23","Why do I get NullPointerException when sending an SMS on an HTC Desire, or what is SubmitPdu?","<android><sms>","4","3","3","",""
"4581014","1","4581158","","2011-01-02 23:07:37","1","1356","<p>Ive been struggling to get an alert dialog to pop up when the user clicks an item in the list view. I can do a toast message but cant seem to get an alert dialog to work. I then want to have a button in the alert dialog to allow me to take the item just selected and display it on the next screen where it will be show contact details etc for the one selected. If anyone can give me any insight into any good techniques or tips on how to do this it would be awesome! Im a very new programmer and ive tried everywhere.</p><p>Below is my code :</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String[] taxi = getResources().getStringArray(R.array.taxi_array);        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listtaxi, taxi));        ListView lv = getListView();        lv.setTextFilterEnabled(true);     lv.setOnItemClickListener(new OnItemClickListener() {          public void onItemClick(AdapterView&lt;?&gt; parent, View view,              int position, long id) {            // When clicked, show a toast with the TextView text            Toast.makeText(getApplicationContext(), ((TextView) view).getText(),                Toast.LENGTH_LONG).show();          }        });    } }</code></pre><p>The array is in the strings.xml file.</p><p>Any help would be very much appreciated.</p>","560679","","244296","","2011-01-02 23:13:33","2011-09-02 23:31:17","Android - Creating an alert dialog in listview from selected item","<android><listview><alertdialog>","3","2","","",""
"4581098","1","","","2011-01-02 23:25:07","1","268","<p>I would like to create a popup after a splashscreen.But A have a crash. I think, because the popup is create in a thread (but terminated).So crash..</p><p>I don't find a good code :(</p><p>Code:</p><pre><code>Thread splashTread = new Thread() {            @Override            public void run() {                boolean error = true;                try {                    int waited = 0;                    Parser parser= Parser();                    error = parser.init();                    while (waited &lt; _splashTime) {                        sleep(100);                        waited += 100;                    }                } finally {                    if(!error){                        startActivity(new Intent(getApplicationContext(),                                Main.class));                        finish();                    }else{                        createPopup(context);                    }                }            }        };</code></pre>","560689","","244296","","2011-01-03 00:35:27","2011-01-03 00:36:16","Popup in a thread","<android><multithreading><popup>","1","0","","",""
"4581213","1","","","2011-01-03 00:04:01","1","173","<p>Is there any way to be notified (e.g. using broadcast receiver) when some activity is or is not at the top of a stack (displayed on the screen)? </p><p>I would like to know when lets say google navigation is being launched and closed (resumed/paused). This means I can't modify application and send appropriate intent in the onResume/onPause methods.</p><p>I have scanned list of system Intents but didn't find anything relevant.</p>","560707","","","","","2011-01-03 00:19:18","Notification when activity is(not) at the top of stack (resumed/paused)","<android><activity><intentfilter>","1","0","","",""
"4581222","1","4696840","","2011-01-03 00:06:18","1","2637","<p>I am calling an activity from within itself - basically i've a list of new storys and two filter buttons that when clicked restart the activity with an intent passed that changes the news stories.</p><p>When i run the app it works, but for a second i get the old activity UI while the app reads from the new xml feed and then the UI updates. Is there any way to stop this from happening and get the activity to restart cold.</p><p>here's the code I am currently attaching to the onclicklistener</p><pre><code>public void openFootballNews(View v) { Intent i = new Intent(this, News_Landing.class); // News_landing class is the class this code is in Bundle bundle = new Bundle();     bundle.putString(""code"", ""football""); // this, if set, changes the xml feed to read     i.putExtras(bundle);     i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);     i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);     this.onCreate(null); //this has halved the time the old UI is on the screen for but I cant get rid of it completely     startActivity(i);}</code></pre><p>any help would be great, thanks!</p>","124181","","","","","2011-01-14 22:54:49","Android Activity Update","<android><activity><restart>","1","4","","",""
"4581310","1","4581353","","2011-01-03 00:31:58","4","381","<p>i have made an app that would calculate numbers from input fields. **main Activityinput1input2input3these input are for user to enter numbers.input5 has a preset number of 9.5 input4 is in ""details"" activity</p><p>""Total"" should add input1,input2,input3 and input4</p><p>the problem i am having is that when i try to calculate the ""total"" would not pull input4 number from the second Activity unless i go to that screen and go back to main then click on calculate. could anyone help me figure out how to run both main and the details activities at the same time with the main Activity on the main screen.thank you for reading.and helping me through this.</p>","555665","","","","","2011-01-03 01:55:25","How can i run 2 activities at the same time","<java><android><activity>","2","0","","",""
"4581406","1","4637192","","2011-01-03 00:57:36","5","3384","<p>I have a webview that I am navigating within. I have implemented go back and go forward. My problem is that when I return to the webview after visiting another activity, the history is lost i.e. the webview starts from the first url.</p><p>How do I code it so that after I call finish on the webview to swap to another activity on returning to the webview, the WebBackForwardList is restored and I am taken to the page I was on when I left the webview?</p><p>I have tried overriding onSaveInstanceState and onRestoreInstanceState using webview.save/restoreState(bundle) but with no success.</p><p>I have achieved returning to the last page by saving the last url in preferences, but have been unable to restore the entire history.</p>","496625","","496625","","2011-01-08 04:59:32","2011-01-09 01:31:13","Restore history and current page on resuming webview","<android><activity><webview><history><bundle>","1","0","5","",""
"4581425","1","","","2011-01-03 01:01:11","0","482","<p>I want my app to trigger a php script. Basically, all it needs to do is visit an url with some get variables (something like www.example.com/foo.php?id=1). Preferably without opening any browser.</p>","557703","","244296","","2011-01-03 01:27:35","2011-01-03 01:27:35","Trigger php script through code","<php><android><triggers>","1","1","","",""
"4581640","1","","","2011-01-03 02:11:58","0","4672","<p>I am a true NEWBIE and if this question sounds stupid i apologize in advance.</p><p>I am looking at trying to create an app that will allow me to post customer data to SQL Server on a windows server, is this possible? If so, what do i need?</p><p>Thanks again for the help, and again i apologize if this is a stupid question.</p>","560765","","394322","","2011-01-03 02:17:31","2012-09-25 12:55:47","using an Android app to post entries to SQL Server","<android><sql-server>","4","1","2","",""
"4581652","1","5671395","","2011-01-03 02:14:54","0","1503","<p>Can someone provide some pointers on how to write a crawler in Java to gather info about apps from android market? because the android market is accessible only from a android device (i.e. not over web). </p><p>Thanks!</p>","232510","","","","","2011-07-26 01:06:21","Need help on how to write a crawler for Android market","<android><crawler>","2","1","","",""
"4581736","1","4582131","","2011-01-03 02:35:52","0","423","<p>I'm trying to get an Android app to draw some simple OpenGL code that I found here.<a href=""http://www.iphonemobilephones.com/opengl-es-from-the-ground-up-part-4-let-there-be-light.html"" rel=""nofollow"">http://www.iphonemobilephones.com/opengl-es-from-the-ground-up-part-4-let-there-be-light.html</a>For the life of me, it doesn't want to do the drawing for any shape where I have multiple triangles. If I have a single triangle, it works fine. </p><p>I was hoping that someone who knows more about OpenGL would be so kind as to see if there are any errors that are obvious right off the bat.</p><p>Thanks,mj</p><pre><code>    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);           gl.glEnableClientState(GL10.GL_COLOR_ARRAY);    gl.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);           gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glRotatef(1.0f, 1.0f, 1.0f, 0f);            float vertices[]= {            0f, -0.525731f, 0.850651f,             // vertices[0]            0.850651f, 0f, 0.525731f,              // vertices[1]            0.850651f, 0f, -0.525731f,             // vertices[2]            -0.850651f, 0f, -0.525731f,            // vertices[3]            -0.850651f, 0f, 0.525731f,             // vertices[4]            -0.525731f, 0.850651f, 0f,             // vertices[5]            0.525731f, 0.850651f, 0f,              // vertices[6]            0.525731f, -0.850651f, 0f,             // vertices[7]            -0.525731f, -0.850651f, 0f,            // vertices[8]            0f, -0.525731f, -0.850651f,            // vertices[9]            0f, 0.525731f, -0.850651f,             // vertices[10]            0f, 0.525731f, 0.850651f               // vertices[11]        };    FloatBuffer v = FloatBufferFromFloatArray( vertices, 12*3);    short icosahedronFaces[] = {        1, 2, 6,        1, 7, 2,        3, 4, 5,        4, 3, 8,        6, 5, 11,        5, 6, 10,        9, 10, 2,        10, 9, 3,        7, 8, 9,        8, 7, 0,        11, 0, 1,        0, 11, 4,        6, 2, 10,        1, 6, 11,        3, 5, 10,        5, 4, 11,        2, 7, 9,        7, 1, 0,        3, 9, 8,        4, 8, 0,    };    ShortBuffer i = ShortBufferFromShortArray( icosahedronFaces, 60 );    float normals[] = {        0.000000f, -0.417775f, 0.675974f,        0.675973f, 0.000000f, 0.417775f,        0.675973f, -0.000000f, -0.417775f,        -0.675973f, 0.000000f, -0.417775f,        -0.675973f, -0.000000f, 0.417775f,        -0.417775f, 0.675974f, 0.000000f,        0.417775f, 0.675973f, -0.000000f,        0.417775f, -0.675974f, 0.000000f,        -0.417775f, -0.675974f, 0.000000f,        0.000000f, -0.417775f, -0.675973f,        0.000000f, 0.417775f, -0.675974f,        0.000000f, 0.417775f, 0.675973f    };    FloatBuffer n = FloatBufferFromFloatArray( normals, 3*12 );    float colors[] = {        1.0f, 0.0f, 0.0f, 1.0f,        1.0f, 0.5f, 0.0f, 1.0f,        1.0f, 1.0f, 0.0f, 1.0f,        0.5f, 1.0f, 0.0f, 1.0f,        0.0f, 1.0f, 0.0f, 1.0f,        0.0f, 1.0f, 0.5f, 1.0f,        0.0f, 1.0f, 1.0f, 1.0f,        0.0f, 0.5f, 1.0f, 1.0f,        0.0f, 0.0f, 1.0f, 1.0f,        0.5f, 0.0f, 1.0f, 1.0f,        1.0f, 0.0f, 1.0f, 1.0f,        1.0f, 0.0f, 0.5f, 1.0f    };    FloatBuffer c = FloatBufferFromFloatArray( colors, 4*12 );    gl.glVertexPointer( 12,  GL10.GL_FLOAT, 0, v);    gl.glColorPointer(4, GL10.GL_FLOAT, 0, c);    gl.glNormalPointer(GL10.GL_FLOAT, 0, n);            gl.glDrawElements(GL10.GL_TRIANGLES, 60, GL10.GL_UNSIGNED_SHORT, i);         // helper functions below as well as the surface created functionprivate ShortBuffer ShortBufferFromShortArray( short[] array, int length ){    ByteBuffer vbb = ByteBuffer.allocateDirect(length * 4);    vbb.order(ByteOrder.nativeOrder());    ShortBuffer fb = vbb.asShortBuffer();    fb.put(array);    fb.position(0);    return fb;}private FloatBuffer FloatBufferFromFloatArray( float[] array, int length ){    ByteBuffer vbb = ByteBuffer.allocateDirect(length * 4);    vbb.order(ByteOrder.nativeOrder());    FloatBuffer fb = vbb.asFloatBuffer();    fb.put(array);    fb.position(0);    return fb;}@Overridepublic void onSurfaceCreated(GL10 gl, EGLConfig config) {    //    //gl.glEnable(GL10.GL_DEPTH_TEST);    //gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glEnable(GL10.GL_LIGHTING);    gl.glEnable(GL10.GL_LIGHT0);    // Define the ambient component of the first light    float[] light0Ambient = {0.1f, 0.1f, 0.1f, 1.0f};            gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, FloatBufferFromFloatArray(light0Ambient, 4));    // Define the diffuse component of the first light    float[] light0Diffuse = {0.7f, 0.7f, 0.7f, 1.0f};    gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, FloatBufferFromFloatArray(light0Diffuse, 4));    // Define the specular component and shininess of the first light    float[] light0Specular = {0.7f, 0.7f, 0.7f, 1.0f};    float light0Shininess = 0.4f;    //gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, FloatBufferFromFloatArray(light0Specular, 4));            // Define the position of the first light    float[] light0Position = {1.0f, 0.0f, 0.0f, 0.0f};    gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, FloatBufferFromFloatArray(light0Position, 4));     // Define a direction vector for the light, this one points correct down the Z axis    float[] light0Direction = {0.0f, 0.0f, -1.0f};    //gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPOT_DIRECTION, FloatBufferFromFloatArray(light0Direction, 3));    // Define a cutoff angle. This defines a 90° field of vision, since the cutoff    // is number of degrees to each side of an imaginary line drawn from the light's    // position along the vector supplied in GL_SPOT_DIRECTION above    //gl.glLightf(gl.GL_LIGHT0, gl.GL_SPOT_CUTOFF, 180.0f);    //gl.glEnable(GL10.GL_CULL_FACE);    // which is the front? the one which is drawn counter clockwise    //gl.glFrontFace(GL10.GL_CCW);    // which one should NOT be drawn    //gl.glCullFace(GL10.GL_BACK);    initShape();    //gl.glScalef(1.0f, 1.0f, 1.0f);}</code></pre>","417678","","44729","","2011-01-03 05:00:21","2011-01-03 05:00:21","Android and OpenGL Triangles don't Display","<android><opengl-es><triangle>","1","3","","",""
"4581745","1","","","2011-01-03 02:38:07","0","681","<p>I have tried to get the ADB interface drivers working for motorola XT5 but have had no success. </p><p>I have windows 7 amd x64,installed google USB driver package, revision 4 (installed via android SDK and AVD manager)I am new to android</p><p>Is this even possible to get working?</p>","95482","","","","","2011-01-03 03:19:36","Android development, help can't get ADB interface drivers working for Motorola XT5","<android>","1","0","","",""
"4581770","1","","","2011-01-03 02:49:08","5","6403","<p>I got this error when trying to export a signed apk in Eclipse</p><p>Error while running zipalign:Unable to open  as zip archive</p><p>I have run the Help->Check for Updates to make sure the latest update is installed and SDK tools also up to date.</p>","434784","","","","","2013-01-24 13:54:35","Error while running zipalign","<android><eclipse><export><package>","9","1","","",""
"4581812","1","4584435","","2011-01-03 03:01:56","5","13452","<p>I havent got a clue to how to do this. My progress bar should be the shape of cloud. Can someone direct me to a book, tutorial or just give the right step by step method?</p><p>Thank you for your time.</p>","557869","","190309","","2012-07-18 07:06:13","2013-06-03 12:20:18","Custom Progress Bar in Android?","<java><android><xml><progress-bar><progress>","3","0","12","",""
"4581834","1","4582055","","2011-01-03 03:10:02","0","2173","<p>So Android continues to act bizzarely. I've run the application on emulator for zillion times and suddenly I can't do it anymore. I haven't changed anything in the program. </p><p>I get tons of these messages:</p><pre><code>01-03 03:56:50.595: DEBUG/dalvikvm(32): GC_FOR_MALLOC freed 9798 objects / 461152 bytes in 308ms01-03 03:56:50.595: DEBUG/dalvikvm(32): GC_FOR_MALLOC freed 9798 objects / 461152 bytes in 308ms01-03 03:56:50.595: DEBUG/dalvikvm(32): GC_FOR_MALLOC freed 9798 objects / 461152 bytes in 308ms</code></pre><p>along with:</p><pre><code>01-03 04:05:16.455: WARN/MountService(88): Waiting too long for mReady!</code></pre><p>Any ideas?? It is urgent as hell to solve it, so I'd appreciate any help!</p><p>Edit: Some new error appeared lol</p><pre><code>Failed to upload Info.apk on device 'emulator-5554'com.android.ddmlib.AdbCommandRejectedException: device not foundSDK Manager] Warning: Error parsing 'C:\Program Files\android-sdk-    windows\platforms\android-5\sdk.properties': java.io.FileNotFoundException: C:\Program Files\android-sdk-windows\platforms\android-5\sdk.properties (The system cannot find the file specified).SDK Manager] Warning: Error parsing 'C:\Program Files\android-sdk-windows\platforms\android-6\sdk.properties': java.io.FileNotFoundException: C:\Program Files\android-sdk-windows\platforms\android-6\sdk.properties (The system cannot find the file specified).</code></pre><p>How can this file be missing is beyond me, since I didn't mess with it. </p>","557866","","557866","","2011-01-03 04:36:43","2011-01-03 05:02:38","Android emulator doesn't load - ""waiting too long for mReady""","<android><android-emulator>","2","4","","",""
"4581895","1","","","2011-01-03 03:32:04","0","1324","<p>Hi<br />I am going to player video on Android, I have tried flowplayer and JW player, flowplayer can't support Android, while JW Player support Android but not for streaming.</p><p>Could anyone suggest a flash player that can play ""streaming"" video on Android?</p><p>Thanks you</p>","495452","","495452","","2011-01-03 04:02:17","2011-02-14 23:25:30","Video player on web for Android 2.2","<android><player>","1","0","","",""
"4582075","1","7102234","","2011-01-03 04:30:59","3","768","<p>I've done a lot of googling over the days and I haven't been able to get this problem solved. I'm writing an app and a widget in which I want the quick contact dialog displayed when the user clicks on an <code>ImageView</code> or some other view element by calling <code>QuickContact.showQuickContact()</code>. For some reason, every time I try on Eclair, I get the following error thrown:</p><blockquote>  <p>01-02 17:51:28.869: ERROR/AndroidRuntime(657):  java.lang.RuntimeException: Unable to start activity  ComponentInfo{com.sx.favwidget/com.sx.favwidget.PopupActivity}:  android.content.ActivityNotFoundException: No Activity found to handle  Intent { act=com.android.contacts.action.QUICK_CONTACT  dat=content://com.android.contacts/contacts/lookup/0n4D29415739  flg=0x14200000 (has extras)</p></blockquote><p>(I left out the rest of the logcat, but I can put it back if you guys need it)</p><p>When I try the exact same code on Froyo, it just works. I don't want to have my app targeted only for Froyo users - I'm targeting 2.1 as the minimum OS level. I've found some other people on Stack Overflow struggling with getting QuickContacts to display.</p><p>I could use a QuickContactBadge, and that does work on Eclair, but I'm not allowed a QuickContactBadge in an AppWidget, so I have do this instead. I dug through Android's source code and found the relevant XML files and code for creating the layout but I can't just easily compile it myself because it's a huge headache with all the private API calls.</p><p>Here is my code. It's simple.</p><pre><code>grid.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {        String name = ((TextView)v.findViewById(R.id.grid_item_label)).getText().toString();        Cursor sc = getContentResolver().query(Contacts.CONTENT_URI, new String[] {Contacts.LOOKUP_KEY,   Contacts._ID}, Contacts.DISPLAY_NAME + ""= ?"", new String[] {name}, null);        sc.moveToFirst();                  String lookup_key = sc.getString(sc.getColumnIndex(Contacts.LOOKUP_KEY));        Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookup_key);        QuickContact.showQuickContact(getApplicationContext(), v, uri, QuickContact.MODE_SMALL, null);        }}</code></pre><p>It's just so strange that it works on Froyo, not Eclair, but the API call has been there since Android 2.0. Can anyone help me here??</p><p>Thanks so much!!!</p>","559481","","844882","","2012-03-18 06:08:17","2012-03-18 06:08:17","android: showquickcontact() works great on froyo, not on eclair, which throws an ActivityNotFound exception","<android><activity><quickcontact>","1","1","1","",""
"4582080","1","4582089","","2011-01-03 04:33:55","0","616","<p>Anybody can explain to me about this diagram <img src=""http://i.stack.imgur.com/LpbED.png"" alt=""alt text""></p><p>How can Android application which run on Dalvik call a native lib from VM?</p>","122456","","244296","","2011-01-03 11:29:34","2011-01-03 11:29:34","About android architecture?","<android><architecture>","1","0","","",""
"4582119","1","4582185","","2011-01-03 04:50:09","0","265","<p>I am developing an application of android which involves saving image of camera on click of click button.Can anyone give me a guidance of how to implement camera in android??</p>","475349","","","","","2011-01-03 05:10:34","regarding implementation of camera in android","<android>","1","0","","",""
"4582123","1","","","2011-01-03 04:50:36","15","16121","<p>So, I've followed this particular thread (<a href=""http://stackoverflow.com/questions/2373617/how-to-stop-scrolling-in-a-gallery-widget"">How to stop scrolling in a Gallery Widget?</a>) yet I am unable to get it to work properly.</p><p>I've created a custom MyGallery class extending Gallery.  I've added the code in the link above...am I supposed to add <code>&lt;com.example.mygallery</code> to the XML file?  If so, do I also add the import to the java file or is this not needed because of the XML file?  I'm so very confused.</p><p>I want to simply make the gallery move one image at a time per fling.</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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/carlot_background""    &gt;&lt;com.gallerytest.mygallery    android:id=""@+id/thisgallery""    android:gravity=""center""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>mygallery.java:</p><pre><code>package com.gallerytest;import android.content.Context;import android.util.AttributeSet;import android.view.KeyEvent;import android.view.MotionEvent;import android.widget.Gallery;public class mygallery extends Gallery {    public mygallery(Context ctx, AttributeSet attrSet) {        super(ctx);        // TODO Auto-generated constructor stub    }    private boolean isScrollingLeft(MotionEvent e1, MotionEvent e2){            return e2.getX() &gt; e1.getX();         }    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){      int kEvent;      if(isScrollingLeft(e1, e2)){ //Check if scrolling left        kEvent = KeyEvent.KEYCODE_DPAD_LEFT;      }      else{ //Otherwise scrolling right        kEvent = KeyEvent.KEYCODE_DPAD_RIGHT;      }      onKeyDown(kEvent, null);      return true;      }}</code></pre><p>main.java:    package com.gallerytest;</p><pre><code>import android.app.Activity;import android.content.Context;import android.content.res.TypedArray;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;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);         mygallery gallery = (mygallery) findViewById(R.id.thisgallery);         gallery.setAdapter(new AddImgAdp(this));         gallery.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView parent, View v, int position, long id) {                Toast.makeText(main.this, ""Position="" + position, Toast.LENGTH_SHORT).show();            }        });    }    public class AddImgAdp extends BaseAdapter {        int GalItemBg;        private Context cont;        private Integer[] Imgid = {                R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5};        public AddImgAdp(Context c) {            cont = c;            TypedArray typArray = obtainStyledAttributes(R.styleable.Gallery1);            GalItemBg = typArray.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);            typArray.recycle();        }        public int getCount() {            return Imgid.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 = new ImageView(cont);            imgView.setImageResource(Imgid[position]);            imgView.setScaleType(ImageView.ScaleType.FIT_CENTER);            imgView.setBackgroundResource(0x0106000d);            imgView.setLayoutParams(new mygallery.LayoutParams(300, 240));            return imgView;        }    }}</code></pre><p>I'd love some help.  Thanks!!</p><p>~Rick</p>","560837","","","","","2013-07-22 14:01:56","Creating a custom Gallery - overriding onFling","<android><class><gallery>","4","0","13","",""
"4582125","1","4582142","","2011-01-03 04:50:43","-1","321","<p>Anybody can tell to me about location of ADT after installation.I want to know, this tool will be saved in ""android-sdk-windows"" folder of Eclipse or another folder.</p>","513413","","244296","","2011-01-03 04:55:15","2011-01-03 05:30:21","About location of android development tools (ADT)","<android><eclipse><location><adt>","2","2","","",""
"4582373","1","4814465","","2011-01-03 06:02:05","0","1291","<p>Hey all,    I am having an unusual problem with my Game. I am loading six textures in my Game, the initial one is a type of Game Background. Now at click of a Sprite i load a Dialog with infalted XML. The problem occurs here, when it first loads my game Background becomes black, when it reloads again it returns to it's original, when it reloads again it's black and it continues like this. It's a big code and that's why i cannot post it here, may be any one of you help me in this. I am stuck since many days in this, I have not unloaded any Texture, but still it's looking like that...............</p><p>Hope to get some help from you all..................</p><p>Thanks............</p>","405521","","","","","2011-12-14 14:51:36","Problem in Android Game using AndEngine","<android><andengine>","4","0","1","",""
"4582405","1","","","2011-01-03 06:09:10","0","1583","<p>iris recognition technology is possible in android or not.i need the details about that.give me some idea about coding for iris scanner</p>","","mukesh","","","","2011-09-06 16:11:59","iris recognition in android","<android>","2","0","","",""
"4582475","1","","","2011-01-03 06:25:15","0","1197","<p>I have a Sony ericsson G900 mobile phone with 2 GB SD card, for experimenting only i wish to install android on my phone device..</p><p>It is a touch screen device, is it possible to install android on my device..</p><p>also advice tips on how to install android on my device.??</p><p>Thanks in advance..</p>","560916","","","","","2011-01-03 06:33:18","I want to Install android on my Sony Ericsson G900","<android>","1","1","","2011-01-03 12:13:10",""
"4582561","1","","","2011-01-03 06:49:00","0","113","<p>I am developing an application in android.I have implemented source code for android.I have added all the required permissions in the manifest file.When i run the program white screen appears on the android emulator.Where is my error.The application crashes after that.What should i do?? Thanks in advance</p>","475349","","","","","2011-01-03 06:49:00","regarding implementation of bluetooth in android","<android>","0","2","","",""
"4582579","1","","","2011-01-03 06:53:49","0","277","<p>I am developing an application in Android 1.6, which fetches feeds from sites in India.These sites have the text in Hindi, which has multi byte characters.When displayed, I see rectangle boxes on Android Emulator.Do I need to install language packs, so this will work, or is that Android apps do not support multi byte characters at all?</p><p>How do I install a language pack?</p>","527541","","","","","2011-01-03 06:53:49","multibyte characters in android","<android><multibyte>","0","4","","",""
"4582581","1","","","2011-01-03 06:54:21","-5","532","<p>i just need to do ECG healthcare monitoring system in android.I don't have any idea regarding that. what are the necessary things &amp; how could i do that.?Pls help me.Its urgent.Thanks in advance.Rgds,Sudhir.</p>","555948","","","","","2011-01-03 13:46:28","ECG healthcare monitoring system in android","<android>","1","3","","2011-01-04 04:02:20",""
"4582677","1","","","2011-01-03 07:17:40","0","1371","<p>I'm creating an android app. It requires a TCP socket connection to send data to the another device.</p><p>Everything works fine for the first time transfer. However when I connect it the second time, it says connection refused by the host or bind error.</p><p>I did all possible things to solve this bind error and connection refused. I shutdown both reading and writing end once the transfer is complete, set socket option to re use address, lingering option.</p><p>These things work fine when I exit the application completely and open it again but it does not work when I try to open the connection without exiting.</p><p>Kindly, help me figure out whether the problem is something related with sockets or with the application, and any ideas how this could be solved?</p>","504712","","441574","","2012-01-20 22:27:39","2012-01-20 22:27:39","Connection refused - socket","<android><sockets>","1","4","","",""
"4582686","1","","","2011-01-03 07:21:36","1","283","<p>I am looking to figure out the technology to use to develop a UI that can work with native code (NDK) plus a way to quickly develop it using some IDE.</p><ol><li><p>Is it possible to create a compiled Mobile JavaFx class library using say NetBeans JavaFX IDE and use it in an Android project in Eclipse or Motodev?</p></li><li><p>Can a completely JavaFX app be tested using the Emulator using any IDE? Can a completely JavaFX app work with libs compiled using NDK?</p></li><li><p>Could an AIR app developed using Flex Burrito talk to a library developed using the NDK?</p></li><li><p>OR, should you fall back on Android Widgets themselves, and do we have an IDE (like NetBeans JavaFX IDE) for developing the UI (involving Android Widgets) quickly?</p></li></ol>","560949","","","","","2011-01-03 07:21:36","Android UI: Compiled JavaFX OR AIR OR Android Widgets?","<android>","0","0","1","",""
"4582687","1","4582722","","2011-01-03 07:22:30","0","1904","<p>I want to change the brightness of any given color (Note: I am not talking about screen brightness), I have looked at the <strong>Color</strong> class, it has a few methods for conversions between RGB and HSV, I'm a newbie in this area. To start with, how do I change the brightness of red, if its value is spefied in RGB (#FF0000)?</p>","421372","","","","","2011-01-03 07:35:07","Android changing a color's brightness","<android><colors>","2","0","","",""
"4582727","1","4582797","","2011-01-03 07:32:17","0","862","<p>I am using TabHost in my application and I want to open a webPage when I click on the Item from the List of one Tab into the another Tab.</p><p>I mean the list is in one Tab and when I click on an item from the list, I want to open the WebPage in to another Tab.</p><p>Can I doe this? If yes than please tell me how?</p><p>Thanks,david</p>","422859","","","","","2011-06-27 13:59:43","Opening the activity in another Tab on Click","<android><activity><android-tabhost>","1","0","","",""
"4582739","1","","","2011-01-03 07:34:21","0","44","<p>I am developing an application which involves implementation of Bluetooth on android stimulator.I have implemented the code for bluetooth.Added the required permission in the manifest file. On running the application.I Got a blank screen.Where is my error. Can anyone tell me in advance. Thanks in advance.</p>","475349","","","","","2011-01-03 07:34:21","regarding impementation of bluetooth in android","<android>","0","2","","",""
"4582757","1","4655833","","2011-01-03 07:38:58","0","3946","<p>I am using these codes to jump from listview to selected class </p><pre><code>public class mainmenu extends Activity{</code></pre><p>private ListView lv1 ;   private ArrayAdapter listAdapter ; @Override   public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView (R.layout.mainmenu);</p><pre><code>  lv1 = (ListView) findViewById(R.id.options); </code></pre><p>String[] lv_arr= new String [] { ""Book a Classified Ad"" , ""Book a Classified display Ad"" , ""Book a display Ad"" , ""Page Position Availability"" , ""MIS"" , ""Market Share"" , ""Approval"" , ""Upload Material"", ""Exit"" };   ArrayList Options = new ArrayList();<br>    Options.addAll(Arrays.asList(lv_arr));    listAdapter = new ArrayAdapter(this, R.layout.simplerow, Options);<br>      lv1.setAdapter( listAdapter );<br>      lv1.setTextFilterEnabled(true);      lv1.setClickable(true);</p><pre><code>  lv1.setOnItemClickListener(new  ListView.OnItemClickListener() {   public void onItemClick( AdapterView&lt;?&gt; a, View v, int position, long id) {    position = a.getSelectedItemPosition();    a.setSelection(position);    int pos1 = position;    if (pos1 == 0) {      Intent intent = getIntent();     intent =  new Intent(mainmenu.this,classifiedAd.class);     startActivity(intent);       }    else  if (pos1 == 1 || pos1 == 2) {              Intent intent1 = new Intent(mainmenu.this, displayAd.class);              startActivity(intent1);          }     else  if (pos1 == 3) {              Intent intent3 = new Intent(mainmenu.this, spaceAvail.class);              startActivity(intent3);          }    else   if (pos1 == 4) {              Intent intent4 = new Intent(mainmenu.this, mis.class);              startActivity(intent4);          }   else  if (pos1 == 5) {              Intent intent5 = new Intent(mainmenu.this, mark.class);              startActivity(intent5);          }   else   if (pos1 == 6) {              Intent intent6 = new Intent(mainmenu.this, approval.class);              startActivity(intent6);          }   else   if (pos1 == 7) {              Intent intent7 = new Intent(mainmenu.this, uploadMat.class);              startActivity(intent7);          }   else if (pos1 == 8) {             finish();         }  }   });  }</code></pre><p>}</p><p>where is the problem ?</p>","542936","","180740","","2011-11-05 14:05:20","2011-11-05 14:05:20","How to jump from ListView to next Activity","<android><listview><android-intent>","3","4","0","",""
"4582773","1","","","2011-01-03 07:42:08","4","1203","<p>I need to display a countdown clock, I calculated the difference between dates in miliseconds, how can I convert this to countdown clock, i.e ""<em>20days 12hrs 12min remaining</em>""? I can get hrs remaining. </p><p><code>(mili / 24 * 60 * 60 * 1000)</code></p><p>But This is the total hours remaining how can i convert this to 0-24 hrs 0-60 min format ?  </p>","560966","","1448212","","2013-08-04 17:18:03","2013-08-04 17:18:03","Countdown clock in android","<java><android><countdowntimer>","2","0","1","",""
"4582818","1","4582873","","2011-01-03 07:50:18","1","526","<p>I think that's a rather simple Question but I don't get it the way I want it to.I Want do do a Linear Layout in Android with 3 areas.</p><p>The Top area should have a fixed height, fill_parent width.The second, below the first, should use all the room available, fill_parent width.The third, below the second, should have fixed height, fill_parent width.</p><p>Here is what i got:</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:gravity=""bottom""  android:background=""#ff63a920""&gt;   &lt;LinearLayoutandroid:id=""@+id/top_bar""android:layout_width=""fill_parent""android:layout_height=""32dp""&gt;&lt;/LinearLayout&gt;  &lt;com.google.android.maps.MapView android:id=""@+id/mymapView""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        /&gt; &lt;LinearLayoutandroid:id=""@+id/bottombar""android:layout_width=""fill_parent""android:layout_height=""32dp""&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The Problem is, that the mapview in the middle ist too big, so it pushes out the topbar.</p><p>I Hope you can help me.</p>","482909","","","","","2011-01-03 08:30:54","Android Linear Layout steching","<android>","2","3","","",""
"4582939","1","4583038","","2011-01-03 08:10:54","0","1366","<p>Im too busy creating a website... but was wondering what part as a web developer i wud have to do? to make it easier for another developer to create a smart phone app for me. I dnt want to get my hands dirty with smart phone app development. Are there people out there who can code an app for me at a fair price? when logged in the site uses alot of jquery... so on old phones dnt work. please let me know as im naive at this. thanx</p><p>ps: the website is done in php/mysql on centos. <code>http://www.veepiz.com</code></p>","384894","","","","","2011-01-03 08:32:44","What is needed to make smart phone application for website?","<php><android><smartphone>","2","2","","2011-01-04 03:48:07",""
"4582958","1","","","2011-01-03 08:14:05","2","1344","<p>it is possible to get installer file name which is stored on /sdcard/download/ ? I want to get from app, apk file name which installed it.There is a easy way to do it especially with non-market app?</p>","560996","","","","","2011-10-21 17:50:30","Android: How to get installer file name programatically?","<android><apk><android-install-apk>","1","2","","",""
"4582990","1","","","2011-01-03 08:22:44","2","479","<p>When i open Activity for EditRecord i want to select spinner row for adequate value in edited recordI find code like below, but its ok for few records in spinner, but when spinner.cursor contains many records i think its not right idea.Is any other method to select spinner row for known rowid ?</p><pre><code>Spinner spinner = (Spinner) findViewById(R.id.spinner);spinner.setAdapter(new SimpleCursorAdapter(...));for (int i = 0; i &lt; spinner.getCount(); i++) {   Cursor value = (Cursor) spinner.getItemAtPosition(i);   long id = value.getLong(value.getColumnIndex(""_id"");   if (id == rowid) {      spinner.setSelection(i);   }}</code></pre>","472670","","634025","","2012-01-01 17:54:07","2012-12-18 22:02:31","how to select row in spinner for known rowid?","<android><spinner>","1","2","1","",""
"4583015","1","4583071","","2011-01-03 08:28:33","5","15193","<p>Hey all, first post and a noob in Android programming, but willing to learn! Basically I've taken the Google sample of a tab layout from <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">here</a></p><p>I found that method to be very easy to create tabs with text within each tab, but I'm trying to make it so that when a tab is selected, I want the text listed below to be separated by a dividing line.  So that a line is dividing between each paragraph, however I'm having trouble doing this. This is what I have so far:main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                                </p><pre><code>        &lt;TableRow&gt;            &lt;TextView            android:id=""@+id/textview1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""this is the FIRST line of the 1st tab"" /&gt;            &lt;TextView            android:id=""@+id/textview1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:text=""this is the SECOND line of the 1st tab"" /&gt;            &lt;/TableRow&gt;            &lt;View    android:layout_height=""2dip""    android:background=""#FF909090"" /&gt;    &lt;TableRow&gt;        &lt;TextView             android:id=""@+id/textview2""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""             android:text=""this is First line of the 2nd tab"" /&gt;            &lt;/TableRow&gt;            &lt;View    android:layout_height=""2dip""    android:background=""#FF909090"" /&gt;            &lt;View    android:layout_height=""2dip""    android:background=""#FF909090"" /&gt;          &lt;TextView             android:id=""@+id/textview3""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""             android:text=""this is the First line of the 3rd tab"" /&gt;         &lt;TextView             android:id=""@+id/textview4""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""             android:text=""This is the First line of the 4th tab."" /&gt;            &lt;/TableLayout&gt;     &lt;/FrameLayout&gt;</code></pre><p></p><p>Here is the info in the java file:</p><pre><code>  public class HelloTabWidget extends TabActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TabHost mTabHost = getTabHost(); mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""TAB 1"").setContent(R.id.textview1));        mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(""TAB 2"").setContent(R.id.textview2)); mTabHost.addTab(mTabHost.newTabSpec(""tab_test3"").setIndicator(""TAB 3"").setContent(R.id.textview3)); mTabHost.addTab(mTabHost.newTabSpec(""tab_test4"").setIndicator(""TAB 4"").setContent(R.id.textview4));        mTabHost.setCurrentTab(0);    }}</code></pre><p>In main.xml I can get ""this is the FIRST line of the 1st tab"" on the first line, but ""this is the SECOND line of the 1st tab"" is showing up in the first line, and in all other tabs.Thanks in advance for any help, hopefully with my gained knowledge I can help others in the future.</p>","560983","","948041","","2012-09-06 07:08:30","2012-09-06 07:08:30","Creating line dividers in Android tab layout paragraphs","<android><layout><tabs><line><divide>","1","0","","",""
"4583073","1","4583127","","2011-01-03 08:38:52","0","715","<p>I am having a listview but i have problemi have the main.xml file, which contains a Listview:</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/gradient""android:gravity=""center""android:padding=""1pt""&gt;&lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content""android:layout_height=""fill_parent"" android:background=""@android:color/transparent""android:cacheColorHint=""#00000000""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Then, i have a custom listview file called listview.xml:</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:orientation=""vertical""  android:background=""@android:color/transparent""  android:cacheColorHint=""#00000000""&gt;&lt;TextView android:gravity=""center"" android:textColor=""#ffffff""android:background=""#0097D0"" android:text=""Overskrift""android:id=""@+id/tvOverskrift"" android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:textStyle=""bold"" /&gt;&lt;ImageView android:id=""@+id/ivBillede"" android:scaleType=""fitXY""android:padding=""2px"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:src=""@drawable/test""/&gt;&lt;TextView android:gravity=""center"" android:textColor=""#ED2025"" android:text=""Dato"" android:id=""@+id/tvDato"" android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:textStyle=""normal""/&gt;&lt;TextView android:gravity=""left"" android:textColor=""#000000"" android:text=""Indledning""android:id=""@+id/tvIndledning"" android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:textStyle=""normal""/&gt;&lt;/LinearLayout&gt;</code></pre><p>the bitmap in the imagview i am getting is from a URL.</p><p>By that code, i am getting is this:<br><a href=""http://img585.imageshack.us/img585/5665/unavngivetv.png"" rel=""nofollow"">http://img585.imageshack.us/img585/5665/unavngivetv.png</a>  </p><p>I am getting too much space in the height as you see</p>","552855","","552855","","2011-01-03 09:28:49","2011-01-03 09:52:01","Imageview in a listview - Height is bugged?","<android><xml><listview>","1","1","","",""
"4583110","1","4599712","","2011-01-03 08:44:13","2","324","<p>I have an activity that is started from the search api. I would like it to ""return"" some values to the activity that was running when the search was instigated, in a similar way to startActivityForResult, but I can't see how to do it. Any suggestions?</p><blockquote>  <p>Activity A -> (startActivity) ->  Activity B -> (Search) -> Activity C  -> (return) -> Activity B</p></blockquote><p>At the moment I'm starting a new instance of activity B using the values. This works, but the activity stack is then not the way it should be. Ie, pressing back from B would go back via C, B, A, instead of just A.</p><p>Any suggestions on the way to do this?</p>","369074","","","","","2011-01-05 20:51:24","Android: Using search API to do equivalent of startActivityForResult","<android>","2","1","1","",""
"4583184","1","4583198","","2011-01-03 08:58:22","1","625","<p>When I am running my hello world codes with Android emulator, its take more time to run. If it take more time my debugging process goes slow, because each time I have to run emulator. Is there a way which I am missing, or emulator takes more time to run applications. </p>","550966","","","","","2011-01-03 09:01:03","Android emulator takes time to run application","<android>","1","0","1","",""
"4583219","1","","","2011-01-03 09:05:08","2","645","<p>I am trying to run sample application VoiceRecognition on Android Emulator SDK 2.2. As i click on Speak button i get a pop - up ""This application Voice Search (process com.google.android.voicesearch) has stopped unexpectedly "".Can i know the why it happens and how to correct it?I have been asking android questions but till date got no reply..</p><p>If anyone has worked or working on Voice Recognition please help me</p>","298943","","404469","","2011-01-03 14:25:56","2011-10-21 15:24:56","Problem running sample Voice Recognition application on Android emulator","<android><android-emulator>","1","1","","",""
"4583241","1","","","2011-01-03 09:10:19","0","289","<p>I want to fetch the path where the images are stored in Emulator and use that path to share the photos in twitpic appliation can anyone please help with this sorry if I am not clear</p><p>Thanks in advance</p>","558304","","","","","2011-01-03 09:33:16","Android twitpic application","<android>","1","0","","",""
"4583266","1","4583416","","2011-01-03 09:14:48","0","768","<p>I want to connect Android phone to other devices using JSR 82.</p>","536091","","","","","2011-01-03 09:37:50","Does Android support JSR 82?","<android>","1","0","","",""
"4583349","1","4583479","","2011-01-03 09:26:44","4","8793","<p>I have a problem with changing the background of a view in a ListView.</p><p><strong>What I need:</strong><br>Change the background image of a row onClick()</p><p><strong>What actually happens:</strong><br>The background gets changed (selected) after pressing e.g. the first entry. But after scrolling down the 8th entry is selected too.Scroll back to the top the first isn't selected anymore. The second entry is selected now.Continue scrolling and it continues jumping...</p><p><strong>What i'm dong in the Code:</strong><br>I have channels, and onClick() I toggle an attribute of channel <strong>boolean selected</strong>and then I change the background.I'm doing this <strong>only</strong> onClick() thats why I don't get why it's actuelly happening on other entries too.One thing I notices is: It seems to be only the ""drawing""-part because the item which get selected ""by it self"" has still the <strong>selected</strong> value on <strong>false</strong>  </p><p>I think it seems to have something to do with the reuse of the views in the custom ListAdapters getView(...)</p><p><strong>Code of onClick() in ListActivity:</strong></p><pre><code>@Override    protected ViewHolder createHolder(View v) {        // createHolder will be called only as long, as the ListView is not        // filled        TextView title = (TextView) v                .findViewById(R.id.tv_title_channel_list_adapter);        TextView content = (TextView) v                .findViewById(R.id.tv_content_channel_list_adapter);        ImageView icon = (ImageView) v                .findViewById(R.id.icon_channel_list_adapter);        if (title == null || content == null || icon == null) {            Log.e(""ERROR on findViewById"",                    ""Couldn't find Title, Content or Icon"");        }        ViewHolder mvh = new MyViewHolder(title, content, icon);        // We make the views become clickable        // so, it is not necessary to use the android:clickable attribute in        // XML        v.setOnClickListener(new ChannelListAdapter.OnClickListener(mvh) {            public void onClick(View v, ViewHolder viewHolder) {                // we toggle the enabled state and also switch the the                // background                MyViewHolder mvh = (MyViewHolder) viewHolder;                Channel ch = (Channel) mvh.data;                ch.setSelected(!ch.getSelected()); // toggle                if (ch.getSelected()) {                    v.setBackgroundResource(R.drawable.row_blue_selected);                } else {                    v.setBackgroundResource(R.drawable.row_blue);                }                // TESTING                Log.d(""onClick() Channel"", ""onClick() Channel: ""                        + ch.getTitle() + "" selected: "" + ch.getSelected());            }        });return mvh;    }</code></pre><p><strong>Code of getView(...):</strong></p><pre><code>@Overridepublic View getView(int position, View view, ViewGroup parent) {    ViewHolder holder;    // When view is not null, we can reuse it directly, there is no need    // to reinflate it.    // We only inflate a new View when the view supplied by ListView is    // null.    if (view == null) {        view = mInflater.inflate(mViewId, null);        // call own implementation        holder = createHolder(view);        // TEST        // we set the holder as tag        view.setTag(holder);    } else {        // get holder back...much faster than inflate        holder = (ViewHolder) view.getTag();    }    // we must update the object's reference    holder.data = getItem(position);            // &lt;EDIT SOLUTION&gt;    if(getItem(position).get_id() == channelList.get(position).get_id()){        if(getItem(position).getSelected())        {            view.setBackgroundResource(R.drawable.row_blue_selected);        }        else{            view.setBackgroundResource(R.drawable.row_blue);        }    }            // &lt;/EDIT SOLUTION&gt;    // call the own implementation    bindHolder(holder);    return view;}</code></pre><p>I really would appreciate any idea how to solve this! :)</p><p>If more information is needed please tell me.</p><p><strong>Thanks in advance!</strong></p>","560297","","47680","","2011-07-21 23:43:32","2011-07-21 23:45:06","Change ListView background - strange behaviour","<java><android><listview><onclick><background-image>","2","0","4","",""
"4583392","1","4585410","","2011-01-03 09:34:33","0","1335","<p>I want to create a GridView for my Main Menu, but it should have one and two columns simultaneously. What do I mean by that? <b>First row</b> will have only one wide icon (actually ""are"" to press will be wide) but row <b>number two</b> will have 2 icons. Here is the picture to make it clear. What's the solution?</p><p><a href=""http://slike.hr/slike/gridview_d2832.jpg.html"" rel=""nofollow"">GridView with one and two columns</a></p>","455268","","","","","2011-01-03 14:48:53","GridView with one and two columns simultaneously","<android><list><listview><gridview><grid>","1","1","","",""
"4583398","1","","","2011-01-03 09:35:01","0","484","<p>I want to change the language of screen, and the language options are set in a spinner. Currently the language is updated when I <code>Manually reload</code> the screen. But I want to update the ui on clicking of the language in spinner.</p><p>How can I do that??</p>","246942","","","","","2011-01-03 09:35:01","Android: Change language of the screen on click of spinner item","<android><android-layout>","0","2","","",""
"4583427","1","4583459","","2011-01-03 09:40:21","0","210","<p>in my app to save configurations I do:</p><p>((Activity) context).getSharedPreferences(""contentList"", 0).edit()                .putString(""contentList"", contentListString).commit();</p><p>((Activity) context).finish();</p><p>This takes a lot of time until the activity finishes. Is there a reason for this, and how to improve it?</p><p>Thanks, best regards.</p>","472355","","","","","2011-01-03 09:45:55","saving in sharedpreferences take a lot of time","<android>","1","0","","",""
"4583434","1","4583498","","2011-01-03 09:41:05","1","992","<p>I need to use the package manager in adb.For that how do i enable the root permission on android samsung galaxy s?</p>","544631","","35060","","2011-01-03 09:50:59","2011-01-03 09:54:04","Root mode in Samsung Galaxy S","<android>","1","0","1","",""
"4583456","1","4583599","","2011-01-03 09:45:29","0","2420","<p>I just wanna display image gallery dynamically in android.(i.e) shouldn't get image from path res/drawable..</p><p>How could I do this?</p>","555948","","206809","","2012-04-20 14:51:58","2014-04-08 14:17:16","image gallery dynamically","<android>","2","0","1","",""
"4583467","1","","","2011-01-03 09:48:21","0","584","<p>I have</p><pre><code>    &lt;LinearLayout android:id=""@+id/LinearLayoutPlayer""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Spinner android:id=""@+id/Spinner01""        android:layout_width=""fill_parent"" android:layout_height=""wrap_content""        android:layout_weight=""100""&gt;&lt;/Spinner&gt;    &lt;ToggleButton android:text=""@+id/ToggleButton01""        android:id=""@+id/ToggleButton01"" android:layout_height=""wrap_content""        android:layout_width=""wrap_content"" android:layout_weight=""1""&gt;&lt;/ToggleButton&gt;&lt;/LinearLayout&gt;</code></pre><p>Which displays a spinner and next to it a toggle button. Everything okay so far. Of course the spinner need some entries, so I add to the spinner the attribute:</p><pre><code>android:entries=""@array/myentries""</code></pre><p>The problem now is that the toggle button is a bit lower than the spinner and the botton of the toggle button is cut off, maybe 3 or 5 lines of pixels.</p><p>Anyone an idea what is wrong here? Android is version 2.2</p><p>Thanks!</p>","481493","","","","","2011-01-04 17:27:42","layout messed up once spinner has entries","<android><layout><android-layout><spinner><togglebutton>","1","0","","",""
"4583484","1","22786827","","2011-01-03 09:51:23","176","78257","<p>In Android applications such as Twitter (official app), when you encounter a ListView, you can pull it down (and it will bounce back when released) to refresh the content.</p><p>I wonder what is the best way, in your opinion, to implement that?</p><p>Some possibilities I could think of:</p><ol><li>An item on top of the ListView - however I don't think scrolling back to item position 1 (0-based) with animation on the ListView is an easy task.</li><li>Another view outside the ListView - but I need to take care of moving the ListView position down when it is pulled, and I'm not sure if we can detect if the drag-touches to the ListView still really scroll the items on the ListView.</li></ol><p>Any recommendations?</p><p>P.S. I wonder when the official Twitter app source code is released. It has been mentioned that it will be released, but 6 months has passed and we haven't heard about it since then.</p>","11238","","1401895","","2013-04-11 14:09:37","2014-04-01 13:06:56","How to implement Android Pull-to-Refresh","<android><listview><android-listview><pull-to-refresh>","10","6","107","",""
"4583545","1","4583577","","2011-01-03 10:02:07","1","1547","<p>I have a preferences activity with a checkbox ""Enable Service"".</p><p>I read the value like this :</p><p>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(con);ServiceEnabled_Pref = prefs.getBoolean(""EnableService"", true);</p><p>ok, but how can I set this Preference ?</p><p>this is not a CustomShared Preference, It is a DefaultShared Preferences and it seems that there is not a method putBoolean for DefaultSharedPreferences.</p><p>I need this, cause I have a Widget with a button that needs to set this value to true/false </p>","467780","","","","","2011-01-03 10:07:03","How to set a DefaultSharedPreferences value?","<android><default><shared><preference>","2","0","","",""
"4583558","1","4583581","","2011-01-03 10:04:12","0","1560","<p>I am creating Option menu items that includes four menus in it. I wanna to display the menus in the List order from top to bottom (i.e) </p><p>Menu 1</p><p>Menu 2</p><p>Menu 3</p><p>Menu 4</p><p>not like menu 1|menu 2</p><pre><code>     menu3 |menu4 </code></pre>","558077","","","","","2011-01-03 10:07:27","Android Option Menu","<android>","1","0","","",""
"4583579","1","4584506","","2011-01-03 10:07:17","0","1689","<p>I have one Activity which displayed some Dialog boxes and Progress bars.<br>This activity does not have call to setContentView as this Activity does not have Screen Layout. It has been just used for displaying Dialogs and progress bar dialogs.</p><p>Now what happens is that Activity Displays Dialog box along with the Blank Activity Window on back of the Dialog, So i want to hide make it transparent so it will look like we are just displaying Dialog. </p><p>Thank,PP.</p>","314247","","","","","2013-10-08 05:39:15","How to hide blank/black activity window behind the Dialog","<android>","2","0","","",""
"4583587","1","","","2011-01-03 10:09:07","0","1313","<p>i hope someoune can help me with this problem that gived me headeakes.</p><pre><code>package org.example.browserview;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class BrowserView extends Activity {   private WebView webView;   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      webView = (WebView) findViewById(R.id.web_view);      webView.getSettings().setJavaScriptEnabled(true);      webView.loadUrl(""http://m.test.com"");     }  }</code></pre><p>It works but the problem i have is that i dont want to load all the page into my webkit, i want to load the page without the header of the html. (so i need to hide the header somehow)</p><p>The html header id i've set it to ""header"" and i used jquery in the html page. So all i have to do and i dont know is how to make a javascript command <code>$('header').hide();</code> or <code>document.getElementById('header').hide();</code> before i insert the page into android application.</p><p>So in this way i will get the page into android application without the header.</p>","561082","","20770","","2012-01-06 19:37:29","2012-01-06 19:37:29","Android webview limited loading","<javascript><android><webview>","1","0","","",""
"4583595","1","4584357","","2011-01-03 10:10:07","1","4352","<p>I want to create a Toast message with custom background and custom rounded border. But it seems I am not able to find the solution.</p>","","user560958","457982","","2011-01-26 08:59:36","2012-09-16 06:55:59","Is there any way to create a custom toast notification?","<android><notifications><toast>","6","0","3","",""
"4583638","1","4583677","","2011-01-03 10:20:20","0","1089","<p>How can i obtain the decimal value after division ?after doing this </p><p><code>days = miliseconds/(24 * 60 * 60 * 1000)</code></p><p>suppose the value(i.e days) is 27.8351how do i get 8351 ?Tried </p><p><code>hours = days % (int) days</code> thought it s doing 27.8351 / 27 but still it returned a big Zero, havent tried converting it into string and then splitting based on DOT (.) but i dont like this way have i over looked some thing ?</p>","561095","","","","","2011-01-03 10:26:48","Obtain Decimal values after Division","<java><android>","3","0","","",""
"4583700","1","4584025","","2011-01-03 10:30:56","0","451","<p>Im trying to construct a little mobile optimizated web. This web list a set of results for bussiness and I need that android interpret the telephone link.</p><p>I have watch other webs and android show an especial intem for telephone links (with a telefhone green image in a grey button) but wheb I try it, it seems like a usual link.</p><p>I have tried with microformars (vcard) and it not works.</p><p>My code:</p><pre><code>&lt;ul id=""search-results""&gt;  &lt;li class=""vcard"" id=""i53380""&gt;&lt;!-- pro//ginecologo_madrid/clinica-dam/ --&gt;  &lt;p class=""fn""&gt;    &lt;a class=""url"" href=""/ginecologo_madrid/clinica-dam/""&gt;Name of bussiness&lt;/a&gt;  &lt;/p&gt;  &lt;p class=""adr""&gt;&lt;span class=""street-address""&gt;Street - zipcode&lt;/span&gt; &lt;span class=""locality""&gt;Locality&lt;/span&gt;&lt;/p&gt;  &lt;p class=""tel""&gt;      &lt;a href=""tel://+34 XXXXXXXXX"" class=""value"" &gt;+34 XXXXXXXXX&lt;/a&gt;  &lt;/p&gt;&lt;/li&gt;   &lt;!-- more results --&gt;</code></pre><p></p><p>Any idea? Thanks in advance and sorry for my English.</p>","189850","","","","","2011-01-03 11:25:12","how to create telephone links in xhtml MP","<android><xhtml><mobile><vcard><telephone>","1","0","","",""
"4583707","1","5068576","","2011-01-03 10:31:50","1","838","<p>I am trying to associate a file extension with my air app on Android. My goal is to be able to start my app by clicking on a file with a specific file type from either a file manager or mail app. I have found a solution that in theory would work in native, but does not with air somehow.</p><p>In the .xml-file for the app, under the  tag I have written:</p><pre><code>&lt;activity&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;category android:name=""android.intent.category.BROWSABLE"" /&gt;        &lt;data android:scheme=""file"" /&gt;        &lt;data android:pathPattern="".*\\.csml"" /&gt;        &lt;data android:host=""*"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>Does anyone have an idea how this could be solved?</p><p>Thanks in advanceJens</p>","561094","","561094","","2011-01-03 13:12:49","2011-02-21 16:37:09","Associate file extension with air app on Android","<android><file><air><invoke><associate>","1","0","0","",""
"4583737","1","4637209","","2011-01-03 10:37:10","1","639","<p><br>From <a href=""http://stackoverflow.com/questions/3821423/background-task-progress-dialog-orientation-change-is-there-any-100-working/3821998#3821998"">this</a> answer in stack overflow and the <a href=""https://github.com/commonsguy/cw-android/tree/master/Rotation/RotationAsync/"" rel=""nofollow"">sample project</a> referred there, i got the Idea of RotationAsync, where a progress bar work fine with device rotation. </p><p>But <strong>my problem</strong> is, i have a <code>listview</code> with each row there is <code>progress bar</code>. And is there any way to <strong>retain the progress while rotation for reach row</strong>.  </p><p>Me creating onclicklistener object for the button click listener in <code>getview</code> function of my <code>adapter</code> class. Where its <code>onClick</code> function call the AsyncTask class</p><p>Since each <code>getview</code> (row) is calling different instant of my <code>AsyncTask</code>, i cannot make it static of single ton class.<br>Any Idea on this.<br>Thanks.  </p>","477754","","","","","2011-01-09 01:36:49","RotationAsync with each row in List view","<android><rotation><android-asynctask>","4","0","","",""
"4583830","1","","","2011-01-03 10:52:18","0","334","<p>Hi<br/>I have a list view with difference item layouts.<br/>First I inflated the view and store it memory.When the list view get the child view (from getChildView function)) I will return the in-memory object. Everything seems ok except when I scroll the list, the view is shrink to 2/3 original size and after that it become bigger (fullsize).<br/>I hope that is an animation of android OS but still not found the solution now.<br/>The reason why I need to load it from memory is the inflate function take a lot of time (~100 miliseconds on HTC desire) and make the scrolling does not smooth (lag)<br/>Have you meet this?</p><p><br/>I tested on android version: 2.0 and 2.2 </p><p><img src=""http://i.stack.imgur.com/lzcJW.png"" alt=""alt text""></p>","364210","","","","","2011-01-03 11:37:44","Android - View be shrink when load from memory","<android>","1","0","","",""
"4583943","1","4583992","","2011-01-03 11:10:10","5","9315","<p>Presently I am developing Android application for Samsung galaxy tab. I am using default  Samsung Galaxy Tab emulator that Samsung has provided in ADT third party add-ons.</p><p>But when I run emulator, its not fit into my monitor screen. I am not able to see full size Emulator, I can only see half size emulator. My monitor resolution is 1600x900. to see full size emulator i need to scale the emulator. </p><p>Is their any way to check full size emulator by scrolling or something. or what will be the screen resolution is required to see full size emulator ?     </p>","555747","","","","","2011-06-08 21:25:56","How to see Samsung galaxy Tab Emulator in Full size?","<android><android-emulator>","4","0","2","",""
"4584002","1","4584221","","2011-01-03 11:21:20","0","304","<p>in my database , dates are stored in DD-mm-yyyy format , how can i sort this to obtain the earliest date ? </p><pre><code>Cursor c = myDb.query(TABLE, new String[]{""dob""}, null, null, null, null, ""dob"");</code></pre><p>I have selected it to order by dob field but its not ordered ...This is the output for the above query</p><pre><code>01-03 17:14:51.595: VERBOSE/ORDER DOB(1431): 01-11-197701-03 17:14:51.595: VERBOSE/ORDER DOB(1431): 01-12-198801-03 17:14:51.614: VERBOSE/ORDER DOB(1431): 15-01-197701-03 17:14:51.656: VERBOSE/ORDER DOB(1431): 31-01-1988</code></pre>","561095","","561095","","2011-01-03 11:47:13","2011-01-03 12:11:21","sort date fields to obtain earliest date","<java><android>","2","2","","",""
"4584015","1","4586760","","2011-01-03 11:22:57","17","6381","<p>I've been bugged by this for a while. How do I properly handle screen orientation changes while I have a separate thread / <code>AsyncTask</code> running? Currently, I have</p><pre><code>android:configChanges=""orientation|keyboard|keyboardHidden""</code></pre><p>in my <code>AndroidManifest.xml</code>, but that is <a href=""http://developer.android.com/guide/topics/manifest/activity-element.html#config"">not really encouraged</a>:</p><blockquote>  <p><strong>Note:</strong> Using this attribute should be avoided and used only as a last-resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.</p></blockquote><p>Also, in the 2.3 emulator, it works when switching to landscape, but switching back to portrait fails.</p><p>Now, the reason why I use <code>configChanges</code> is because when the user switches orientation, I might have an <code>AsyncTask</code> running, doing some network traffic, and I don't want it stopped.</p><p>Is there any other way of doing this, or is there a way of fixing 2.3 to switch back to portrait?</p><p>I know about <code>onRetainNonConfigurationInstance</code>, but I'm not sure it would be a good idea to ""save"" the <code>AsyncTask</code> instance, mainly because the class that extends <code>AsyncTask</code> is not static (so it is tied to the <code>Activity</code>) -- and it needs to be, because in <code>onPostExecute()</code> it calls methods from the <code>Activity</code> instance.</p>","180784","","","","","2011-01-03 18:49:01","Handle screen orientation changes when there are AsyncTasks running","<android><android-asynctask>","3","2","12","",""
"4584063","1","4745092","","2011-01-03 11:30:32","0","551","<p>I am using <code>LocalActivityManager activityManager = getLocalActivityManager();</code>, I put all my activities to this by <code>View view = activityManager.startActivity(""123"", myIntent)</code>.There are many activities in this activityManger which are identical by their ID e.g(123).</p><p>1 activity hold favorite Items name <code>FavoriteActivty</code>. Another activity hold items. All I want to do is to notify <code>FavoriteActivty</code> that data has been changed so activity has to refresh itself...How to do this? I dont want to create that activity again.</p>","486139","","104117","","2011-01-03 12:24:49","2012-12-25 10:30:16","How to notify Intent that data in changed?","<android><activity><android-intent>","2","0","","",""
"4584103","1","4584143","","2011-01-03 11:37:38","0","1407","<p>I am using <code>android.util.Log</code>for logging purposes in my Android application. In short my code is as </p><pre><code>import android.util.Log;...private static final String TAG = ""myActivity""; // Creating a tag ...public void onCreate(Bundle savedInstanceState) {....          Log.i(TAG,""My INFO_msg should be print "");} </code></pre><p>The problem is that, when my application runs, this LOG message doesn't appear on the console window. Is it printed on another window ? If my work is to print LOG messages on console window then what will be the process.</p>","550966","","281545","","2013-11-11 00:03:53","2013-11-11 00:03:53","Log in android development","<android>","1","0","0","",""
"4584124","1","","","2011-01-03 11:40:59","1","584","<p>I have never seen this type of <strong><code>EditText</code></strong>, <strong><code>Toggle Button</code></strong> and <strong><code>Bottom Bar Button</code></strong> used by Opera Mobile / Mini in other applications on Android. I want to know which GUI framework they have used to build such a great cross platform UI application?. Is there any open source framework available for this or they have used their own proprietary. Also I want to know how can we develop such a great user interface based applications?. </p><p><img src=""http://i.stack.imgur.com/adl4W.jpg"" alt=""alt text""></p>","","user560958","","user560958","2011-01-04 05:25:15","2011-01-04 05:25:15","GUI Framework Used in Opera Mobile/Mini Android Application","<android><gui><frameworks><opera>","1","0","","",""
"4584309","1","","","2011-01-03 12:13:45","1","1131","<p>1) Does all android phone have Internal GPS?2) How do we find out if the android phone supports Google Map library through code?3) If Google map API is not supported, can we bundle it along with our application to make it work?</p><p>Thanks in advance.</p><p>Regards,Sivaram.</p>","561058","","387194","","2011-04-01 07:11:11","2012-06-28 07:04:27","Android - Google MAP API and Internal GPS support","<javascript><android><google-maps><gps>","3","0","","",""
"4584344","1","4584544","","2011-01-03 12:17:40","2","1124","<p>i am worked on android application in this application image saved in byte code,in this byte code convert image </p><p>in this original image resize in smaller image and clarity image  dynamically how can implemented in android </p><p>please forward some valuable solution thanks in advance...</p>","254790","","","","","2011-01-03 12:47:43","dynamically resize the actual image in android how can implemented","<android><resize-image>","1","2","1","",""
"4584376","1","4585298","","2011-01-03 12:23:26","7","3020","<p>I ran into a bit of a problem, which I think is related to the emulator itself. I have put this code right at the top of my <code>onCreate</code> method in one of my activities:</p><pre><code>Log.d(Const.TAG, ""onCreate orientation: "" + getRequestedOrientation());</code></pre><p>Everytime I switch orientation in the emulator (via Ctrl+F11 and/or Num 7), it prints <code>-1</code> (which corresponds to <a href=""http://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_UNSPECIFIED""><code>SCREEN_ORIENTATION_UNSPECIFIED</code></a>), and it gets stuck in landscape (doesn't switch back to portrait unless I relaunch the app).</p><p>Am I doing something wrong? Is anyone else having this problem? Is it a problem related strictly to the 2.3 emulator or does it appear on devices (Nexus S currently) as well?</p>","180784","","","","","2012-03-04 12:35:12","Android 2.3 emulator orientation changes","<android><android-emulator><android-sdk-2.3>","4","1","2","",""
"4584457","1","","","2011-01-03 12:34:22","0","694","<p>I have display issue when I open 3d   <strong>.3ds</strong> file through min3D android open source project.The following given below is the approach and step involved before issue raised.(1) I have developed the my own 3D modeling and save it as monster_high1.3ds</p><p>(2) Min3D project successfully able to parse and create the object , I am confirmed for this output </p><p>(3) But 3d model isn't displaying at the same XYZ coordinates which I have looked through 3D Max design tools after rendering. That is there is different rendering in context to coordinates by autodesk 3D Max tools and min3D project.</p><p>(4) However when I used the .3ds file shipped with the project it is displaying properly .</p><p>(5) From the code this issue shouldn’t be comes which is mention below Public void initScene(){ //Source code<br> scene.camera().target = monster.position() ;}</p><p>Which set the camera to current parse object position?(6) Is there is any way to map the same look from render point of view between any 3D design tools ( like Autodesk 3D Max , render ) to min3d Google open source project .</p><p>Please help me to solve this issue.Thanks in advance.</p>","1219096","","","","","2012-01-01 11:40:03","Regarding the 3D model displaying issue of .3ds file in min3D android project","<android>","1","2","","",""
"4584472","1","","","2011-01-03 12:36:20","1","296","<p>I was wondering if there's a built in way of adding a 'get current location' button to the MapView, similar to the way you can set the zoom controls. I can't see a suitable-looking method in the API.</p><p>If not that's fine, I can write the code and add my own overlay but just wanted to check first.</p>","559376","","35060","","2011-01-03 12:39:20","2011-01-03 12:56:45","Current Location method","<android>","1","0","","",""
"4584532","1","4584574","","2011-01-03 12:45:57","7","3872","<p>Is there an easy way to map data from JSON to fields of my class by means of android APIs?</p><p>JSON: </p><pre><code>{ email: 'email', password: 'pass' }</code></pre><p>My class:    </p><pre><code>class Credentials{    string email;    string password;}</code></pre>","397991","","104117","","2011-01-03 13:25:52","2013-03-27 12:33:47","JSON to Java class","<java><android><json>","4","1","2","",""
"4584649","1","4584776","","2011-01-03 13:04:21","0","1387","<p>How can I send data from my PHP server side App to Android Client Side App  in terms of Notification or something else i dont want to use C2DM ,is there any other Alternative.</p><p>I want to send such data on a particular event happen on server like a new row inserted in some table or existing row deleted by user A but also shared to user B.So i want to notify user B by sending some notification on his mobile.</p>","395661","","","","","2011-01-03 14:31:59","Sending notification (few data) from PHP server side App to Android Client Side App","<php><android>","2","0","","",""
"4584668","1","4584838","","2011-01-03 13:07:00","1","1808","<p>I have a listview with a couple of strings in at the moment. when a user selects one it brings up an alertdialog box which gives the option to book(this is going to be a taxi app) or cancel. What i cant work out is how to get it so that when the user clicks ""Book"" it takes the information they've selected and loads up a new view with more contact information.</p><p>My Code is currently this -</p><p>public class ListTaxi extends ListActivity{    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);</p><pre><code>    String[] taxi = getResources().getStringArray(R.array.taxi_array);    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listtaxi, taxi));    final ListView lv = getListView();    lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id)       {              AlertDialog.Builder adb=new AlertDialog.Builder(ListTaxi.this);            adb.setTitle(""Taxi Booking"");           adb.setMessage(""You have chosen = ""+lv.getItemAtPosition(position));           adb.setPositiveButton(""Book"", null);          adb.setNegativeButton(""Cancel"", null);           adb.show();        }  }); </code></pre><p>Any help or pointers with this would be immensely appreciated as its the last bit i need to get working before its almost done.</p><p>Thanks everyone</p><p>Oli</p>","560679","","","","","2011-01-03 15:45:14","Android - Change View when alertdialog button is clicked","<android><listview><alertdialog>","3","0","","",""
"4584727","1","","","2011-01-03 13:15:22","2","1151","<p>Is it possible to fetch DTMF tones in android when the person on other side presses 1,2,3.....9 during a conversation? If so, how?</p>","549524","","496830","","2011-11-10 17:10:15","2011-12-30 12:42:24","How to fetch DTMF Tones in Android application","<android><android-sdk-2.2><dtmf>","1","0","1","",""
"4584730","1","","","2011-01-03 13:15:48","0","1381","<p>I have an expandable list view. It has 4 sections. In the first two sections i want to display text. In third one i want to display image and in fourth one i want to display a video.In short every parent is having a different child. How to implement this in an expandable list in android?</p><p>Thanks,Neha</p>","535026","","227532","","2011-01-29 13:58:59","2012-10-12 07:42:07","How to add different children in each section of an expandable list view in android?","<android><expandablelistview>","2","0","","",""
"4584737","1","","","2011-01-03 13:16:27","0","453","<p>I am using the following code to send a large file to struts2. but i dont know howto retrieve this file in struts2. for eg. getFile(); </p><p>Give some code snippets for how to retrieve stream data in struts2.</p><p>InputStreamEntity reqEntity = new InputStreamEntity(new FileInputStream(f), -1);</p><p>reqEntity.setContentType(""binary/octect-stream"");</p><p>reqEntity.setChunked(true);</p><p>httppost.setEntity(reqEntity);</p>","558228","","","","","2011-01-03 13:16:27","android, httppost","<android><httpclient>","0","2","","",""
"4584775","1","4601485","","2011-01-03 13:20:22","4","4554","<p>I am developing an android application which requires to decompress an <strong>AES-256</strong> encrypted zip files, is there any libraries out there that I can use to accomplish that?</p><p>I am greatly appreciative of any guidance or help.  </p>","488434","","488434","","2012-10-07 05:21:32","2013-01-21 17:38:20","How to decompress an AES-256 Encrypted zip files? ","<java><android><zip><decompression><aes>","5","0","","",""
"4584843","1","","","2011-01-03 13:28:55","3","2030","<p>I want to use Flurry in my android app, I have created an account, got api and using that api and i can use onEvent methods in FlurryAgent. </p><p>Now I want to track those calls in fiddler to check, I am able to trace the http calls, but https calls are getting failed.</p><p>I did the following,</p><p>Changed the SSL settings in fiddler and firefox, so if I open any https urls in firefox browser then its tracked, but I am not able to track the calls through android emulator.</p><p>I have changed the emulator settings like given in this link <a href=""http://aurir.wordpress.com/2010/03/22/tutorial-getting-android-emulator-working-with-fiddler-http-proxy-tool/"" rel=""nofollow"">http://aurir.wordpress.com/2010/03/22/tutorial-getting-android-emulator-working-with-fiddler-http-proxy-tool/</a>even though it is not working.</p><p>Can anyone help me to solve this issue?</p>","262523","","","","","2011-01-03 13:38:32","Android : How to track https urls through android emulator using fiddler","<android><emulator><fiddler><flurry>","1","1","2","",""
"4584862","1","","","2011-01-03 13:32:19","11","1405","<p>I want to play a movie from my sd-card. Ive tried using the following code:</p><pre><code>VideoView videoView = (VideoView) findViewById(R.id.videoView);final String MEDIA_PATH = new String(""/sdcard/robot.avi"");MediaController mediaController = new MediaController(this);mediaController.setAnchorView(videoView);videoView.setVideoPath(MEDIA_PATH);videoView.setMediaController(mediaController);videoView.start();</code></pre><p>But when Im trying to play the file i get an error message. ""video not found"" or something similar. When i tried streaming from the web, the video worked but was very laggy. Whats the best way to play videos in my app?</p><p>Thanks</p>","557187","","","","","2012-05-31 02:38:07","Android 2.2 VideoView problem","<android><videoview>","7","0","2","",""
"4584882","1","4585750","","2011-01-03 13:36:26","15","19455","<p>how can I change the focus color (orange) on an edittext box.  thefocus color is a small rim around the entire control and is brightorange when the control has focus.  how can I change the color of thatfocus either with a different color .Can anyone help me in sorting out this issue?Thanks in Advance,</p>","429501","","","","","2012-10-31 06:09:09","how to change focus color of EditText in Android","<android>","2","0","11","",""
"4585076","1","","","2011-01-03 14:06:29","2","793","<p>I am an Android developer and I am working for a set top box project. I want to be able to change the width and height of the display. Because, on the some of the televisions which I use with our box and HDMI cable, the display is bigger than the panel of TV. It doesn't look good. I want to develop an application to allow users changing the size of display. How can I do this? I am waiting for your help.</p>","511853","","","","","2011-01-16 18:57:42","How to Scale Down HDMI Output in Android","<java><android><scale>","2","0","1","",""
"4585151","1","","","2011-01-03 14:15:07","1","1999","<p>Is there any way to get latitude and longitude from the device without using the GPS? I would also like to know if theres a way to get some kind of serial number or similar.</p><p>Thanks</p>","557187","","","","","2011-01-03 15:03:25","Android, get latitude, longitude (wifi) and device ID","<android><latitude-longitude>","2","0","2","",""
"4585352","1","","","2011-01-03 14:41:52","2","829","<p>How do I flip <em>TextView</em> horizontally in android (Not looking for suggestions using anything other than a TextView). The text should appear as if it is seen through the mirror. How do I achieve this?</p>","421372","","421372","","2011-01-03 14:56:23","2011-05-02 23:13:29","Flipping the TextView horizontally","<android><text><textview>","1","3","1","",""
"4585450","1","","","2011-01-03 14:54:38","0","3064","<p>I want to create Option menu and display the menu items in option menu in List order..</p><p>Menu 1</p><p>Menu 2</p><p>Menu 3</p>","561368","","","","","2012-01-17 12:08:23","Android Menu options","<android>","4","1","","",""
"4585482","1","4585602","","2011-01-03 14:58:07","4","509","<p>I need to build various versions of the same project with little differences between them. I would like to pass a parameter at build time in order to specify which version on the project I want to build. Is this possible ? If so how, if not, is there any alternative to reach my goal ?</p>","271395","","","","","2011-01-03 15:11:16","Build time arguments for Android","<android><build><arguments>","1","0","1","",""
"4585591","1","4650113","","2011-01-03 15:10:13","11","11740","<p>I'm compiling native sources and adding the dependencies with .a libs and those relative header files with the following structure.</p><p>/jni/</p><blockquote>  <p>Android.mk</p></blockquote><pre><code>LOCAL_PATH := $(call my-dir)include $(call all-subdir-makefiles)include $(CLEAR_VARS)LOCAL_LDLIBS := -llogLOCAL_MODULE    := ndk1LOCAL_SRC_FILES := native.cLOCAL_STATIC_LIBRARY := mschema include $(BUILD_SHARED_LIBRARY)</code></pre><blockquote>  <p>native.c</p></blockquote><p>/jni/prereqs/</p><blockquote>  <p>Android.mk</p></blockquote><pre><code>LOCAL_PATH := $(call my-dir)include $(call all-subdir-makefiles)include $(CLEAR_VARS)</code></pre><p>--Used to call the sub-folders mk files</p><p>/jni/prereqs/mschema/</p><blockquote>  <p>Android.mk</p></blockquote><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE    :=mschemaLOCAL_SRC_FILES :=libmschema.aLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/includeinclude $(PREBUILT_STATIC_LIBRARY)</code></pre><blockquote>  <p>libmschema.a</p></blockquote><p>/jni/prereqs/mschema/include</p><blockquote>  <p>Header files. (.h)</p></blockquote><p>But while trying to ndk-build (NDK5) I got the following error.</p><pre><code>marcos@marcos-AY675AA-AC4-s5320br:~/dev/workspace/rmsdk.native.wraper$ ndk-buildmake: *** No rule to make target `/home/marcos/dev/workspace/rmsdk.native.wraper/jni/prereqs/mschema/native.c', needed by `/home/marcos/dev/workspace/rmsdk.native.wraper/obj/local/armeabi/objs/ndk1/native.o'.  Stop.</code></pre><p>While tiping I noted the error is about <code>/home/marcos/dev/workspace/rmsdk.native.wraper/jni/prereqs/mschema/native.c' and actually this file is under</code>/home/marcos/dev/workspace/rmsdk.native.wraper/jni/native.c', what's wrong in my make files?</p><p>I solve it with changing the first Android.mk to the following:</p><pre><code>LOCAL_PATH := $(call my-dir)include $(call all-subdir-makefiles)LOCAL_PATH :=/home/marcos/dev/workspace/rmsdk.native.wraper/jniinclude $(CLEAR_VARS)LOCAL_LDLIBS := -llogLOCAL_MODULE    := ndk1LOCAL_SRC_FILES := native.cLOCAL_STATIC_LIBRARY := mschemainclude $(BUILD_SHARED_LIBRARY)</code></pre><p>But it's look wrong, any better approach?</p>","558433","","558433","","2011-01-03 17:04:23","2013-09-16 07:40:27","No rule to make target NDK","<java><android><android-ndk>","2","0","3","",""
"4585627","1","4585733","","2011-01-03 15:14:45","27","5866","<p>The android app I am working on overrides the Application class to store lightweight state (username, gps location, etc) in static vars.  Most of this state is set in OnCreate of the launch activity (username retrieved from prefs, location listener runs).  Is it safe to rely on the launch activity to initialize the Application class?  Are there any cases where the Application class might be re-created without the Launch activity also being created?  </p><p>The question comes up because I ran into a null pointer exception accessing a variable in the Application class on resuming the app after the phone was asleep for several hours (the app was left in the foreground before phone went to sleep).  Is it possible that the process was killed while the phone was asleep and on waking the phone, the Application class was re-created, the top activity in the stack was resumed, but the launch activity.onCreate wasn't run thus the Application class wasn't initialized?</p><p>Note that I have tried to test these kinds of scenarios by Forcing the App to stop using Settings / Manage applications.  However, I'm not able to recreate the problem.  On the next run, the Application class is created,  followed by the launch activity.onCreate.</p><p><strong>Is it safe to assume that the Application class instance will exist as long as the process, and that when the Application class is created it is equivalent to ""restarting"" the application ie. start with a new activity stack (and first activity on stack is the launch activity)?</strong></p>","479567","","","","","2013-11-27 04:41:29","Android Application Class Lifecycle","<android><activity><stack><lifecycle>","2","3","7","",""
"4585693","1","","","2011-01-03 15:23:29","2","11099","<p>I make connection with my webservices (SOAP) this the xml result that I recieved from the webservices how can I parse this result without SAX parser...</p><pre><code>&lt;maintag&gt;&lt;item&gt;  &lt;name&gt;AndroidPeople&lt;/name&gt;   &lt;website category=""android""&gt;www.androidpeople.com&lt;/website&gt; &lt;/item&gt;&lt;item&gt;  &lt;name&gt;iPhoneAppDeveloper&lt;/name&gt;   &lt;website category=""iPhone""&gt;www.iphone-app-developer.com&lt;/website&gt;   &lt;/item&gt;&lt;/maintag&gt;</code></pre><p>EDIT:/ I was wondering to parse this result with Kxmlparser, can anybody tell me how? </p><p>Many thanks!</p><p>SOAP FILE</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);       tv = (TextView)findViewById(R.id.TextView01);       // Maak een nieuw Soap Request object en parameter        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);       request.addProperty(""GUID"",""4fe78-a4s4df8-65a4sd-465as4a"");        request.addProperty(""InstallVersion"",""1"");       // Soapenvelope versie van webservice        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);       envelope.dotNet = true;       envelope.encodingStyle = SoapSerializationEnvelope.XSD;       envelope.setOutputSoapObject(request);       // Transport gegevens vanaf URL        HttpTransportSE aht = new HttpTransportSE(URL);       try       {           aht.call(SOAP_ACTION, envelope);           SoapPrimitive resultsString = (SoapPrimitive)envelope.getResponse();           tv.setText(""Result :"" + resultsString);       }       catch (Exception e)       {             e.printStackTrace();       }    }}</code></pre>","468003","","468003","","2011-01-03 16:12:23","2011-12-05 07:27:00","Android: Parsing XML with KSOAP","<android><xml><sax><ksoap2><kxml>","2","4","","",""
"4585716","1","4596700","","2011-01-03 15:26:35","11","6855","<p>Is there a LWJGL port for Android available (does not matter if the phone needs to rooted)</p>","111731","","","","","2013-09-29 23:33:34","LWJGL port to android","<java><android><port><lwjgl>","3","0","1","",""
"4585743","1","","","2011-01-03 15:29:07","0","1103","<p>When I try to download the ADT Plugin in Eclispe using the URL provided <a href=""https://d1-ss1.google.com/android/eclispe/"" rel=""nofollow"">https://d1-ss1.google.com/android/eclispe/</a> It comes back saying that it can't find this location.  I have tried using ""http:"" also and get the same error.</p><p>I have also tried downloading the plugin (ADT-8.0.0.zip) as directed.  When I try to configure the ADT Plugin (Window>preferences), Android is not listed in the left panel.</p><p>Can anyone tell me whats wrong?</p>","561374","","9453","","2011-01-03 15:32:52","2011-01-03 15:32:52","I am having trouble downloading the ADT Plugin using the URL provided","<android><eclipse-plugin>","1","0","","",""
"4585790","1","4699074","","2011-01-03 15:36:29","2","1193","<p>Actucally I have two related questions concerning Android Errors. I released an update of an app which worked ok before and works in the current version on my Nexus One, G1 and the emulator. However I get a lot of error logs through the Android market console since this last update and I can't reproduce the error. The app is quite simple with only two activities, so it should be quite easy to test the App manually. However there are often Errors which I did not find before releasing. </p><p>So the first questions is, is there a way to test more deaply?</p><p>My second question is concerning the current error specifically. There seems to be a problem with the SQLite database wich can't find a table. I guess the database can't be created in the first place thus the error. Here's the stack trace: </p><p>BTW. There were three users with a Desire HD with complaints. Is there a bug known?</p><pre><code>java.lang.RuntimeException: Unable to resume activity {XXX/XXX}: android.database.sqlite.SQLiteException: no such table: main_ger: , while compiling: SELECT _id, code, area FROM main_gerat android.app.ActivityThread.performResumeActivity(ActivityThread.java:3394)at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3415)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2859)at android.app.ActivityThread.access$2300(ActivityThread.java:136)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:5068)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:858)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)at dalvik.system.NativeStart.main(Native Method)Caused by: android.database.sqlite.SQLiteException: no such table: main_ger: , while compiling: SELECT _id, code, area FROM main_gerat android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:64)at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:80)at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:46)at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1417)at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1301)at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1256)at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1336)at XX.XXX.DataBaseHelper.fetchAll(DataBaseHelper.java:190)at XX.XXX.fillData(mainactivity.java:240)at XX.XXX.onResume(mainactivity.java:522)at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1238)at android.app.Activity.performResume(Activity.java:3904)at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3384)... 12 more</code></pre>","268125","","","","","2011-04-17 17:52:51","Problem with Testing and Debuging of Android Apps","<sql><android><debugging><sqlite>","4","2","1","",""
"4585808","1","4586430","","2011-01-03 15:38:48","10","6224","<p>I've begun playing around with styles and such in my android applications, and I have gotten everything working so far. I quite understood the 'style' <a href=""http://developer.android.com/guide/topics/ui/themes.html"">section of the guide</a>.</p><p>But, looking around, as in <a href=""http://stackoverflow.com/questions/1717489/android-hello-gallery-tutorial-r-styleable-cannot-be-resolved"">this thread</a>, I can't really figure out the difference between the two (<code>declare-stylable</code> and <code>style</code>).From my understanding <code>declare-styleable</code> takes the attribute specified in it and specifies it as styleable, and then from the code one changes it as he wants.</p><p>But if this is what it really does, wouldn't it be simpler to just define the attribute in the layout? Or declare a style specifying it?</p>","525843","","648313","","2011-10-15 15:47:05","2013-12-04 11:51:02","Difference between declare-styleable and style","<android><styles><declare-styleable>","2","0","3","",""
"4585899","1","","","2011-01-03 15:50:17","0","1048","<p>I need help in making my click intents work. I used to have them in my appwidgetprovider, but decided to move them into a service, but I am having trouble getting it to work. Below is the entire code from my intentservice:</p><pre><code>public class IntentService extends Service {static final String ACTION_UPDATE = ""android.tristan.widget.digiclock.action.UPDATE_2"";private final static IntentFilter sIntentFilter;public int layoutID = R.layout.clock;int appWidgetIds = 0;static {    sIntentFilter = new IntentFilter();}@Overridepublic IBinder onBind(Intent intent) {    return null;}@Overridepublic void onStart(Intent intent, int startId) {    super.onStart(intent, startId);}@Overridepublic void onCreate() {    super.onCreate();    registerReceiver(onClickTop, sIntentFilter);    registerReceiver(onClickBottom, sIntentFilter); Log.d(""DigiClock IntentService"", ""IntentService Started."");}@Overridepublic void onDestroy() {    super.onDestroy();    unregisterReceiver(onClickTop);    unregisterReceiver(onClickBottom);}private final BroadcastReceiver onClickTop = new BroadcastReceiver() { @Override    public void onReceive(Context context, Intent intent)  {     if(intent.getAction().equals(""android.tristan.widget.digiclock.CLICK""))     {         PackageManager packageManager = context.getPackageManager();         Intent alarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);         String clockImpls[][] = {                 {""HTC Alarm Clock"", ""com.htc.android.worldclock"", ""com.htc.android.worldclock.WorldClockTabControl"" },                 {""Standar Alarm Clock"", ""com.android.deskclock"", ""com.android.deskclock.AlarmClock""},                 {""Froyo Nexus Alarm Clock"", ""com.google.android.deskclock"", ""com.android.deskclock.DeskClock""},                 {""Moto Blur Alarm Clock"", ""com.motorola.blur.alarmclock"",  ""com.motorola.blur.alarmclock.AlarmClock""}         };         boolean foundClockImpl = false;         for(int i=0; i&lt;clockImpls.length; i++) {             String vendor = clockImpls[i][0];             String packageName = clockImpls[i][1];             String className = clockImpls[i][2];             try {                 ComponentName cn = new ComponentName(packageName, className);                 ActivityInfo aInfo = packageManager.getActivityInfo(cn, PackageManager.GET_META_DATA);                 alarmClockIntent.setComponent(cn);                 foundClockImpl = true;             } catch (NameNotFoundException e) {                 Log.d(""Error, "", vendor + "" does not exist"");             }         }         if (foundClockImpl) {         Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);         vibrator.vibrate(50);         final RemoteViews views = new RemoteViews(context.getPackageName(), layoutID);         views.setOnClickPendingIntent(R.id.TopRow, PendingIntent.getActivity(context, 0, new Intent(context, DigiClock.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), PendingIntent.FLAG_UPDATE_CURRENT));         AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);         alarmClockIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         context.startActivity(alarmClockIntent);           }     } }};     private final BroadcastReceiver onClickBottom = new BroadcastReceiver() {      @Override         public void onReceive(Context context, Intent intent)       {          if(intent.getAction().equals(""android.tristan.widget.digiclock.CLICK_2""))          {              PackageManager calendarManager = context.getPackageManager();              Intent calendarIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);                  String calendarImpls[][] = {                          {""HTC Calendar"", ""com.htc.calendar"", ""com.htc.calendar.LaunchActivity"" },                          {""Standard Calendar"", ""com.android.calendar"", ""com.android.calendar.LaunchActivity""},                          {""Moto Blur Calendar"", ""com.motorola.blur.calendar"",  ""com.motorola.blur.calendar.LaunchActivity""}                  };              boolean foundCalendarImpl = false;              for(int i=0; i&lt;calendarImpls.length; i++) {                  String vendor = calendarImpls[i][0];                  String packageName = calendarImpls[i][1];                  String className = calendarImpls[i][2];                  try {                      ComponentName cn = new ComponentName(packageName, className);                      ActivityInfo aInfo = calendarManager.getActivityInfo(cn, PackageManager.GET_META_DATA);                      calendarIntent.setComponent(cn);                      foundCalendarImpl = true;                  } catch (NameNotFoundException e) {                      Log.d(""Error, "", vendor + "" does not exist"");                  }              }              if (foundCalendarImpl) {              Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);              vibrator.vibrate(50);              final RemoteViews views2 = new RemoteViews(context.getPackageName(), layoutID);              views2.setOnClickPendingIntent(R.id.BottomRow, PendingIntent.getActivity(context, 0, new Intent(context, DigiClock.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), PendingIntent.FLAG_UPDATE_CURRENT));              AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views2);              calendarIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);              context.startActivity(calendarIntent);                }          }};};;};</code></pre><p>What am I doing wrong here?</p>","525720","","13070","","2011-01-03 15:53:13","2011-01-03 16:15:26","Service with intents not working. Help needed","<android><service><android-intent>","1","6","","",""
"4586056","1","4586561","","2011-01-03 16:08:17","0","715","<p>I have created some extended UI controls based on the default android widgets (Button, ProgressBar). At some point, in the custom control, I want to communicate with the view that contains the custom control. For example, I want to pass the current value of the ProgressBar or a value from the Button.What is the best approach? Is it possible to create a custom event (like the ""onClick"") and then have in the container class an handler? Or there is some better approach?Thank you in advance! ;)</p>","449689","","","","","2011-01-03 17:10:29","Communication between a custom view embedded in a view","<android>","1","1","","",""
"4586088","1","","","2011-01-03 16:11:11","0","75","<p>I am trying to get the current GPS location of the mobile. I am using emulator I have given the position to the emulator using DDMS but I am getting nothing in the screen also I don't get any errors.</p><pre><code>public class getitright extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    LocationManager lm=(LocationManager)this.getSystemService(Context.LOCATION_SERVICE);    LocationListener ll=new LocationListener(){        public void onLocationChanged(Location l)        {            go(l);        }        @Override        public void onProviderDisabled(String provider) {            // TODO Auto-generated method stub        }        @Override        public void onProviderEnabled(String provider) {            // TODO Auto-generated method stub        }        @Override        public void onStatusChanged(String provider, int status,                Bundle extras) {            // TODO Auto-generated method stub        }    };    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ll);}    public void go(Location l){     TextView tv=(TextView)findViewById(R.id.tv1);    tv.setText(""""+l.getLatitude());    }}</code></pre>","553670","","","","","2011-01-03 16:16:34","whats wrong with this code?","<android>","1","1","","",""
"4586172","1","4586272","","2011-01-03 16:21:28","1","5606","<p>i'm tryng to implement an OnClickListener on some buttons that are repeated in a GridView, but Eclipse give me an error on the btn.setOnClickListener Line.</p><p>This is the error:</p><pre><code>1 method(s) to implement:- android.view.View.OnClickListener.onClick()</code></pre><p>And This is the code:</p><pre><code>package com.example.convert;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.GridView;public class convert extends Activity {    //private ListView List;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String [] elenco = {                ""ciao"",""questo"",""è"",""un esempio"",""Configurazione""                };        ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(this,R.layout.oggetto,R.id.testogg,elenco);        GridView gridview = (GridView) findViewById(R.id.gridview);        gridview.setAdapter(arrayAdapter);        Button btn = (Button) (findViewById(R.id.testogg));        btn.setOnClickListener(new Button.OnClickListener(){              OnClickListener(View v) {                  setContentView(R.layout.oggetto);              }            });    }}</code></pre><p>I don't understand what that mean, i'm new to java.</p><p>Thanks!</p>","561438","","561438","","2011-01-03 16:44:40","2011-01-03 16:44:40","Android - OnClickListener issue","<java><android><onclick>","4","0","","",""
"4586233","1","4587993","","2011-01-03 16:29:01","0","3244","<p>I have a working copy of the android source tree that I have used to compile from. I want to sync the latest changes from the repo (any new things they have done) but I get an error that </p><pre><code>""You have local changes to 'kernel'; cannot switch branches.""""You have local changes to 'products/common.mk; cannot switch branches.""</code></pre><p>then I get presented 2 errors at what I assume is the end (it seems to have done one more line of tree syncing after that).</p><p>So, my question is, how do I sync their changes on top of things I have changed locally?I cannot commit a change because I am not a contributor to the project, I want to keep my changes local.</p>","353674","","","","","2013-01-02 04:55:46","Android Source repo sync latest changes?","<android><source><sync><repository>","3","0","","",""
"4586275","1","","","2011-01-03 16:33:17","4","591","<p>Is there some way in android to save objects to a place where they can be accessed by different activities of the same application? Without having to serialize or parcel the object?</p>","25282","","","","","2011-01-03 23:18:58","Android Saving Data to application","<android>","5","0","","",""
"4586301","1","4586686","","2011-01-03 16:37:35","2","424","<p>I'm trying to override the <code>offsetTopAndBottom(int offset)</code> method which is a <code>View</code> class method.But when I try to access the <code>mTop</code> or <code>mBottom</code> fields, even though they are <code>protected</code> in the <code>View</code> class, I get an error.</p><p>Does anyone know why I would have this kind of access problem ?</p><p>For example:</p><pre><code>CustomView extend android.view.View{   someOverridenMethod()   {       mTop = 10 //error, mTop no resolved as a type   }}</code></pre>","527677","","84631","","2012-11-02 03:53:22","2012-11-02 03:53:22","Why cant I inherit a protected field from android.view?","<java><android><view>","2","3","1","",""
"4586383","1","","","2011-01-03 16:49:49","1","1050","<p>I would like to add a preference setting that uses an ACTION_PICK intent. My goal is to acquire the phone number of a contact in my phone by using a preference. Is this possible?</p><p>I can run this code from my activity but I discovered I cannot run it from a class that extends DialogPreference.</p><p>Intent intentContact = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intentContact, PICK_CONTACT); </p><p>Or is there a way to start a new activity from a preference? Then that activity could execute the above two lines of code?</p>","479542","","","","","2013-12-04 17:43:50","Need to pick contact from a dialog preference","<android>","3","0","1","",""
"4586442","1","4637710","","2011-01-03 16:57:22","2","2395","<p>I have a Listview that looks like the following:</p><p>checkbox:textview {0 .. n}</p><p>I have a OnCheckChangedListener that listens for checkbox changes (checkbox has focusable set to false as recommended by <a href=""http://www.mousetech.com/blog/?p=74"" rel=""nofollow"">http://www.mousetech.com/blog/?p=74</a>).</p><p>The behaviour that I am looking for is that users can click the checkbox to set its state, and they can click on the listview item to get a description.</p><p>Currently, checkbox state is saved properly and if you click on an item, then it shows a description. However, if you first change a state and then click to get the description, the checkbox reverts to a prior state. In fact all checkboxes revert back to a prior state.</p><p>Anyone know how i can get this working?</p><p>Thanks.</p><p><em><strong></em>**<em>*</em>**</strong><em>EDIT</em><strong><em>*</em>**<em>*</em>****</strong></p><pre><code>SimpleCursorAdapter adapter =     new SimpleCursorAdapter(this,        R.layout.listview_item,         cursor,         new String[] {MyContentColumns.NAME, MyContentColumns.MyBoolean },         new int[] {R.id.listview_item_title,R.id.listview_item_myBoolean });adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {    @Override    public boolean setViewValue(View view, Cursor cursor,int columnIndex) {        String c_name = cursor.getColumnName(columnIndex);        if (c_name.equals(MyContentColumns.NAME)) {            // set up name and description of listview            MyContent v = mycontent.getMyContent(cursor.getString(columnIndex));            if (view instanceof TextView) {                TextView tv = (TextView) view;                if (tv.getId() == R.id.listview_item_title) {                    tv.setText(v.getLongName());                }            }            return true;        } else if (c_name.equals(MyContentColumns.MyBoolean)) {            // if myBoolean == 0, box is checked            // if myBoolean == 1, box is unchecked            int myBoolean = cursor.getInt((cursor.getColumnIndex(MyContentColumns.MyBoolean)));            final String myCont_name = cursor.getString(cursor.getColumnIndex(MyContentColumns.NAME));            final String myCont_cid = cursor.getString(cursor.getColumnIndex(MyContentColumns.CONTENT_ID));            final long c_id = cursor.getLong(cursor.getColumnIndex(MyContentColumns._ID));            if (view instanceof CheckBox) {                ((CheckBox) view).setChecked(myBoolean == 1);                ((CheckBox) view)                        .setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {                            @Override                            public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {                                ContentValues values = new ContentValues();                                values.put(MyContentColumns.MyBoolean,isChecked ? 1 : 0);                                int rows = getContentResolver()                                .update(                                        ContentUris.withAppendedId(Uri.withAppendedPath(MyContentColumns.CONTENT_URI,""mycontent""),c_id),                                        values,                                        null,                                        null);                                if ( rows == 0) {                                    Logger.wLog(String                                            .format(""Couldn't update values for %s into db for content %d"",                                                    myCont_name, myCont_cid));                                }                            }                        });            }            return true;        }        return false;    }});</code></pre><p>So it seems that clicking on one list item causes the other list items to also get clicked... so values revert and my states become inconsistent... ideas? thanks.</p>","354607","","354607","","2011-01-05 15:31:50","2011-12-05 07:56:19","ListView from cursor with checkbox","<android><listview><checkbox>","3","1","1","",""
"4586529","1","4586547","","2011-01-03 17:06:28","0","314","<p>When I run an application that contain some kind of error, the emulator tells me that the application has stopped unexpetedly.</p><p>I use Eclipse on Ubuntu 10.10.</p><p>Where I can find a more verbose log on what happened to the application?</p><p>Thanks!</p>","561438","","539542","","2012-01-15 05:32:37","2012-01-15 05:32:37","Handle Errors on Android","<android><error-handling>","2","0","","",""
"4586543","1","4586589","","2011-01-03 17:08:02","6","1334","<p>I needed to do NTLM authentication for one of my applications on ANDROID. And i have already done it using the JCIFS client library.</p><p>Since i checked issue 4962 on the android forums from google. It says that still NTLM support is not on ANDROID due to legality issue in Apache server license and LGPL. </p><p>So i need to know in case if i want to have a application on the ANDROID market supporting NTLM is it legal or illegal?</p><p>BR,J</p>","523134","","","","","2011-01-03 17:14:00","Is NTLM authentication on ANDROID legal?","<android><legal><ntlm>","1","3","1","2011-01-04 06:09:27",""
"4586635","1","4586673","","2011-01-03 17:20:20","2","1807","<p>I am about to finish my first android app.Could you give me some knowledge/links/references about stuff likedeployment, app signing, android market, app publishing etc</p><p>Thanks </p>","547515","","","","","2011-01-03 17:24:42","android app deployment and publishing","<android>","1","1","3","",""
"4586658","1","4586798","","2011-01-03 17:22:53","0","900","<p>I have managed to setup a page so that a user clicks an item in a listview which then shows an alertdialog box and gives them the option to book or cancel. If they click book it takes them to another screen. What i need is to show the item selected on the next screen. I almost have it but i cant work out where its going wrong. What i was hoping is if someone could help in working out the best way to do this?</p><p>My code at present is - </p><pre><code>        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, final int position, long id)       {               final int selectedPosition = position;            AlertDialog.Builder adb=new AlertDialog.Builder(ListTaxi.this);              adb.setTitle(""Taxi Booking"");             adb.setMessage(""You have chosen = ""+lv.getItemAtPosition(position));              adb.setPositiveButton(""Book"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(getApplicationContext(), Booking.class);                     intent.putExtra(""booking"",  taxi[selectedPosition]);                     startActivity(intent);                 }             });             adb.setNegativeButton(""Cancel"", null);              adb.show();          }     });</code></pre><p>And on the booking.java is: </p><p>public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.booking);            TextView tv_taxi = (TextView) findViewById(R.id.tvtaxi);            //tv_taxi.setText(taxi);</p><pre><code>        Intent intent = getIntent();        String booking = """";        if (intent != null) {            Bundle extras = intent.getExtras();            if (extras != null) {                booking = extras.getString(""booking"");               }            }        }</code></pre><p>Original article is at - <a href=""http://stackoverflow.com/questions/4584668/android-change-view-when-alertdialog-button-is-clicked"">Android - Change View when alertdialog button is clicked</a></p><p>Thanks Everyone</p>","560679","","","","","2011-01-03 17:40:46","Android - Displaying ListView item in a textview","<android><listview><textview><alertdialog>","1","0","","",""
"4586684","1","4607026","","2011-01-03 17:25:49","3","2523","<p>In my app I have a menu item that I want to open up the user's preferred media player, only interested in audio. Ideally the first time the user chooses this item it would choose the only media player on the phone if they only have one installed, or present them with a list if they have more than one. I would then save off their choice so next time it would open that one.</p><p>As I understand it, Android has no default media player. I have the original Droid and it has a media player, but I understand other carriers use their own, or the user can uninstall the standard one.</p><p>I have tried a few things but can't get anything to work.</p><p>I tried this code, which is supposed to get a list of packages that support the intent. It works for some things like ""application/pdf"" and ""video/*"". When I try it with ""audio/*"" I get an empty list, even though I have both the stock Android media player and MixZing installed. Have also tried it with ""media/*"" and get nothing.</p><pre><code>PackageManager packageManager = getPackageManager();Intent testIntent = new Intent(Intent.ACTION_VIEW);testIntent.setType(""audio/*"");List list = packageManager.queryIntentActivities(testIntent, 0);</code></pre><p>I have seen this code which works and opens an audio file with the default player, however I don't want to open a file, I just want to open up the audio app as if the user opened it from the application drawer.</p><pre><code>Intent i = new Intent(Intent.ACTION_VIEW);Uri u = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,""1""); i.setData(u); startActivity(i); </code></pre><p>The only other thing I can think to do is go out and get the package names of the most popular media players and hard code them in and search the phone to see which ones are installed, but this doesn't seem like the best approach. I don't understand why the first bit of code doesn't work. Maybe the intent filters aren't properly set for those apps or I am using the wrong code or mime types.</p>","548949","","","","","2012-03-16 07:26:09","How to get a list of installed media players","<android><audio><android-intent><media><media-player>","1","3","2","",""
"4586750","1","4586922","","2011-01-03 17:35:21","0","2013","<p>I am a beginner to android. I am trying to figure out the errors I am getting when using the following syntax:</p><pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data) {</code></pre><p>The following are the errors: 1.void is an invalid type for the variable onActivityResult.  2.Syntax error on token "","" "";"" expected.  3. same as 2.  4.Syntax error on token ""("" "";"" expected.  5.Syntax error on token "")"" "";"" expected.Sorry if you find this question trivial.</p>","556167","","","","","2011-01-03 17:55:51","android syntax problem with onActivtyresult","<android><syntax><activity><android-intent>","1","4","","",""
"4586761","1","4586937","","2011-01-03 17:36:01","0","1600","<p>I'm new here and a fairly newbish developer overall. I have looked online for an answer to my problem but it seems that noone has had such requirement. Perhaps my approach is flawed. Please help me.</p><p>I want to have a ListView with multiple TextViews that are populated by three different sets of data. First TV is a title of the item, second a summary and third a reference. The only approach I can think of is three separate ListAdapters for the separate TVs but as you can already imagine, every next ListAdapter overwrites the previous one. It looks like only one ListView adapter can be attached to a ListView layout. Is this correct? Here are snippets of my code.</p><p>Test hardcoded data objects:</p><pre><code>    private void createDummyResults() {    ArrayList&lt;SearchResult&gt; searchResults = new ArrayList&lt;SearchResult&gt;();</code></pre><p>// the searchResults array of SearchResults objects is populated here with random data, but I have removed this code for brevity</p><pre><code>    String[] searchResultsTitles = new String[searchResults.size()];    String[] searchResultsSummaries = new String[searchResults.size()];    String[] searchResultsReferences = new String[searchResults.size()];    for (int i = 0; i &lt; searchResults.size(); i++) {        searchResultsTitles[i] = searchResults.get(i).getTitle();        searchResultsSummaries[i] = searchResults.get(i).getSummary();        searchResultsReferences[i] = searchResults.get(i).getReference();    }    // this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_checked, searchResultsList));    ArrayAdapter&lt;String&gt; aa1 = new ArrayAdapter&lt;String&gt;(this, R.layout.results, R.id.titlePane, searchResultsTitles);    ArrayAdapter&lt;String&gt; aa2 = new ArrayAdapter&lt;String&gt;(this, R.layout.results, R.id.summaryPane, searchResultsSummaries);    ArrayAdapter&lt;String&gt; aa3 = new ArrayAdapter&lt;String&gt;(this, R.layout.results, R.id.referencePane, searchResultsReferences);    this.setListAdapter(aa1);    this.setListAdapter(aa2);    this.setListAdapter(aa3);}</code></pre><p>XML layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FFF""    &gt;    &lt;LinearLayout        android:id=""@+id/resultPane""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:gravity=""center_vertical""        android:clickable=""true""        android:focusable=""true""        &gt;        &lt;ImageView            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:padding=""5dp""            android:src=""@drawable/uk_statute_64""            &gt;        &lt;/ImageView&gt;        &lt;LinearLayout            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:orientation=""vertical""            android:background=""#FFF""            &gt;            &lt;LinearLayout                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:orientation=""vertical""                &gt;            &lt;TextView                android:id=""@+id/titlePane""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""#FFF""                android:textColor=""#000""                android:textStyle=""bold""                android:singleLine=""true""                android:text=""This is the Title field""                &gt;            &lt;/TextView&gt;            &lt;TextView                android:id=""@+id/summaryPane""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""#FFF""                android:textColor=""#000""                android:singleLine=""false""                android:maxLines=""2""                android:text=""This is the Summary field; it needs to be two lines long.""                &gt;            &lt;/TextView&gt;            &lt;TextView                android:id=""@+id/referencePane""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""#FFF""                android:textColor=""#AAA""                android:singleLine=""true""                android:text=""This is the ref field, eg. 1989 c.46 s.17""                &gt;            &lt;/TextView&gt;        &lt;/LinearLayout&gt;        &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","561498","","321697","","2011-01-03 17:48:06","2011-01-03 18:03:20","Can I have separate ListAdapters for different TextView items in a ListView?","<android><listview><listadapter>","1","1","","",""
"4586770","1","4586831","","2011-01-03 17:37:37","0","2289","<p>I've a simple test application with a GridView containing an array of buttons, i'm tryng to perform an operation (any operation) touching one of these button.</p><p>the main code is this:</p><pre><code>package com.example.convert;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.GridView;public class convert extends Activity {    //private ListView List;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String [] elenco = {                ""ciao"",""questo"",""è"",""un esempio"",""Configurazione""                };        ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(this,R.layout.oggetto,R.id.testogg,elenco);        GridView gridview = (GridView) findViewById(R.id.gridview);        gridview.setAdapter(arrayAdapter);        Button btn = (Button) (findViewById(R.id.testogg));        btn.setOnClickListener(new OnClickListener(){              @Override              public void onClick(View v) {                  setContentView(R.layout.oggetto);              }            });    }}</code></pre><p>the main.xml is the following:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:columnWidth=""90dp""    android:stretchMode=""columnWidth""    android:gravity=""center""/&gt;</code></pre><p>and the oggetto.xml contain the following lines:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Button    xmlns:android=""http://schemas.android.com/apk/res/android""    android:text=""@+id/TextView01""    android:layout_width=""80dp""    android:layout_height=""80dp""    android:id=""@+id/testogg""&gt;&lt;/Button&gt;</code></pre><p>But when i try to Run the application it return me a NullPointerExeption on the btn.setOnClickListener(new OnClickListener() line.</p><p>May be that happen cause the buttons have the same id? if this is the case, how can i obtain repeated buttons with different ids?</p><p>Thanks for your help!</p>","561438","","","","","2011-01-03 17:45:57","Android Null Pointer Exeption on OnClickListener line","<android>","2","0","1","",""
"4586782","1","","","2011-01-03 17:39:26","0","5356","<p>I have been working on an Android 2.2 app for the past three months, but decided this past week to try to build the app using Android 2.1 SDK. The app ran fine under 2.2 in the emulator, and I was able to build the source as a 2.1 project successfully, but when I try to run the app in the 2.1 emulator, I get the following runtime error:</p><p>java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.tampamobileapps.testapp/.LoginScreen } from null (pid=-1, uid=-1) requires null</p><p>The app is not that complicated and only makes HTTP POST and GET requests. It also supports PayPal payments, but this API worked fine under 2.2. I have googled this error message and have not found any solutions to get rid of the error. </p><p>Any ideas?</p><hr><p><strong>Edit:</strong></p><p>Here's the relevant parts of the Android manifest; the <code>LoginScreen</code> currently does nothing of consequence.</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.app""  android:versionCode=""1""  android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon""       android:debuggable=""true""      android:label=""@string/app_name""      android:name="".SharedApplicationContext""&gt;        &lt;activity android:name="".LoginScreen""          android:label=""@string/login_screen_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="".LoginScreen""          android:label=""@string/app_name""&gt;        &lt;/activity&gt;        &lt;activity android:name="".MainMenu""          android:label=""@string/app_name""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;     &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""/&gt;&lt;/manifest&gt; </code></pre>","561546","","234938","","2011-01-07 00:08:13","2012-11-09 01:15:12","Android ""Permission Denial""","<android>","2","4","0","",""
"4587129","1","","","2011-01-03 18:26:35","0","87","<p>Right now I have a specific group of UI elements(Spinners, edit-boxes, buttons, etc.) which I want to be in the program's UI multiple times. Specifically one copy when the program first loads up and new copies are 'created' and show up in the UI due to user interaction(such as a button press event). I'm aware of using XML to define a specific UI groups but I'm not sure how to properly set up having those groups appear in the UI at the start of the program and by user command within the Java code.</p>","561605","","","","","2011-01-03 18:55:14","Loading UI elements on user command","<java><android><xml><user-interface>","1","1","","",""
"4587131","1","4587143","","2011-01-03 18:26:59","0","578","<p>I am saving a number of preferences which are defined in an xml Preference Screen file.  Included are a few names and phone numbers.   I have managed to connect the contacts list to the preference screen so I only need to show on the preference list one entry and then I can recover the name and number from the contacts.   However if both name and number are not shown on the preference screen as seperate items then I do not seem to able to save the missing item. </p><p>Are Preferences only available if they are part of a displayed screen?</p>","538847","","","","","2011-01-03 18:28:36","preferences without a preference screen?","<android>","1","0","","",""
"4587207","1","","","2011-01-03 18:36:58","0","1561","<p>I use a seekbar in my application and would like to customize it.</p><p>I want to change the drawable(I want to use my own image).How to do it?</p>","412168","","","","","2011-01-03 19:08:42","Customize SeekBar in Android","<android><seekbar>","1","0","","",""
"4587301","1","4587651","","2011-01-03 18:51:20","2","23114","<p>I currently have a listview which contains a couple of strings. These are called from a string array in strings.xml</p><pre><code>&lt;string name=""app_name""&gt;Taxi Me&lt;/string&gt;&lt;string-array name=""taxi_array""&gt;    &lt;item&gt;Barrys Taxi&lt;/item&gt;    &lt;item&gt;Boom Taxi&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>What i was trying to do is create subitems for these so that i can show fields such as address and contact details etc. I made a customlistview a while back but cant work out how i can do it using the strings.xml file? Are there any particular tags i need to use so they show up in the list view?</p><p>Any help would be greatly appreciated.</p><p>Main Activity Code: </p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    final String[] taxi = getResources().getStringArray(R.array.taxi_array);    final String[] address = getResources().getStringArray(R.array.taxi_add);    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listtaxi, taxi));    final ListView lv = getListView();    lv.setTextFilterEnabled(true);    for (int i = 0; i &lt; taxi.length; i++) {        lv.add(new ListTaxi (taxi[i], address[i]));    } /*lv.setOnItemClickListener(new OnItemClickListener() {      public void onItemClick(AdapterView&lt;?&gt; parent, View view,          int position, long id) {        // When clicked, show a toast with the TextView text        Toast.makeText(getApplicationContext(), ((TextView) view).getText(),            Toast.LENGTH_LONG).show();      }    });   */        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, final int position, long id)       {               final int selectedPosition = position;            AlertDialog.Builder adb=new AlertDialog.Builder(ListTaxi.this);              adb.setTitle(""Taxi Booking"");             adb.setMessage(""You Have Selected: ""+lv.getItemAtPosition(position));              adb.setPositiveButton(""Book"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(getApplicationContext(), Booking.class);                     intent.putExtra(""booking"",  taxi[selectedPosition]);                     startActivity(intent);                 }             });             adb.setNegativeButton(""Cancel"", null);              adb.show();          }     });</code></pre><p>Thanks</p>","560679","","560679","","2011-01-03 21:20:35","2013-11-11 19:11:51","Android - Adding Subitem to a listview","<android><listview><subitem>","3","3","1","",""
"4587355","1","","","2011-01-03 18:58:35","0","945","<p>I'm getting this error, though in my postMap I definitely specify a post var ""eventTitle"", what the heck is going on?:</p><blockquote>  <p>01-03 11:52:29.758:  INFO/System.out(27682): Server  response is: <b>Warning</b>:  htmlspecialchars(): Invalid multibyte  sequence in argument in  <b>/home/staging/public_html/system/library/request.php</b>  on line <b>31</b><b>Warning</b>:  session_start(): Cannot send session  cookie - headers already sent by  (output started at  /home/staging/public_html/index.php:100)  in  <b>/home/staging/public_html/system/library/session.php</b>  on line <b>11</b><b>Warning</b>:  session_start(): Cannot send session  cache limiter - headers already sent  (output started at  /home/staging/public_html/index.php:100)  in  <b>/home/staging/public_html/system/library/session.php</b>  on line <b>11</b><b>Warning</b>:  Cannot modify header information -  headers already sent by (output  started at  /home/staging/public_html/index.php:100)  in  <b>/home/staging/public_html/index.php</b>  on line <b>181</b><b>Warning</b>:  Cannot modify header information -  headers already sent by (output  started at  /home/staging/public_html/index.php:100)  in  <b>/home/staging/public_html/system/library/currency.php</b>  on line  <b>45</b>846</p></blockquote><pre><code>public String postHTTPMultipart(LinkedHashMap&lt;String, String&gt; postMap, String apiCall, String token, String imagePath) {     private String header1 = ""api-key"";     private String apiKey = ""xxx"";     private String header2 = ""User-agent"";    private String headerValue2 = ""Testing"";     private String header3 = ""Accept:"";     private String headerValue3 = ""application/json"";     private String header4 = ""session-token"";        HttpURLConnection conn = null;        DataOutputStream dos = null;        DataInputStream inStream = null;        String lineEnd = ""\r\n"";        String twoHyphens = ""--"";        String boundary = ""*****"";        int bytesRead, bytesAvailable, bufferSize;        byte[] buffer;        int maxBufferSize = 1 * 1024 * 1024;        try {            // ------------------ CLIENT REQUEST            FileInputStream fileInputStream = new FileInputStream(new File(imagePath));            //open a URL connection to the Servlet            URL url = new URL(apiCall);            //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.addRequestProperty(header1, apiKey);            conn.addRequestProperty(header2, headerValue2);            conn.addRequestProperty(header3, headerValue3);            conn.addRequestProperty(header4, token);            conn.setRequestProperty(""Content-Type"",""multipart/form-data;boundary="" + boundary);            //add post parameters            String urlParameters = null;            for (Entry&lt;String, String&gt; entry : postMap.entrySet()) {                String key = entry.getKey();                String value = entry.getValue();                String append = key + ""="" + URLEncoder.encode(value, ""UTF-8"") + ""&amp;"";                if (urlParameters != null) {                    urlParameters = urlParameters + append;                } else {                    urlParameters = append;                }            }            urlParameters = urlParameters.substring(0, urlParameters.length() - 1);            dos = new DataOutputStream(conn.getOutputStream());            dos.writeBytes(twoHyphens + boundary + lineEnd);            dos.writeBytes(""Content-Disposition: form-data; name=\""file\"";"" + "" eventImage=\"""" + imagePath + ""\"""" + lineEnd);            dos.writeBytes(lineEnd);            // 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);            //add post parameters here?            dos.writeBytes(twoHyphens + boundary + lineEnd + urlParameters + lineEnd);            // close streams            fileInputStream.close();            dos.flush();            dos.close();        } catch (MalformedURLException ex) {            System.out.println(""From ServletCom CLIENT REQUEST:"" + ex);        }        catch (IOException ioe) {            System.out.println(""From ServletCom CLIENT REQUEST:"" + ioe);        }        // ------------------ read the SERVER RESPONSE        String response = null;        try {            inStream = new DataInputStream(conn.getInputStream());            while ((response = inStream.readLine()) != null) {                System.out.println(""Server response is: "" + response);                System.out.println("""");            }            inStream.close();        } catch (IOException ioex) {            Log.e(""IOException"", ""Exception"", ioex);            System.out.println(""From (ServerResponse): "" + ioex);        }        return response;}</code></pre>","375566","","","","","2011-01-03 19:04:27","Android 2.2 SDK / JAVA - error uploading file/posting params via HttpUrlConnection","<java><android><http-headers>","1","0","","",""
"4587856","1","","","2011-01-03 20:01:03","1","2243","<p>i am trying to create web service call in Visual Studio 2008. But while running android application i am not getting any output in emulator. can you please tell me whats the problems in my coding so that i can fix it.</p><p>_</p><pre><code>Public Function HelloWorld() As String Return ""Hello how are you""End Function</code></pre><p>similarly in .java file of android i have used codings as:</p><pre><code>package com.webservicetest;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.HttpTransportSE;import android.app.Activity;public class webservicetest extends Activity {private static final String NAMESPACE = ""http://localhost/webservicetest/"" ;private static final String URL = ""http://192.168.1.10/webservicetest/Service.asmx"";private static final String HelloWorld_SOAP_ACTION = ""http://localhost/webservicetest/HelloWorld"";private static final String METHOD_NAME1 = ""HelloWorld"";public static void main(String[] args){GetHelloWorld();}/** Called when the activity is first created. */public static void GetHelloWorld() {SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);//SoapSerializationEnvelope envelope =new SoapSerializationEnvelope(SoapEnvelope.VER11);SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);envelope.dotNet = true;envelope.setOutputSoapObject(request);HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);try{androidHttpTransport.call(HelloWorld_SOAP_ACTION, envelope);SoapObject response = (SoapObject)envelope.getResponse();int result = Integer.parseInt(response.getProperty(0).toString());}catch(Exception e){   e.printStackTrace();}}}</code></pre><p>i am getting error in <code>int result = Integer.parseInt(response.getProperty(0).toString());</code> as ""The local variable result is never read"".</p>","556077","","101361","","2013-12-10 14:31:15","2013-12-10 14:31:15","Getting Started with KSOAP on Android","<android><web-services><ksoap>","1","0","1","",""
"4588076","1","4610859","","2011-01-03 20:28:38","23","2462","<p>Is Dalvik's memory model the same as <a href=""http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.4"">Java's</a>? I am particularly interested in whether reads and writes of reference and non-<code>long</code>/non-<code>double</code> primitive variables are atomic, but I would also like to know whether there are any differences between the two platforms' memory models.</p>","196844","","","","","2013-05-02 17:15:16","Is Dalvik's memory model the same as Java's?","<java><android><dalvik><memory-model><java-memory-model>","3","0","15","",""
"4588091","1","","","2011-01-03 20:30:21","2","785","<p>I have a few people using my application and it sounds like, after a few days, the phone becomes less responsive and a little strange if my app is not killed.</p><p>I'd like a little bit of assistance with memory management.  I have a few questions:</p><p>1) I make very few references to static classes or variables in my application.  I have a class (in its own file), which is essentially a Singleton.  This class just has methods in it.  No variables and such.  My application makes heavy use of web-service calls and this class is the access point for that.  Calling a method in this class will boot an IntentService which makes the actual web-service call.  Here is an example.  Please notice that the callWebService method also references MyIntentService.JOB_DELETE and MyIntentService.ITEM_ALL, which are static ints in MyIntentService:</p><pre><code>public class MySingleton {    private static MySingleton mInstance = null;    protected MySingleton() { }    public synchronized static MySingleton getInstance() {        if (mInstance == null) {            mInstance = new MySingleton();        }        return mInstance;    }    public void callWebService(Context appContext, int intUserId) {        Intent intent = new Intent();        intent.setClass(appContext, MyIntentService.class);        intent.putExtra(""job"", MyIntentService.JOB_DELETE);        intent.putExtra(""data_type"", MyIntentService.ITEM_ALL);        intent.putExtra(""user_id"", intUserId);        appContext.startService(intent);    }}</code></pre><p>In my Activity, I call:</p><pre><code>MySingleton.getInstance().callWebService(getApplicationContext(), ((MyApplication)getApplicationContext()).getUserId());</code></pre><p>Is there anything I'm doing wrong here?  Since this Singleton consists only of methods, would it be better to have it not be a Singleton and have all the methods be static?</p><p>2) Cursors.</p><p>I have several Activitys which use CursorAdapters.  I will query for a Cursor using an AsyncQueryHandler.  When the AsyncQueryHandler receives the Cursor, I call changeCursor on my CursorAdapter, passing in this new Cursor.  In the changeCursor handler of my CursorAdapter, I pass the Cursor to super, then set a private Cursor member variable of my Activity to this Cursor and call startManagingCursor on it.</p><p>After this, I don't do anything in the onPause() or onStop() methods to stop managing the Cursor or null it out or anything.  Is this wrong?  I'm thinking there may be some leaking going on by running a little test.  If I scroll down the ListView and rotate the screen, the Activity is ""destroyed,"" re-created, a new Cursor is queried for, and the ListView is automatically scrolled to the place it was before the screen was rotated.  It obviously then still has access to the previous Cursor, right?  I'm not really sure how Android is doing this.</p><p>If I call mCursor.close(); in the onStop() handler, this creates a problem.  When the screen is rotated and populates, the user loses their scrolling position.  This is obviously undesirable.  So what do I do?  Do I get the scroll position, close the Cursor, and then pass the scroll position through savedInstanceState?</p><p>3) How do I run the blasted DDMS stand-alone?  If I open it with Eclipse open, it whines about an instance of DDMS already running and closes.  If I close Eclipse, launch an emulator and then launch the stand-alone DDMS, it doesn't see anything.</p><p>4) Given what you know about my Android experience (based on this post or others), what else should I be looking out for?  I've read a few articles by Romain Guy and I've gotten rid of potential problems, but there's surely more I haven't realized yet.</p>","406790","","406790","","2011-01-03 22:02:12","2011-01-03 22:02:12","Some help uncovering memory leaks","<android><memory-management><memory-leaks>","1","1","","",""
"4588325","1","","","2011-01-03 21:00:29","0","113","<p>Consider this code:</p><pre><code>Message message = Message.obtain(null, MSG_REQUEST_QUOTE, symbol);message.replyTo = new Messenger(new Handler() {    @Override    public void handleMessage(Message msg) {        switch (msg.what) {            case StockMessengerService.MSG_QUOTE_VALUE:                callback.onQuote(symbol, msg.arg1);                break;            case StockMessengerService.MSG_QUOTE_FAILURE:                callback.onFailure(symbol, msg.obj.toString());                break;            default:                super.handleMessage(msg);        }    }});mService.send(message);</code></pre><p>How is the JVM able to garbage collect the replyTo Messenger? In the Android javadocs, they only have a single Messenger, bound to the Activity. But this code works, but I'm quite curious how it is the JVM doesn't GC the Messenger before it gets its message, OR, whether this code is quite risky and will leak memory?</p><p>Edit2:mService is like:</p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder service) {        mService = new Messenger(service);</code></pre><p>This is based on the sample code in the Service javadoc at <a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Service.html</a></p><p>Thanks,Eric</p>","436820","","436820","","2011-01-03 21:51:35","2011-01-03 21:51:35","How are Messengers garbage collected?","<android>","0","2","","",""
"4588485","1","4588642","","2011-01-03 21:22:23","19","20641","<p>Is it possible to measure distance to object with phone camera. I mean, in my application I start the camera, facing the camera to the object (lets say house) and then press the button and it calculates the distance and shows me in screen. </p><p>If it's possible where I can find some tutorial or information about it?</p>","526217","","526217","","2011-07-07 13:03:58","2013-02-26 17:31:23","Is it possible to measure distance to object with camera?","<android><camera><distance>","7","3","13","",""
"4588502","1","","","2011-01-03 21:24:33","0","649","<p>Can anyone tell me if it is still posible to make applications for android 2.1 eclair in flash cs5 via air. I have spent a lot of time downloading, installing, configuring... all the nessesary software but when i try to install the apk on my android 2.1 device (htc desire wich i can't update to froyo because orange has still not released the update...) i get an error saying something alog the lines of ""error_androidskd_outofdate"" sorry i can't be more presice but i can't remember the exact words. I belive this is due to the fact that you can no longer put air apk files on android 2.1 despite the fact that i have allready installed the air runtime on the device.</p><p>Is it in fact inpossible? Is there any solution?</p>","561796","","995926","","2012-05-22 08:24:33","2012-05-22 08:24:33","Making apps for android 2.1 in flash cs5 via air. Impossible?","<android><flash><air><adobe><android-2.0-eclair>","3","0","","",""
"4588506","1","","","2011-01-03 21:24:53","0","279","<p>I am having some trouble creating an application that downloads data from server. What I would like to do is download some data when a user clicks on a tab from within a tab host. The idea is that the next activity that the tab points to will then use the data to populate a list view. I've been trying to use an onClickListener for the tabs, but It doesn't seem to work. I am attaching what I have thus far. I'd like to call the method performGetClasses(), when a user clicks on the tab labeled TAB_NAME_2. </p><p>Thanks in advance.</p><pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     try {      FileInputStream fis = openFileInput(""token"");      try {       fis.read(tokenInt);       token = new String(tokenInt);       fis.close();      } catch (IOException e) {      }     } catch (FileNotFoundException e) {     }     //TODO: Add code to send the token as a put extra to each tab, rather than retrieving in each separate activity.      setContentView(R.layout.home_screen);     Resources res = getResources();      TabHost tabHost = getTabHost();      TabHost.TabSpec spec;       Intent intent;      // Do the same for the other tabs     intent = new Intent().setClass(this, HomePage.class);     spec = tabHost.newTabSpec(""TAB_NAME_1"").setIndicator(""Home"",res.getDrawable(R.layout.ic_tab_home)).setContent(intent);     tabHost.addTab(spec);     intent = new Intent().setClass(this, ClassesPage.class);     spec = tabHost.newTabSpec(""TAB_NAME_2"").setIndicator(""Classes"",res.getDrawable(R.layout.ic_tab_classes)).setContent(intent);     tabHost.addTab(spec);     intent = new Intent().setClass(this, SearchPage.class);     spec = tabHost.newTabSpec(""TAB_NAME_3"").setIndicator(""Search"",res.getDrawable(R.layout.ic_tab_search)).setContent(intent);     tabHost.addTab(spec);     intent = new Intent().setClass(this, MessagesPage.class);     spec = tabHost.newTabSpec(""TAB_NAME_4"").setIndicator(""Messages"",res.getDrawable(R.layout.ic_tab_messages)).setContent(intent);     tabHost.addTab(spec);     intent = new Intent().setClass(this, AccountPage.class);     spec = tabHost.newTabSpec(""TAB_NAME_5"").setIndicator(""Account"",res.getDrawable(R.layout.ic_tab_account)).setContent(intent);     tabHost.addTab(spec);     tabHost.setCurrentTab(0); } public void performGetClasses(String token){  progressDialog = ProgressDialog.show(HomeScreen.this,                ""Please wait..."", ""Retrieving data..."", true, true);        if (!(token == null)) {         PerformClassesTask task = new PerformClassesTask();         task.execute(token);            progressDialog.setOnCancelListener(new CancelTaskOnCancelListener(task));        } }</code></pre>","561797","","561797","","2011-01-05 04:51:56","2011-01-05 04:51:56","Help with Tab OnClickListeners android","<java><android><tabs>","1","2","","",""
"4588548","1","","","2011-01-03 21:30:14","27","38505","<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>Just installed latest Java SE development kit and rebooted so now my system shows Java 6 Update 23 (64 bit) and Java SE Development kit 6 update 23 (64 bit) installed.</p><p>However, when running Android SDK installer, it still complains ""Java SE development kit(JDK) not found."" </p><p>Has anyone experienced this problem?</p>","561798","","","","","2012-04-27 18:54:29","Help: JDK not detected problem during Android SDK Tools setup","<android>","3","2","4","2011-06-30 18:12:37",""
"4588551","1","4588663","","2011-01-03 21:30:40","18","13156","<p>i want to make the button to fill always 50% from the width of the screen, as when i rotate the device horizontally or vertically always the button fill 50% from the width </p>","508377","","","","","2011-01-03 21:45:21","how to make button to fill 50% from the screen width in android?","<android>","1","0","11","",""
"4588718","1","","","2011-01-03 21:55:11","0","2354","<p>This is driving me nuts. I'm trying to upload a draft apk to the app store, I'm a windows developer, and this is my first android app, so I don't really have a frame of reference to work from. I export the signed apk, and from the developer console I browse to the apk, select it, and attempt to upload. I receive the message: The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value. I have uploaded this apk to the web, and can successfully download, install, and run the app outside of the market. I've self-signed the apk, and have verified that is done correctly. Any suggestions would be appreciated.</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.My.PackageName""      android:versionCode=""1"" android:versionName=""1.0.0""&gt;      &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;          &lt;activity android:name="".Home"" android:configChanges=""orientation""                android:label=""@string/app_name"" android:launchMode=""standard"" android:icon=""@drawable/icon""&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="".Preferences"" android:label=""@string/set_preferences""&gt;  &lt;/activity&gt;          &lt;activity android:name=""com.admob.android.ads.AdMobActivity""               android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""              android:configChanges=""orientation|keyboard|keyboardHidden""        /&gt;                        &lt;meta-data android:value=""myValue"" android:name=""ADMOB_PUBLISHER_ID"" /&gt;          &lt;meta-data android:value=""true"" android:name=""ADMOB_ALLOW_LOCATION_FOR_ADS"" /&gt;              &lt;/application&gt;      &lt;uses-sdk android:minSdkVersion=""4"" /&gt;      &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;  &lt;/manifest&gt;`</code></pre>","561818","","83444","","2011-12-02 19:45:26","2013-09-17 23:24:34","The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value","<android><google-play>","3","3","","",""
"4588827","1","","","2011-01-03 22:08:05","0","696","<p>I have a problem with opening a default sms Activity.<br>I'm using the code:  </p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);  intent.setData(Uri.parse(""sms:""+contact));  intent.putExtra(""sms_body"", R.string.sms);  startActivity(intent);  </code></pre><p>It happens to fill the number but not body. Have you come across this problem? Or maybe you know other way to open default sms Activity with filled number and body?</p><p><strong>EDIT</strong><br>OK. What I found is that Android has problem with accessing the String in R file. What is the way to convert some R.string to String in code?</p>","532968","","861565","","2012-01-03 20:27:42","2012-01-03 20:27:42","Problem with fill the sms body in Androids' default sms Acvtivity","<android><activity><sms>","1","0","","",""
"4588869","1","4591023","","2011-01-03 22:14:36","1","2087","<p>was wondering if it is possible to have 2 instances of  the camera preview in android. what i mean is running 2 instances of the camera at the same time. if it is, How would one go about this, will there be need to implement an instance on a different thread? I have not used the camera api before, so i would appreciate it if i can have a heads up on the issue, so i don't waste time on it. Thank you.</p><p>by the way, Happy New Year everyone!</p>","316843","","","","","2011-01-04 05:54:29","Running 2 instances of the Camera at the same time","<android>","2","0","","",""
"4588895","1","","","2011-01-03 22:17:48","1","836","<p>I am an android beginner. My aim is to obtain an email address and show it to the user.I am using the following code to form an email cursor: </p><pre><code>  emailCur=getContentResolver().query(uri,null,           ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI + "" = "" + uri, null, null);</code></pre><p>And this to get the email address from the cursor:</p><pre><code>email = emailCur.getString(           emailCur.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Email.DATA));emailType = emailCur.getString(           emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE));</code></pre><p>And I am trying to save using this code:</p><pre><code>EditText ctext= (EditText) findViewById(R.id.contacttxt);           ctext.append(email);</code></pre><p>I am getting the following error:</p><pre><code>   android.database.SQLliteException:unrecognized token while compiling SELECT.....</code></pre><p>I think my usage of DATA is wrong. What should I use in its place?If this is not the problem, then what is?</p><p>The complete code is here:</p><pre><code>package com.examples.!@##;import android.app.Activity;import android.util.AttributeSet;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.*;import android.net.Uri;import android.os.Bundle;import android.provider.BaseColumns;import android.provider.Contacts.People;import android.provider.ContactsContract;import android.content.Context;import android.content.Intent;import android.database.Cursor;public class !@#$ extends Activity {Button sharebutton, plusbutton, contactbutton;private final Context ctx = this;private String TAG = ""!@#$"";public void onCreate(Bundle savedInstanceState) {    Log.d(TAG, ""oncreate() started."");    super.onCreate(savedInstanceState);    Log.d(TAG, ""line 1"");    setContentView(R.layout.main);    Log.d(TAG, ""line 2"");    // Initialize buttons    sharebutton = (Button) findViewById(R.id.Buttonshare);    Log.d(TAG, ""line 3"");    // Define button listeners    sharebutton.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            Log.d(TAG, ""button clicked"");            Toast.makeText(ctx, ""asdf"", Toast.LENGTH_SHORT).show();        }    });    contactbutton = (Button) findViewById(R.id.contactbutton);    // Define button listeners    contactbutton.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            Log.d(TAG, ""contact button clicked"");            Toast.makeText(ctx, ""Contact button clicked"",                    Toast.LENGTH_SHORT).show();            Intent contacts = new Intent(Intent.ACTION_GET_CONTENT);            contacts.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);            startActivityForResult(contacts, 1);        }    });    Log.d(TAG, ""oncreate() ends"");}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    Log.d(TAG, ""requestCode = "" + requestCode + "" / resultCode = ""            + resultCode);    String id = ""0"",email="""",emailType="""";    if (data != null) {        Log.d(TAG, ""inside if 1"");        Uri uri = data.getData();        if (uri != null) {            Log.d(TAG, ""inside if 2"");            Cursor emailCur=null;            try {                emailCur=getContentResolver().query(uri,null,                        ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI + "" = "" + uri, null, null);                if (emailCur != null &amp;&amp; emailCur.moveToFirst()) {                    Log.d(TAG, ""inside if 3"");                    id = emailCur.getString(0);                    Toast.makeText(this,""name""+id,Toast.LENGTH_LONG).show();                }                email = emailCur.getString(                          emailCur.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Email.DATA));                emailType = emailCur.getString(                          emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE));                Toast.makeText(this, ""email"" + email +""\nType"" + emailType + ""\nid: "" +                           id, Toast.LENGTH_LONG).show();            } finally {                if (emailCur != null) {                    emailCur.close();                }            }        }    }    EditText ctext= (EditText) findViewById(R.id.contacttxt);    ctext.append(email);    Log.d(TAG, ""onActivityResult() ends"");}}</code></pre>","556167","","128165","","2011-01-03 22:20:52","2011-01-03 22:20:52","android contact email import and display","<android><email><activity><android-intent>","0","0","","",""
"4588973","1","","","2011-01-03 22:26:15","34","45057","<p>I have created a basic program in Eclipse for Android 2.1. then I wanted to look at some of the samples, and import sample projects which are in the SDK directory. I have tried opening a new project and 'create project from existing source', I browse and can select a project, all the details come up and I can click finish, but I receive an error message saying 'could not write file', and if I click on details, it says ""access is denied"" I have tried copying a project folder into my own workspace but it still does the same thing.</p>","561862","","1288","","2012-05-25 13:11:27","2013-12-23 21:02:12","How do i open a sample Android SDK app in Eclipse ","<android><eclipse><sdk><sample>","6","1","10","",""
"4588983","1","4589079","","2011-01-03 22:27:15","0","1196","<p>I'm a noob working on my first app that consists of the following:</p><ol><li>Main Activity which simply has one CheckBox which upon an onClick starts/stops my service.</li><li>Service which runs a method (quick database query) every 60 seconds.</li></ol><p>After getting everything working, I realized that my CheckBox was not saving its state. After a bit more searching I figured I should be using CheckBoxPreference rather than CheckBox.</p><p>My <strong>question(s)</strong> before I start researching HOW to do this: Is it possible to have a preference screen setup as the main activity? If so, does anyone know of any examples of this or can anyone provide an outline of what I'll need to look into using?</p><p>I'm just looking for some guidance as I continue to research. I'm trying to learn so I like to understand WHY.</p><p>I created my MyPreferenceActivity.class and it looks like my preferences are saved and returned correctly. Now, I'm having an issue with this error ""This method must return a result of type boolean."" This occurs on this line of my code: </p><pre><code>public boolean onPreferenceClick(Preference preference)</code></pre><p>Sorry I'm not getting the toolbar for formatting.</p><p>MyPreferenceActivity.class</p><pre><code>package com.example.android.myprogram;import android.content.Intent;import android.os.Bundle;import android.preference.Preference;import android.preference.PreferenceActivity;import android.preference.PreferenceManager;import android.preference.Preference.OnPreferenceClickListener;public class MyPreferenceActivity extends PreferenceActivity {    private static final String TAG = ""MyPreferenceActivity"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preferences);        PreferenceManager.setDefaultValues(this, R.xml.preferences, false);        getPreferenceManager().findPreference(""checkbox"").setOnPreferenceClickListener(new OnPreferenceClickListener()        {            Intent myIntent = new Intent(getApplicationContext(), MyService.class);            @Override            public boolean onPreferenceClick(Preference preference)            {                startService(myIntent);            }        });    }}</code></pre>","558929","","558929","","2011-01-03 23:59:42","2011-01-04 05:28:11","PreferenceActivity as Main Activity","<android><preference><preferenceactivity><checkboxpreference>","2","0","","",""
"4589045","1","","","2011-01-03 22:34:16","0","313","<p>I am a total newbie to Android and this is my first Application. I have been running into this problem the last few days and just give up searching for an answer. I would very much appreciate some help on this.</p><p>The method sendSelectedItem is called when a button is clicked. In the else if clause the methods setTvText and setTvColor are simply ignored, they are supposed to set the Text and Color of a TextView but don't do a thing. What follows is a httpPOST request on a php script on my webserver, that returns a simple String, this part works fine.</p><pre><code>    public void sendSelectedItem(View v){    if(v == findViewById(R.id.btnCancel)){        setTvText(""nothing happens"");        setTvColor(0);    }    else if (v == findViewById(R.id.btnSend)){        setTvText(""selection transmitted"");        setTvColor(1);        /*SelectedItemHttpPost si = new SelectedItemHttpPost();        try {            String retResp = si.executeHttpPost(selectedItem);            setTvText(retResp);            setTvColor(2);        }        catch(Exception e){};*/    }}</code></pre><p>Do you have an idea, why the setTvText and setTvColor are executed only if the remaining Code is commented out, as depicted above?</p><p>In case it helps, I paste the code of SelectedItemHttpPost.Thank you very much.</p><pre><code>public class SelectedItemHttpPost{private HttpClient client = null;private HttpPost request = null;private HttpResponse response = null;private List&lt;NameValuePair&gt; postParameters = null;private UrlEncodedFormEntity formEntity = null;private String responsePHP = """";private BufferedReader in = null;private StringBuffer sb = null;public SelectedItemHttpPost(){}public String executeHttpPost(String selectedItem) throws Exception{    try{    client = new DefaultHttpClient();    request = new HttpPost(""http://www.somedomain.com/test/test.php"");    postParameters = new ArrayList&lt;NameValuePair&gt;();    postParameters.add(new BasicNameValuePair(""arg1"", selectedItem));    formEntity = new UrlEncodedFormEntity(postParameters);    request.setEntity(formEntity);    response = client.execute(request);    in = new BufferedReader((new InputStreamReader(response.getEntity().getContent())));    sb = new StringBuffer("""");    sb.append(in.readLine());    in.close();    responsePHP = sb.toString();    return responsePHP;    }finally     {}}</code></pre><p>}</p>","552039","","","","","2011-01-04 05:30:16","TextView set Text and Color are simply ignored","<android><textview><http-post>","1","3","","",""
"4589062","1","4589358","","2011-01-03 22:36:17","3","2469","<p>I want to create a bookmark in the stock android-browser from my own application. How can I do this?</p><p>I only found the <code>Browser.saveBookmark</code>-Method (<a href=""http://developer.android.com/reference/android/provider/Browser.html#saveBookmark%28android.content.Context,%20java.lang.String,%20java.lang.String%29"" rel=""nofollow"">api-doc</a>) but this displays a new window where the user can change the data. As I want to import bookmarks from a external data-source I want to save the bookmark directly and not ask the user for input.</p>","61855","","","","","2013-01-15 14:50:40","Create Browser-Bookmark from app","<android><browser>","2","0","5","",""
"4589084","1","4589242","","2011-01-03 22:39:15","1","1290","<p>I'm trying to create a custom LinearLayout (on Android), but I keep getting compiler errors when trying to use it in my main Activity class. The extended LinearLayout needs a Context passed to it by the constructor, but I don't know where to get that Context. All the examples I see show the passing of the this pointer from the Activity. What am I doing wrong?</p><p>Compiler Error</p><pre><code>MyApp.java:15: cannot find symbolsymbol: constructor BoardLayout(com.test.program.MyApp)location: class com.test.program.BoardLayout    BoardLayout board = new BoardLayout(this);</code></pre><p>BoardLayout.java</p><pre><code>public class BoardLayout extends LinearLayout {    public void BoardLayout(Context context) {        // initialisation code    }    public BoardLayout(Context context, AttributeSet attrs) {            super(context, attrs);    }}</code></pre><p>MyApp.java</p><pre><code>public class MyApp extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        BoardLayout board = new BoardLayout(this); // Doesn't work!        setContentView(board);    }}</code></pre><hr><p><strong>Solution:</strong></p><p>Looks like the problem was two issues.</p><ol><li>Constructors don't have type void (careless mistake on my part).</li><li>Had to call ""super(context)"" as the first instruction in the constructor.</li></ol>","397706","","397706","","2011-01-03 23:44:40","2011-01-03 23:44:40","Android: can't find constructor for custom LinearLayout","<java><android><android-layout>","2","1","","",""
"4589117","1","4589220","","2011-01-03 22:45:13","3","268","<p>Ok so I am starting off with android development and I have found a bunch of useful tutorials so I am set there.  What I am looking for is a resource that provides homework style problems to do and has the answers downloadable so I can check my solution against the ""official"" solution.  </p><p>So for example instead of the notepad tutorial it would be: ""Build an application that you can create, edit, delete notes, ...etc."".  Ideally the ""official"" solution would have some explanation as to why they built it the way they did. (so a tutorial at the tail end)</p><p>Anyone know of any resources that provide their tutorials in this format?</p><p>Thanks.</p>","407526","","","","","2011-01-04 01:24:18","Where to find Android Development Homework Problems","<android><wiki>","3","0","","",""
"4589155","1","5502765","","2011-01-03 22:51:06","3","1962","<p>I have an activity that I want to run every time the user goes to an xml (specifically rss) page in the browser (at least assuming the user get's it from the list of apps that can support it).</p><p>I currently already have the current intent filter:</p><pre><code>    &lt;activity android:name="".activities.EpisodesListActivity""        android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;            &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;            &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;            &lt;data android:scheme=""http""&gt;&lt;/data&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>Now as you can guess, this is an evil intent, as it wants to open whenever a page is requested via http.  However, when I ad the line:</p><pre><code>&lt;data android:mimeType=""application/rss+xml""&gt;&lt;/data&gt;</code></pre><p>to make it:</p><pre><code>    &lt;activity android:name="".activities.EpisodesListActivity""        android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;            &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;            &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;            &lt;data android:scheme=""http""&gt;&lt;/data&gt;            &lt;data android:mimeType=""application/rss+xml""&gt;&lt;/data&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>The application no longer claims to be able to run rss files.</p><p>Also, if I change the line to:</p><pre><code>&lt;data android:mimeType=""application/xml""&gt;&lt;/data&gt;</code></pre><p></p><p>It also won't work (for generic xml file even).</p><p>So what intent filter do I need to make in order to claim that the activity supports rss.</p><p>(Also, bonus points if you can tell me how I know what URL it was the user opened.  So far, I've always sent that information from one activity to the other using extras).</p><p>Thank you for your help</p>","288439","","","","","2011-03-31 15:59:43","Intent filter for browsing XML (specifically rss) in android","<android><android-intent>","2","0","4","",""
"4589406","1","4589523","","2011-01-03 23:38:02","2","157","<p>I'm manipulating .wav audio files in Android.<br>So far things are going well (I can record a .wav file from the mic, add echoes etc.), but I'd like to mimic the behaviour of <code>sf_readf_double()</code> and <code>sf_writef_double</code> as per <a href=""http://www.mega-nerd.com/libsndfile/api.html#readf"" rel=""nofollow"">libsndfile</a> in C++ to implement more complex filters.<br>I have a com.sun.media.sound.WaveFileReader and WaveFileWriter objects and I'm getting at the audio data using </p><pre><code>stream = wfr.getAudioInputStream(new File(inputAudioFileName));</code></pre><p>which returns an <a href=""http://download.oracle.com/javase/1.5.0/docs/api/javax/sound/sampled/AudioInputStream.html"" rel=""nofollow"">AudioInputStream</a>.<br>Is it just a case of reading 8 bytes from the stream at a time into a double or is there more to it than that? I'm a little confused as other filters I'm using seem to manipulate <code>short</code>s rather than <code>double</code>s.</p>","319618","","85140","","2011-01-03 23:40:08","2011-01-04 00:22:25","Java equivalent of C++ sf_readf_double()","<java><c++><android><audio><libsndfile>","1","1","1","",""
"4589434","1","4838141","","2011-01-03 23:42:51","1","810","<pre><code>String[] projections = { MediaStore.Audio.Media._ID,                MediaStore.Audio.Media.TITLE,                MediaStore.Audio.Media.ALBUM,                MediaStore.Audio.Albums._ID,                MediaStore.Audio.Media.ARTIST,                MediaStore.Audio.Media.TRACK,                MediaStore.Audio.Media.DATA };</code></pre><p>Shouldn't MediaStore.Audio.Media._ID by the id field for the song, and MediaStore.Audio.Albums._ID be the id field for the album?  What I want to see is a common ID field for all songs on an album.  What is the correct field to use?</p>","550587","","","","","2011-01-29 17:03:17","MediaStore.Audio.Albums._ID is distinct by song","<android><mediastore>","1","0","1","",""
"4589518","1","4589564","","2011-01-03 23:58:47","1","1326","<p>ive been attempting to add subrows to a listview. I have a taxi app which at present shows a list of taxi company names, i want to be able to add some sub rows in which show address, postcode etc. </p><p>I have had some attempts at this but none have been successful. I am calling my strings from an array in the strings.xml file. My code at the moment is :</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);           final String[] taxi = getResources().getStringArray(R.array.taxi_array);    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.listtaxi, taxi));    final ListView lv = getListView();    lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, final int position, long id)       {               final int selectedPosition = position;            AlertDialog.Builder adb=new AlertDialog.Builder(ListTaxi.this);              adb.setTitle(""Taxi Booking"");             adb.setMessage(""You Have Selected: ""+lv.getItemAtPosition(position));              adb.setPositiveButton(""Book"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(getApplicationContext(), Booking.class);                     intent.putExtra(""booking"",  taxi[selectedPosition]);                     startActivity(intent);                 }             });             adb.setNegativeButton(""Cancel"", null);              adb.show();          }     });</code></pre><p>If anyone can help me get round this problem it would be very much appreciated. </p><p>The original question i asked is here: <a href=""http://stackoverflow.com/questions/4587301/android-adding-subitem-to-a-listview"">Android - Adding Subitem to a listview</a></p><p>Thanks</p>","560679","","","","","2011-01-04 00:22:41","Android- Adding subrows to a ListView!","<android><listview><rows>","1","0","","",""
"4589544","1","4732395","","2011-01-04 00:03:24","2","707","<p>I recently installed a fresh copy of Motodev. When I type the name of object and a period after it a popup comes up with a list of all of the methods available to that object. Ever since I started using this new copy of Motodev if I have an object with a very large amount of available methods this process freezes the whole program for several seconds. RelativeLayout and EditText are the two that I have personally noticed that this is a problem with, but I suspect any object that has a large number of methods will cause this. It was never a problem before. Has anyone else seen this issue and if so how did you fix it? I do like having the list pop up so that I can see all of the methods available to me so I'd like to leave that feature turned on if at all possible. </p>","507810","","","","","2011-02-15 03:34:48","Motodev / Eclipse freezes up for several seconds when autofill tooltip proprosal pops up","<android><eclipse><tooltip>","2","0","","",""
"4589625","1","","","2011-01-04 00:21:12","1","773","<p>I am trying to be able to open a file with my app and to receive a file via the SEND intent.I've tried several filters in the manifest file but could not get it to be displayed anywhere.How is this done?</p><pre><code>`    &lt;activity        android:name="".MyActivity""        android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action                android:name=""android.intent.action.MAIN"" /&gt;            &lt;category                android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;        &lt;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=""file"" /&gt;                &lt;data android:mimeType=""*"" /&gt; </code></pre><p>                    </p>","376244","","","","","2011-01-04 00:21:12","Open android app via intent filter","<android><filter><android-intent><send>","0","3","1","",""
"4589641","1","4589780","","2011-01-04 00:25:22","0","269","<p>I have a list view in which I show data. When I click on a row of the list view, I want to display data for that row from web services. How do I do that?</p>","512383","","196844","","2011-01-04 00:57:48","2011-04-12 17:47:09","listview in android","<android><android-listview>","2","3","","",""
"4589817","1","4589923","","2011-01-04 01:00:13","0","335","<p><strong>What I am doing</strong>: Trying to get familiar with the HTTP protocol and it's implementation.</p><p><strong>My question</strong>: Is it possible to get the headers (specifically Content-Length) of an HTTP GET before you    read the actual body?  From what I understand, I could use a HEAD call for that purpose, but am trying to see if it is even required.  Specifically, in the HttpClient commons library (and most other I guess), there are methods to retrieve the response body as a stream.  Is this stream being read from the socket as it's coming in or has it already been buffered?</p><p>Thanks!</p>","351220","","","","","2011-01-04 01:54:23","On an HTTP GET, do the headers come in first, following with the body (using the HttpClient library from apache)?","<java><android><http><header><httpclient>","4","0","","",""
"4589834","1","4589925","","2011-01-04 01:04:21","0","1824","<p>My app crashes every time I start it in the emulator. Here is the logcat:</p><pre><code>01-02 17:20:58.859: ERROR/AndroidRuntime(249): Uncaught handler: thread main exiting due to uncaught exception01-02 17:20:58.889: ERROR/AndroidRuntime(249): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shoppinglist/com.shoppinglist.ShoppingList}: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.os.Handler.dispatchMessage(Handler.java:99)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.os.Looper.loop(Looper.java:123)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at android.app.ActivityThread.main(ActivityThread.java:4203)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at java.lang.reflect.Method.invokeNative(Native Method)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at java.lang.reflect.Method.invoke(Method.java:521)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-02 17:20:58.889: ERROR/AndroidRuntime(249):     at dalvik.system.NativeStart.main(Native Method)**</code></pre><p>Here is my .java file:</p><pre><code>package com.shoppinglist;import android.app.ListActivity;import android.app.Dialog;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class ShoppingList extends ListActivity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button button1main = (Button) findViewById(R.id.Button01main);     button1main.setOnClickListener(new OnClickListener()  {     @Override      public void onClick(View v)  {       final Dialog dialog = new Dialog(ShoppingList.this);       dialog.setContentView(R.layout.maindialog);       dialog.setCancelable(true);       Button button = (Button) dialog.findViewById(R.id.cancel);       button.setOnClickListener(new OnClickListener()  {        @Override         public void onClick(View v)  {          dialog.dismiss();        }        });       dialog.show();       }     });    }}</code></pre><p>My layout.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FFCC00""    android:padding=""10dp""    android:id=""@+id/listview""&gt;        &lt;Button            android:id=""@+id/Button01main""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""   android:text=""Add item...""/&gt;&lt;/ListView&gt; </code></pre><p>My dialog 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:id=""@+id/layout_root""  android:orientation=""vertical""  android:background=""#FFFFFF""  android:minHeight=""100dp""  android:minWidth=""300dp""&gt;  &lt;EditText    android:id=""@+id/edittext""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:hint=""Type the name of an item here...""&gt;   &lt;/EditText&gt; &lt;LinearLayout  android:id=""@+id/button_layout""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:orientation=""horizontal""  android:layout_gravity=""right""&gt;  &lt;Button   android:id=""@+id/ok""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:text=""OK""   android:layout_gravity=""bottom""&gt;   &lt;/Button&gt;  &lt;Button   android:id=""@+id/cancel""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:text=""Cancel""   android:layout_gravity=""bottom""&gt;   &lt;/Button&gt;  &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p><strong>Any help will be appreciated. I need code samples for fixes, I am not very experienced.</strong></p>","560096","","932225","","2012-07-13 10:31:21","2012-07-13 10:31:21","App Crashes On Startup Due To java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView","<android><android-adapterview>","1","0","","",""
"4589946","1","","","2011-01-04 01:31:23","4","7879","<p>I'm starting to code with MulticastSocket, trying to make a simple app with a client and a server to send messages.</p><p>The code I have for the server:</p><pre><code>    import java.io.IOException;    import java.net.DatagramPacket;    import java.net.InetAddress;    import java.net.MulticastSocket;    import java.net.SocketException;    public class Servidor { private static MulticastSocket ms; public static void main(String[] args) throws IOException{  InetAddress sessAddr = InetAddress.getByName(""224.2.76.24"");     try{    sessAddr = InetAddress.getByName(""224.2.76.24"");       ms = new MulticastSocket(5500);       ms.joinGroup(sessAddr);       while (true)       {       byte[] mensaje = new byte[1024];       mensaje = ""aa"".getBytes();       DatagramPacket dp = new DatagramPacket(mensaje, mensaje.length,sessAddr,5500);       ms.send(dp);       }      }      catch (SocketException se) {        System.err.println(se);      }      ms.leaveGroup(sessAddr);    }}</code></pre><p>And this on the client:</p><pre><code>    package com.example;    import java.io.IOException;    import java.net.DatagramPacket;    import java.net.InetAddress;    import java.net.MulticastSocket;    import java.net.UnknownHostException;    import android.app.Activity;    import android.os.Bundle;    import android.widget.EditText;    import android.widget.TextView;    public class ClienteMultiCast extends Activity {    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView Mensaje;        Mensaje =(TextView)findViewById(R.id.Mensaje);        InetAddress ia = null;        byte[] buffer = new byte[65535];        MulticastSocket ms = null;        int port = 5500;        try {        ia = InetAddress.getByName(""224.2.76.24"");        DatagramPacket dp = new DatagramPacket(buffer, buffer.length,ia,port);        ms = new MulticastSocket(port);            ms.joinGroup(ia);            while (true) {                ms.receive(dp);                String s = new String(dp.getData(),0,dp.getLength());                Mensaje.setText(s);            }            } catch (UnknownHostException e) {Mensaje.setText(e.getMessage());} catch (IOException e) {Mensaje.setText(e.getMessage()); }            try {            ms.leaveGroup(ia);             } catch (IOException e) {            Mensaje.setText(e.getMessage());  }    }}</code></pre><p>The problem is that when I start both, nothing happens. The client doesn't get any message.</p><p>Any idea what's wrong?</p>","611363","","496830","","2011-03-14 04:07:36","2014-01-27 03:03:51","Problem with MulticastSocket on Java-Android","<java><android><multicastsocket>","2","1","2","",""
"4590015","1","4590059","","2011-01-04 01:47:47","2","446","<p>My new Nexus One came pre-installed with CyanogenMod. It's great so far, but since I bought it for software development purposes (initially just <em>learning</em> how to program for Android), should I stay with it, or install the official Android OS (2.3)?</p><p>My main concern is compatibility issues with documented API, that is wasting time on debugging problems that shouldn't have been there in the first place.</p>","418055","","995926","","2012-05-22 08:13:39","2012-05-22 08:13:39","Android Programming: Stay with CyanogenMod?","<android><android-2.2-froyo><cyanogenmod>","2","1","1","",""
"4590022","1","4590034","","2011-01-04 01:49:07","0","1209","<p>On my HTC wildfire, the status bar is black. Thus I had to make sure that my notification icons have bright colors (white, yellow) for them to look legible. I'm pretty certain the choice of the status bar's background color is the prerogative of the manufacturer/telco. How can I ensure that the icon is legible in all phones (given that I don't know the color of the status bar in advance) ?</p>","450278","","","","","2011-01-04 01:57:05","How to match color of my notification icon with the color of the status bar?","<android>","1","0","","",""
"4590045","1","4590067","","2011-01-04 01:55:54","0","1451","<p>I'm trying to create a chess game board with 8x8 buttons. I'm using nested LinearLayouts. The problem is that there's a padding between each row of ImageViews that I can't get rid of. This is what I have sofar, the board should be square, but isn't:</p><p><img src=""http://i.stack.imgur.com/KsHFO.jpg"" alt=""alt text""></p><pre><code>public class BoardLayout extends LinearLayout {    public BoardLayout(Context context) {        super(context);        LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(            LinearLayout.LayoutParams.FILL_PARENT,            LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);            setLayoutParams(parms);            setOrientation(LinearLayout.VERTICAL);            setPadding(0, 0, 0, 0);            for (int i = 0; i &lt; 8; i++) {                LinearLayout row = new LinearLayout(context);                row.setLayoutParams(parms);                row.setOrientation(LinearLayout.HORIZONTAL);                row.setPadding(0, 0, 0, 0);                for (int j = 0; j &lt; 8; j++) {                    ImageView button = new ImageView(context);                    button.setLayoutParams(parms);                    button.setImageResource(R.drawable.icon);                    button.setAdjustViewBounds(true);                    button.setPadding(0, 0, 0, 0);                    row.addView(button);                }                addView(row);            }            setSquare();    }    public void setSquare() {        int size = Math.min(getWidth(), getHeight());        // setHeight(size); // Not Function, but this is what I need        // setWidth(size); // Not Function, but this is what I need        // also doesn't work        setLayoutParams(new LinearLayout.LayoutParams(size, size, 1.0f));    }}</code></pre><hr><p><strong>Solution:</strong></p><p>As suggested TableLayout is better for what I'm trying to do. So the main class should be changed to a TableLayout and the nested LinearLayouts to TableRows.</p><p>But that alone didn't fix it, I also had to call the following in TableLayout:</p><pre><code>setShrinkAllColumns(true);setStretchAllColumns(true);</code></pre><p>and for each item inserted, I had to also call:</p><pre><code>setAdjustViewBounds(true);</code></pre>","397706","","397706","","2011-01-04 02:59:18","2011-01-04 02:59:18","android: remove padding from linearlayout to create square layout","<android><layout>","2","0","","",""
"4590119","1","4590200","","2011-01-04 02:14:17","10","5249","<p>I'm trying to view an xml file in eclipse for work on Android but I'm not enjoying their tree structure view for the xml data. I was hoping there'd be a simple highlighted text view for it but I couldn't find it.</p><p>Closest I got was the plain text view which was nearly it</p><p>Is there such a view? If so, where is it</p><p>Thanks</p>","243203","","","","","2011-01-04 02:33:54","How do I view xml in Eclipse with simple syntax highlighting?","<android><xml><eclipse>","1","0","1","",""
"4590126","1","4590142","","2011-01-04 02:15:34","1","944","<p>For iPhone apps, we can check sales through itunesConnect.</p><p>Does Android have something similar for us to check app sales?</p>","404109","","","","","2011-03-01 01:22:27","How to check android app sales?","<android><sales>","1","1","","",""
"4590133","1","","","2011-01-04 02:17:36","5","698","<p>I am copying an image to a private directory like so:</p><pre><code>FileChannel source = null;FileChannel destination = null;source = new FileInputStream(sourceFile).getChannel();destination = new FileOutputStream(destFile).getChannel();destination.transferFrom(source, 0, source.size());source.close();destination.close();</code></pre><p>..but when I insert it back in to Gallery, untouched, at a later time:</p><pre><code>private void moveImageToGallery(Uri inUri) throws Exception {    MediaStore.Images.Media.insertImage(getContentResolver(), ImageUtil.loadFullBitmap(inUri.getPath()), null, null);}</code></pre><p>..it apparently loses its Exif data. The rotation no longer works. Is there some way I can copy an image file and not lose that data? Thanks for any suggestions.</p>","232240","","","","","2013-03-09 17:56:56","Copying an image, loses Exif data","<android><image><exif>","1","2","1","",""
"4590143","1","4590153","","2011-01-04 02:20:45","2","654","<p>I am new to android.As I know, an android app used xml to construct the gui.Is there a tool to create the gui xml from a visual drag &amp; drop editor?</p>","262325","","319618","","2012-02-16 13:02:30","2012-02-16 13:02:30","Is there a GUI tool help to create gui xml","<android>","3","1","","",""
"4590154","1","4590969","","2011-01-04 02:22:42","0","467","<p>Hey guys. I've just published my first Android application to show this guy who might hire me for his research, and I've got some good reviews except for one problem - my activity force closes with my current code to restart! I dont have an android phone so I cant test it out. Is there a simple way to just restart an app from the beginning? Apparently it force closes with a null pointer exception with this code: </p><pre><code>Intent intent = getIntent();finish();startActivity(intent);</code></pre><p>which I got from another question.</p><p>Please help!! I need to have this fixed</p><p>Thanks so much</p>","554464","","","","","2012-10-19 14:37:51","Restarting an activity just like the user is pressing it for the first time","<android><exception><restart>","3","0","","",""
"4590176","1","","","2011-01-04 02:27:53","1","506","<p>I wrote a custom view that extends LinearLayout. It holds two views, a ""header"" and a ""body"". The custom view maintains ""expanded"" state that toggles on and off whenever the header view is clicked. When expanded, the body is VISIBLE and when not expanded, the body is GONE. I want to preserve the expanded state of this view when the device orientation changes, so I wrote onSaveInstanceState and onRestoreInstanceState to save an expanded flag.</p><p>One problem is that if I reorient the device when any of these views is expanded, then the entire activity is redrawn without changing the orientation of the views. (If I change from portait to landscape, the screen stays in portrait.) If none of the custom views are expanded, the activity's view tree is reoriented correctly.</p><p>Here's my logic for the view's onRestoreInstanceState:</p><pre><code>protected void onRestoreInstanceState(Parcelable state) {    SavedState ss = (SavedState) state;    super.onRestoreInstanceState(ss.getSuperState());    if (ss.expanded != mHeader.isExpanded()) {        mHeader.toggleExpanded();    }    mBody.setVisibility(ss.expanded ? VISIBLE : GONE);}</code></pre><p>What am I doing wrong?</p>","535871","","","","","2011-01-04 02:27:53","Problem handling orientation change in custom view","<android><view><orientation>","0","0","0","",""
"4590253","1","4590293","","2011-01-04 02:48:22","7","8485","<p>I am using a customised BaseAdapter to display items on a ListView. The items are just strings held in an ArrayList.</p><p>The list items have a delete button on them (big red X), and I'd like to remove the item from the ArrayList, and notify the ListView to update itself.</p><p>However, every implementation I've tried gets mysterious position numbers given to it, so for example clicking item 2's delete button will delete item 5's. It seems to be almost entirely random.</p><p>One thing to note is that elements may be repeated, but must be kept in the same order. For example, I can have ""Irish"" twice, as elements 3 and 7.</p><p>My code is below:</p><pre><code>private static class ViewHolder {        TextView lang;        int position;}public View getView(final int position, View convertView, ViewGroup parent) {    ViewHolder holder;    if (convertView == null) {        convertView = mInflater.inflate(R.layout.language_link_row, null);        holder = new ViewHolder();        holder.lang = (TextView)convertView.findViewById(R.id.language_link_text);        holder.position = position;        final ImageView deleteButton = (ImageView)                 convertView.findViewById(R.id.language_link_cross_delete);        deleteButton.setOnClickListener(this);        convertView.setTag(holder);        deleteButton.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    holder.lang.setText(mLanguages.get(position));    return convertView;}</code></pre><p>I later attempt to retrieve the deleted element's position by grabbing the tag, but it's always the wrong position in the list. There is no noticeable pattern to the position given here, it always seems random.</p><pre><code>// The delete button's listenerpublic void onClick(View v) {    ViewHolder deleteHolder = (ViewHolder) v.getTag();    int pos = deleteHolder.position;    ...    ...    ...}</code></pre><p>I would be quite happy to just delete the item from the ArrayList and have the ListView update itself, but the position I'm getting is incorrect so I can't do that.</p><p>Please note that I did, at first, have the deleteButton clickListener inside the getView method, and used 'position' to delete the value, but I had the same problem.</p><p>Any suggestions appreciated, this is really irritating me.</p>","295199","","","","","2012-09-11 13:45:13","Deleting items from a ListView using a custom BaseAdapter","<android><listview><delete><android-listview>","3","0","5","",""
"4590339","1","4859578","","2011-01-04 03:12:17","2","5027","<p>I like to use a PPTP VPN in the Android emulator. My VPN provider is Witopia. The settings work on a real phone (HTC Desire).</p><p>It does not work, the connection just times out after a while.</p><p><strong>adb logcat</strong> prints:</p><pre><code>D/VpnManager( 1527): succeeded to connect to VPN serviceD/com.android.settings.vpn.AuthenticationActor( 1527): ~~~~~~ connect() succeeded!I/SProxy_mtpd( 2211): Stop VPN daemon: mtpdD/VpnSettings( 1527): received connectivity: Witopia: connected? CONNECTING   err=0D/SProxy_mtpd( 2211): mtpd is stopped after 0 msecD/SProxy_mtpd( 2211): stopping mtpd, success? trueI/SProxy_racoon( 2211): Stop VPN daemon: racoonD/SProxy_racoon( 2211): racoon is stopped after 0 msecD/SProxy_racoon( 2211): stopping racoon, success? trueD/VpnService( 2211):   Local IP: 10.0.2.15, if: eth0D/VpnService( 2211):        VPN UP: downI/SProxy_mtpd( 2211): Start VPN daemon: mtpdD/SProxy_mtpd( 2211): mtpd is running after 0 msecD/SProxy_mtpd( 2211): service not yet listen()ing; try againD/mtpd    ( 2224): Waiting for control socketD/mtpd    ( 2224): Received 19 argumentsI/mtpd    ( 2224): Using protocol pptpI/mtpd    ( 2224): Connecting to 203.131.247.213 port 1723I/SProxy_mtpd( 2211): got data from control socket: 19I/mtpd    ( 2224): Connection established (socket = 10)D/mtpd    ( 2224): Sending SCCRQD/mtpd    ( 2224): Received SCCRP -&gt; Sending OCRQ (local = 32087)I/mtpd    ( 2224): Tunnel establishedD/mtpd    ( 2224): Received OCRQ (remote = 52286)I/mtpd    ( 2224): Session establishedI/mtpd    ( 2224): Creating PPPoX socketF/mtpd    ( 2224): Socket() Address family not supported by protocol</code></pre><p>Followed by the user message: <strong>Unable to connect to the network. Do you want to try again?</strong></p><p>Meanwhile in <strong>adb logcat</strong></p><pre><code>E/VpnService( 2211): onError()E/VpnService( 2211): java.io.IOException: Connecting timed outE/VpnService( 2211):    at com.android.server.vpn.VpnService.waitUntilConnectedOrTimedout(VpnService.java:206)E/VpnService( 2211):    at com.android.server.vpn.VpnService.onConnect(VpnService.java:136)E/VpnService( 2211):    at com.android.server.vpn.VpnServiceBinder$2.run(VpnServiceBinder.java:114)E/VpnService( 2211):    at java.lang.Thread.run(Thread.java:1096)I/VpnService( 2211): disconnecting VPN...D/VpnSettings( 1527): received connectivity: Witopia: connected? DISCONNECTING   err=0I/SProxy_mtpd( 2211): Stop VPN daemon: mtpdD/SProxy_mtpd( 2211): mtpd is stopped after 0 msecD/SProxy_mtpd( 2211): stopping mtpd, success? trueI/SProxy_racoon( 2211): Stop VPN daemon: racoonD/SProxy_racoon( 2211): racoon is stopped after 0 msecD/SProxy_racoon( 2211): stopping racoon, success? trueD/VpnService( 2211): onFinalCleanUp()I/VpnService( 2211): restore original suffices --&gt; nullD/VpnSettings( 1527): received connectivity: Witopia: connected? IDLE   err=101</code></pre><p>I guess this is either a permission problem or the Android emulator does not support it.</p><p>My platform is MacOSX, Emulator is running Android 2.2.</p><p>This question is related to:</p><ul><li><a href=""http://stackoverflow.com/questions/3223344/does-vpn-in-the-android-emulator-2-2-work"">Does VPN in the Android emulator 2.2 work?</a></li><li><a href=""http://stackoverflow.com/questions/3442865/setting-up-a-vpn-in-the-emulator"">Setting up a VPN in the emulator</a></li><li><a href=""http://stackoverflow.com/questions/3859675/will-android-emulator-access-a-network-using-a-vpn-on-the-host-machine"">will android emulator access a network using a vpn on the host machine</a></li></ul>","375209","","","","","2013-04-26 17:31:59","How to enable VPN support in Android Emulator","<android><android-emulator><android-sdk-2.2>","2","2","3","",""
"4590342","1","","","2011-01-04 03:12:45","1","346","<p>I have the following problem: I have an activity with a EditText on top and a toolbar on the bottom. When I select the EditText, the softkeyboard pops-on and hides the toolbar - but I want the EditText to be resized or panned, so I can see the toolbar while using the softkeyboard.<br>I've read the following article:<br><a href=""http://developer.android.com/resources/articles/on-screen-inputs.html"" rel=""nofollow"">http://developer.android.com/resources/articles/on-screen-inputs.html</a><br>and set the attribute windowSoftInputMode:   </p><pre><code>android:windowSoftInputMode=""adjustResize""</code></pre><p>it just doesn't work. Then I also tried to set it to ""adjustPan"" - it doesn't work either. Here is the full layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget28""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""android:background=""#eceef2""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@drawable/my_border2""        android:orientation=""horizontal""     &gt;           &lt;ImageButton                android:id=""@+id/ibtnCancel""                android:layout_width=""42px""                android:layout_height=""44px""                    android:src=""@drawable/ico_reload""                android:background=""@drawable/buttonhighlight""                              &gt;        &lt;/ImageButton&gt;          &lt;ImageView              android:id=""@+id/imvLogo""              android:layout_weight=""1""              android:layout_width=""fill_parent""              android:layout_height=""44px""               android:src=""@drawable/stub""                  android:scaleType=""fitCenter""              android:background=""@drawable/my_border""              /&gt;        &lt;ImageButton                android:id=""@+id/ibtnOK""                android:layout_width=""42px""                android:layout_height=""44px""                    android:src=""@drawable/ico_reload""                android:background=""@drawable/buttonhighlight""                              &gt;        &lt;/ImageButton&gt;                         &lt;/LinearLayout&gt;     &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:background=""@drawable/my_border2""        android:orientation=""vertical""     &gt;                      &lt;EditText            android:id=""@+id/etComment""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""1""            android:gravity=""top""                       android:hint=""B?n dang nghi gì?""                        android:textSize=""18sp""                         &gt;            &lt;/EditText&gt;             &lt;GridView android:id=""@+id/gvEmoIcons""                          android:background=""#88000000""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:numColumns=""auto_fit""                android:verticalSpacing=""10dp""                 android:horizontalSpacing=""10dp""                android:columnWidth=""54dp""                 android:stretchMode=""columnWidth""&gt;            &lt;/GridView&gt;     &lt;/FrameLayout&gt;     &lt;!--  Emo icons bar --&gt;     &lt;LinearLayout        android:id=""@+id/llIconsBar""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""             &gt;        &lt;ImageButton            android:id=""@+id/ibOpenSmileys""             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/smile_smile""                             /&gt;               &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I've search for hours for this problem but haven't found the solution yet ! I appreciate your help. </p><p>Thanks,<br>Son</p>","424721","","424721","","2011-01-04 04:20:52","2011-01-04 04:20:52","How to make views resized/panned when softkeyboard pop-on?","<android>","0","0","","",""
"4590384","1","4590401","","2011-01-04 03:23:59","1","613","<p>I am building a basic twitter client application. I am trying to figure out how to make the TextView that holds the Tweets to autoLink the @mentions so that they link to the twitter page of whoever it is the same as it does on the twitter website. My guess is that this is going to involve making a custom TextView and adding this into the part that already handles the auto linking of websites,emails,maps and such. Is this right approach to achieving something like this? or should I be using a stock TextView and handling this by parsing the tweet before it gets put into the view? If I should be going the custom view route could anyone point me in the right direction for how to get this capability added to the autolink? And if I should be using the stock TextView and handling it in java before the tweet gets put into the view how do I get it ""linkify"" the text my only guess is using something like .fromHTML() but I'm not even sure if this supports the  tag.</p>","507810","","","","","2011-01-04 04:26:34","AutoLink @mentions in a twitter client","<android><twitter><textview><custom-view>","1","0","","",""
"4590476","1","4592090","","2011-01-04 03:51:05","0","2584","<p>I am using backport bluetooth api on android 1.6. I am using Google Bluetooth Chat sample app for testing. The app works fine in normal scenarios.</p><p>In a scenario, when I try to connect to paired device which is in off state, I get following error.<br><strong>01-04 09:00:11.629: ERROR/BluetoothEventLoop.cpp(84): onGetRemoteServiceChannelResult: D-Bus error: org.bluez.Error.ConnectionAttemptFailed (Host is down)<br>01-04 09:00:11.729: DEBUG/dalvikvm(128): GC freed 4535 objects / 256008 bytes in 296ms<br>01-04 09:00:21.880: ERROR/bluetooth_RfcommSocket.cpp(1433): connect error: Host is down (112)</strong></p><p>But it sets the state as connected. The app is unable to catch the exception.<br>Why does it happen? Or is it the case with backport api?<br>Any help is appreciated as I am struggling a lot to get things run fine.</p>","296257","","","","","2011-01-04 09:21:37","Android bluetooth socket error","<android><sockets><bluetooth><backport>","1","0","","",""
"4590566","1","4590653","","2011-01-04 04:09:28","5","874","<p>I am trying to load phone contacts and tried to show the contact names in ascending order.  My code is given below:</p><pre><code>    Cursor cursor = getContentResolver().query(    ContactsContract.Contacts.CONTENT_URI, null,    ContactsContract.Contacts.HAS_PHONE_NUMBER + "" = 1"", null,    ContactsContract.Contacts.DISPLAY_NAME + "" ASC"");</code></pre><p>I got the required output. But a problem is there, names staring with small letter is shown as last one. First the capital letters are sorted, only after that contact names staring with small letters is shown. PLS HELP</p><p>OUTPUT IS:</p><pre><code>Alfin ABipin BCalvin CJobinShineanurag Ushine H</code></pre>","548218","","1542144","","2013-05-29 07:40:27","2013-05-29 07:40:27","Loading phone contacts in ascending order","<android>","1","0","1","",""
"4590636","1","6080790","","2011-01-04 04:23:56","0","362","<p>As my requirement I need to add a shape in middle of an existed xml layout using Java code. In that xml I have a graph title at the top, under that I have some text details. Up to now I am able to draw that shape under the graph title, i.e where I want to place in xml, by using the following code.</p><pre><code>linear =(LinearLayout) findViewById(R.id.linear);RectangleView aView = new RectangleView(this);linear.addView(aView);</code></pre><p>But the problem is, after adding the shape, remaining ui of that xml (other textual details) is gone. I want to place that thing also in my xml. If any one is aware of this, can you please suggest me how to fix this? Any response will be appreciated.</p>","524937","","469983","","2012-02-20 14:27:29","2012-02-20 14:27:29","adding a shape using java code, in middle of a xml layout?","<android>","1","1","","",""
"4590727","1","","","2011-01-04 04:47:58","3","1968","<p>I need to store an object in phone internal memory, how can I do this in Android. </p>","487219","","272824","","2011-01-04 04:55:19","2011-11-30 09:28:28","Android internal storage","<android>","4","1","","",""
"4590753","1","4590786","","2011-01-04 04:54:11","3","3812","<p>I am using <a href=""http://www.json.org/javadoc/org/json/JSONArray.html"" rel=""nofollow"">JSONArray</a> under the <code>org.json</code> Package.</p><p>My first JSONArray is like:</p><blockquote>  <p>[[""249404"",""VPR249404""],[""249403"",""VPR249403""],[""249391"",""M249391""]]</p></blockquote><p>and Second</p><blockquote>  <p>[[""249386"",""M249386""],[""249385"",""M249385(I)""],[""249384"",""I249384""]]</p></blockquote><p>So I'd like to append new JSONArray to my first JSONArray.</p><p>I am working on Java and Android. I have heard about <a href=""http://code.google.com/p/google-gson/"" rel=""nofollow"">google-gson</a> library, but I don't know whether it can help me or not but I don't want any other dependency in my Android Application.</p>","415865","","244296","","2011-01-04 13:22:48","2011-01-04 13:22:48","Concate JSONArray","<java><android><arrays><json><concatenation>","1","0","","",""
"4590856","1","4590897","","2011-01-04 05:15:32","21","27367","<p>I am using an array adapter and to this am adding an array list of string s , the list is multi select , How can i get the values of list items clicked ?</p><pre><code>my_contacts_list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);ArrayAdapter&lt;String&gt; adapter=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_multiple_choice,conts_list);  my_contacts_list.setAdapter(adapter);</code></pre><p>I was trying to do this ,</p><pre><code>SparseBooleanArray positions = my_contacts_list.getCheckedItemPositions();  int size=positions.size();  int i=0;  while(i &lt;= size){   conts_list.get(positions.get(i));   i++;  }</code></pre><p>But position.get(i) is an array list , how to retrieve the selected items then ?</p>","562110","","435706","","2011-12-04 12:33:40","2014-01-13 20:52:27","How to get Selected items from Multi Select List View","<android><android-listview>","8","2","16","",""
"4590957","1","4594761","","2011-01-04 05:40:11","22","68649","<p>How can I set the text of an EditText?</p>","555910","","321697","","2011-01-04 14:35:59","2014-03-21 10:21:37","How To Set Text In An EditText","<android><textview><edittext>","6","2","2","",""
"4590998","1","","","2011-01-04 05:48:40","0","414","<p>Hi in my application i have menu that contain 4 option , i need  to align the menu in the following format, 2X2  </p>","487219","","","","","2011-01-04 05:52:42","Android Menu alignment","<android>","1","1","","",""
"4591011","1","4591039","","2011-01-04 05:51:31","0","1108","<p>How to edit xml files within layout directory in android. And how can I use controls (defined in xml file) in my java code. </p>","550966","","","","","2011-01-04 06:04:11","xml files in android : How to design them and access in java code","<android>","1","0","0","",""
"4591029","1","4591085","","2011-01-04 05:55:22","0","3314","<p>I have a Html Response for my application that I need to parse ultimately. Is there any way to perform the Html Parsing in android application. I have searched net a lot but couldn't found anything I was looking for.</p><p>Can anyone have a clue to do the same?</p><p>Thanks,david</p>","422859","","","","","2011-01-04 07:29:56","Html Parsing in android","<android><html-parsing>","2","3","","",""
"4591065","1","","","2011-01-04 06:02:02","2","910","<p>I would like to make app in android in which i wand to send some message to server and also want to get notification from server if there is any updates via C2DM in android.</p><p>How to send message to the third party server. (Third-party server like php)and inputs are necessary to send message to the third-party server. and how to send response Third-party server to C2DM and get notification from C2DM to Android device?</p>","550843","","469983","","2011-10-27 08:56:13","2011-10-27 08:56:13","How to implement pushnotification using C2DM in android?","<android><android-c2dm>","1","0","0","",""
"4591068","1","8440771","","2011-01-04 06:02:15","1","3170","<p>I want to join two cursors so that the contents of the second Cursor shall also appear in first Cursor after joining.</p><p>Precisely here is my code,</p><pre><code>public final Uri AllImage_URI_Int = MediaStore.Images.Media.INTERNAL_CONTENT_URI;public final Uri AllAudio_URI = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;cContentList = managedQuery(AllImage_URI_Int, null, null, null, MediaStore.Images.ImageColumns.TITLE);cList_Int = managedQuery(AllImage_URI, null, null, null, MediaStore.Images.ImageColumns.TITLE);</code></pre><p>Should i use the <a href=""http://www.eoeandroid.com/sdk/api/reference/android/database/CursorJoiner.html"" rel=""nofollow"">CursorJoiner</a> in this case?</p><p>I want to pass this Cursor to SimpleListAdapter? How can i join those two cursors?</p><p>Thanks!!</p>","177303","","","","","2014-01-10 12:04:22","Add the contents of one Cursor to another Cursor","<android><cursor>","2","1","2","",""
"4591083","1","4719327","","2011-01-04 06:05:48","1","8066","<p>I have a tricky problem related to synchronized scrolling of twodifferent views.I've made my own custom grid view widget, which has ""sticky"" views tothe left and top that only in one direction with the grid. Think of acalendar where you have times at the top, dates at the left, and whenyou scroll horizontally through time, the date view should stay put,and when you scroll vertically through the dates, the time view shouldstay put.</p><p>The grid itself is implemented using a nested horizontal scrollview ina vertical scrollview. The grid is working great, so no problem there.Since the sticky views are not in the actual grid, I have overridenonScrollChanged in the grid scrollviews and programatically callscrollTo on the sticky views when the user scrolls the grid.</p><p>That works as expected, except that there is a slight time offset asto when the two different views start scrolling and ends scrolling. Itmakes sense when you consider that the scrolling likely is executedlinearly on the UI thread I suppose..</p><p>All the views are scroll views, and I have enabled smooth scrollingand used smoothScrollTo, etc, instead to try to improve this, but it'sthe same problem nonetheless. The problem is especially noticeable onlarger screens, such as the Samsung Galaxy Tab, whereas it's hardlynoticeable on small-medium screen devices.</p><p>Any help is appreciated! If there is an easy fix, great..if it meansnew design (that meets the sticky view usecase above), then so be it.</p><p>Code to trigger prog. scroll, same for horizontal  </p><pre><code>@Override  protected void onScrollChanged(int x, int y, int oldx, int oldy) {     mListener.onScrollY(y);     super.onScrollChanged(x, y, oldx, oldy);  }  // which leads to,  // Handle vertical scroll  public void onScrollY(final int y) {     mCurrentY = y;     mVerticalScroll.smoothScrollTo(0, y);  }  </code></pre><p>XML layouts below, if that's of any help  </p><p>The actual grid, which is a horizontal scroll view wrapped in a vertical scroll view and the grid items are added vertically in the nested linearlayout<br>    ></p><pre><code>  &lt; com.....VerticalScrollView      android:id=""@+id/gridscroll""     android:layout_width=""fill_parent""      android:layout_height=""fill_parent""     android:layout_below=""@id/timescroll""    android:layout_toRightOf=""@id/vertscroll""      android:layout_alignTop=""@id/vertscroll""      android:layout_marginLeft=""2dp"" android:scrollbars=""none""      android:fadingEdge=""none""&gt;       &lt; com....HorizScrollView    android:id=""@+id/horizscroll""    android:layout_width=""fill_parent""      android:layout_height=""fill_parent""    android:scrollbars=""none""      android:fadingEdge=""none""&gt;      &lt; LinearLayout android:id=""@+id/grid""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:orientation=""vertical""&gt;        &lt; /LinearLayout&gt;        &lt; /com.....HorizScrollView&gt;        &lt; /com.....VerticalScrollView&gt;  </code></pre><p>The horizontal sticky view</p><blockquote>  <p></p></blockquote><pre><code> &lt; com.....GridTimeScrollView    android:id=""@+id/timescroller""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:scrollbars=""none""    android:fadingEdge=""none""&gt;    &lt; LinearLayout android:id=""@+id/timelist""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal"" /&gt;    &lt; /com.....GridTimeScrollView&gt;</code></pre><p>The vertical sticky view</p><blockquote>  <p></p></blockquote><pre><code>&lt; com....GridVertListScrollViewandroid:id=""@+id/vertscroller""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:scrollbars=""none"" android:fadingEdge=""none""&gt;&lt; LinearLayoutandroid:id=""@+id/vertitemlist""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical"" /&gt;&lt; /com.....GridVertListScrollView&gt;</code></pre>","281097","","1175051","","2012-05-23 16:52:14","2012-05-23 16:52:14","Android: Synchronized scrolling of two different views","<android><gridview><scrolling><scrollview>","3","0","3","",""
"4591116","1","","","2011-01-04 06:14:57","0","895","<p>How can I use a ttf file for a button's text?</p>","432559","","23897","","2011-01-04 06:22:00","2012-12-12 11:12:59","How can I use a ttf file for a button's text?","<android>","4","0","1","",""
"4591149","1","4602715","","2011-01-04 06:22:07","2","8652","<p>I'm basically looking to just keep track of seconds and minutes starting at 0:00 from when the app starts, and display it in a TextView what would be the best method of doing this?</p>","486086","","","","","2013-02-02 08:21:19","create a simple digital timer in android","<android><timer>","4","2","2","",""
"4591164","1","12026790","","2011-01-04 06:26:41","3","7989","<p>I searched a lot in google and found in stackoverflow one link how to change color of text using styles and themes but I dont know how to use in code.</p><pre><code>&lt;style name=""TextAppearance.Widget.IconMenu.Item"" parent=""@android:style/TextAppearance.Small""&gt;         &lt;item name=""android:textColor""&gt;#ff0000&lt;/item&gt;     &lt;/style&gt; </code></pre><p>Please give me snippet for better understanding. I know how to change the background of menuItem by using Factory.In that we can find the View object. Is there any facility to get menu Item. Then we can change the color of menuItem?</p>","486216","","310574","","2011-01-04 06:30:44","2013-04-02 09:44:53","How to change Menu Item Color & Size programmatically?","<android>","2","1","2","",""
"4591180","1","","","2011-01-04 06:30:14","0","1613","<hr><p>i am creating app in which i had to send data to phone via embedded device.</p><hr><p>is it possible to send file via embedded device to android phone with bluetooth?</p><hr><p>i dont find any of example of it and i think i need another embedded device like dongle for implementing obex protocol.</p><hr><p>if anyone have done it b4 pls help me.</p>","544537","","","","","2011-01-04 06:49:59","android bluetooth connection to embedded device","<android><bluetooth>","1","0","2","",""
"4591249","1","4593218","","2011-01-04 06:48:12","1","2295","<p>I want to store &amp; retrieve the data from android web application to MySQL through jsp/servlet.</p><p>is it possible ? how : any other way to do this things.</p><p>thanks in advance.</p>","489902","","","","","2011-01-04 11:46:07","how to integrate servlet/jsp page in android application?","<android><jsp><servlets><webview>","1","0","2","",""
"4591263","1","4591358","","2011-01-04 06:52:17","0","478","<p>Iam using </p><pre><code>locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);Criteria criteria = new Criteria();String bestProvider = locationManager.getBestProvider(criteria, true);locationManager.requestLocationUpdates(bestProvider, 0, 0, this);location = locationManager.getLastKnownLocation(bestProvider);</code></pre><p>but first time it is not giving location object.Always giving me null.I read in developer.android.com ,</p><blockquote>  <p>""Cached Location is dismissed if it is  too old""</p></blockquote><p>But second time it is giving location updates.How to solve my problem.</p><p>Regards,Android Developer</p>","486216","","","","","2011-01-04 07:48:50","How to get CurrentLocation from GPS FirstTime quickly?","<android>","2","0","","",""
"4591273","1","4591471","","2011-01-04 06:53:57","0","604","<p>How can I use any layout in .xml files. Let I want to use Tablelayout, so I dragged it on Graphical Layout of an xml file, and then I want that layout should be in two columns ( if I want add ""Name : "" in first column and ""EditText"" in another column.) but I am anable to do it.I am using Graphical layout. I want do like </p><pre>Name : EditText (A textbox for Name entry)Age  : EditText (A textbox for Age entry)              Button (to save user entry)</pre><p>How to design it.</p>","550966","","550966","","2011-01-04 07:26:58","2011-02-01 06:16:52","How to use layouts in .xml files : Android application","<android>","3","1","2","",""
"4591281","1","4591345","","2011-01-04 06:56:23","0","1311","<p><strong>Quick note</strong>: Java and Android noob here, I'm open to you telling me I'm stupid (as long as you tell me why.)</p><p>I have an android application which requires me start multiple threads originating from various classes and only advance to the next activity once all threads have done their job. I also want to add a ""failsafe"" timeout in case one the the threads takes too long (HTTP request taking too long or something.)</p><p>I searched Stack Overflow and found a post saying that I should create a class to keep a running total of open threads and then use a timer to poll for when all the threads are completed.</p><p>I think I've created a working class to do this for me, it's untested as of yet but has no errors showing in eclipse.</p><p>Is this a correct implementation? Are there any APIs that I should be made aware of (such as classes in the Java or Android APIs that could be used in place of the abstract classes at the bottom of the class?)</p><pre><code>package com.dmp.geofix.libs;import java.util.ArrayList;import java.util.Iterator;import java.util.Timer;import java.util.TimerTask;public class ThreadMonitor {    private Timer timer = null;    private TimerTask timerTask = null;    private OnSuccess onSuccess = null;    private OnError onError = null;    private static ArrayList&lt;Thread&gt; threads;    private final int POLL_OPEN_THREADS = 100;    private final int TIMEOUT = 10000;    public ThreadMonitor() {        timerTask = new PollThreadsTask();    }    public ThreadMonitor(OnSuccess s) {        timerTask = new PollThreadsTask();        onSuccess = s;    }    public ThreadMonitor(OnError e) {        timerTask = new PollThreadsTask();        onError = e;    }    public ThreadMonitor(OnSuccess s, OnError e) {        timerTask = new PollThreadsTask();        onSuccess = s;        onError = e;    }    public void start() {        Iterator&lt;Thread&gt; i = threads.iterator();        while (i.hasNext()) {            i.next().start();        }        timer = new Timer();        timer.schedule(timerTask, 0, POLL_OPEN_THREADS);    }    public void finish() {        Iterator&lt;Thread&gt; i = threads.iterator();        while (i.hasNext()) {            i.next().interrupt();        }        threads.clear();        timer.cancel();    }    public void addThread(Thread t) {        threads.add(t);    }    public void removeThread(Thread t) {        threads.remove(t);        t.interrupt();    }    class PollThreadsTask extends TimerTask {        private int timeElapsed = 0;        @Override        public void run() {            timeElapsed += POLL_OPEN_THREADS;            if (timeElapsed &lt;= TIMEOUT) {                if (threads.isEmpty() == false) {                    if (onSuccess != null) {                        onSuccess.run();                    }                }            } else {                if (onError != null) {                    onError.run();                }                finish();            }        }    }    public abstract class OnSuccess {        public abstract void run();    }    public abstract class OnError {        public abstract void run();    }}</code></pre>","249390","","","","","2011-01-04 07:49:37","Running code when all threads are finished processing","<java><android><multithreading><timer>","4","0","0","",""
"4591327","1","4591399","","2011-01-04 07:04:41","0","646","<p>hi when i run hello Android test <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></p><p>i got the following errors </p><pre><code>java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.helloandroid/com.ex.helloAndroid.HelloAndroid }at android.app.Instrumentation.startActivitySync(Instrumentation.java:447)at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:106)at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:84)at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:87)at com.example.helloandroid.test.HelloAndroidTest.setUp(HelloAndroidTest.java:19)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:425)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1520)</code></pre><p>I did not understand why these errors are coming and give me some suggestions.Thanks in advance</p>","479027","","","","","2011-09-28 19:28:55","Hello Android Test Errors","<android>","1","0","","",""
"4591359","1","4591595","","2011-01-04 07:13:15","1","840","<p>I want to count my application launches and after some launches i need to request user to give feed back.So how to count launches?</p>","486216","","","","","2011-05-03 20:37:53","how to count application successfull launches programmatically android?","<android>","3","0","0","",""
"4591415","1","4597439","","2011-01-04 07:22:44","0","3446","<p>I am not geeting any force close in application but this error is showing in logcat please suggest me how to solve this error?</p><p>I am using this </p><pre><code>line no 210::public Cursor getreLaunchView()       {     Cursor cursor = db.query(reLaunchView.TABLE,new String[] { reLaunchView.Launch_ID,          reLaunchView.Launch_CENTERLATITUDE,           reLaunchView.Launch_CENTERLONGITUDE,reLaunchView.Launch_LATDELTA,reLaunchView.Launch_LONGDELTA,           reLaunchView.Launch_ZOOMLEVEL},null, null, null, null, null);   if (cursor != null)    {     cursor.moveToFirst();    }     return cursor; }01-04 12:26:29.482: ERROR/Cursor(3479): Finalizing a Cursor that has not been deactivated or closed. database = /data/data/com.bluepal.android.parkable/databases/parkable.db, table = reLaunchView, query = SELECT _id, centerLatitude, centerLongitude, latDelta, longDelta, zoomLevel FROM reLaunchView01-04 12:26:29.482: ERROR/Cursor(3479): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here01-04 12:26:29.482: ERROR/Cursor(3479):     at android.database.sqlite.SQLiteCursor.&lt;init&gt;(SQLiteCursor.java:210)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1229)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1184)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1264)01-04 12:26:29.482: ERROR/Cursor(3479):     at **com.bluepal.android.parkable.parkdatabase.getreLaunchView(parkdatabase.java:210)**01-04 12:26:29.482: ERROR/Cursor(3479):     at com.bluepal.android.parkable.Prakablescreen.databasefunction(Prakablescreen.java:663)01-04 12:26:29.482: ERROR/Cursor(3479):     at com.bluepal.android.parkable.Prakablescreen.displayMap(Prakablescreen.java:563)01-04 12:26:29.482: ERROR/Cursor(3479):     at com.bluepal.android.parkable.Prakablescreen$1.handleMessage(Prakablescreen.java:531)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.os.Handler.dispatchMessage(Handler.java:99)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.os.Looper.loop(Looper.java:123)01-04 12:26:29.482: ERROR/Cursor(3479):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-04 12:26:29.482: ERROR/Cursor(3479):     at java.lang.reflect.Method.invokeNative(Native Method)01-04 12:26:29.482: ERROR/Cursor(3479):     at java.lang.reflect.Method.invoke(Method.java:521)01-04 12:26:29.482: ERROR/Cursor(3479):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-04 12:26:29.482: ERROR/Cursor(3479):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-04 12:26:29.482: ERROR/Cursor(3479):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","460336","","644669","","2011-11-27 10:44:20","2011-11-27 10:44:20","Cursor that has not been deactivated or closed.I am getting error?","<android>","1","0","","",""
"4591450","1","4591469","","2011-01-04 07:29:55","1","404","<p>There are cross-platform mobile application frameworks like Sencha Touch, which creates web apps with native look-and-feel. And frameworks like PhoneGap can pack them into an mobile application. How can I know if an application on Android or iPhone is written in a such way?</p><p>Thanks</p>","111896","","111896","","2011-01-04 07:38:57","2011-01-04 08:06:07","How can I tell if an application is written as a WebApp or native application?","<iphone><android><html5>","1","0","","",""
"4591482","1","","","2011-01-04 07:39:13","0","1763","<p>I just follow <a href=""http://xilard.hu/"" rel=""nofollow"">this</a> to enable SIP in Android 2.3 emulator.<br/>I can use Sipdriod in G1 to get call from emulator, but the emulator can't get call from  G1.<br/></p><p>What's problem with this? <br/>Or is any other way to test new SIP API in emulators?<br/></p><p>Edited:<br/>I just redir add udp:5060:5060 in my emulator, but still can't work.</p>","421579","","421579","","2011-01-04 13:41:05","2012-10-16 13:28:24","SipDemo in Android 2.3","<android><sip>","3","1","","",""
"4591519","1","4591662","","2011-01-04 07:45:09","2","2637","<p>I want to display an image which is saved into database in blob form on my Android. I am using ImageView as image container. Please suggest me something soon.</p><p>Regards,Rahul</p>","315140","","","","","2012-11-19 06:05:10","How to display a blob image in Android?","<android><imageview>","1","0","","",""
"4591542","1","4591578","","2011-01-04 07:48:58","5","1596","<p>i have a html embeds a swf file</p><p>i write this to load the html file by webview : </p><pre><code>mywebview.loadUrl(""file:///android_asset/myweb.html"");</code></pre><p>now i have a question , i wanna let the html embed a swf file , which also in the </p><p>eclipse project assets directory.</p><p>could anyone tell me what path should i set?  file:///android_asset/myswf.swf??</p>","422405","","","","","2011-01-04 07:55:49","android load local path html and swf file using webview","<android>","1","0","1","",""
"4591602","1","6991695","","2011-01-04 08:00:44","2","3252","<p>I'd like to make some changes in my code according to some Marketing requires.I thing that the best solution is using preprocessing, like in J2ME.How can I do it? Is there any tool for this task?Thanks,Eyal.</p>","341497","","","","","2013-07-02 05:54:11","Preprocessing with Android","<android><preprocessor>","3","1","1","",""
"4591678","1","","","2011-01-04 08:14:58","1","1680","<p>I'm need to write the XML file in android and replace it with the new one. The code is working properly but nothing changed in the XML file I have.</p><p>any ideas?</p><pre><code>try{FileOutputStream fOut = openFileOutput(""/data/data/test.fileshow/files/Landmarks.xml"", MODE_WORLD_READABLE);OutputStreamWriter osw = new OutputStreamWriter(fOut); String filepath = ""Landmarks.xml"";DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();     DocumentBuilder docBuilder = docFactory.newDocumentBuilder();     Document doc = docBuilder.parse(filepath);     Element Row, Longitude, Latitude, Title, Category, Rating;            Node staff = doc.getElementsByTagName(""Root"").item(0);         Row=doc.createElement(""Row"");         Longitude=doc.createElement(""Longitude"");         Longitude.appendChild(doc.createTextNode(""555""));         Row.appendChild(Longitude);         Latitude=doc.createElement(""Latitude"");         Latitude.appendChild(doc.createTextNode(""ABCCamera""));         Row.appendChild(Latitude);         Title=doc.createElement(""Title"");         Title.appendChild(doc.createTextNode(""title""));         Row.appendChild(Title);         Category=doc.createElement(""Category"");         Category.appendChild(doc.createTextNode(""category""));         Row.appendChild(Category);         Rating=doc.createElement(""Rating"");         Rating.appendChild(doc.createTextNode(""rating""));         Row.appendChild(Rating);         staff.appendChild(Row);        //write the content into xml file        TransformerFactory transformerFactory = TransformerFactory.newInstance();        Transformer transformer = transformerFactory.newTransformer();        DOMSource source = new DOMSource(doc);        StreamResult result =  new StreamResult(new File(filepath));        transformer.transform(source, result);        osw.flush();        osw.close();      }catch(ParserConfigurationException pce){     pce.printStackTrace();      }catch(TransformerException tfe){     tfe.printStackTrace();      }catch(IOException ioe){     ioe.printStackTrace();      }catch(SAXException sae){     sae.printStackTrace();      }</code></pre>","560133","","101999","","2011-01-04 08:24:45","2011-11-28 20:44:58","Writing XML file to android after appending it","<java><android><xml>","1","3","","",""
"4591696","1","4591768","","2011-01-04 08:17:24","8","3298","<p>I have different strings.xml files in my resources folders (values, values_fr, values_de...) and I would like to load additional translations during runtime. Is it possible to add the new strings to those files even if it has already been compiled ? Or is there any workaround ?</p><p>Thanks</p>","337141","","","","","2011-01-04 08:31:06","Android: How to generate xml resources on runtime?","<android><xml><localization><runtime>","1","0","4","",""
"4591712","1","","","2011-01-04 08:20:42","2","847","<p>anyone knows how do i change the starting offset of a ListView ? </p><p>i mean to make the list view's starting item a different item then number zero </p><p>so when you drag down the listview from starting point it will return to the first (custom) starting point item </p><p>when i try using ListView.offsetTopAndBottom(x) it gets that effect, only its not usable for me because it changes the offset of the entire view (the bottom as well) </p>","527677","","","","","2011-01-04 08:27:34","Android ListView starting offset?","<java><android><listview><offset>","1","0","","",""
"4591757","1","","","2011-01-04 08:29:34","2","2979","<p>Can anyone tell me what Html Cleaner is and for which purpose it is used?</p><p>Thanks,david</p>","422859","","","","","2011-01-04 08:40:55","What is HTMLCleaner in android","<android><html>","2","1","","",""
"4591765","1","4591843","","2011-01-04 08:30:33","2","3709","<p>i've a class in this app that should create and use a database, but Eclipse tell me that the sqlite methods are undefined.</p><p>Seem to be a context problem but i don't understand how to fix, have i to extend a different class instead of Activity?</p><pre><code>package com.android.userdata;import android.app.Activity;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast; public class getdata extends Activity {  private final String MY_DATABASE_NAME = ""DataStore"";        private final String MY_DATABASE_TABLE = ""UserData"";     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.userdata);         SQLiteDatabase myDB = null;            /* Create the Database (no Errors if it already exists) */            this.createDatabase(MY_DATABASE_NAME, 1, MODE_PRIVATE, null);            myDB = this.openDatabase(MY_DATABASE_NAME, null);            myDB.execSQL(""CREATE TABLE IF NOT EXISTS ""                    + MY_DATABASE_TABLE                    + "" (LastName VARCHAR, FirstName VARCHAR,""
                    + "" Country VARCHAR, Age INT(3));"");         Button btn = (Button) findViewById(R.id.confirm);         btn.setOnClickListener(new OnClickListener() {          @Override          public void onClick(View v) {           Toast.makeText(getdata.this, ""Hai Premuto il Pulsante"", Toast.LENGTH_SHORT).show();          }         });     }}</code></pre><p>Thanks for your help!</p>","561438","","135152","","2011-05-25 03:02:03","2011-05-25 03:02:03","Android - Sqlite database method undefined fot type","<java><android><sqlite>","2","0","1","",""
"4591786","1","","","2011-01-04 08:34:46","2","572","<p>I have drawn an image manually on bitmap. But it has shown out of memory error. I, then reduced the size of the image which shows me the compressed form of the image.I need the original size of the image to be displayed which is then showing out of memory error. Kindly, help me out in resolving the issue. I am enclosing the part of the code too.</p><p>ImageView iv1 = new ImageView(mcontext);</p><p>BitmapFactory.Options options = new BitmapFactory.Options();<br>options.inSampleSize = 2;</p><p>BitmapFactory.decodeFile(pageViewManager.getPenToolPath() + pageViewManager.getCurrentPageIndex() + "".jpg"");</p><p>bmp = BitmapFactory.decodeFile(pageViewManager.getPenToolPath() + pageViewManager.getCurrentPageIndex() + "".jpg"", options);</p><p>iv1.setImageBitmap(bmp);</p>","562237","","","","","2011-01-04 09:08:27","BItmap:out of memory error. how to get the original image size after compressing it in android","<android>","1","0","","",""
"4591878","1","4591906","","2011-01-04 08:48:00","10","13303","<p>In my app I am doing some intense work in <code>AsyncTask</code> as suggested by Android tutorials and showing a <code>ProgressDialog</code> in my main my activity:</p><pre><code>dialog = ProgressDialog.show(MyActivity.this, ""title"", ""text"");new MyTask().execute(request);</code></pre><p>where then later in <code>MyTask</code> I post results back to activity:</p><pre><code>class MyTask extends AsyncTask&lt;Request, Void, Result&gt; {    @Override protected Result doInBackground(Request... params) {        // do some intense work here and return result    }    @Override protected void onPostExecute(Result res) {        postResult(res);    }}</code></pre><p>and on result posting, in main activity I hide the dialog:</p><pre><code>protected void postResult( Result res ) {    dialog.dismiss();    // do something more here with result...}</code></pre><p>So everything is working fine here, but I would like to somehow to update the progress dialog to able to show the user some real progress instead just of dummy ""Please wait..."" message. Can I somehow access the progress dialog from <code>MyTask.doInBackground</code>, where all work is done? </p><p>As I understand it is running as separate Thread, so I cannot ""talk"" to main activity from there and that is why I use <code>onPostExecute</code> to push the result back to it. But the problem is that <code>onPostExecute</code> is called only when all work is already done and I would like to update progress the dialog in the middle of doing something.</p><p>Any tips how to do this?</p>","283037","","","","","2011-01-04 08:52:46","Updating progress dialog in Activity from AsyncTask","<android><android-asynctask><progressdialog>","1","0","2","",""
"4592017","1","4600800","","2011-01-04 09:10:54","0","263","<p>I am using a SortedMap in a calss that extends SimpleCursoradapter. can i acess that map from another class that extends ListActivity.</p><p>The code im using is given below.</p><pre><code>publicclass ListContacts extends ListActivity { ListAdapter lAdapter; @Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activitylist); // /** * * Use the ContentResolver instance to query the database and return a* Cursor with the contacts list. The query is performed against the URI* stored in ContactsContract.Contacts.CONTENT_URI.*/Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, ContactsContract.Contacts.HAS_PHONE_NUMBER + "" = 1"", null,null); startManagingCursor(cursor);// start mappings String[]  columns = new String[] { ContactsContract.Contacts.DISPLAY_NAME }; int[] names  = new int[] { R.id.contact_name }; lAdapter = new ImageCursorAdapter(this, R.layout.main, cursor, columns,names); @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); }} //  end of class ListContacts publicclass ImageCursorAdapter extends SimpleCursorAdapter { private Cursor c; private Context context; SortedMap&lt;String, String&gt; phoneNumberMap = new TreeMap&lt;String, String&gt;(); public SortedMap&lt;String, String&gt; getPhoneNumberMap() { return phoneNumberMap; }public void setPhoneNumberMap(SortedMap&lt;String, String&gt; phoneNumberMap) { this.phoneNumberMap = phoneNumberMap; }public ImageCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); this.c = c; this.context = context; }public View getView(int pos, View inView, ViewGroup parent) { phoneNumberMap.put(""1"", ""fasfa"");   phoneNumberMap.put(""2"", ""fasfa1""); phoneNumberMap.put(""3"", ""fasfa2""); phoneNumberMap.put(""4"", ""fasfa3""); phoneNumberMap.put(""5"", ""fasfa4"");phoneNumberMap.put(""6"", ""fasfa5"");System.out.println("" Map : size: "" + phoneNumberMap.size()); } }// end of  class ImageCursorAdapter</code></pre><p>How can i access phoneNumberMap in the onListItemClick () method of Listcontacts class.</p>","548218","","329637","","2011-01-04 09:11:48","2011-01-06 06:27:51","Can we access Java.util Map of a class in another class","<android>","3","2","","",""
"4592060","1","4602740","","2011-01-04 09:16:17","2","3620","<p>I am showing current location using a red marker and some other set of location using a blue marker. After an operation, I have to remove some of the locations indicated using blue marker. Rest should be shown in the map itself. How will I do it?</p>","504162","","","","","2012-10-10 13:24:50","remove an overlay in map","<android>","3","0","2","",""
"4592065","1","4610395","","2011-01-04 09:17:03","5","5691","<p>I have a set of 12 images to show in a layout. The number is chosen semi arbitrarily, but boils down to 3 horizontaly and 4 vertically for portrait mode and the other way around for landscape.</p><p>First implementation was using a gridview. Problem is the height cannot be forced to fit in the screen.For a workaround I can (try to) scale the images ofcourse, but its near impossible to calculate the room available to the gridview: Total screensize is known ofcourse, but you have to 'guess' the size of the notification bar and that doesn't seem to be an elegant sollution. The measured size isn't really to be trusted: I'm not doing a complete restart on orientation change (for speed), but the way the screen is build the complete space isn't available on the spot.In the end the conclusion is that I don't want to calculate the size of the images and then scale them accordingly: I think it's better to say how the views should fit in the screen, right?</p><p>So the next try is just using a TableLayout. Using ""ShrinkColumns=""*"" the images fitted fine, so the size of the images is now how we want them. But 'extra' room we might have in the height is now evenly divided between the tablerows. This is to be expected, but ugly.</p><p>The current code seems irrelevant because it doesn’t work, but looks like this in the end:I’ve removed all the padding and other stuff which doesnt seem relevant.(for portait:) </p><pre><code>&lt;TableLayout       android:shrinkColumns=""*""&gt;    &lt;TableRow&gt;        &lt;ImageView/&gt;        &lt;ImageView/&gt;        &lt;ImageView/&gt;    &lt;/TableRow&gt;    … (repeat 3 tablerows)&lt;/TableLayout&gt;</code></pre><p>To ‘scale’ the too-large images, the TableLayout has the “shrinkcolumns=”*”” attribute. </p><p>How can we get the three ImageViews to be aligned in the center of the TableRow and not spread evenly in the width? And the same goes for the vertical columns, how can we keep everything together and not spread across the height of the screen? Basically, the ""excess"" space should go to the sides as padding/margin, and now it goes in between the Images.</p><p>Example:The left screen-shot shows too much left/right distance, the right has too much top/bottom<img src=""http://i.stack.imgur.com/vzIQc.png"" alt=""example-androblip-layout-image""></p>","546999","","546999","","2011-01-05 12:32:45","2011-01-06 10:17:40","How to layout a 'grid' of images in the center of the screen","<android><gridview><android-layout><tablelayout>","1","4","8","",""
"4592086","1","4592109","","2011-01-04 09:20:45","4","2488","<p>Goal: On the Android platform, detect the phone number of the individual with whom the user is speaking to now.</p><p>Currently, using PhoneListener, there exists a certain ambiguity in the case of calls on hold.</p><p>Case: User is talking to someone during a call (""Call 1""). The user is therefore in call state OFFHOOK. Then the user is in state RINGING indicating an incoming phone call (""Call 2""). The state then changes to OFFHOOK. This could indicate one of two possibilities -- either the user answered Call 2, and placed Call 1 on hold. Alternatively, the user rejected Call 2 and returned to Call 1. </p><p>How is it possible to distinguish between the two cases? Is it possible to detect the phone number of the CURRENT CALL on the phone?</p>","299080","","881229","","2014-02-24 00:24:47","2014-02-24 00:24:47","Android: Detect currently active phone number during phone call","<android><phone>","1","0","3","",""
"4592113","1","4607227","","2011-01-04 09:24:47","3","6440","<p>I am a newbie in android world. I tired to create a android project using eclipse IDE, in which i tried reading a pdf file with the help of itext library.This pgm is not showing any output.Please tell me how to correct the code,so that i can extract the text from pdf file stored in Assets folder in the project.</p><p>The program code is given as :</p><pre><code>public class hello extends Activity {    /** Called when the activity is first created. */    public static final String LOG_TAG=""Fifth"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        AssetManager assetManager =getAssets();        InputStream istr = null;        PdfReader reader=null;        String str=null;        int n=0;        try {            istr =(InputStream) assetManager.open(""FirstPdf"");             reader=new PdfReader(istr);             n=reader.getNumberOfPages();            Log.v(LOG_TAG,""n value:"" +n);         str=reader.getPageContent(2).toString();        }        catch (Exception e)        {            e.printStackTrace();        }         TextView tv = new TextView(this);        tv.setText(n);        setContentView(tv);    }}</code></pre><p>RegardsThomas</p>","560752","","","","","2011-02-23 05:16:12","How to read a pdf using itext library in android","<android><itext>","2","6","0","",""
"4592178","1","","","2011-01-04 09:34:46","3","438","<p>i coded an app, which called the android mediaplayer to play an audiostream (by URL). In the emulator (Android 2.2) everything works fine (The App plays the stream). When I install the App on my HTC Desire (Android 2.2) it works fine.This week a friend installed the app on his Samsung S i9000 (Android 2.2) and it didn´t work. The app just freezes and the user is called to wait or to abort when mediaplayer.start(); is called.When the app initialises the mediaplayer is constructed (by standard constructor), but on the i9000 you are changing the the call volume, not the media volume if you push the buttons.Any ideas? :)</p><p>Edit: When i call a mp3-file instead of the stream the i9000 plays it... confusing...</p>","562328","","21234","","2011-01-04 09:57:41","2012-06-28 09:45:39","Android Mediaplayer @ Samsung S i9000","<android><stream><media-player><freeze>","1","2","1","",""
"4592312","1","","","2011-01-04 09:52:27","0","496","<p>I have problem in loading map with multiple marker in samsung epic.map will display after some time.pls give me the solution.</p><p>Thanks.</p>","500420","","500420","","2011-01-04 10:19:06","2011-01-04 10:19:06","fast map loading issue with multiple markers in android?","<android><google-maps><google-maps-api-3>","1","0","","",""
"4592326","1","4592341","","2011-01-04 09:53:46","2","2212","<p>I'm using the Android Developer Tools on eclipse, plus Java (obviously). I'm quite new to Java, and i don't know where the output can be seen. I tried the obvious: the console, but the string wasn't there. I tried the Logcat, but the string wasn't there either.</p><p>Thanks in advance!</p>","313194","","313194","","2011-01-04 10:00:52","2011-08-29 09:03:51","On eclipse, developing for Android, where can i see the output of System.out.println()?","<java><android><eclipse><adt>","5","1","","",""
"4592338","1","4592368","","2011-01-04 09:55:24","0","1632","<p>I have an Android tablet and I want to know the OS version. I checked in Settings->About Device but there is no OS version present. It says,</p><pre><code>Model Number:GenericFirmware Version:1.6Kernel Version:2.6 29-00236-g4f8dbbb-dirtyBuild Number:WMT2.1_88</code></pre><p>How would I know OS version from this?</p>","528965","","844882","","2012-03-17 06:42:11","2012-03-17 06:42:11","How to check Android Os Version?","<android>","1","1","","",""
"4592375","1","","","2011-01-04 09:59:03","0","3445","<p>can anyone tell me how to call another class which does not extend activity , I have searched in many forums I am not clear with that ...</p><p>Thanks in Advance</p>","558304","","","","","2013-06-10 10:34:11","Android -to call another class","<android>","2","5","","",""
"4592384","1","4592404","","2011-01-04 09:59:58","3","1676","<p><br>I need to have a custom pdf viewer inside my application where i have my own menu and all.<br>It is not working with webview and i tried by converting each page into image but i feel its not a good way and it make my application big and complex.<br>Is there any way to create custom pdf view in suggest me some link and tutorial<br>Thanks </p>","477754","","","","","2011-09-26 22:08:02","Custom pdf viewer in android","<android><pdf-generation>","1","0","2","",""
"4592508","1","4592598","","2011-01-04 10:17:24","1","716","<p>I am trying to draw a bitmap on a polygon has sides more than 4. i am dealing with opengl to do this but i realised in 2d there is a method called drawBitmapMesh in Canvas for this. It worked for 4 side polygon but not working for 5.This works</p><pre><code>float verts[] = {0,0, 0,10, 0,20 ,0,30, 10,0, 10,10, 10,20, 10,30, 20,0, 20,10, 20,20, 20,30, 30,0, 30,10, 30,20, 30,30};canvas.drawBitmapMesh(bitmap, 3, 3, verts, 0, null, 0, null);</code></pre><p>This does not work gives runtime error. </p><pre><code>float verts[] = {0,0, 0,10, 0,20 ,0,30, 0,40, 10,0, 10,10, 10,20, 10,30,10,40, 20,0, 20,10, 20,20, 20,30,20,40, 30,0, 30,10, 30,20, 30,30,30,40};canvas.drawBitmapMesh(bitmap, 4, 4, verts, 0, null, 0, null);</code></pre>","459904","","44729","","2011-01-04 17:37:36","2011-01-04 17:37:36","Android draw bitmap on polygons","<android><opengl-es><canvas>","1","0","","",""
"4592571","1","4592602","","2011-01-04 10:26:04","0","865","<p>In my project i have activity with options menu. I override <code>onOptionsItemSelected</code> method and add my handlers to menu items (switch-case block). But in one handler i need access to another menu item, how i can do that? findViewById doesn't work</p><pre><code> @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {            case R.id.visit:                    //how to access another MenuItem from here?                    return true;                }...</code></pre>","410919","","","","","2011-01-04 10:30:09","Android option menu","<java><android><menu><options>","1","1","","",""
"4592698","1","4593097","","2011-01-04 10:42:31","2","385","<p>i am developing one application in android ,in this app related to themes. select theme will effect entire os (entire mobile ) how can implement this functionality </p><p>please forward some valuable solution thanks in advance...</p>","254790","","","","","2011-01-04 11:29:15","how can implement mobile themes app in android","<android><themes>","1","0","3","",""
"4592716","1","","","2011-01-04 10:44:10","0","3018","<p>I am developing on Android but the question might be just as valid on any other Java platform.</p><p>I have developed a multi-threaded app. Lets say I have a first class that needs to do a time-intensive task, thus this work is done in another Thread.When it's done that same Thread will return the time-intensive task result to another (3rd) class. </p><p>This last class will do something and return it's result to the first-starting class.I have noticed though that the first class will be waiting the whole time, maybe because this is some kind of loop ? </p><p>Also I'd like the Thread-class to stop itself, as in when it has passed it's result to the third class it should simply stop. The third class has to do it's work without being ""incapsulated"" in the second class (the Thread one).Anyone knows how to accomplish this ?</p><p>right now the experience is that the first one seems to be waiting (hanging) till the second and the third one are done :(</p>","162147","","437703","","2011-02-03 11:05:02","2011-02-03 11:05:02","MultiThreading question","<android><multithreading>","3","0","2","",""
"4592754","1","4593485","","2011-01-04 10:48:07","0","249","<p>When I run my application, buttons are not displaying(A little part is displaying, that makes feel that something is there), although I scroll down. How to solve my problem. Is there any way to set size of textboxes (Where size depends on screen size). </p>","550966","","550966","","2011-03-19 18:38:03","2012-11-16 00:08:40","Design view problem in xml file : Android","<android><android-linearlayout>","3","0","","",""
"4592846","1","4827785","","2011-01-04 10:58:50","1","1195","<p>I need to set alarm in google calendar via Android app. I have successfully entered data in calendar even though it shows alarm has been set too but when I view detail of calendar entry, it automatically remove alarm setting. </p><p>please advise, below is code snippet. </p><pre><code>private Uri MakeNewCalendarEntry(int calId, String title, String desc,        String location, String matchDate) {    ContentValues event = new ContentValues();    String value = matchDate;    String[] splitedTimeDate = value.split(""T"");    String dateValue = splitedTimeDate[0];    String[] timeValue = splitedTimeDate[1].split(""-"");    matchDate = dateValue + "" "" + timeValue[0];    event.put(""calendar_id"", calId);    event.put(""title"", title);    event.put(""description"", desc);    event.put(""eventLocation"", location);    SimpleDateFormat formatter = new SimpleDateFormat(""yyyy-MM-dd HH:mm"");    java.util.Date d = null;    try {        d = formatter.parse(matchDate);// catch exception    } catch (ParseException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    // This is the UTC Event Start Date    Calendar calUTCEventDate = Calendar.getInstance();    calUTCEventDate.setTime(d); // rest is the same....    // This is the current UTC Date    Calendar calCurrentUTCDate = Calendar.getInstance();    TimeZone z = calCurrentUTCDate.getTimeZone();    int offset = z.getRawOffset();    int offsetHrs = offset / 1000 / 60 / 60;    int offsetMins = offset / 1000 / 60 % 60;    calCurrentUTCDate.add(Calendar.HOUR_OF_DAY, (-offsetHrs));    calCurrentUTCDate.add(Calendar.MINUTE, (-offsetMins));    // This is the current Device Date    Calendar calCurrentDeviceDate = Calendar.getInstance();    long diff = calUTCEventDate.getTimeInMillis()            - calCurrentUTCDate.getTimeInMillis();    long minutes = Math.abs(diff) / (1000 * 60);    long hours = minutes / 60;    long startTime = System.currentTimeMillis() + 1000 * 60 * 60 * hours;    long endTime = System.currentTimeMillis() + 1000 * 60 * 60            * (hours + 8);    event.put(""dtstart"", startTime);    event.put(""dtend"", endTime);    event.put(""allDay"", 0); // 0 for false, 1 for true    event.put(""eventStatus"", 1);    event.put(""visibility"", 1);    event.put(""transparency"", 0);    event.put(""hasAlarm"", 1); // 0 for false, 1 for true    Uri eventsUri = Uri.parse(getCalendarUriBase() + ""events"");    Uri insertedUri = getContentResolver().insert(eventsUri, event);    return insertedUri;}</code></pre>","227129","","756941","","2013-12-11 05:09:21","2013-12-11 05:09:21","Google Calendar Entry Alarm not working Android","<android><google-calendar><alarm>","2","0","0","",""
"4592966","1","","","2011-01-04 11:13:39","1","984","<p>I am very new to Android development. I need some clarifications from you. My question is 'Is it possible to store no.of sms's in drafter programatically?"". Please help me.</p><p>Thank you,Sekhar Bethalam.</p>","533835","","21234","","2011-01-04 14:56:58","2011-10-20 08:22:38","Is it possible to save sms in drafts using Android sdk","<android><android-sdk-2.1>","2","0","1","",""
"4592989","1","","","2011-01-04 11:16:03","0","2407","<p>Is there a way to tell precisely where an image is placed on the parent?ImageView layout returns some frame around the actual image.One can see the difference when working with images that are very different from the screen proportions. For example a square image on a long screen.</p><p>Worse: devices like Edge have their bottom bar that consumes parts of the screen and affect the layouting calculations. In that case it's hard to do reverse calculations.</p>","361169","","361169","","2011-01-04 11:35:59","2011-12-08 14:41:27","Android: Actual position of an ImageView","<android><imageview>","1","0","","",""
"4593027","1","4599128","","2011-01-04 11:19:56","2","3847","<p>I want to display different children in each section of Expandable list in android. So i have written following lines:</p><pre><code>//SmplExpandable.javapackage com.bogotobogo.android.smplexpandable;import android.app.ExpandableListActivity;import android.content.Context;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.view.WindowManager;import android.widget.HeterogeneousExpandableList;import android.widget.ImageView;import android.widget.SimpleExpandableListAdapter;import android.widget.TextView;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;/** * Demonstrates expandable lists backed by a Simple Map-based adapter */public class SmplExpandable extends ExpandableListActivity implements HeterogeneousExpandableList{    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        List&lt;Map&lt;String, Object&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();        List&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt; childData = new ArrayList&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt;();            Map&lt;String, Object&gt; curGroupMap = new HashMap&lt;String, Object&gt;();            curGroupMap = new HashMap&lt;String, Object&gt;();            curGroupMap.put(""Name"",""Recipe"");            groupData.add(curGroupMap);            curGroupMap = new HashMap&lt;String, Object&gt;();            curGroupMap.put(""Name"",""Feedback"");            groupData.add(curGroupMap);            curGroupMap = new HashMap&lt;String, Object&gt;();            curGroupMap.put(""Name"",""Images"");            groupData.add(curGroupMap);            curGroupMap = new HashMap&lt;String, Object&gt;();            curGroupMap.put(""Name"",""Video"");            groupData.add(curGroupMap);            List&lt;Map&lt;String, Object&gt;&gt; children = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();            Map&lt;String, Object&gt; curChildMap = new HashMap&lt;String, Object&gt;();            curChildMap = new HashMap&lt;String, Object&gt;();            curChildMap.put(""MyRecipe"",getResources().getString(R.string.My_Recipe));            children.add(curChildMap);            childData.add(children);            children = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();            curChildMap = new HashMap&lt;String, Object&gt;();            curChildMap.put(""MyFeedback"", getResources().getString(R.string.My_Feedback));            children.add(curChildMap);            childData.add(children);            children = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();            curChildMap = new HashMap&lt;String, Object&gt;();            curChildMap.put(""MyImage"", getResources().getDrawable(R.drawable.icon));            children.add(curChildMap);            childData.add(children);            children = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();            curChildMap = new HashMap&lt;String, Object&gt;();            curChildMap.put(""MyImage"", getResources().getDrawable(R.drawable.icon));            children.add(curChildMap);            childData.add(children);        // Set up our adapter            setListAdapter( new SimpleExpandableListAdapter(                    this,                    groupData,                    android.R.layout.simple_expandable_list_item_1,                    new String[] {""Name""},            // the name of the field data                    new int[] { android.R.id.text1 }, // the text field to populate with the field data                    childData,                    0,                    null,                    new int[] {}                )                 {                    @Override                    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {                        final View v = super.getChildView(groupPosition, childPosition, isLastChild, convertView, parent);                        if (groupPosition == 0)                        {                        // Populate your custom view here                        ((TextView)v.findViewById(R.id.TextView01)).setText( (String) ((Map&lt;String,Object&gt;)getChild(groupPosition, childPosition)).get(""MyRecipe"") );                        }                        else if (groupPosition == 1)                        {                        // Populate your custom view here                            ((TextView)v.findViewById(R.id.TextView02)).setText( (String) ((Map&lt;String,Object&gt;)getChild(groupPosition, childPosition)).get(""MyFeedback"") );                        }                        else if (groupPosition == 2)                        {                        // Populate your custom view here                             ((ImageView)v.findViewById(R.id.ImageView01)).setImageDrawable((Drawable) ((Map&lt;String,Object&gt;)getChild(groupPosition, childPosition)).get(""MyImage""));                        }                        else if (groupPosition == 3)                        {                        // Populate your custom view here                             ((ImageView)v.findViewById(R.id.ImageView01)).setImageDrawable((Drawable) ((Map&lt;String,Object&gt;)getChild(groupPosition, childPosition)).get(""MyImage""));                        }                        return v;                    }                    @Override                    public View newChildView(boolean isLastChild, ViewGroup parent) {                        {                            return layoutInflater.inflate(R.layout.myrow, null, false);                        }                    }                }             );        // Set the width and height of activity.        WindowManager.LayoutParams params = getWindow().getAttributes();          params.height =400;          params.width = 400;          this.getWindow().setAttributes(params);      }}</code></pre><p>File myrow.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=""wrap_content""&gt;      &lt;ImageView android:id=""@+id/ImageView01""     android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;   &lt;/ImageView&gt;    &lt;TextView android:id=""@+id/TextView01""     android:layout_width=""fill_parent""     android:background=""#FFFFFF""     android:textColor=""#FF0000""     android:textSize=""10px""     android:layout_height=""fill_parent""/&gt;    &lt;TextView android:id=""@+id/TextView02""     android:layout_width=""fill_parent""     android:background=""#FFFFFF""     android:textColor=""#FF0000""     android:textSize=""10px""     android:layout_height=""fill_parent""/&gt;    &lt;VideoView android:id=""@+id/VideoView01""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;    &lt;/VideoView&gt;&lt;/LinearLayout&gt;</code></pre><p>My problem is that i am able to see both text and image in all the four sections, whereas i want to display text only in first two sections and image in other two sections.</p><p>Can anybody tell me that what i am doing wrong?</p><p>Thanks,Neha </p>","535026","","14302","","2011-07-12 13:21:14","2011-07-12 13:21:14","How to add different children in each section of an expandable list view in android?","<android><expandablelistview>","1","0","3","",""
"4593037","1","4635272","","2011-01-04 11:20:59","2","36765","<p>is there any example or tutorial of Gyroscope in android. if yes then please give any link.... </p>","304961","","","","","2012-11-09 18:09:38","Android Gyroscope tutorial or sample code","<android>","2","0","3","2013-03-20 17:18:56",""
"4593046","1","4601031","","2011-01-04 11:22:25","11","3516","<p>I thought that it is impossible to access resources contained in other APK unless content providers are used. However, I stumbled upon an app called Better Keyboard. It uses skins, so I decided to download an example of a skin.</p><p><a href=""http://code.google.com/p/betterandroid/downloads/detail?name=WhiteKeyboard.zip"">An example skin</a> really surprised me. It contains almost no code, declares only an activity and no content providers. Nontheless it contains resources and they are apparently somehow accessed from Better Keyboard app if the APK with the skin gets installed. So how is it done?</p>","45668","","45668","","2011-01-05 20:22:53","2011-11-01 11:57:54","Is it possible to access resources in another APK without using content providers?","<android><android-contentprovider>","3","0","11","",""
"4593061","1","4648839","","2011-01-04 11:24:57","6","6075","<p>I'm trying to retrieve the AuthToken for Facebook (saved by <strong>Facebook for Android</strong>) by using the following piece of code.</p><pre><code>AccountManager am = AccountManager.get(this);Account[] accounts = am.getAccountsByType(""com.facebook.auth.login"");if (accounts.length &gt; 0) {              for(int j = 0; j &lt; accounts.length; j++) {        Account account = accounts[j];        if(account.type != null &amp;&amp; account.type.equals(""com.facebook.auth.login"")) {             Log.e(RuntimeVars.MY_NAME, ""FACEBOOK-TYPE FOUND"");            am.getAuthToken(account, ""com.facebook.auth.login"", null, ConversationList.this,                new AccountManagerCallback&lt;Bundle&gt;() {                    public void run(AccountManagerFuture&lt;Bundle&gt; arg0) {                        try {                            Bundle b = arg0.getResult();                            Log.e(RuntimeVars.MY_NAME, ""THIS AUTHTOKEN: "" + b.getString(AccountManager.KEY_AUTHTOKEN));                        }                        catch (Exception e) {                            Log.e(RuntimeVars.MY_NAME, ""EXCEPTION@AUTHTOKEN"");                        }                    }                }, null);            }        }    }</code></pre><p>The login credentials are found and <em>FACEBOOK-TYPE FOUND</em> is written into LogCat, but neither <em>THIS AUTHTOKEN: [...]</em> nor <em>EXCEPTION@AUTHTOKEN</em> is logged. So I suppose <code>am.getAuthToken</code> is never called.</p><p>What am I missing? </p><p>In general, if there is a better (and at least working) approach to retrieve the Facebook authtoken from the Android accounts please let me know.</p><p>Thanks a lot for your help!</p><p>Best regards<br>S.</p>","419501","","419501","","2011-01-06 14:14:46","2011-06-17 22:53:31","How to retrieve an Facebook-AuthToken from the accounts saved on Android","<android><facebook><accountmanager><auth-token>","4","0","3","",""
"4593082","1","","","2011-01-04 11:27:19","1","3213","<p>I just downloaded the Open NFC API and it comes with an example project called <code>NFCBrowser</code>.I have gone through the PDF they have provided for the configuration of the AVD. But in the page no. 10 it says:</p><blockquote>  <p>3.4 Launching of the AVD and starting of the Open NFC stack</p>    <p>The connection center is used by the “Open NFC for Android” add-on to access to NFC controller.Prior launching the AVD, the Connection center must be launched and configured to accept client connections from other machines, as shown below:""</p></blockquote><p>and I am not able to find connection center as mentioned in the PDF.</p><p>I am also getting this error when try to run this application which says:</p><blockquote>  <p>no NFC access granted at all for the application</p></blockquote>","418271","","40342","","2012-10-22 13:50:23","2012-10-22 13:50:23","Open nfc example application","<android><nfc><open-nfc>","2","1","","",""
"4593093","1","4593349","","2011-01-04 11:28:24","2","2051","<p>In eclipse i updated installed packages for Android SDK Tools from revision 2 to revision 8.</p><p>Now when i am trying to install the ADT plugin 8.0.1 (help->install new sw).</p><p>I select the path of the zip folder in my local (ADT-8.0.1.zip) and check on all Android DDMS,Android Development Tools,Android Hierarchy Viewer</p><p>and click on next button</p><p>The screen shows something as "" Calculating requirements and dependencies "" and gets stuck there.</p><p>Pls suggest where am i going wrong. Thanks in advance.</p>","552712","","","","","2011-12-10 12:44:16","issue in installing ADT 8.0.1 in eclipse galileo","<android><eclipse><adt>","2","3","","",""
"4593211","1","4594917","","2011-01-04 11:45:16","0","3970","<p>I'm working with android project in which I want to rotate image along with touch to some fix pivot point. I have completed all these things but I am facing one problem: While I'm trying to rotate image the image bitmap is resized. I dont have any idea why it occurs. If somebody has then please give me an idea to help overcome this problem.</p><p>my code:</p><pre><code>package com.demo.rotation;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Matrix;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.ImageView;import android.widget.ImageView.ScaleType;public class temp  extends Activity{ImageView img1;float startX;float startX2 ;Bitmap source;Bitmap bitmap1 = null;double r;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    img1 = (ImageView) findViewById(R.id.img1);    img1.setOnTouchListener(img1TouchListener);    bitmap1 = BitmapFactory.decodeResource(getResources(), R.drawable.orsl_circle_transparent);}private OnTouchListener img1TouchListener = new OnTouchListener(){    @Override    public boolean onTouch(View v, MotionEvent event)    {        switch (event.getAction())        {            case MotionEvent.ACTION_MOVE:                Log.d(""MOVE"", ""1"");                if(source!=null)                 r = Math.atan2(event.getX() - source.getWidth(),                        (source.getHeight() / 2) - event.getY());                Log.i(""startX"" + event.getX(), ""startY"" + event.getY());                     rotate(r,bitmap1, img1);                     img1.setScaleType(ScaleType.CENTER);                break;            case MotionEvent.ACTION_DOWN:                break;            case MotionEvent.ACTION_UP:                break;            default :                break;        }        return true;    }};private void rotate(double r , Bitmap currentBitmap  ,ImageView imageView ){    int rotation = (int) Math.toDegrees(r);    Matrix matrix = new Matrix();    matrix.setRotate(rotation, currentBitmap.getWidth()/2, currentBitmap.getHeight()/2);    source = Bitmap.createBitmap(currentBitmap, 0, 0, currentBitmap.getWidth(), currentBitmap.getHeight(), matrix, false);    imageView.setImageBitmap(source);    Log.i(""HIGHT OF CURRENT BITMAP"", """"+source.getHeight());}}</code></pre>","501483","","319618","","2011-01-04 14:56:09","2011-07-19 14:07:43","Resize image while rotating image in android","<android>","3","0","1","",""
"4593246","1","","","2011-01-04 11:48:52","0","1922","<p>I am using flurry in my app, and I am new to that. I have some doubts.</p><p>My requirement is, In my main activity I will start a session, and calling onevent method in some activities. And I am not calling endSeesion method anywhere. I want to know when the FlurryAgent will hit the flurry site. </p><ol><li><p>So do I need to call endSession then where should I call that method?</p></li><li><p>How FlurryAgent maintains the session.</p></li><li><p>In case if I call like this</p><pre><code>FlurryAgent.onEndSession(this);FlurryAgent.onStartSession(this, Constants.FLURRY_API);        FlurryAgent.setLogEnabled(true);</code></pre><p>will it work like this - previous session will be closed and new session will be started.</p></li><li><p>I can track only http urls using fiddler, when I try to track https calls then its getting crashed, I have modified ssl settings in fiddler, I dont know how to configure my emulator.</p></li></ol><p>Thanks in Advance.</p>","262523","","262523","","2011-01-04 12:01:51","2011-02-28 15:54:02","Android : How to use flurry API","<android><flurry>","1","0","","",""
"4593251","1","4593280","","2011-01-04 11:49:46","0","149","<p>Any easy to make a simple linearlayout with a buncha textviews scrollable? Right now, the last textview gets cut off...</p><p>(I don't really wanna use a listview)</p>","479180","","","","","2011-01-04 11:53:31","linearlayout/textviews scrollable?","<android>","1","0","","",""
"4593275","1","4883186","","2011-01-04 11:52:57","6","4393","<p>This code for resuming download is not working properly in Aandroid, although it works fine in a Java application. Here I am trying to download a zip file, and it will resume the download, but the net result is an invalid zip file.</p><pre><code> BufferedInputStream in = null;        FileOutputStream fos = null;        BufferedOutputStream bout=null;        try {            downloaded=0;            HttpURLConnection connection = (HttpURLConnection) url.openConnection();            if(ISSUE_DOWNLOAD_STATUS.intValue()==ECMConstant.ECM_DOWNLOADING){                File file=new File(DESTINATION_PATH);                if(file.exists()){                    downloaded = (int) file.length();                }            }            connection.setRequestProperty(""Range"", ""bytes="" + downloaded + ""-"");            connection.connect();            size=connection.getContentLength();            Dialog.setMax(size);             in = new BufferedInputStream(connection.getInputStream());             fos=(downloaded==0)? new FileOutputStream(DESTINATION_PATH): new FileOutputStream(DESTINATION_PATH,true);             bout = new BufferedOutputStream(fos, 1024);            byte[] data = new byte[1024];            int x = 0;            while ((x = in.read(data, 0, 1024)) &gt;= 0) {                bout.write(data, 0, x);                 downloaded += x;                 System.out.println(downloaded);                 onProgressUpdate((int)(downloaded*100/size));            }            succes=true;        } catch (Exception e) {            e.printStackTrace();        } finally {            try {                in.close();                bout.close();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }</code></pre><p>Thanks.</p>","562431","","832136","","2012-01-18 16:00:13","2012-01-18 16:05:56","Resume Download not working in android","<android><resume-download>","2","2","4","",""
"4593350","1","","","2011-01-04 12:02:08","0","171","<p>I have got the Html response from the server that I have stored in a string variable named ""response"" Now I want to scan that string variable and take the selected tags from that string and add them to another string and display them.</p><p>Somebody told me about the string replacement but I don't have an idea.</p><p>Can anybody tell me how can I do that thing?</p><p>Thanks,david</p>","422859","","","","","2011-01-04 12:40:51","Replacing the Text of the Html Response received in android","<android><string><response><string-replacement>","2","0","","",""
"4593457","1","","","2011-01-04 12:15:50","1","989","<p>In an application I'm building, I'm trying to systematically change the font of every piece of text to a custom font.  Does anyone know whether it's possible to apply styles such as custom typefaces to the title of a dialog?</p><p>So far, I haven't been able to find a way, and so my best bet seems to be to use an AlertDialog, and just use a textview as my title in a layout that I inflate.  This is a bit long winded, so if there's a direct way to customise the style of the dialog's title, that would save some time!</p>","559861","","","","","2011-01-04 12:22:28","custom typeface for dialog's title","<android><dialog><typeface>","1","0","","",""
"4593510","1","","","2011-01-04 12:23:39","0","752","<p>I'm creating a game that is full screen. I'm using an image for the background and I'm drawing images on top of it. The background image looks great in all the devices, but I can't draw the overlay images in the same spot on all devices.</p><p>For example if I use</p><p><code>canvas.drawBitmap(overlay, 365, 85, paint);</code></p><p>It will align the image perfectly for phones that have 854px width. But anything lower then that it will be pushed way to the right.</p><p>I've tried playing around with dip but I can't seem to figure that out. Is there any where I can ensure that they items line up correctly on all resolutions? </p>","562537","","","","","2011-01-04 14:41:19","Display image in the same spot on multiple screens | Android","<android><screen><resolutions><drawbitmap>","2","1","","",""
"4593552","1","4593608","","2011-01-04 12:27:44","18","33717","<p>Is there a way to get/set media volume? I have tried the following:</p><pre><code>AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);int currentVolume = audio.getStreamVolume(AudioManager.STREAM_RING);</code></pre><p>but it returns the ringtone volume.</p>","517558","","267702","","2013-05-24 02:09:22","2014-02-10 21:35:54","How do you get/set media volume (not ringtone volume) in Android?","<android><get><media><volume><android-audiomanager>","7","1","7","",""
"4593610","1","","","2011-01-04 12:33:24","0","1497","<p>In my app,I have an edittext and a PopupWindow.I want to show the popup once the user starts editing the text. but when I show the popup, it graps the focus from the edittext, and the virtual keyboard is dismissed (and I want it shown).</p><p>I tried creating the popup as not focusable, but then I can't select it after it's shown.</p><p>I also tried changing the focus and selection attributes of both edittext and from code after and before the popup is shown, but if the popup is created as not focusable, I can't select it after it's shown.</p><p>Is there a way of displaying a selectable popup along with editing the edittext?</p>","554233","","","","","2011-12-14 07:23:14","Android PopupWindow window focus/selection","<android><focus><selection><edittext><popupwindow>","1","0","","",""
"4593689","1","4593765","","2011-01-04 12:42:14","0","246","<p>Looking for a bit of help with taking a dat from a DatePicker Widget and storing it in an sqlite database within the app. I have the following code:</p><pre><code>java.util.Date utilDate = null;            String y = Integer.toString(date.getDayOfMonth()) + ""/"" + (date.getMonth()+1) + ""/"" + Integer.toString(date.getYear());            SimpleDateFormat formatter = new SimpleDateFormat(""dd/MM/yyy"");            utilDate = formatter.parse(y);            java.sql.Date z = new java.sql.Date(utilDate.getDate());            x = z.toString();            Log.v(""The date: "", x);}</code></pre><p>Where date is the DatePicker widget. If I output the utilDate variable (i.e. the Java version of date) using logCat it seems to work fine and gives me a format like: Tue Jan 04 00:00:00 GMT 2011 which I am expecting but using the code above to get the sql version of the date, it always gives me the date 1970-01-01. I'm pretty sure the solution is very simple but I just can't see it.</p>","400406","","","","","2011-01-04 12:51:43","Help with dates in Android","<java><android><date>","1","1","","",""
"4593746","1","4594811","","2011-01-04 12:48:03","3","4240","<p>I've been trying to add some preferences to my app for a couple of weeks now</p><p>I really only need the checkbox feature.</p><p>I'm trying to control the visibility of a single radio button with the checking of a checkbox</p><p>Here is my Preferences.java</p><pre><code>import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.CheckBoxPreference;import android.preference.Preference;import android.preference.PreferenceActivity;import android.preference.PreferenceManager;import android.preference.Preference.OnPreferenceClickListener;import android.preference.Preference.OnPreferenceChangeListener;import android.widget.Button;import android.widget.CheckBox;import android.widget.CompoundButton;import android.widget.RadioButton;import android.widget.Toast;import android.widget.CompoundButton.OnCheckedChangeListener;import android.view.View;public class Preferences extends PreferenceActivity {private RadioButton btn01;@Overrideprotected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       addPreferencesFromResource(R.xml.prefs);       btn01 = (RadioButton)findViewById(R.id.RadioButton01);       Preference customPref = (Preference) findPreference(""customPref"");                      customPref.setOnPreferenceClickListener(new OnPreferenceClickListener(){                          public boolean onPreferenceClick(Preference preference) {                          Toast.makeText(getBaseContext(),                                                      ""The Custom Preference Has Been Clicked"",                                                      Toast.LENGTH_LONG).show();                          SharedPreferences customSharedPreference = getSharedPreferences(                                           ""myCutomSharedPrefs"", Activity.MODE_PRIVATE);                          SharedPreferences.Editor editor = customSharedPreference                                           .edit();                          editor.putString(""myCustomPref"",                                           ""The preference has been clicked"");                          editor.commit();                          return true;}                          public void CheckBox() {                          final CheckBox ThisCheckBox = (CheckBox) findViewById (R.id.checkboxPref);{                             ThisCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener(){                              public boolean OnCheckedChange (CompoundButton compoundButton) {                          if (ThisCheckBox.isChecked()){                           {                          btn01.setVisibility(0);                          }{                          btn01.setVisibility(2);                          }}                                    }                            ;});};}});}}</code></pre><p>Any way I'm pretty sure this is completely wrong and i get an error on this line</p><p>ThisCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener(){</p><p>any idea why? I think its to do with the way I've called the line above but whether I use final, boolean or void it still generates errors</p><p>this is the error message</p><p>The type new CompoundButton.OnCheckedChangeListener(){} must implement the inherited abstract method CompoundButton.OnCheckedChangeListener.onCheckedChanged(CompoundButton, boolean)</p><p>So I guess what i'm asking is</p><p>Am I doing the Preferences RightAnd how do I do the If else command properly?? </p>","562562","","562562","","2011-01-04 18:31:40","2011-01-05 21:27:08","if and else command in android preferences","<android><checkbox><if-statement><android-preferences>","2","2","","",""
"4593951","1","4594863","","2011-01-04 13:12:10","0","1616","<p>Does anyone know if it is possible to use NPOT textures on Android's OpenGL ES renderer?</p>","97688","","19679","","2011-01-04 18:19:03","2011-02-18 01:19:48","Can we use non-power-of-2 textures on OpenGL ES on Android?","<android><opengl-es>","2","0","","",""
"4594071","1","4594304","","2011-01-04 13:23:48","2","9095","<p>I would execute a command on my rooted Android 2.1 device</p><blockquote>  <p>String path = ""/data/data/com.android.providers.settings/databases/settings.db"";  Runtime.getRuntime().exec(""/system/bin/chmod -f 777 "" + path);</p></blockquote><p>But this command does nothing on the targeted file. Any idea?</p>","301132","","","","","2011-07-03 15:06:00","Android: how can execute a chmod on rooted devides","<android><root><chmod>","3","0","1","",""
"4594076","1","4594420","","2011-01-04 13:24:25","0","880","<p>I want to create application in android in which i can listen music to the other side person...for that i have written code..in that code ....when phone state goes to OFFHOOK mode music start automatic....but there is problem with that.....music start even though phone has not been recived....means when phone is dialing....at the same time music start....i want music should start when the other side of person  receive call.......</p><p>thanks.....</p>","533863","","","","","2011-01-04 13:59:59","Listen Music when the other side person recive my call","<android><android-sdk-2.2>","1","0","","",""
"4594105","1","","","2011-01-04 13:28:00","0","138","<p>Is it possible to read the particular tags form the entire html response with different tags by using the Bufferreader so that the data or say content of that tags only can be taken to a different string and displayed by setText on the TextView object?</p><p>If it is possible than how to do that ultimately?</p><p>Thanks,david</p>","422859","","","","","2011-01-04 13:28:00","Reading the tags from the whole html response in android","<android><buffer><response>","0","4","","",""
"4594107","1","5155668","","2011-01-04 13:28:02","1","431","<p>I'm currently working with <a href=""https://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">Facebook official SDK for Android</a>.</p><p>I'm playing around with the advanced example app right now and I don't see how to make it get the applications wall/stream/status instead of the user that logged in.</p><p>Is this possible and how in that case?</p>","525016","","102703","","2011-01-04 14:51:26","2011-03-01 14:15:10","Facebook android, get application stream - Android","<android><facebook><facebook-android-sdk>","1","0","","",""
"4594256","1","4594343","","2011-01-04 13:43:28","1","1886","<p>I am using tabs in my application.  </p><p>I have 3 tabs : home, services, contact us.</p><p>In the 'home tab', there is 'login button' and my requirement is when I click the login button, it should display the view for 'login' in the same tab itself. That means it should start another activity (login.class) and display corresponding view (login.xml). And the tabs should be displayed at the top as before.</p><p>But when I click the login button, it should start login activity, but the tabs are disappeared.</p><p>How can I start an activity in the same tab itself?</p>","523058","","244296","","2011-02-16 14:18:44","2011-02-16 14:18:44","How to start an activity in a tab?","<android><tabs>","2","0","","",""
"4594426","1","8123927","","2011-01-04 14:01:04","6","2374","<p>The new Youtube app, and the newer version of JuiceDefender, contains a sliding tabbed layout similar to those seen in Windows 7 Phone. This is a UI feature I would like to include in an app I'm am designing but I cannot find any information or tutorials online. Has anyone seen a tutorial on this? </p>","308474","","","","","2013-01-07 16:27:47","Youtube style sliding Tab Layout in Android App","<android><android-layout>","3","0","2","",""
"4594503","1","4594624","","2011-01-04 14:09:33","1","654","<p>Is there any way to find out if the user has checked the 'Unknown Sources' checkbox in the 'Application settings' menu?</p>","264276","","","","","2013-04-06 07:28:37","Android: Anyway to know if 'Unknown Sources' is checked?","<android><application-settings>","2","0","1","",""
"4594510","1","4594606","","2011-01-04 14:10:00","0","314","<p>I am new to Andriod, I have n of TextView inside the GridView, which comes with its own scroller, I need a method which tell whether a particular View in the GridView is Visible in the View Port?</p>","562656","","","","","2011-01-04 14:22:10","Grid View Scroller","<android><gridview><scroller>","1","0","","",""
"4594572","1","","","2011-01-04 14:17:54","4","150","<p>I'm beginning to look into Android programming.</p><p>When developing a mobile application, are there other options besides using the SDK to develop a native application?</p><p>For instance, is it possible to develop an application using only web technologies?</p><p>If so, what is your experience on the different techniques (limitations, etc)?</p><p>Thanks</p>","131640","","131640","","2011-01-04 14:41:40","2011-01-05 00:40:06","Android Application Building Alternatives","<android>","3","4","2","",""
"4594612","1","4594766","","2011-01-04 14:23:08","2","149","<p>This is my first question here so let me know if I'm doing things wrong!</p><p>I am building an Android application with Eclipse and am reading QR codes with the barcode reader. This is all working just fine, however, sometimes there are 'special case' barcodes that contain a 'reward' for the user.</p><p>This 'reward' is contained in a specially formatted string, this string COULD be tampered with by people who intend to cheat the system. This isn't a huge issue but I have implimented steps to prevent it, now my question is... How secure are these steps?</p><p>Here are two examples of the strings:</p><pre><code>***Code-v1.0:31c8f90a4050:1001:0:C:1337***Code-v1.0:6a9c4e8d92da:1002:C4D23A1B:C:1337</code></pre><p>The strings are formatted like so:</p><pre><code>***Code-v1.0:HASH:CODE_ID:REDEEM_ONCE:CODE_ACTION:ARG(REDEEM_ONCE has 3 possible values)</code></pre><p>My hashing system work like so:</p><pre><code>salt = ""************:***""; // didnt think it wise to post this, but the length is                           //  the same and its alphanumericMD5 = salt . "":"" . codeParts[2] . codeParts[5] . codeParts[4] . "":"" . codeParts[3] . "":"";MD5 .= codeParts[4] . codeParts[3] . "":"" . codeParts[5] . codeParts[2];</code></pre><p>Is this a secure way of doing this, the code cannot seem to be tampered without affecting the hash, but surely hashes can colide and if somebody worked out the hashing scheme it all becomes pointless (this is a little less of a risk of just 'finding' it as it's on the server side, but if somebody figures it out).</p><p>What are your thoughts?</p>","562663","","","","","2011-01-04 14:40:49","Is my method of ensuring the integrity of a string secure?","<android><security><md5><barcode><hashes>","1","2","","",""
"4594635","1","4594709","","2011-01-04 14:25:34","7","3912","<p>I would like some help in sending data backwards to an <code>Activity</code> that is already running.</p><p>I want the user to be able to select an option from a list and then that selection be used in a previous activity. I know how to do it going forward using intents but can't see how that would work in this case without having an arbitrary number of the same activity windows running at the same time.</p><p>Sort of like changing the settings within the phone but more having access to a string. If you need any more information just ask.</p>","400406","","119895","","2011-01-04 14:35:08","2011-01-04 14:35:08","Send data backwards to a previous activity","<android><activity><android-intent>","4","0","1","",""
"4594777","1","4594865","","2011-01-04 14:42:03","0","4195","<p>I am having some problems with an alertdialog box. I have a listview containing some strings and when i click the box, it shows an alert dialog box giving the option to book or cancel (its a taxi app). I am trying to get it so the name of the item chosen shows in the alert dialog box. But everytime i try it comes up showing random letters and numbers. Ill post my code as it might make it easier to understand:</p><p>Code below -</p><pre><code>public class TaxiMain extends ListActivity {/** Called when the activity is first created.  * @return */class Taxi {    private String taxiName;    private String taxiAddress;    public String getName() {        return taxiName;    }    public void setName(String name) {        taxiName = name;    }    public String getAddress() {        return taxiAddress;    }    public void setAddress(String address) {        taxiAddress = address;    }    public Taxi(String name, String address) {        taxiName = name;        taxiAddress = address;    }}public class TaxiAdapter extends ArrayAdapter&lt;Taxi&gt; {    private ArrayList&lt;Taxi&gt; items;    private TaxiViewHolder taxiHolder;    private class TaxiViewHolder {        TextView name;        TextView address;     }    public TaxiAdapter(Context context, int tvResId, ArrayList&lt;Taxi&gt; items) {        super(context, tvResId, items);        this.items = items;    }    @Override    public View getView(int pos, View convertView, ViewGroup parent) {        View v = convertView;        if (v == null) {            LayoutInflater vi = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.taxi_list_item, null);            taxiHolder = new TaxiViewHolder();            taxiHolder.name = (TextView)v.findViewById(R.id.taxi_name);            taxiHolder.address = (TextView)v.findViewById(R.id.taxi_address);            v.setTag(taxiHolder);        } else taxiHolder = (TaxiViewHolder)v.getTag();         Taxi taxi = items.get(pos);        if (taxi != null) {            taxiHolder.name.setText(taxi.getName());            taxiHolder.address.setText(taxi.getAddress());        }        return v;    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final String[] taxiNames = getResources().getStringArray(R.array.taxi_name_array);    final String[] taxiAddresses = getResources().getStringArray(R.array.taxi_address_array);    ArrayList&lt;Taxi&gt; taxiList = new ArrayList&lt;Taxi&gt;();    for (int i = 0; i &lt; taxiNames.length; i++) {        taxiList.add(new Taxi(taxiNames[i], taxiAddresses[i]));    }    setListAdapter(new TaxiAdapter(this, R.layout.taxi_list_item, taxiList));      final ListView lv = getListView();    lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, final int position, long id)        {               final int selectedPosition = position;            AlertDialog.Builder adb=new AlertDialog.Builder(TaxiMain.this);              adb.setTitle(""Taxi Booking"");             adb.setMessage(""You Have Selected: ""+taxiNames);              adb.setPositiveButton(""Book"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(TaxiMain.this, Booking.class);                     intent.putExtra(""booking"",  taxiNames[selectedPosition]);                     intent.putExtra(""address"",  taxiAddresses[selectedPosition]);                     startActivity(intent);                 }             });             adb.setNegativeButton(""Cancel"", null);              adb.show();         }     });</code></pre><p>You'll see at the bottom of the code, theres the line that wont work properly. - </p><pre><code>adb.setMessage(""You Have Selected: ""+taxiNames);</code></pre><p>If anyone can help into seeing why this wont show would be of great help.</p><p>Thanks</p>","560679","","35060","","2011-01-04 14:46:01","2011-01-04 14:50:04","Alert dialog in listview from selected item","<android><listview><alertdialog>","2","0","","",""
"4594836","1","4650082","","2011-01-04 14:48:06","7","15666","<p>i'm wrapping a native API to Android by NDK.</p><p>But when building it don't find the header files.</p><p>I have the following structure.</p><p>project/jni</p><p>Android.mk</p><pre><code>LOCAL_PATH := $(call my-dir)include $(call all-subdir-makefiles)LOCAL_PATH :=/home/marcos/dev/workspace/rmsdk.native.wraper/jniinclude $(CLEAR_VARS)LOCAL_LDLIBS := -llogLOCAL_MODULE    := ndk1LOCAL_SRC_FILES := native.c DelegateDRMProcessorClient.cppLOCAL_STATIC_LIBRARY := adept cryptopenssl dp expat fonts hobbes jpeg mschema png t3 xml zlibinclude $(BUILD_SHARED_LIBRARY)</code></pre><p>project/jni/prereqs/</p><p>Android.mk (Used to call all subdirs Android.mk files)</p><pre><code>LOCAL_PATH := $(call my-dir)include $(call all-subdir-makefiles)include $(CLEAR_VARS)</code></pre><p>project/jni/prereqs/%lib%/</p><p>Android.mk</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE    :=dpLOCAL_SRC_FILES :=libdp.aLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/includeinclude $(PREBUILT_STATIC_LIBRARY)</code></pre><p>And there's a include folder on each %lib% folder.</p><p>When using ndk-build I get a""/home/marcos/dev/workspace/rmsdk.native.wraper/jni/DelegateDRMProcessorClient.h:18:20: error: dp_all.h: No such file or directory""</p><p>Anyone knows how to include these header to be available to the compiler?</p>","558433","","","","","2013-05-16 20:37:07","Unable to find header files - Android NDK","<android><android-ndk>","3","3","5","",""
"4594952","1","","","2011-01-04 14:57:09","11","21461","<p>Hi friends i wanna to generate Key hash to incorporate FaceBook Application in my Apps.. I am having Open SSL Zip. pl guide me how to generate key.. </p>","561368","","","","","2014-01-06 09:16:35","Android Key Hash","<android>","5","2","6","",""
"4594996","1","4595070","","2011-01-04 15:01:19","6","11202","<p>When I run my app on the debugger, I get the main thread and 3 binder threads.</p><p>On a button click I call <strong>Activity.finish()</strong>, which looks like it ends the activity as the UI closes and goes back to the home screen.</p><p>However, in the debugger, it still shows the main thread and 3 binder threads as ""<em>(running)</em>"".</p><p>I am baffled to why this is happening. Even more so, it is causing my app to call <strong>Activity.onResume()</strong> when I run it again after exiting the app.</p><p>I currently override these methods in the Activity, but I call the appropriate super functions in each one:</p><ul><li>onDestroy()</li><li>onPause()</li><li>onResume()</li><li>onSaveInstanceState()</li></ul><p>Any help or advice regarding this is much appreciated!</p>","253704","","1702557","","2012-09-27 07:45:31","2012-09-27 07:45:31","Activity.finish() called but activity stays loaded in memory","<android><android-activity><android-lifecycle>","1","2","1","",""
"4595025","1","5521716","","2011-01-04 15:04:15","1","11021","<p>I am a new beginner in android, so please tell me how to finish an activity in Android. I have already done one project. In this project, the previous activity was also working. So please tell me how to finish that activity when the next activity starts briefly. </p><p>Thanks in advance</p>","745367","","2371339","","2013-07-31 20:26:10","2013-07-31 20:26:10","how to use the finish() method in android","<android>","2","2","","2013-08-01 08:30:36",""
"4595066","1","","","2011-01-04 15:08:48","3","220","<p>After reading another question, explaing to allow apps2sd I should change my android target to 2.2, keep minsdk at 4 and add installpref to manifest - this works great. However I noticed after uploading this update that my sales dropped, and free downloads. My brother in japan can no longer see my app! My question is - how can I keep my app on the international market, and use froyos SDK?</p><p>working link:<a href=""http://www.androidblip.com/android-games/wheelz-2d-physics-platformer-90018.html"" rel=""nofollow"">http://www.androidblip.com/android-games/wheelz-2d-physics-platformer-90018.html</a></p><p>broken on appbrain:<a href=""http://www.appbrain.com/app/wheel-2d-physics-platformer/com.chozabu.android.BikeGame"" rel=""nofollow"">http://www.appbrain.com/app/wheel-2d-physics-platformer/com.chozabu.android.BikeGame</a></p><p>Extra information!I uploaded copy of my game - where the only change is to return SDK to 1.6<a href=""http://www.appbrain.com/app/wheelz-international-trials/com.chozabu.android.BikeGameBeta"" rel=""nofollow"">http://www.appbrain.com/app/wheelz-international-trials/com.chozabu.android.BikeGameBeta</a>it shows up on appbrainz!Thanks</p>","445831","","445831","","2011-01-04 23:31:23","2011-01-11 03:39:04","cupcake to FroYo marketplace problems (app not shown to some people - or listed on appbrain)","<android><google-play><android-2.2-froyo>","1","1","3","",""
"4595077","1","4595152","","2011-01-04 15:10:06","1","1338","<p>Is there a way to call a method in one class from another class.   I could have say 5 classes and more than one may want to perform the same operation.   So can I have one file (class??) with these common methods and call into that?   If so what is the necessary modifier for these 'common' methods - public, final??</p><p>If anyone can point me to a suitable tutorial I would be grateful - in this instance I havent had much useful from GoogleThanksRon</p>","538847","","","","","2011-01-04 15:33:14","calling methods between classes","<java><android>","4","3","","",""
"4595099","1","4595301","","2011-01-04 15:12:05","1","3601","<p>I want to get my coordinates every minute, even if a user is not moving. So i used requestLocationUpdates with the following parameters:</p><pre><code>  locMgr.requestLocationUpdates(                    LocationManager.GPS_PROVIDER,                    60000,      // minTime in ms                    0,      // minDistance in meters                    PosljiLokacijo.this);</code></pre><p>But when i test it on my HTC Hero (2.1 Android) and i am not moving, onLocationChanged() is never called. If i change minDistance to 1, then i get a few updates at start but after that, they come in very unregular intervals. </p><p>How should i choose these 2 parameters (minTime and minDistance) to receive coordinates every minute?</p>","324417","","","","","2011-01-04 15:28:40","How to get gps coordinates every minute in Android?","<java><android><gps>","2","0","3","",""
"4595170","1","","","2011-01-04 15:17:03","2","368","<p>I have been doing some android basic projects for one of my client. Now I have to develop an application for him in android which will be a slideshow. I have done using this using viewFlipper and everything is perfect till now. Now my client wants to add animation in each slide, but these animations will be totally different for each slide (although they will be basic alpha, scale and rotate animations). So I am confused what's the best way to achieve this? One way is to create xml for each animation and apply on each imageview or create animation function for each imageview. But that seems more and more work for even a simple fadein for imageview bcoz imageview will be at different position on each slide.</p><p>I wish if there were a Tweener kind of thing (like in actionscript in flash) where I could define just properties for that imageview and create animation by just one line of code.</p><p>Or is there any easy way to achieve this. Will be really grateful if you can help.</p><p>Thanks in Advance.</p>","115403","","","","","2012-07-26 06:08:43","Best Way to Handle a Rich Animation in Android","<android><animation>","1","0","","",""
"4595217","1","4595546","","2011-01-04 15:21:14","1","509","<p>From the <a href=""http://developer.android.com/sdk/ndk/index.html"" rel=""nofollow"">official NDK site</a>:</p><blockquote>  <p>The Android NDK... provides  headers and libraries that allow you  to build <strong>activities, handle user  input, use hardware sensors, access  application resources, and more</strong>,  when programming in C or C++. If you  write native code, your applications  are still packaged into an .apk file  and they still run inside of a virtual  machine on the device. The fundamental  Android application model does not  change.</p></blockquote><p>Yet, it is always described as a <strong>companion</strong> tool to the Android SDK and as a toolset that allows to ""implement <strong>parts</strong> of your applications using native-code languages such as C and C++"".</p><p>My understanding from this is that, unlike the Java based SDK, the NDK is not designed to implement certain parts of an Android application.</p><p>Is this correct?</p><p>If so, what parts <strong>doesn't</strong> the NDK allow implementing?</p>","418055","","","","","2011-01-21 15:41:04","What can't the NDK be used for?","<c++><android><android-ndk>","2","0","0","",""
"4595224","1","","","2011-01-04 15:22:02","0","730","<p>Actually i m using PHP based webservice to get json. its working fine. Returning me the result(String)</p>   <pre>Array  (    [error] => 0    [response] => Array        (            [error] => You have successfully logged in.        ))</pre><p>I dont know what to do after this..i want to parse it to get the response.</p><p>Please help me..what should be the next steps..</p>","383597","","9453","","2011-01-04 16:00:37","2011-05-29 07:01:59","Android json parsing","<php><android><web-services><json>","1","4","1","",""
"4595242","1","4595433","","2011-01-04 15:23:31","0","1980","<p>Is there a way to dynamically set the icon displayed on a default alertDialog box without needing to create a custom one? For example, i would like for the following alertDialog, the method setIcon() to display the image i provide using a uri variable with a path stored inside.</p><pre><code>private void showProductInfo(){    MyProduct myProduct= (MyProduct) myProductGoldenRetriever();    final AlertDialog alertDialog = new AlertDialog.Builder(this).create();    alertDialog.setTitle(""Product Information"");    alertDialog.setMessage(myProduct.getMyProductInfo());    alertDialog.setButton(""Back"", new DialogInterface.OnClickListener() {       @Override        public void onClick(DialogInterface dialog, int which) {           showPrompt();       }    });    alertDialog.setIcon(R.drawable.default_img);//&lt;--Here Need to Provide a different image each time    alertDialog.show();}//endOfShowProductInfo</code></pre><p>Is this somehow possible or do i need to create a custom alertDialog using an appropriate .xml layout file?  </p>","485328","","485328","","2011-01-04 15:36:07","2011-01-04 15:40:04","Dynamical use of setIcon() on default alertDialogs?","<android><icons><set><uri><alertdialog>","1","0","2","",""
"4595334","1","4595449","","2011-01-04 15:30:38","23","16195","<p>Is it possible to get the amount of free memory on an Android device (not on the SD CARD) via the Android SDK?</p><p>If so, how?</p>","97688","","815724","","2013-06-29 07:43:35","2013-06-29 07:43:35","Get free space on internal memory","<android>","5","0","12","",""
"4595492","1","","","2011-01-04 15:46:09","0","121","<p>I am developing one GPS based application. in that i given few default values to user those are phone number which will used to make a phone call. and server address which is used to sent the location data to server.. In this I got 2 major and critical problems..</p><p>1) I have hide that default values in regular menu and that should display when user presses some key or combination of keys then only it should display.</p><p>2)When ever the Default phone number and server address is changed at provider side that should be updated at user side that should happen through SMS from a specific number in a encrypted format by accepting that SMS those values has to change</p><p>Please Any body knows about these things help which are very very very useful to me</p><p>Thanks for reading</p>","546107","","","","","2011-01-04 18:53:30","How to update the settings Through SMS","<android><android-emulator>","1","0","","",""
"4595522","1","4596427","","2011-01-04 15:49:03","10","9199","<p>I have implemented a locationlistener in my app which uses the Network Provider.</p><p>This all works fine because i want a location quickly and with GPS Provider it takes ages.</p><p>But I've come to a point in my app where location has to be accurate (max 5-10meters).</p><p>I was wondering if it's possible to use the GPS provider with the Network Provider at the same time and then get the best result of both?And is it also possible to let me know when the GPS provider provided me with an GPS Location?</p><p>So basically:</p><pre><code>LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);</code></pre><p>Will this work with the same overridden onLocationChanged() ?</p><p>And how can I see if the GPS has gotten a Location?</p><p>Thanks,</p>","517460","","","","","2012-12-13 17:33:43","Use GPS and Network Provider at the same time in Android","<android><geolocation><gps><location>","2","0","7","",""
"4595587","1","4595632","","2011-01-04 15:55:16","0","832","<p>To put some context, my game has been developped for android 1.5. So it was using the lowest resolution by default on any android phones. Which was great, game was running fast and all.</p><p>Now I added support for scoreloop which required my game to support android 1.6. When I runned the game I realized everything got smaller since I used unit dimension without looking at the screen density. </p><p>Now that I fixed sizing. I realize that my game seems a bit choppy. I believe that redrawing on the new screen resolution is the problem.</p><p>I draw my game in a Canvas in a SurfaceView. How can I make it faster? I use default functions like drawCircle, drawLine... I believe reducing the screen resolution should help since I don't need high screen resolution. I just don't know how or if it's possible. </p><p>Or may be doing my drawing in opengl would solve the problem too.</p>","54606","","452723","","2011-01-04 16:59:41","2011-01-04 16:59:41","Android Surface and ScreenResolution","<android><canvas><screen><pixel><surface>","1","0","","",""
"4595803","1","4595865","","2011-01-04 16:15:08","0","231","<p>What is the easiest way to upgrade an application that was installed on the OS? I cannot delete this application from Setting->Application List - ""Uninstall"" option is unselectable.</p><p>BTW: I have changed a few things on androidmanifest.xml, like added more activities, changed the start up(launch/main) activity. The package is the same. I have updated version name and code. </p><p>When I try to download a new version of the application, the OS installs TWO applications with the same name. Of course I want the previous to be replaced by the new one.</p>","562804","","881229","","2014-01-23 02:05:20","2014-01-23 02:05:20","Cannot uninstall old OS installed application and upgrade to a new version on Android","<android>","2","0","","",""
"4595854","1","","","2011-01-04 16:21:15","0","2603","<p>I have know core java, I want to develop android apps, in few sites I saw apps in XML in few Java.Which is best and easy to use Java or XML?</p>","497421","","","","","2011-03-15 14:18:35","Which is best, Java or Xml for developing android apps","<android><xml>","3","0","1","",""
"4595938","1","4595967","","2011-01-04 16:30:11","2","247","<p>I have a list view with some items in it and I would like to know how to add extra information to the side of this? I have a photoshopped example below of what I mean, it's difficult to describe without an image or I would have used google to try and find the answer myself. I want it with the extra text on the right hand side, i've seen it done easily within the iPhone but i'm a bit stuck with android. Thanks.</p><p><img src=""http://i.stack.imgur.com/QX38k.jpg"" alt=""alt text""></p>","400406","","","","","2011-01-04 16:33:54","Extra information within a ListView","<android><listview>","1","0","","",""
"4596091","1","5172498","","2011-01-04 16:46:32","0","783","<p>I am the beginner to the android, I done some application in android and successfully run them.<br>I wrote the application, now the problem is ,whenever I run the project ,in console window it shows the error message like:</p><pre><code>[2011-01-04 22:00:47 - Emulator] unknown option: -sdcardC:\Android\sdcard[2011-01-04 22:00:47 - Emulator] please use -help for a list of valid options"".</code></pre><p>help me to fix this problem.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     try{        rl= new URL(""http://www.androidbook.com/akc/filestorage/android/documentfiles/3389/movie.mp4"");        File file = new File(""movie.mp4"");        URLConnection ucon = url.openConnection();        InputStream is = ucon.getInputStream();    }catch(Exception e) {        e.printStackTrace();    }}</code></pre>","562743","","617750","","2011-03-02 18:33:28","2011-03-02 19:40:40","Emulator launching Error","<android><android-emulator>","1","0","0","",""
"4596104","1","4596144","","2011-01-04 16:48:05","0","955","<p>I have a textview and a nine-patch image. Assigning this image in the xml editor to the tag ""background"" works as desired. Now I want to set this image dynamically in the coding, I thought</p><pre><code>myTextView.setBackgroundDrawable(mydrawable);</code></pre><p>would be the right thing to do. My png is in res/drawable. The API says that mydrawable needs to be an object of type drawable</p><pre><code> R.drawable.myninepatch</code></pre><p>is of type int. So my problem is that I have to convert from that int to a drawable somehow. Then I thought I can use a constructor</p><pre><code>NinePatchDrawable mydrawable = new NinePatchDrawable();</code></pre><p>But I am again not able to construct such an object. Anyone an idea?</p><p>Thanks.</p>","481493","","","","","2014-03-28 07:19:51","background picture for textview","<android><background><textview><nine-patch>","3","0","","",""
"4596352","1","4610727","","2011-01-04 17:09:37","3","1901","<p>The description for the method <a href=""http://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis%28%29"" rel=""nofollow"">uptimeMillis</a> says:  </p><blockquote>  <p>Returns milliseconds since boot, not  counting time spent in deep sleep.  <strong>Note:</strong> This value may get reset  occasionally (before it would  otherwise wrap around).</p></blockquote><p>How often might this happen and (more importantly) will it affect runnables that should be executed by <a href=""http://developer.android.com/reference/android/os/Handler.html#postAtTime%28java.lang.Runnable,%20long%29"" rel=""nofollow"">Handler.postAtTime</a>?</p>","31207","","1003511","","2013-06-18 03:18:30","2013-06-18 03:18:30","How often will uptimeMillis() reset and will it affect Handler.postAtTime","<android><timer><handler><uptime>","3","0","1","",""
"4596368","1","","","2011-01-04 17:10:59","8","3499","<p>I am building a mobile application that has some realtime constraints. Therefore I turn to stackoverflow to get advices &amp; opinions and attempt to decide which is the best solution to update the state of the application while running:</p><ol><li>rely on long-polling or direct connection to my server</li><li>rely on Apple Push Notification Service and Android C2DM</li></ol><p>Beyond the fact that APNS and C2DM provide a unified interface to push notification while the application is running or not, one can say that a custom solution (based on long-polling or a direct connection) is more flexible and less dependent on the latency of Apple &amp; Android queues.</p><p>As far as I can see, I think most of the debate stems from the cost comparison of how much battery it consumes to keep a connection opened compared to opening a connection on a smartphone. </p><p>I am therefore particularly interested in two things:</p><ul><li>Experiences with APNS and C2DM </li><li>Details on all the implications of keeping a TCP connection open on a smartphone.</li></ul><p>References welcome! Thanks!</p>","560971","","","","","2011-01-04 17:49:38","Long-polling vs Apple Push Notification Service & Android C2DM","<android><ios><apple-push-notifications><long-polling><android-c2dm>","1","0","3","2011-08-24 17:30:32",""
"4596445","1","7262129","","2011-01-04 17:17:55","13","9788","<p>My eclipse workspace has just one android project in it and is set to ""build automatically"".  Every time I make a change to some code, and save the change, the workspace builds.  Initially this is fine, but at some point the builds start to take about 5 seconds for every change.  At this point, I create a new workspace and import the project, and everything works great for a while (days or weeks), but inevitably it slows down again.  Has anyone else experienced this and/or have a solution?</p>","426493","","","","","2014-02-14 19:01:27","Android: eclipse workspace takes a long time to build?","<android><eclipse>","4","5","5","",""
"4596515","1","4598378","","2011-01-04 17:25:27","0","485","<p>I am new to android. So I request you to be patient with me. I am trying to write an application where on pressing a button the contacts API is opened. Then the user chooses the contact. Then I want to get the chosen contact in ""onAcitvityResult(int reqcode, int rescode, Intent data)"". Is there a way to do this without getting the Uri and querying for it through the whole database?This is my code where the second activity starts:</p><pre><code>public void onClick(View v) {            Log.d(TAG, ""contact button clicked"");            Toast.makeText(ctx, ""Contact button clicked"",                    Toast.LENGTH_SHORT).show();            Intent contacts = new Intent(Intent.ACTION_GET_CONTENT,Contacts.CONTENT_URI);            contacts.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);            startActivityForResult(contacts,1);        }</code></pre><p>Am I correct in using ""Contacts.CONTENT_URI"" and ""Intent.ACTION_GET_CONTENT""?</p><p>Is the intent I am using correct? I get the feeling that I should include email specifics here.</p><p>And this is where I deal with the result from activity:    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);        String email=""""; long id;        if (requestCode == 1) {            if (resultCode == Activity.RESULT_OK) {</p><pre><code>            // get the contact ID            Uri contacturi= data.getData();            Cursor c= getContentResolver().query(contacturi,null,null,null,null);            id = c.getLong(c.getColumnIndex(ContactsContract.Contacts._ID));            c.close();            // get the data package containing the email address for the contact            c=getContentResolver().query(ContactsContract.Data.CONTENT_URI,                    new String[]{Email.DATA1},                     ContactsContract.Data.CONTACT_ID + ""=? AND "" + Email.MIMETYPE + ""=?"",                    new String[]{String.valueOf(id), Email.CONTENT_ITEM_TYPE}, null);            email=c.getString(c.getColumnIndex(Email.DATA1));            Log.d(TAG, ""email is"" + email);        }    }    else {        Log.d(TAG, ""requestCode is not 1"");    }    EditText ctext= (EditText) findViewById(R.id.contacttxt);    ctext.append(email);    Log.d(TAG, ""onActivityResult() ends"");}</code></pre><p>I am getting a runtime exception saying that ""failure delivering result"".Should I include some setResult() method?? Thank you in advance.</p>","556167","","556167","","2011-01-04 17:54:11","2011-01-04 21:01:41","android email address getting and storing and displaying","<android><email><contactscontract>","1","5","","",""
"4596806","1","4597143","","2011-01-04 18:03:15","0","368","<p>I don't want to do something user don't want to, so if user has checked that he don't want to have any background data transfer (general sync settings) but in my application he has checked in prefs that he want from my application to do some background data transfer i want to show him some Warning Message and let him go (directly) from this point to general sync settings screen so he could change it. Is this possible?</p>","441130","","","","","2011-01-04 18:40:59","How to show user ""General Sync Settings"" screen from my Android App?","<android>","1","0","0","",""
"4596863","1","4597605","","2011-01-04 18:09:56","0","3298","<p>I have a grid view (http://developer.android.com/resources/tutorials/views/hello-gridview.html).Can i animate these images, like moving up,down,left right. Think those images are balls and i want to animate those balls.</p><p>Thank you all.</p>","478700","","478700","","2011-01-11 14:26:44","2011-01-11 14:26:44","Animating GridView in android","<android><gridview><animation>","1","0","1","",""
"4596901","1","4597975","","2011-01-04 18:13:18","0","1670","<p>I have an application that I suspect might be leaking a thread or its context. What makes me think so is that after closing the app, the process is still running (visible process monitoring applications). I've cut everything in the code, going as far as calling finish() from the onCreate. The process is still around and annoying me.</p><p>I've read that (from <a href=""http://developer.android.com/guide/topics/fundamentals.html"" rel=""nofollow"">here</a>)</p><blockquote>  <p>An empty process is one that doesn't hold any active application components. The only reason to keep such a process around is as a cache to improve startup time the next time a component needs to run in it. The system often kills these processes in order to balance overall system resources between process caches and the underlying kernel caches.</p></blockquote><p>How do I know if my process is still around because of circular reference or context leak or anything else equally bad or if is simply that the process is empty?</p>","3610","","","","","2013-06-27 11:01:33","Application Process still around after app is closed","<android>","3","0","","",""
"4597003","1","4597147","","2011-01-04 18:26:49","2","1519","<p>I would like to know if my given Context object is from Activity, Service or Application. Or in other words if my code is executing in background or in foreground. (By foreground i mean Activity code and threads that have been created by Activity.)</p>","441130","","","","","2011-01-04 18:41:32","How to distinguish if given Context object is an Activity or a Service Context?","<android>","1","2","1","",""
"4597216","1","4597285","","2011-01-04 18:50:48","10","3327","<p>I'm making an android app and since I've just started I want to try get the most organised code/resources. In my strings.xml file so far I have this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string name=""app_name""&gt;GameController&lt;/string&gt;&lt;string name=""stop""&gt;Stop&lt;/string&gt;&lt;string name=""start""&gt;Start&lt;/string&gt;&lt;string name=""preferences""&gt;Preferences&lt;/string&gt;&lt;string name=""back""&gt;Back&lt;/string&gt;&lt;/resources&gt;</code></pre><p>All of the strings except app_name are used in an options menu. But since I will be adding much more strings I was thinking that it might be better to do something like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string name=""app_name""&gt;GameController&lt;/string&gt;&lt;string name=""menu_stop""&gt;Stop&lt;/string&gt;&lt;string name=""menu_start""&gt;Start&lt;/string&gt;&lt;string name=""menu_preferences""&gt;Preferences&lt;/string&gt;&lt;string name=""menu_back""&gt;Back&lt;/string&gt;&lt;/resources&gt;</code></pre><p>Is it the best way or should I use another system?</p>","336983","","80766","","2013-06-08 01:08:16","2014-04-07 17:30:11","Organizing Strings.xml","<android><xml><string><organization>","2","0","","",""
"4597389","1","4597622","","2011-01-04 19:10:25","0","540","<p>Hey I want to know what is the class that implement the ListView in CallLog. I mean I have all this package <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree</a></p><p>But I dont know what class in this package implements the CallLog activity, the list of recent callings. </p><p>Thanks;</p>","399459","","","","","2011-01-04 19:37:42","What is the class that implement the CallLog ListView in android source code?","<android><android-widget><android-layout>","1","0","","",""
"4597497","1","4598437","","2011-01-04 19:22:10","1","2666","<p>I'm trying to build my first application which pretty much creates a list from an XML file on the net. as soon as i click on a list item it should open another activity and access another online generated XML file with the details for the item.ive managed to get the list working aswell as the 2nd activity window with the details. the only thing thats left to do is to pass the id from one activity to another.is there a way to store the ID of each entry in the list items? im not using a local SQLite db or anything, so i need to find a way to do this ""on the fly"" if possiblethanks in advance</p>","563020","","244296","","2011-01-04 20:12:47","2011-10-08 10:58:03","Hidden field in ListView to pass a variable","<android><variables><listview><activity><android-intent>","2","0","","",""
"4597513","1","4597546","","2011-01-04 19:23:38","3","8007","<p>Is there any kind of onPress and onRelease for android buttons like in flash?  </p>","336983","","375874","","2011-01-04 19:28:46","2013-09-12 11:32:26","onPress/onRelease in Android","<android>","5","0","","",""
"4597690","1","4598737","","2011-01-04 19:45:21","76","108323","<p>Can someone get a simple example of updating textfield every second or so?Thanks.</p><p>i want to make flying ball and need to calculate ball`s coordinates every second, thats why i need some sort of timer/</p><p>i dont get anything from here <a href=""http://android-developers.blogspot.com/2007/11/stitch-in-time.html"">http://android-developers.blogspot.com/2007/11/stitch-in-time.html</a></p>","563047","","","","","2013-12-02 22:09:08","Android timer? How?","<android><timer>","11","1","49","",""
"4597749","1","4597851","","2011-01-04 19:53:01","6","18893","<p>I open <b>Notepad</b> (Windows) and write</p><pre><code>Some lines with special charactersSpecial: Ždšcc</code></pre><p>and go to <b>Save As...</b> ""someFile.txt"" with <b>Encoding</b> set to <b>UTF-8</b>.</p><p>In Java I have</p><pre><code>FileInputStream fis = new FileInputStream(new File(""someFile.txt""));InputStreamReader isr = new InputStreamReader(fis, ""UTF-8"");BufferedReader in = new BufferedReader(isr);String line;while((line = in.readLine()) != null) {                             printLine(line);}in.close();</code></pre><p>But I get question marks and similar ""special"" characters. Why?</p><p><b>EDIT:</b> I have this input (one line in .txt file)</p><pre><code>665,Ždšcc</code></pre><p>and this code</p><pre><code>                    FileInputStream fis = new FileInputStream(new File(fileName));                    InputStreamReader isr = new InputStreamReader(fis, ""UTF-8"");                    BufferedReader in = new BufferedReader(isr);                    String line;                    while((line = in.readLine()) != null) {                        Toast.makeText(mContext, line, Toast.LENGTH_LONG).show();                        Pattern p = Pattern.compile("","");                        String[] article = p.split(line);                        Toast.makeText(mContext, article[0], Toast.LENGTH_LONG).show();                        Toast.makeText(mContext, Integer.parseInt(article[0]), Toast.LENGTH_LONG).show();                    }                    in.close();</code></pre><p>And <b>Toast</b> output (for ones who aren't familiar with Android, Toast is just a method to show a pop-up on screen with particular text in it) is fine. Console shows ""weird characters"" (probably because of encoding in console window). But it fails at parsing an integer because console says this (warning: toast output is just fine) - <a href=""http://slike.hr/slike/snag0022_f3402.jpg.html"" rel=""nofollow"">Problem?</a></p><p>Like String is containing some ""weird"" characters which Toast can't show/render but when I try to parse it, it crashes. Suggestions?</p><p>If I put ANSI in NotePad it works (integer parsing) and there is no weird chars as in the picture above, but of course my special characters aren't working.</p>","455268","","455268","","2011-01-04 21:03:01","2012-03-01 11:59:26","Read/write .txt file with special characters","<java><android><eclipse><file-io><character-encoding>","5","4","1","",""
"4597957","1","4598940","","2011-01-04 20:13:44","4","886","<p>What is the difference between <a href=""http://developer.android.com/reference/android/graphics/Canvas.html"" rel=""nofollow"">Canvas</a> and OpenGL for doing 2D graphics with Android? </p><p>Does Canvas use OpenGL in the background?  Are there cases where OpenGL might be slower than Canvas?</p>","459904","","44729","","2011-01-04 21:15:46","2011-01-04 22:03:36","Android 2D graphics programming","<android><opengl-es>","1","0","","",""
"4598020","1","4598127","","2011-01-04 20:18:53","0","612","<p>I want the EditText to fill all the available space to the right side until the button placed on the right of it. I'm using RelativeLayout to construct such a view. But in result I don't have my button visible, the only EditText. Please advice how to make both of them visible.</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;RelativeLayout   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:padding=""10dp""&gt;  &lt;EditText   android:id=""@+id/edit_text""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:hint=""Task description""&gt;  &lt;/EditText&gt; &lt;Button   android:id=""@+id/ok_button""   android:layout_width=""wrap_content""      android:layout_height=""wrap_content""   android:text=""OK""   android:layout_toRightOf=""@id/edit_text""&gt;  &lt;/Button&gt;       &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","397991","","","","","2011-01-04 20:30:25","Placing two view in one row using RelativeLayout","<android>","1","0","1","",""
"4598404","1","4895948","","2011-01-04 21:04:26","1","2614","<p>I am developing an app that uses some custom classes as members.I have implemented serialization/de-serialization in the onSaveInstanceState and onRestoreInstanceState methods. </p><p>It all works fine when rotating the screen (app is destroyed and re-created) and my objects are restored. However, when pressing the home button, the app crashes in the onPause method (which I have not modified)...</p><p>Any clue as to what's happening?</p><p>Here's a code sample that reproduces the issue</p><pre><code>import java.io.Serializable;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class InvestigateError extends Activity {    private static final String LOG_TAG = ""MYERROR"";    protected ShowInfo myShowInfo;    protected class ShowInfo implements Serializable    {        private static final long serialVersionUID = 1L;        public String title;    }    public void populateMembers()    {        myShowInfo = new ShowInfo();        myShowInfo.title = ""Was I serialized???"";    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        if(savedInstanceState == null)            populateMembers();        Log.d(LOG_TAG,""Activity created"");    }    /* Save members */    @Override    public void onSaveInstanceState(Bundle outState) {        Log.d(LOG_TAG,""__ SAVEINSTANCE __"");        outState.putSerializable(""myshowInfo"", myShowInfo);        super.onSaveInstanceState(outState);        }    /* Restore members */    @Override    public void onRestoreInstanceState(Bundle savedInstanceState) {        super.onRestoreInstanceState(savedInstanceState);        Log.d(LOG_TAG,""__ RECALLINSTANCE __"");        myShowInfo = (ShowInfo) savedInstanceState.getSerializable(""myshowInfo"");        Log.d(LOG_TAG,""string from object: "" + myShowInfo.title);    }    @Override    protected void onDestroy() {        Log.d(LOG_TAG,""__ DESTROY __"");        super.onDestroy();    }    @Override    protected void onPause() {        Log.d(LOG_TAG,""__ PAUSE __"");        super.onPause();    }    @Override    protected void onStop() {        Log.d(LOG_TAG,""__ STOP __"");        super.onStop();    }}</code></pre><p>Here's the beginning of the stack trace</p><blockquote>  <p>java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.esquared.InvestigateError.InvestigateError$ShowInfo)</p>    <blockquote>    <p>at android.os.Parcel.writeSerializable(Parcel.java:1160)</p>        <p>at ndroid.os.Parcel.writeValue(Parcel.java:1114)</p>        <p>at android.os.Parcel.writeMapInternal(Parcel.java:479)</p>        <p>...</p>  </blockquote></blockquote>","525623","","","","","2011-02-07 08:22:28","Android: Fatal Exception (NotSerializableException) when quitting an activity that serializes objects in onSave/onRecall ","<android><exception><serialization>","1","5","1","",""
"4598418","1","","","2011-01-04 21:06:11","0","788","<p>I have a small piece of code which is basically supposed to make a phone call when a button is pushed. I looked it up online and all the sources basically gave the same code. But for some reason this code doesn't work. It makes the app crash but the LogCat doesn't display anything (meaning the log is completely blank). I should also mention that in my manifest file I did add the following permission      </p><pre><code>&lt;uses-permission android:name = ""andriod.permission.CALL_PHONE"" /&gt;</code></pre><p>The code I have is as follows. Any help would be greatly appreciated!</p><pre><code>phoneButton.setOnClickListener(new OnClickListener () {            public void onClick(View v) {                try {                final Intent callIntent = new Intent(Intent.ACTION_CALL);                callIntent.setData(Uri.parse(""tel:232131232""));                ContactUs.this.startActivity(callIntent);                }catch (ActivityNotFoundException e){                    Log.e(""Dialing"", ""call Failed!"", e);                }            }                   });</code></pre>","563139","","2847","","2011-01-04 21:09:09","2011-12-15 08:35:53","Correct way of invoking a phone call from within the app in android","<android><android-manifest><android-logcat>","3","5","","",""
"4598461","1","","","2011-01-04 21:12:08","2","76","<p>I have a question about the android virtual device(avd)... as what you already know, that you can test your android application through avd in eclipse, and i'm getting a boring repeted thing with that.</p><p>each time I want to test my application and when I make a small change to my application, I have to run the avd again and wait for a long time till the application run(switch the device on and wait for the system to boot and then wait for the application to start,this takes approx. 15 sec)... as I said, each time I make whatever change to the program I have to go through these boaring time consuming loop :( ...</p><p>So, is there is a way to avoid these issue, and makes the avd run only for the first time and any changes can take effect quickly and only needed to restart the application without needed to stop and run the project again ??</p><p>I hope there is a way for that...</p><p>Thanks alot...</p>","408389","","408389","","2011-01-24 19:48:25","2011-02-01 21:03:13","a compilling issue using the android virtual device ","<java><android>","3","1","","",""
"4598467","1","4598513","","2011-01-04 21:12:26","0","758","<p>When I used to program for the iphone, I used a program called AppViz to track my sales and whatnot. Is there anything similar to it for android besides using google checkout?</p>","507007","","","","","2013-04-23 18:02:27","Android third party program for tracking app sales?","<android><third-party><sales>","3","3","1","2013-11-04 18:34:10",""
"4598518","1","4599254","","2011-01-04 21:17:34","1","87","<p>I have an application with a simple layout that contains a few buttons. When running the application on ""plain"" android (a G1 with 1.6) the buttons look like they do elsewhere on the phone (grey gradients). They also look more or less the same on Sony Ericsson X10 Mini Pro (with 2.1), but the buttons in other applications on the X10 Mini (eg dialer, pin code input) looks very different (transparent).</p><p>Is it possible to somehow make sure that the buttons and other form input elements use the platform (for lack of a better word) styling across different Android devices?</p>","17542","","","","","2011-01-04 22:48:15","How can I use the platform specific styling on the Android platform?","<android><android-widget>","1","2","1","",""
"4598528","1","4598900","","2011-01-04 21:18:51","1","1096","<p>Im creating a very basic Android App. All it does is renders a mobile site into a WebView. Nothing else to it...</p><p>When I'm testing the links and such I run into a problem when trying to ""Like"" an article through Facebook. What happens is it redirects me to login...then once I login it does nothing. I go back to my Android App and view the site and it does not register that I've ""Liked"" the article. </p><p>If im logged in prior to ""Like"" the article it still will not mark is as liked on the mobile site. I do verify that I am logged into Facebook but its as if my App cannot read the cookies. </p><p>Has anyone had this problem, if so, do you have a fix/workaround?</p><p>Thanks</p>","477918","","21234","","2011-01-04 21:47:45","2011-01-04 21:59:30","Android WebView with Facebook Like functionality","<android><android-webview><facebook-like>","1","0","","",""
"4598652","1","4598861","","2011-01-04 21:32:53","0","142","<p>Greetings Fellow Coders!</p><p>I want to implement a pinch a zoom function in one of my apps, my problem is that this is only supported by Android 2.2 and most but not all of my user base is 2.1.  So my question is, can I implement this feature without causing incompatibility with 2.1?</p><p>I look forward to your always helpful responses.</p><p>-Mitchell</p>","445342","","","","","2011-01-04 21:55:41","Android Cross Version Features","<android><zoom><fragmentation><pinch>","1","5","","",""
"4598707","1","","","2011-01-04 21:39:02","0","199","<p>Lets say I have 2 activities:</p><ul><li>A: A ListView displaying articles titles. Data is fetched from a web server and converted from XML to a list of ArticleSummary. Only user titles and id are returned by the server. Click on a title starts activity B.</li><li>B: A form to edit an article. Article is fetched from server. When the user hits OK, modifications are sent to the server and activity closed.</li></ul><p>When the user go back to activity A, I would like to update the article title without any additional web request.</p><p>I was thinking about the following solution:</p><ol><li>When article is modified, send a broadcast event with article id and new attributes values.</li><li>Listen for this event on activity A</li><li>Update the ArticleSummary object</li><li>notify data changed on ListView</li></ol><p>Is there a better approach ?</p>","508194","","244296","","2011-01-04 21:45:55","2011-01-04 22:11:19","Update model objects across different activities","<android><architecture>","2","0","","",""
"4598769","1","4599124","","2011-01-04 21:47:00","8","6094","<p>How do I get a list of Apps that have been installed by the user on an Android device. <br/>I am using the following piece of code at the moment:</p><pre><code>List&lt;PackageInfo&gt; packs = getPackageManager().getInstalledPackages(0);</code></pre><p>but it returns Apps that have been installed by the both device manufacturer and me. How to I limit it so that only the apps that I installed are returned?</p>","406930","","406930","","2011-01-04 22:07:34","2014-03-26 20:18:46","List of user installed apps","<android>","4","0","4","",""
"4598822","1","","","2011-01-04 21:51:26","3","2100","<p>the traditional way of doing a camera preview background with OpenGL on the front is to take two SurfaceViews(one for the camera another for OpenGL) and stack them on top of each other.The problem is that stacking SurfaceViews is discouraged:</p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/4850fe5c314a3dc6"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/4850fe5c314a3dc6</a></p><p>So what alternatives are there? I was considering the following:</p><ol><li>Subclass GlSurfaceView, and then call set the Camera preview onto the holder of this subclass: Camera.setPreviewDisplay(mHolder);</li><li>Don't use GLSurfaceView, instead create your own SurfaceView subclass where you display the Camera preview onto the holder and also draw your openGL. This would require to use OpenGL without GLSurfaceView, has anyone done this before?</li></ol><p>I'm not sure if this even is possible or makes sense, since it implies displaying the camera preview onto the holder of the surface and at the same time drawing OpenGL on the same surface.Is there any other sensible alternative to solving the problem without using two SurfaceViews?</p><p>Thanks!</p>","480894","","44729","","2011-01-04 23:22:20","2013-09-13 12:17:06","Alternative approach to OpenGL View on top of Camera","<android><opengl-es><camera><android-camera>","3","4","1","",""
"4598866","1","4598916","","2011-01-04 21:56:09","0","1088","<p>I currently have a listview showing a couple of string arrays. I was wondering if anyone knew if it was possible to add a button to a row in a listview so that when clicked, it loads up the map screen?</p><p>My code for the class is follows -</p><pre><code>class Taxi {    private String taxiName;    private String taxiAddress;    private String taxiDist;    public String getName() {        return taxiName;    }    public void setName(String name) {        taxiName = name;    }    public String getAddress() {        return taxiAddress;    }    public void setAddress(String address) {        taxiAddress = address;    }    public String getDist() {        return taxiDist;    }    public void setDist(String dist){        taxiDist = dist;    }    public Taxi(String name, String address, String dist) {        taxiName = name;        taxiAddress = address;        taxiDist = dist;    }}public class TaxiAdapter extends ArrayAdapter&lt;Taxi&gt; {    private ArrayList&lt;Taxi&gt; items;    private TaxiViewHolder taxiHolder;    private class TaxiViewHolder {        TextView name;        TextView address;         TextView dist;    }    public TaxiAdapter(Context context, int tvResId, ArrayList&lt;Taxi&gt; items) {        super(context, tvResId, items);        this.items = items;    }    @Override    public View getView(int pos, View convertView, ViewGroup parent) {        View v = convertView;        if (v == null) {            LayoutInflater vi = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.taxi_list_item, null);            taxiHolder = new TaxiViewHolder();            taxiHolder.name = (TextView)v.findViewById(R.id.taxi_name);            taxiHolder.address = (TextView)v.findViewById(R.id.taxi_address);            taxiHolder.dist = (TextView)v.findViewById(R.id.taxi_dist);            v.setTag(taxiHolder);        } else taxiHolder = (TaxiViewHolder)v.getTag();         Taxi taxi = items.get(pos);        if (taxi != null) {            taxiHolder.name.setText(taxi.getName());            taxiHolder.address.setText(taxi.getAddress());            taxiHolder.dist.setText(taxi.getDist());        }        return v;    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.listtaxi);    final String[] taxiNames = getResources().getStringArray(R.array.taxi_name_array);    final String[] taxiAddresses = getResources().getStringArray(R.array.taxi_address_array);    final String[] taxiDist = getResources().getStringArray(R.array.taxi_array_dist);    ArrayList&lt;Taxi&gt; taxiList = new ArrayList&lt;Taxi&gt;();    for (int i = 0; i &lt; taxiNames.length; i++) {        taxiList.add(new Taxi(taxiNames[i], taxiAddresses[i], taxiDist[i]));    }    setListAdapter(new TaxiAdapter(this, R.layout.taxi_list_item, taxiList));      final ListView lv = getListView();    lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, final int position, long id)        {                   final int selectedPosition = position;            AlertDialog.Builder adb=new AlertDialog.Builder(ListTaxi.this);              adb.setTitle(""Taxi Booking"");             adb.setMessage(""You Have Selected: ""+taxiNames[selectedPosition]);              adb.setPositiveButton(""Book"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(ListTaxi.this, Booking.class);                     intent.putExtra(""booking"",  taxiNames[selectedPosition]);                     intent.putExtra(""address"",  taxiAddresses[selectedPosition]);                     intent.putExtra(""distance"", taxiDist[selectedPosition]);                     startActivity(intent);                 }             });             adb.setNegativeButton(""Cancel"", null);              adb.show();         }     });}</code></pre><p>}</p><p>Been trying this all night and have not successfully found a way to accomplish this with my setup</p><p>Any ideas or hints would be awesome!</p><p>Thanks Everyone</p>","560679","","","","","2011-01-04 22:01:13","Android - Adding button to a listview to show MapView","<android><google-maps><listview><button>","1","0","","",""
"4598873","1","4598993","","2011-01-04 21:57:20","6","11834","<p>I have a simple class to try and wrap encryption for use elsewhere in my program. </p><pre><code>import java.security.SecureRandom;import javax.crypto.Cipher;import javax.crypto.KeyGenerator;import javax.crypto.spec.SecretKeySpec;public final class StupidSimpleEncrypter{    public static String encrypt(String key, String plaintext)    {        byte[] keyBytes = key.getBytes();        byte[] plaintextBytes = plaintext.getBytes();        byte[] ciphertextBytes = encrypt(keyBytes, plaintextBytes);        return new String(ciphertextBytes);    }    public static byte[] encrypt(byte[] key, byte[] plaintext)    {        try        {            Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS5Padding"");            SecretKeySpec spec = new SecretKeySpec(getRawKey(key), ""AES"");            cipher.init(Cipher.ENCRYPT_MODE, spec);            return cipher.doFinal(plaintext);        }        catch(Exception e)        {            // some sort of problem, return null because we can't encrypt it.            Utility.writeError(e);            return null;        }    }    public static String decrypt(String key, String ciphertext)    {        byte[] keyBytes = key.getBytes();        byte[] ciphertextBytes = ciphertext.getBytes();        byte[] plaintextBytes = decrypt(keyBytes, ciphertextBytes);        return new String(plaintextBytes);    }    public static byte[] decrypt(byte[] key, byte[] ciphertext)    {        try        {            Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS5Padding"");            SecretKeySpec spec = new SecretKeySpec(getRawKey(key), ""AES"");            cipher.init(Cipher.DECRYPT_MODE, spec);            return cipher.doFinal(ciphertext);        }        catch(Exception e)        {            // some sort of problem, return null because we can't encrypt it.            Utility.writeError(e);            return null;        }    }    private static byte[] getRawKey(byte[] key)    {        try        {            KeyGenerator gen = KeyGenerator.getInstance(""AES"");            SecureRandom rand = SecureRandom.getInstance(""SHA1PRNG"");            rand.setSeed(key);            gen.init(256, rand);            return gen.generateKey().getEncoded();        }        catch(Exception e)        {            return null;        }    }}</code></pre><p>It seems to handle encryption correctly, but not so much when decrypting, which throws a javax.crypto.IllegalBlockSizeException ""last block incomplete in decryption"" at the highlighted line. Here is the stack trace:</p><pre>Location:com.xxxxxx.android.StupidSimpleEncrypter.decrypt ln:49last block incomplete in decryptionjavax.crypto.IllegalBlockSizeException: last block incomplete in decryption     at org.bouncycastle.jce.provider.JCEBlockCipher.engineDoFinal(JCEBlockCipher.java:711)     at javax.crypto.Cipher.doFinal(Cipher.java:1090)     at com.xxxxxx.android.StupidSimpleEncrypter.decrypt(StupidSimpleEncrypter.java:44)     at com.xxxxxx.android.StupidSimpleEncrypter.decrypt(StupidSimpleEncrypter.java:34)</pre><p>I have done a good amount of banging my head against my desk to try and figure this out, but if I get anywhere at all, it ends up being a different exception. I also can't seem to find much by searching.</p><p>What am I missing? I would appreciate any help.</p>","101318","","101318","","2011-01-05 14:55:10","2014-01-10 09:49:52","How to handle ""last block incomplete in decryption""","<android><encryption><aes>","5","0","","",""
"4599061","1","4599155","","2011-01-04 22:19:38","7","9009","<p>Alright...I have this .txt file (UTF-8)</p><pre><code>4661,SOMETHING,3858884120607,24,24.094659,SOMETHING1,3858884120621,24,15.954660,SOMETHING2,3858884120614,24,19.58</code></pre><p>And this code</p><pre><code>FileInputStream fis = new FileInputStream(new File(someTextFile.txt));InputStreamReader isr = new InputStreamReader(fis, ""UTF-8"");BufferedReader in = new BufferedReader(isr);int i = 0;String line;while((line = in.readLine()) != null) {Pattern p = Pattern.compile("","");String[] article = p.split(line);// I don't know why but when a first line starts with// an integer - article[0] (which in .txt file is 4661)// becomes someWeirdCharacter4661 so I need to trim it// *weird character is like |=&gt;|if (i == 0) {    StringBuffer articleCode = new StringBuffer(article[0]);    articleCode.deleteCharAt(0);    article[0] = articleCode.toString();}SomeArticle**.addOrChange(mContext, Integer.parseInt(article[0]), article[1], article[2], Integer.parseInt(article[3]), Double.parseDouble(article[4]));i++;}</code></pre><p>On <b>emulator it's fine</b> but on real device (HTC Desire) I get this (weird) error:</p><pre><code>E/AndroidRuntime(16422): java.lang.NumberFormatException: unable to parse '4661' as integer</code></pre><p><b>What's the problem?</b></p><p>** it's just some my class which needs those parameters as input (context,int,string,string,int,double)</p>","455268","","","","","2013-08-20 21:17:07","Unable to parse as integer","<android><readfile><parseint>","4","0","2","",""
"4599087","1","4599823","","2011-01-04 22:23:40","2","1235","<p>I need to detect if a wifi network that lacks any WPA or WEP protection is actually a usable wifi hotspot with internet access.  In other words I need to discern between standard free hotspots and things like T-mobile hotspots which are unsecured networks but require logging in via a browser window.</p><p>I thought about sending a ping to our servers and checking the response, but if the ping was successful how do know for sure that they haven't just logged in already (e.g. in this scenario if they had a T-mobile account and previously logged in).</p><p>Its an android app if that matters.</p>","435281","","","","","2011-01-05 00:28:25","Detect if unsecured wifi network actually has internet access","<android><security><wifi><dhcp><wep>","3","2","1","",""
"4599106","1","4599121","","2011-01-04 22:25:57","0","374","<p>I've noticed that classes that subclass android classes don't require having a constructor and calling the constructor of the superclass. Why is that? I thought all classes except pojo's needed a constructor?</p>","186359","","19750","","2011-01-04 22:59:11","2011-01-04 22:59:11","Why do subclasses of android classes not require calling of super-constructor?","<java><android>","2","0","1","",""
"4599257","1","4599291","","2011-01-04 22:48:42","0","521","<p>Hy!!</p><p>If i want to add a textview and a textedit, both are in the same line</p><p>I have a Linear 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""    &gt;    &lt;TextView         android:text=""@+id/TextView01""         android:id=""@+id/TextView01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        /&gt;    &lt;EditText         android:text=""@+id/EditText01""         android:id=""@+id/EditText01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>What i have made wrong?</p>","547995","","321697","","2011-01-04 22:53:36","2011-01-04 22:53:36","Layout Drawer doesn't add new view in a new line","<android>","1","0","","",""
"4599296","1","","","2011-01-04 22:52:45","0","561","<p>I've writing a application on Android which calls a .Net restful wcf web service I've written.  I'm successfully obtaining XML and String results, but cannot call a method on the web service which returns a byte[] - it looks like its encoding is alerted.  </p><p>I am using the org.apache.http.HttpHost library and an currently reading the byte[] as a string (the encoding in eclipse looks like unicode);</p><pre><code>     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();        String asciiString = str.toString();</code></pre><p>Basically I want to convert the data held in asciiString to a Bitmap (the WCF service outputs a byte[] of a PNG image)</p><p>If anyone can offer pointers as what I am doing wrong or how to do this (if it is possible) it would be most welcome.</p><p>Many thanks</p>","563246","","","","","2011-01-04 23:37:11","Calling a web service to obtain an byte[] in Android","<java><android><web-services>","1","0","","",""
"4599362","1","","","2011-01-04 23:03:04","0","1857","<p>I have an app that inserts calendar events into Android calendars using the provider <code>content://com.android.calendar/events</code> (for Android 2.2, else it is <code>content://calendar/events</code>).</p><p>This works fine usually, and on my Nexus One the events are added and synced correctly up to Google Calendar.</p><p>On the Galaxy S however, new events added to a Google Account calendar appear correctly on the phone, but do not sync back to Google Calendar.  Even after forcing a sync to occur in phone settings, the new event does not appear in Google Calendar (viewed from the web).  </p><p>Whereas on the same phone a new event added to the same Google calendar using the built-in Samsung calendar app does get synced up to Google Calendar.</p><p>Does anyone know how I can get the new events to sync to Google from a Galaxy S?</p><p>Some code: my actual inserts are done like this:</p><pre><code>Builder b = ContentProviderOperation.newInsert(""content://com.android.calendar/events"").withValues(values);ops.add(b.build());    getContentResolver().applyBatch(""com.android.calendar"", ops);</code></pre><p>This is similar to how the stock Android calendar app does inserts, as seen in the AOSP <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git;a=blob_plain;f=src/com/android/calendar/EditEvent.java;hb=HEAD"" rel=""nofollow"">EditEvent</a> class.</p>","391377","","","","","2011-01-11 09:30:40","Calendar insert on Galaxy S not syncing to Google Calendar","<android><calendar><galaxy>","2","1","","",""
"4599397","1","4644765","","2011-01-04 23:08:07","0","264","<p>this probably is a popular question so sorry if I'm asking the obvious but I couldn't find an answer. Basically I've got a ListActivity which is being populated by LinearLayout which has many Views in it. I just want the bars to be clickable and selectable as at the moment they do not respond to clicks. Thanks.</p><p>                                                                                                                </p>","561498","","","","","2011-01-10 08:05:30","How to make a ListActivity item with many Views in inside clickable","<android><click><listactivity>","2","0","","",""
"4599421","1","4627105","","2011-01-04 23:13:49","0","1364","<p><br>I have a problem with C2DM service. Given that there is more than one Google account loged on the device I would like my application to choose one of these accounts to register to C2DM with (You know using preferences). Is it possible?</p><p>Thanks in advance</p>","532968","","","","","2011-01-07 15:27:54","Choosing Google account for Android C2DM","<android><android-c2dm>","2","0","","",""
"4599434","1","4600025","","2011-01-04 23:16:49","0","1235","<p>So I'm loading images into Android Gallery from SD card. I hit menu and then select and it's inserted into Gallery via code below. Problem is after about 5 or 6 images I get a out of memory error 01-04 18:10:35.246: ERROR/AndroidRuntime(10220): java.lang.OutOfMemoryError: bitmap size exceeds VM budget Any ideas on what I can do to resolve this?</p><pre><code>public class ImageAdapter extends BaseAdapter{      int mGalleryItemBackground;      public ImageAdapter(Context c)  {             mContext = c;             TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);        mGalleryItemBackground = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);        typArray.recycle();    }      public int getCount(){          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.setImageURI(mUrls[position]);         i.setScaleType(ImageView.ScaleType.FIT_XY);          i.setLayoutParams(new Gallery.LayoutParams(120, 120));          return i;      }         private Context mContext;      }     </code></pre>","427377","","215266","","2013-03-27 01:37:18","2013-03-27 01:37:18","Android Java Gallery out of memory error","<java><android><gallery>","2","2","","",""
"4599435","1","4604047","","2011-01-04 23:16:57","0","265","<p>I have adapted lesson six of insantydesign's android examples (<a href=""http://insanitydesign.com/wp/projects/nehe-android-ports/"" rel=""nofollow"">http://insanitydesign.com/wp/projects/nehe-android-ports/</a>) to work for a 2d square and the texture is displaying fine but I also have other (non textured) shapes drawn on screen and the texture from the square ""spills over"" to them.</p><p>In my on surface created method I have the line    squaretexture.loadGLTexture(gl, this.context);which I think may be the problem. </p><p>My question is where should I put this line in order to fix my problem?</p>","560571","","","","","2011-01-05 12:38:25","Texture spill over android open gl es","<android><opengl-es><textures>","1","2","","",""
"4599438","1","4599678","","2011-01-04 23:17:25","2","2758","<p>My app sent home this stack trace which seems as though something very wrong is going on under the hood.</p><p>phone_model=SKY IM-A630K, android_version=2.1-update1</p><p><code>java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10089 nor current process has android.permission.READ_PHONE_STATE.</p><pre><code>   at android.os.Parcel.readException(Parcel.java:1218)   at android.os.Parcel.readException(Parcel.java:1206)   at com.android.internal.telephony.IPhoneSubInfo$Stub$Proxy.getLine1Number(IPhoneSubInfo.java:223)   at android.telephony.TelephonyManager.getLine1Number(TelephonyManager.java:764)   at android.telephony.SmsManager.sendTextMessage(SmsManager.java:129)   at android.telephony.SmsManager.sendTextMessage(SmsManager.java:108)   at com.emergency.button.SMSSender.safeSendSMS(SMSSender.java:91)   at com.emergency.button.EmergencyActivity$EmergencyThread.sendSMS(EmergencyActivity.java:294)   at com.emergency.button.EmergencyActivity$EmergencyThread.sendMessages(EmergencyActivity.java:386)   at com.emergency.button.EmergencyActivity$EmergencyThread.run(EmergencyActivity.java:266)</code></pre><p></code></p><p>So should I just catch any and all exceptions around sendTextMessage? Who's fault is this?</p>","177498","","","","","2011-01-04 23:59:36","Why would sendTextMessage require READ_PHONE_STATE permission?","<android><permissions><sms>","1","0","","",""
"4599476","1","","","2011-01-04 23:23:35","1","915","<p>I've got an AsyncTask doing a post after some user interactions the post is statistical data, not user input. I want to make sure the data gets onto the web sever otherwise retry. What are the best practices for retrying? Which errors are retryable and which require notifying the user before retrying? (connection timeout for example means no network connection?)</p><p>Should I queue and on every post attempt I make send any previously failed queue'd data?</p><p>The code which came from online somewhere:</p><pre><code>    HttpParams params = new BasicHttpParams();    params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(mParent.getUrl());    try {        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        HttpResponse response = httpclient.execute(httppost);        HttpEntity resEntity = response.getEntity();        String resp = EntityUtils.toString(resEntity);        return resp.trim();    } catch (ClientProtocolException e) {        Log.e(LOG_TAG, ""There was a protocol issue Try again later"");    } catch (IOException e) {        Log.e(LOG_TAG, ""There was an IO issue Try again later"");       e.printStackTrace();    }</code></pre><p>Additional exceptions to handle from <a href=""http://stackoverflow.com/questions/3993732/http-get-and-post-method-exceptions-in-android"">Http Get and Post method exceptions in android?</a> </p><p>UnsupportedEncodingException<BR>NullPointerException<BR>ClientProtocolException<BR>ConnectTimeoutException</p>","317033","","","","","2011-01-04 23:23:35","Android - Http post verification best practices","<android><http><post>","0","0","","",""
"4599520","1","4600214","","2011-01-04 23:30:57","4","2447","<p>android allows me to launch an intent to create a new contact. i can put extras into the intent to pre-fill the new contact fields. </p><pre><code>Intent intent = new Intent(Intent.ACTION_INSERT);intent.setType(ContactsContract.Contacts.CONTENT_TYPE);intent.putExtra(ContactsContract.Intents.Insert.NAME, ""Foo Bar"");intent.putExtra(ContactsContract.Intents.Insert.PHONE, ""(408) 555-1212"");intent.putExtra(ContactsContract.Intents.Insert.EMAIL, ""foo.bar@foobar.com"");startActivityForResult(intent, INSERT_CONTACT_REQUEST);</code></pre><p>this works, but i don't see how to handle multiple types of a given field, say phone number. in the intent, i can put extra a phone number, and i can put extra a phone number type, but how do i put extra an <strong>additional</strong> phone number, with a different (or perhaps even the same) type?</p>","337455","","","","","2013-04-12 10:38:03","insert contact intent, multiple phone / email / etc types?","<android><android-contacts>","1","0","","",""
"4599567","1","4600085","","2011-01-04 23:37:12","5","6773","<p>i'm wondering if there's a clean way to import a vcard as an android contact. i have a vcard parser, but mapping each possible vcard field and field type is going to be a painful, bug-prone exercise. is there a better way?</p><p>an android contact looks suspiciously like a vcard, so i suspect they use vcards internally. there's no public API for this however.</p>","337455","","","","","2011-09-28 19:31:16","android vcard string to contact","<android><vcard><android-contacts>","2","0","6","",""
"4599619","1","4608361","","2011-01-04 23:47:59","5","5390","<p>I have a AsyncTask that runs and does its job and completes. onPostExecute does what its supposed to do and all is good.  BUT the task is still running on the debug window in Eclipse.  Every time I run the task I get a new one.  So its not re-using the task I guess.  </p><p>Has anyone seen this before?</p>","528130","","","","","2012-04-14 18:46:24","Java Android AsyncTask - When does AsyncTask stop running?","<android><android-asynctask>","4","0","1","",""
"4599675","1","4599753","","2011-01-04 23:59:25","0","213","<p>In my app, there is a dialog that lets the user select an item. When the ok button is pressed the app should dial a number associated with the item. I'm able to get the items to show up in the dialog and the app knows that they're options, but I'm having trouble figuring out how to make the app process which was chosen and then dial the number.Here's what I've got so far</p><pre><code> final CharSequence[] item = {""item1"", ""item2"", ""item3"", ""item4""};         AlertDialog.Builder ab=new AlertDialog.Builder(crossingActivity.this);   ab.setTitle(""Which item?"");   ab.setSingleChoiceItems(item, -1, new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int whichButton) {             }         })         .setPositiveButton(""Call"", new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int whichButton) {                  if item = ""item1""? android.intent.action.DIALtel:""number1"";              if item = ""item2""? android.intent.action.DIALtel:""number2"";              if item = ""item3""? android.intent.action.DIALtel:""number3"";              if item = ""item4""? android.intent.action.DIALtel:""number4"";</code></pre><p>The dialog box opens and allows you to select an item, and that's where I'm stuck.Eclipse gives me an error on all of the ""if""s that says, ""syntax error on token ""if"", invalid type. I think I'm just starting it wrong and I just don't know how to start it right.</p>","446875","","234039","","2011-01-05 00:07:35","2011-01-05 21:08:48","How to tell app what to do after an item is selected from a dialog?","<java><android><eclipse>","2","0","","",""
"4599743","1","","","2011-01-05 00:11:21","4","1194","<p>I see a backdrop being added to my launch icon on the Samsung Galaxy S devices. I need this backdrop changed to a custom backdrop which we created. I know this can be changed since apps like""Daily Briefing"" have their own cloud like backdrop making the launch icon look really rich. If anyone does know how to change this backdrop please let me know.  </p><blockquote>  <p>Take a look at the Icon for <strong>DAILY  BRIEFING</strong>. You can notice the cloud backdrop for DAILY BRIEFING.   I would like to control the  Icon backdrop and if possible the size  of the Icon Eg. See difference between  the size of <strong>GOOD</strong> and <strong>YAHOOMAIL</strong></p></blockquote><p><img src=""http://i.stack.imgur.com/1w9yB.png"" alt=""alt text""></p><p>Thanks in advance.Appreciate your help.</p>","324446","","324446","","2011-01-05 21:24:10","2011-01-05 21:24:10","Icon backdrop on Samsung Galaxy S? how to change this?","<android><icons><launcher>","1","2","3","",""
"4599786","1","10145943","","2011-01-05 00:17:23","8","3370","<p>Ok so I asked this yesterday:</p><p><a href=""http://stackoverflow.com/questions/4590384/autolink-mentions-in-a-twitter-client"">AutoLink @mentions in a twitter client</a></p><p>I got my @mentions linking correctly. But in order to get it to work I had to take android:autoLink=""web"" out my xml for the TextView. So now I get links to @mentions but it no longer links URLs. I tried doing two seperate Linkify.addLinks() calls like this:</p><pre><code>mentionFilter = new TransformFilter() {    public final String transformUrl(final Matcher match, String url) {        return match.group(1);    }};// Match @mentions and capture just the username portion of the text.//pattern = Pattern.compile(""@([A-Za-z0-9_-]+)"");pattern = Pattern.compile(""(@[a-zA-Z0-9_]+)"");scheme = ""http://twitter.com/"";tweetTxt = (TextView) v.findViewById(R.id.tweetTxt);Linkify.addLinks(tweetTxt, pattern, scheme, null, mentionFilter);Linkify.addLinks(tweetTxt, Linkify.WEB_URLS);</code></pre><p>But which ever gets called last is the one that gets applied. Can anyone tell me how I can make it link both the @mentions and still autoLink the URLs?</p><p>Edited to clarify some more of the code.</p>","507810","","507810","","2011-01-05 01:28:44","2013-02-24 22:35:39","Android Linkify both web and @mentions all in the same TextView","<android><textview><linkify>","6","0","11","",""
"4599799","1","","","2011-01-05 00:21:15","0","358","<p>I'm trying to centre a 40x40 marker at a lat/lon position in an itemizedOverlay for a mapview.</p><p>I set the marker bounds with</p><pre><code>    markerDefault.setBounds( -markerDefault.getIntrinsicWidth()/2            ,-markerDefault.getIntrinsicHeight()/2            , markerDefault.getIntrinsicWidth()/2            , markerDefault.getIntrinsicHeight()/2);</code></pre><p>When I check the lat/lon by tapping the centre of the marker image, the lat seems to be wrong by about the height of the image.</p><p>Is there a way to ensure the image is centred at the required lat/lon? </p><p>Is it possible the default mouse cursor - an arrow - isn't doing its usual behaviour of using its pointy end to interact with the emulator?</p><p>Thanks,</p><p>Geoff</p>","443445","","","","","2011-02-05 05:53:01","Precise positioning of markers for lat/lon","<android><overlay><android-mapview><marker>","1","2","","",""
"4599956","1","","","2011-01-05 00:59:31","1","853","<p>Can someone tell me how to implement facebook recommendation or like on mobile (iPhone, Android) web browser?</p><p>I following the guides for plugin approach and FB.ui approach:<a href=""http://developers.facebook.com/docs/reference/plugins/like"" rel=""nofollow"">http://developers.facebook.com/docs/reference/plugins/like</a>http://developers.facebook.com/docs/reference/javascript/FB.ui</p><p>but, none of them gave a mobile web sharing experience for recommentation/like. All of them give me desktop version of recommendata/like page.</p><p>Is there any tutorial or examples for Facebook sharing on mobile web? Can anyone help?</p><p>Thanks.</p>","445302","","","","","2011-07-27 02:40:35","Facebook sharing on mobile web","<iphone><android><facebook>","3","0","","",""
"4599972","1","4600391","","2011-01-05 01:02:57","4","2470","<p>is it somehow possible to show all broadcast events/intents that are triggered in android? I just want to know if I can quickly figure out if an application is using intents/broadcasts I can hook into. For most of the stock android applications I can read the source but is time consuming. </p>","325102","","","","","2013-07-11 09:31:08","Showing all broadcast events on Android","<java><android><android-intent>","3","4","","",""
"4600200","1","4602218","","2011-01-05 01:58:40","0","663","<p>Hy my code:</p><pre><code>           package com.android.skiptvad;import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;import java.util.ArrayList;import java.util.List;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.HttpGet;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.apache.http.protocol.HTTP;import org.apache.http.util.EntityUtils;import org.json.JSONException;import org.json.JSONObject;import android.app.Activity;import android.app.Dialog;import android.app.ProgressDialog;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.view.Window;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;import com.android.skiptvad.*;public class Login extends Activity {    private static final int DIALOG_LOADING = 0;    /** Called when the activity is first created. */    TextView tvuser;    String sessionid;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);        tvuser = (TextView) findViewById(R.id.tvuser);        TextView tvpw = (TextView) findViewById(R.id.tvpw);        final EditText etuser = (EditText) findViewById(R.id.etuser);        final EditText etpw = (EditText) findViewById(R.id.etpw);        Button btlogin = (Button)findViewById(R.id.btlogin);        btlogin.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                if (etuser.getText() != null &amp;&amp; etpw.getText()!= null)                {                    showDialog(DIALOG_LOADING);                    try                    {                    //download(etuser.getText().toString(), md5(etpw.getText().toString()));                    HttpClient client = new DefaultHttpClient();                      String postURL = ""http://surfkid.redio.de/login"";                    HttpPost post = new HttpPost(postURL);                         List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                        params.add(new BasicNameValuePair(""username"", etuser.getText().toString()));                        params.add(new BasicNameValuePair(""password"", md5(etpw.getText().toString())));                        UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);                        post.setEntity(ent);                        HttpResponse responsePOST = client.execute(post);                          HttpEntity resEntity = responsePOST.getEntity();                        final JSONObject jObject = new JSONObject(EntityUtils.toString(resEntity));                        JSONObject menuObject = jObject.getJSONObject(""responseData"");                        if (jObject.getInt(""responseStatus"")== 200 &amp;&amp; jObject.get(""responseDetails"")!= null)                        {                            sessionid = menuObject.getString(""session_id"");                        }                           else                        {                             if (jObject.getInt(""responseStatus"")== 500)                             {                                 throw new Exception(""Server Error"");                             }                             else if (jObject.getInt(""responseStatus"")== 400)                             {                                 throw new Exception(""Wrong User/Password"");                             }                             else                             {                                 throw new Exception();                             }                        }                    }                    catch (Exception e)                    {                        Log.d(""error"", ""error"");                    }                    finally{                        dismissDialog(DIALOG_LOADING);                    }                }            }        });    }    public void download (final String user, final String pw)    {    }    private String md5(String in) {        MessageDigest digest;        try {            digest = MessageDigest.getInstance(""MD5"");            digest.reset();                    digest.update(in.getBytes());            byte[] a = digest.digest();            int len = a.length;            StringBuilder sb = new StringBuilder(len &lt;&lt; 1);            for (int i = 0; i &lt; len; i++) {                sb.append(Character.forDigit((a[i] &amp; 0xf0) &gt;&gt; 4, 16));                sb.append(Character.forDigit(a[i] &amp; 0x0f, 16));            }            return sb.toString();        } catch (NoSuchAlgorithmException e) { e.printStackTrace(); }        return null;    }    @Override    protected Dialog onCreateDialog(int id) {        Dialog dialog = null;        switch (id) {        case DIALOG_LOADING:            dialog = new ProgressDialog(this);            ((ProgressDialog) dialog).setMessage(""Loading, please wait..."");            break;        }        return dialog;    }}</code></pre><p>No Dialog appears!!!</p>","547995","","547995","","2011-01-06 14:32:58","2011-01-06 14:32:58","ProgressDialog Error","<android>","3","0","","",""
"4600329","1","","","2011-01-05 02:28:24","0","409","<p>In my app I simply open the list of activities and when a contact is clicked I attempt to retrieve the name of the contact selected and put it into a string.  The app crashes in the onActivityResult() function.  I do have the READ_CONTACTS permission set.</p><pre><code>/** *  Opens the contacts activity */public void openContacts() {    Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);    startActivityForResult(intent, PICK_CONTACT);}@Overridepublic void onActivityResult(int reqCode, int resultCode, Intent data) {  super.onActivityResult(reqCode, resultCode, data);  switch (reqCode) {    case (PICK_CONTACT) :      if (resultCode == Activity.RESULT_OK) {        Uri contactData = data.getData();          Cursor c =  managedQuery(contactData, null, null, null, null); //NullPointerException thrown here, line 102        if (c.moveToFirst()) {          String name = c.getString(c.getColumnIndexOrThrow(People.NAME));          FRIEND_NAME = name;          showConfirmDialog(name);        }      }      break;  }}</code></pre><p>The following logcat error logs are returned:<img src=""http://i.stack.imgur.com/A4ku6.png"" alt=""alt text""></p><p>Any help is appreciated.</p><p>Thanks</p>","451037","","451037","","2011-01-05 02:51:13","2011-01-05 02:51:13","Contacts activity doesn't return data","<android><android-intent><contacts>","0","4","","",""
"4600550","1","4733070","","2011-01-05 03:21:51","0","10242","<p>I have an enterprise Flex web application, served up over https, that runs fine on Flash player 10.0 and beyond on a desktop computer/browser.  </p><p>However, when I run it from my HTC Incredible with Android 2.2 the app loads fine, but there is no on-screen keyboard and so I cannot log in.  I can see the blinking cursor inside the username and password text fields.  I can switch between them.  I can even hit the login button and see an authentication error!</p><p>According to <a href=""http://kb2.adobe.com/cps/860/cpsid_86018.html"" rel=""nofollow"">Adobe</a> this should Just Work.  Any ideas?  I wanna show off our spanking new app to strangers at the bus stop!</p>","218028","","218028","","2011-01-05 03:49:15","2012-10-28 10:26:26","Missing on-screen keyboard for Flash/Flex web application on Android?","<android><flex><flash><web-applications>","6","7","","",""
"4600555","1","","","2011-01-05 03:22:17","0","4234","<p>I need to integrate Twitter with my Android app, and this is my code (based on <a href=""http://www.pastie.org/1283631"" rel=""nofollow"">this</a>):</p><pre><code>package com.anta40.oauthsetup;import twitter4j.Twitter;import twitter4j.TwitterException;import twitter4j.TwitterFactory;import twitter4j.http.AccessToken;import twitter4j.http.RequestToken;import twitter4j.Status;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.widget.Toast;import java.util.List;public class OAuthSetup extends Activity {Twitter twitter;RequestToken requestToken;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    String CONSUMER_KEY = ""xxxxxxxxxx"";    String CONSUMER_SECRET = ""yyyyyyyyyyyyyyyyyyyy"";    try {        twitter = new TwitterFactory().getInstance();        twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);        RequestToken requestToken = twitter.getOAuthRequestToken();        AccessToken accessToken = null;        String url = requestToken.getAuthorizationURL();        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));        startActivity(intent);    }    catch (TwitterException e){        e.printStackTrace();    }}@Overrideprotected void onNewIntent(Intent intent) {    super.onNewIntent(intent);    Uri uri = intent.getData();    try {        String verifier = uri.getQueryParameter(""oauth_verifier"");        AccessToken accessToken = twitter.getOAuthAccessToken(requestToken, verifier);        String token = accessToken.getToken();        String secret = accessToken.getTokenSecret();        displayTimeLine(token, secret);    }    catch (TwitterException e){        e.printStackTrace();    }}@SuppressWarnings(""deprecation"")void displayTimeLine(String token, String secret) {    if (null != token &amp;&amp; null != secret) {        List&lt;Status&gt; statuses = null;        try {            twitter.setOAuthAccessToken(token, secret);            statuses = twitter.getFriendsTimeline();            Toast.makeText(this, statuses.get(0).getText(), Toast.LENGTH_LONG)                .show();        } catch (Exception ex) {            Toast.makeText(this, ""Error:"" + ex.getMessage(),                    Toast.LENGTH_LONG).show();            Log.d(""Main.displayTimeline"",""""+ex.getMessage());        }    } else {        Toast.makeText(this, ""Not Verified"", Toast.LENGTH_LONG).show();    }}</code></pre><p>}</p><p>Now, instead of using WebView, how can I use Dialog to input the Twitter username &amp; password?</p>","132127","","","","","2012-05-30 07:44:54","Twitter integration for Android apps","<android><twitter><twitter4j>","2","0","","",""
"4600638","1","","","2011-01-05 03:40:29","2","1351","<p>I have a ViewFlipper and sometimes I would like to have it animate between views and sometimes I want it to instantly switch between views.</p><p>I'm trying to figure out how to do this.</p><p>I tried changing the animation, in animation, and out animation before the switch but if I do that the current view disappears during the animation.</p><p>Anyone know of a way to do this?</p>","445348","","","","","2011-07-01 12:25:51","Changing the animation or duration of a ViewFlipper transition","<android><animation><viewflipper>","1","0","1","",""
"4600740","1","4601251","","2011-01-05 04:07:35","10","8918","<p>I'm having some trouble retrieving icons for installed Android App. The following code returns icons for all apps, however, some apps are returned with small icons (perhaps from drawable - ldpi folder) while some with large icons. </p><pre><code>List&lt;PackageInfo&gt; package = getPackageManager().getInstalledPackages(0);for(PackageInfo p : package){    iApp.icon = p.applicationInfo.loadIcon(getPackageManager()); }</code></pre><p>How Can I get icons which are all of the same size, just like in Manage Application section of Android?</p>","406930","","","","","2013-10-29 10:40:48","Getting App Icon in Android","<android>","3","0","5","",""
"4600760","1","4622809","","2011-01-05 04:13:22","0","2182","<p>I have a ListView and a EditText. How can I filter ListView data when typing on EditText ? </p><p>My code is given below: </p><pre><code> public class ListContacts extends ListActivity { ListAdapter lAdapter; EditText filterText; @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);// Associate the xml with the activitysetContentView(R.layout.activitylist);     Cursor cursor = getContentResolver().query(    ContactsContract.Contacts.CONTENT_URI, null,    null, null,     null); startManagingCursor(cursor);// start mappings     String[] columns = new String[] { ContactsContract.Contacts.DISPLAY_NAME };int[] names = new int[] { R.id.contact_name };     lAdapter = new ImageCursorAdapter(this, R.layout.main, cursor, columns,    names);</code></pre><p>/**     * to filter contacts     */</p><pre><code>filterText = (EditText) findViewById(R.id.EditText01);      filterText.addTextChangedListener(new TextWatcher() {    public void afterTextChanged(Editable s) {    }    public void beforeTextChanged(CharSequence s, int start, int count,        int after) {    }    public void onTextChanged(CharSequence s, int start, int before,        int count) {    }});}</code></pre><p>}// end of class ListContacts</p><pre><code>        public class ImageCursorAdapter extends SimpleCursorAdapter {         private Cursor c;         private Context context;         public ImageCursorAdapter(Context context, int layout, Cursor c,    String[] from, int[] to) {super(context, layout, c, from, to);this.c = c;this.context = context;}     public View getView(int pos, View inView, ViewGroup parent) {        }</code></pre><p>}// end of class ImageCursorAdapter</p>","548218","","","","","2011-03-24 05:00:29","How can I filter ListView data when typing on EditText in android","<android>","2","0","1","",""
"4600791","1","","","2011-01-05 04:24:14","0","169","<p>How can we get Facebook APIs for Android?</p>","421645","","19750","","2011-01-05 05:19:25","2013-03-22 15:18:35","Facebook APIs for Android","<android><facebook>","2","2","1","",""
"4600818","1","4601189","","2011-01-05 04:28:14","3","13076","<p>Basically, I'd like to know if there's a specific folder I can look in and copy/paste cookie data from. I've tried looking around myself but to no avail. Google didn't help much either.</p><p>If they aren't stored to a folder that is directly accessible, is there any other way to get to them?</p><p>I'm on the Android 2.2 (Froyo) version if that helps. THANKS. :D</p>","505337","","","","","2013-11-14 00:43:26","Where are the cookies in the native android browser stored?","<android><cookies>","3","0","2","",""
"4600864","1","","","2011-01-05 04:38:52","0","353","<p>Where does the emulator data lie(the contacts, messages, saved images)?</p>","559076","","493939","","2012-04-18 09:25:42","2012-04-18 09:25:42","Where does the android emulator data lies?","<android>","4","0","","",""
"4600865","1","4601028","","2011-01-05 04:39:00","0","870","<p>I have a simple android app on the market. I have noticed some error reports and I want to fix the errors however, I cannot reproduce these errors. So I have a few questions</p><ol><li>Is it possible to know or guess if these errors are hardware specific?</li><li>If errors are device specific, how can I attempt to fix the problem without knowing what device was used and without owning that particular device</li><li>If anyone could point me in the right direction with this specific error, that would be much appreciated</li></ol><p>Here's the error report</p><blockquote>  <p>java.lang.RuntimeException: Unable to  start activity  ComponentInfo{com.slamdunksoftware.techitotpets/com.slamdunksoftware.techitotpets.Main}:  java.lang.NullPointerException at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753)  at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)  at  android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905)  at  android.app.ActivityThread.access$2600(ActivityThread.java:129)  at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)  at  android.os.Handler.dispatchMessage(Handler.java:99)  at  android.os.Looper.loop(Looper.java:143)  at  android.app.ActivityThread.main(ActivityThread.java:4717)  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.slamdunksoftware.techitotpets.Main.onCreate(Main.java:81)  at  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)</p></blockquote><p>And here's the class (Line 81 is music.setLooping(false) near the bottom)</p><pre><code>public class Main extends Activity { MediaPlayer music;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);               // Hide the Title Bar     requestWindowFeature(Window.FEATURE_NO_TITLE);      setContentView(R.layout.main);     // Hide the Status Bar     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        WindowManager.LayoutParams.FLAG_FULLSCREEN);     // Set to landscape     setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);     ImageButton btnMemory = (ImageButton) findViewById(R.id.btnMemory);     ImageButton btnStickers = (ImageButton) findViewById(R.id.btnStickers);     ImageButton btnDot2Dot = (ImageButton) findViewById(R.id.btnDot2Dot);     ImageButton btnWindow = (ImageButton) findViewById(R.id.btnWindow);        btnMemory.setOnClickListener(new View.OnClickListener() {                    public void onClick(View view) {          Intent intent = new Intent(Main.this, Memory.class);          startActivity(intent);             setResult(RESULT_OK, intent);             finish();                               }        });         btnStickers.setOnClickListener(new View.OnClickListener() {                    public void onClick(View view) {          Intent intent = new Intent(Main.this, Stickers.class);          startActivity(intent);             setResult(RESULT_OK, intent);             finish();                               }        });         btnDot2Dot.setOnClickListener(new View.OnClickListener() {               public void onClick(View view) {        Intent intent = new Intent(Main.this, Dot2Dot.class);        startActivity(intent);           setResult(RESULT_OK, intent);           finish();                             }   });        btnWindow.setOnClickListener(new View.OnClickListener() {               public void onClick(View view) {        Intent intent = new Intent(Main.this, WindowWasher.class);        startActivity(intent);           setResult(RESULT_OK, intent);           finish();                             }   });        // Music        music = MediaPlayer.create(this, R.raw.techitot);  music.setLooping(false);  music.start();    }    @Override    public void onDestroy()    {     music.stop();     super.onDestroy();    }    @Override    public void onPause()    {     super.onPause();     music.stop();         }}</code></pre>","454509","","","","","2011-01-05 05:14:06","How to investigate android market application error report","<android>","1","0","","",""
"4600891","1","4600907","","2011-01-05 04:44:40","252","292253","<p>When I develop the project using <a href=""http://en.wikipedia.org/wiki/Eclipse_%28software%29"" rel=""nofollow"">Eclipse</a>, the <a href=""http://en.wikipedia.org/wiki/APK_%28file_format%29"" rel=""nofollow"">APK</a> file goes on the emulator. But I want to upload my application to a real device.  Is there a tool to build an APK file?</p><p>What is the process? Or is it possible to pull the APK file from the emulator?</p>","516160","","890016","","2014-04-03 20:36:04","2014-04-03 20:36:04","How to build an APK file in Eclipse?","<android><eclipse><android-emulator><apk><android-install-apk>","10","4","72","",""
"4600896","1","11846692","","2011-01-05 04:45:11","6","7954","<p>Is there any way to know(programmatically) in your Activity/Application that the user has connected your phone to PC through USB?</p>","522448","","","","","2013-07-19 20:26:50","Android: Detecting USB","<android><usb>","5","0","2","",""
"4600963","1","","","2011-01-05 04:58:58","3","2273","<p>It is very easy to call an intent for the native Android Media Player to play an MP3 file. e.g.</p><pre><code>Intent intent = new Intent(android.content.Intent.ACTION_VIEW);  Uri data = Uri.parse(""file:///sdcard/bigTune.mp3"");  intent.setDataAndType(data,""audio/mp3"");     try {          startActivity(intent);         }            catch (ActivityNotFoundException e) {          e.printStackTrace();         }</code></pre><p>The Problem is that when the player starts the file plays and the album art CD is blank and the player shows NO song Information.</p><p>If the same was to be done through a file manager like Astro file Manager, I would see the song Information (Title, Artist Album Art)</p><p>Is there any thing else that i need to know to add to the Intent or something else that I need to do to enable the Media Player to show the mp3's Info ???</p><p>Thanks is advance</p>","457908","","1675954","","2013-04-07 20:16:56","2013-04-07 20:16:56","Android Intent for media player plays mp3 but does not display information(Title, Artist, Album Art)","<android>","0","2","1","",""
"4601221","1","","","2011-01-05 05:55:00","0","520","<p>Does anybody have the Android mediaframeworktest test media files?</p>","562518","","472792","","2013-05-19 11:15:21","2013-05-19 11:15:21","Where can I get Android Mediaframeworktest test media files?","<android>","3","0","","",""
"4601250","1","4602069","","2011-01-05 06:03:20","0","1154","<p>I have number of tables in my database. There will be number of methods in DB class if i write a crud operations for every table.</p><p>If i can pass name of Table on insertMethod, updateMethod &amp; deleteMethod. Then operation should be performed on that table only.</p><p>By this way there will be only 3 methods in DB class and code would be much cleanier.</p><p>Does any one have such implementation before in Android?</p><p>Thanks,Zoombie</p>","493423","","","","","2011-01-05 08:26:53","CRUD operations on different tables with single method for Android","<java><android><sqlite>","1","2","1","",""
"4601283","1","4966788","","2011-01-05 06:09:48","0","477","<p>I am having problem in parsing the xml data, below is my code</p><pre><code>URL url=new URL(Urls.statusUrl);     SAXParserFactory spf=SAXParserFactory.newInstance();     SAXParser sp=spf.newSAXParser();     XMLReader xr=sp.getXMLReader();     FOIA_Parsing_Handler mxmlparsing=new FOIA_Parsing_Handler();     xr.setContentHandler(mxmlparsing);     xr.parse(new InputSource(url.openStream()));//Exception at this line     mStatus=mxmlparsing.getRecords();     m_adapter=new StatusAdapter(Status_Inquiry.this, R.layout.status_inquiry_view, mStatus);     mLstViewStatusInquiry.setAdapter(m_adapter);</code></pre><p>I am getting </p><blockquote>  <p>org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 8299: not well-formed (invalid token)</p></blockquote><p>at above line</p><p>RegardsSaurabh</p>","517247","","","","","2011-02-11 08:01:05","Android XML parsing problem","<android><xml>","1","3","","",""
"4601342","1","","","2011-01-05 06:18:18","0","1298","<p>I'm doing a login registration page with username &amp; password EditText fields and a button.When the button is clicked after entering values on the edit fields,it should be registered into the DB.But it didn't do that.How could i do this?</p><p>My registration code is shown below.</p><p>public class Registration extends Activity {    DBAdapter db = new DBAdapter(this);    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.register);        final EditText set1=(EditText)findViewById(R.id.set1);        final EditText set2=(EditText)findViewById(R.id.set2);</p><pre><code>    Button reg=(Button)findViewById(R.id.reg);    Button reset=(Button)findViewById(R.id.reset);    reg.setOnClickListener(new OnClickListener() {        @Override         public void onClick(View v)         {            String str1=set1.getText().toString();            String str2=set2.getText().toString();            db.open();            ContentValues initialValues = new ContentValues();            initialValues.put(""Username"",str1);            initialValues.put(""Password"",str2);                         //long n = dbAdapter.insertRecordsInDB(""user"", null, initialValues);            db.insertTitle(""login"",initialValues);                    db.close();            Toast.makeText(Registration.this,""Registration done"",Toast.LENGTH_SHORT).show();                 }        });reset.setOnClickListener(new OnClickListener() {    @Override     public void onClick(View v)     {       set1.setText("""");       set2.setText("""");       set3.setText("""");       set4.setText("""");       set5.setText("""");    }    });</code></pre><p>}}And my DBAdapter class is shown below..</p><p>public class DBAdapter {    public static final String KEY_ROWID = ""_id"";    public static final String KEY_USER = ""user"";    public static final String KEY_PASS = ""pass"";<br>    private static final String TAG = ""DBAdapter"";</p><pre><code>private static final String DATABASE_NAME = ""login"";private static final String DATABASE_TABLE = ""userpass"";private static final int DATABASE_VERSION = 1;private static final String DATABASE_CREATE =    ""create table userpass (_id integer primary key autoincrement, ""    + ""user text not null, pass text not null); "";private final Context context; private DatabaseHelper DBHelper;private SQLiteDatabase db;public DBAdapter(Context ctx) {    this.context = ctx;    DBHelper = new DatabaseHelper(context);}private static class DatabaseHelper extends SQLiteOpenHelper {    DatabaseHelper(Context context)     {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db)     {        db.execSQL(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 titles"");        onCreate(db);    }}    //---opens the database---    public DBAdapter open() throws SQLException     {        db = DBHelper.getWritableDatabase();        return this;    }  //---closes the database---        public void close()     {        DBHelper.close();    }    //---insert a title into the database---    public long insertTitle(String DATABASE_TABLE,String nullColumnHack,ContentValues initialValues)     {        //ContentValues initialValues = new ContentValues();        //initialValues.put(KEY_USER, user);        //initialValues.put(KEY_PASS, pass);        return db.insert(DATABASE_TABLE,initialValues);    }  //---deletes a particular title---    public boolean deleteTitle(long rowId)     {        return db.delete(DATABASE_TABLE, KEY_ROWID +                 ""="" + rowId, null) &gt; 0;    }    //---retrieves all the titles---    public Cursor getAllTitles()     {        return db.query(DATABASE_TABLE, new String[] {                KEY_ROWID,                 KEY_USER,                KEY_PASS},                 null,                 null,                 null,                 null,                 null);    }        //---retrieves a particular title---        public Cursor getTitle(long rowId) throws SQLException         {            Cursor mCursor =                    db.query(true, DATABASE_TABLE, new String[] {                            KEY_ROWID,                            KEY_USER,                             KEY_PASS,                            },                             KEY_ROWID + ""="" + rowId,                             null,                            null,                             null,                             null,                             null);            if (mCursor != null) {                mCursor.moveToFirst();            }            return mCursor;        }    //---updates a title---    public boolean updateTitle(long rowId, String isbn,     String title, String publisher)     {        ContentValues args = new ContentValues();        args.put(KEY_USER, isbn);        args.put(KEY_PASS, title);        return db.update(DATABASE_TABLE, args,                          KEY_ROWID + ""="" + rowId, null) &gt; 0;    }}</code></pre>","555948","","114066","","2011-11-23 07:51:15","2011-11-23 07:51:15","Login registration with DB in android","<android>","1","2","","",""
"4601352","1","4752490","","2011-01-05 06:20:17","7","4784","<pre>public class TestButton extends Activity {       /** Called when the activity is first created. */       ImageButton imgBtn;       @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        imgBtn = (ImageButton) findViewById(R.id.image);        //String url = ""http://thenextweb.com/apps/files/2010/03/google_logo.jpg"";        String url1 = ""http://trueslant.com/michaelshermer/files/2010/03/evil-google.jpg"";        Drawable drawable = LoadImage(url1);        imgBtn.setImageDrawable(drawable);    }    private Drawable LoadImage(String url) {        try {            InputStream is = (InputStream) new URL(url).getContent();            Drawable d = Drawable.createFromStream(is, ""src"");            return d;        } catch (Exception e) {            return null;        }    }}</pre><p>Above is the code snippet which I use to load image from web into ImageButton. Most of the images get displayed , but certain urls like the one above i.e. url1 , Drawable.createFromStream returns null !! What is the reason and how to avoid it or overcome  this problem ?</p>","207646","","","","","2011-03-07 08:06:00","CreateFromStream in Android returning null for certain url","<android>","2","0","2","",""
"4601389","1","","","2011-01-05 06:26:41","6","1979","<p>in android there is any possibility to getting source file from .apk file.</p>","","mukesh","21234","","2011-01-05 08:46:04","2012-01-07 13:37:20","how to get source file from apk file","<android><android-install-apk>","3","1","1","",""
"4601410","1","","","2011-01-05 06:29:42","0","600","<p>I am trying to send a file by Bluetooth, but I can't find any good solutions. I think I can do it with an FTP connection, but I can't find any examples using an FTP connection to send a file to another Android phone. How can I make an FTP connection to send a file between Android devices?</p>","544537","","321697","","2012-08-18 05:00:48","2012-08-18 05:00:48","Sending a file via FTP","<android><ftp><connection>","0","2","","",""
"4601442","1","5248064","","2011-01-05 06:36:05","3","2833","<p>I have an Android app that I have just prepared for localization, with one locale completed and more on the way. I want to give users the option of viewing the app in a different locale (ie- language) without having to modify their system locale settings.</p><p>So, for example:App has locale capability for en, es, zh, ja.User has ""es"" selected as their system locale.User can open the application's preferences page and select ""ja"" locale.App will now display the text/formatting according to the Ja locale of the app.</p><p>Is this possible?</p>","563556","","","","","2011-03-09 15:32:03","Allowing user to select app language/locale?","<android><localization><locale>","1","4","1","",""
"4601450","1","4603191","","2011-01-05 06:36:42","0","906","<p>I want to show ""Contact name"" and ""contact number"" in a list. But my code repeats ""contact name"" depends on how many number or other attributes (i.e. email id ) associated with that particular Name. For example .In Contact directory contact list as..Pankaj Kumar and numbers 000000-000 and 00000-2222. I want output as only Pankaj Kumar and primary_number, but output comes with ( Pankaj kumar and number 000000-000) and its repeat with ( Pankaj kumar and number 00000-2222). </p><p>How can I solve it.. My code is as below ..<code><pre>  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);</p><pre><code>    // We'll define a custom screen layout here (the one shown above), but    // typically, you could just use the standard ListActivity layout.    setContentView(R.layout.contacts_list_item);    Cursor mCursor = getContentResolver().query(Data.CONTENT_URI,                    null,                       // projection                    null,                       // selection                    null,                       // selectionArgs                    Data.DISPLAY_NAME);         // sortOrder            startManagingCursor(mCursor);     // Now create a new list adapter bound to the cursor.    // SimpleListAdapter is designed for binding to a Cursor.    contactAdapter = new SimpleCursorAdapter(            this, // Context.            android.R.layout.two_line_list_item,  // Specify the row template to use (here, two columns bound to the two retrieved cursor rows).            mCursor,    // Pass in the cursor to bind to.            new String[] {Data.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER},           // Array of cursor columns to bind to.            new int[] {android.R.id.text1, android.R.id.text2});  // Parallel array of which template objects to bind to those columns.    // Bind to our new adapter.    setListAdapter(contactAdapter);}</code></pre><p></pre></code></p>","550966","","","","","2011-08-03 09:20:44","Display contact name ( Repeats name depends on number of contact number exists to a name)","<android>","1","0","1","",""
"4601475","1","4601598","","2011-01-05 06:40:07","3","11631","<p>Can u please suggest a good tutorial (with example) for ActivityGroup. I am completely new about this topic.</p><p>Thank you</p>","523058","","","","","2012-05-29 06:30:27","Android: ActivityGroup tutorial with example","<android><activitygroup>","1","1","2","",""
"4601493","1","4601519","","2011-01-05 06:42:28","0","951","<p>I want to perform an operation when I scroll to the end of the scrollView, where i have scrollview that is filled by some data from JSON file, i want when i reach the end of the scrollview to show Download more button and start downloading more data nad scroll the scroll view to the start of the new downloaded data </p>","508377","","","","","2011-01-05 06:47:39","how to fire an action when scrolling to the end of the scrollview in android?","<android><scrollview>","1","0","","",""
"4601515","1","","","2011-01-05 06:47:11","0","992","<p>I am doing project on uploading Images and to share that in twitter , I have Oauth and Twitpick Key can anyone send some sample on this. I have checked Grepcode but not clear,I have to complete today can anyone guide me plz. </p><p>Thanks in Advance</p>","558304","","","","","2012-01-05 00:06:45","Android Twitpic Application -upload Images","<android>","1","0","","",""
"4601605","1","5620448","","2011-01-05 07:05:39","1","2393","<p>here is the code for exception::</p><pre><code>if (getZoomLevel() != last_zoom) { // if computeScroll called before timer counts down we should drop it and start it over again   zoom_event_delay_timer.cancel();   zoom_event_delay_timer = new Timer();   Log.v(""last_zoom"",""last_zoom"");  zoom_event_delay_timer.schedule(new TimerTask()  {   @Override  public void run()  {      zoom_change_listener.onZoomChange(_this, getZoomLevel(), last_zoom);       Log.v(""last_zoom"",""last_zoom""+last_zoom);       last_zoom = getZoomLevel();       Log.v(""last_zoom"",""last_zoom"");   }  }, events_timeout);}</code></pre><p>and the Error:</p><pre><code>01-05 12:24:50.791: ERROR/AndroidRuntime(11132): FATAL EXCEPTION: Timer-11    01-05 12:24:50.791: ERROR/AndroidRuntime(11132): java.util.ConcurrentModificationException    01-05 12:24:50.791: ERROR/AndroidRuntime(11132):     at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)    01-05 12:24:50.791: ERROR/AndroidRuntime(11132):     at com.bluepal.android.parkable.Prakablescreen.onRegionChange(Prakablescreen.java:1028)    01-05 12:24:50.791: ERROR/AndroidRuntime(11132):     at com.bluepal.android.parkable.Prakablescreen$14.onPanChange(Prakablescreen.java:467)    01-05 12:24:50.791: ERROR/AndroidRuntime(11132):     at com.bluepal.android.parkable.EnhancedMapView$2.run(EnhancedMapView.java:126)    01-05 12:24:50.791: ERROR/AndroidRuntime(11132):     at java.util.Timer$TimerImpl.run(Timer.java:289)</code></pre>","460336","","437703","","2011-02-21 06:03:18","2011-04-11 11:11:26","how to solve FATAL EXCEPTION: Timer-11 in android?","<android>","3","0","1","",""
"4601624","1","4601677","","2011-01-05 07:08:51","2","681","<p>I have an mobile application (on Android &amp; BB) which interacts with the Drupal site via web services. Users are required to pay a amount for registering on the site which is achieved by UberCart module of Drupal.</p><p>Now, I want to have a registration process from my mobile apps too which requires the payment from the app. </p><p>@Drupal Guys - Can drupal web services can be used for the payment also? Any security risks or loopholes?@Android/BB Guys - What are the possible ways of having a payment solution from the app.</p><p>Thanks in Advance</p><p>Cheers,Prateek</p>","481314","","","","","2011-03-21 04:56:50","Making Credit Card Payment from Android / Blackberry","<android><drupal><blackberry><payment>","3","0","","",""
"4601653","1","4601720","","2011-01-05 07:13:48","0","735","<p>I have two different applications doing different things. Now I'm creating an application in which main.xml will have only two buttons and each button click will open one of these application. </p><p>I want to include these two applications' code along with their packages to my this application [for some reasons I really do not want to change their packaga names]. Is it possible?</p><p>Will manifest file creation need any non-trivial changes? </p><p>Thanx in advance.</p>","227943","","","","","2011-01-05 07:36:35","Can I have two different packages in same Android application?","<android>","2","0","","",""
"4601718","1","","","2011-01-05 07:25:49","2","1344","<p>I am attempting to launch one animation after another has finished by monitoring the onanimationEnd callback of the first one. However Android gives the following error when I attempt to do this:</p><p>Error - The method loadAnimation(Context, int) in the type AnimationUtils is not applicable for the arguments (new Animation.AnimationListener() {}, int)  </p><p>I tried to use the answer in this post: ---<a href=""http://stackoverflow.com/questions/3519682/android-animation-one-after-other"">Android Animation one after other</a>Which I interpreted to mean that I should move everything except the start animation out of the callback, but when I do this I get the following error:</p><p>Error - Cannot refer to a non-final variable fade3 inside an inner class defined in a different method</p><p>What am I missing here???</p><hr><p><em><strong></em>**CODE FOR FIRST EXAMPLE*<em>*</em>****</strong></p><hr><pre><code>package com.smartproducts.dragracepro;import android.content.Intent;import android.media.MediaPlayer;import android.os.Bundle;import android.util.TypedValue;import android.view.Gravity;import android.view.View;import android.view.animation.Animation;import android.view.animation.Animation.AnimationListener;import android.view.animation.AnimationUtils;import android.view.animation.LayoutAnimationController;import android.widget.ImageView;import android.widget.TableLayout;import android.widget.TableRow;import android.widget.TextView;public class DragRaceProSplashActivity extends DragRaceProActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.splash);        //animate title fade in        TextView programtitle = (TextView) findViewById(R.id.TextViewTopTitle);        Animation fade1 = AnimationUtils.loadAnimation(this,R.anim.fade_in);        programtitle.startAnimation(fade1);        //show introduction and logo for Smart Shocks        fade1.setAnimationListener(new AnimationListener(){                     @Override            public void onAnimationEnd(Animation fade1)            {***************  ERROR IS HERE&gt; Animation fade3 = AnimationUtils.loadAnimation(this,R.anim.fade_in2); ***************            ImageView sslogo = (ImageView) findViewById(R.id.ImageView03);                sslogo.setVisibility(View.VISIBLE);                sslogo.startAnimation(fade3);            }            @Override            public void onAnimationRepeat(Animation animation) {}            @Override            public void onAnimationStart(Animation animation) {}        });    }</code></pre>","551998","","186636","","2013-08-01 22:07:14","2013-08-01 22:07:14","Can I launch an Android animation in the onanimationEnd callback of the previous one?","<java><android><user-interface>","1","2","1","",""
"4601758","1","","","2011-01-05 07:33:19","3","5576","<p>Using a canvas, I want to draw some short label text (1-2 characters) which fits into some specified rectangle.For some other reasons, the scaling I use is such that the dimensions of this recangle are small, i.e. about 1. </p><p>The problem I'm facing is to calculate the optimal (as large as possible so that the text still fits) text size to use with <code>Paint.setTextSize</code> prior to drawing the text (which I do using <code>Canva.drawText()</code>).For that I can either use the <code>Paint.Fontmetrics</code> object to get some general font dimensions as floats or <code>getTextBounds(String text, int start, int end, Rect bounds)</code> to get the bounding box of the text as an integer rectangle. Due to the scaling I use, the integer bounding box from the latter is to imprecise to calculate the optimal text size for my purpose.</p><p>What I would need is some method to get the bounding box of the text with higher precision (i.e. like <code>getStringBounds(String str, Graphics context)</code> in <code>java.awt.FontMetrics</code>), but I found no suitable method.</p>","341927","","341927","","2011-01-05 08:37:23","2013-05-26 10:32:44","Draw text fitting in some specified Rectangle","<android><text><canvas><drawing>","2","0","1","",""
"4601814","1","4601871","","2011-01-05 07:44:56","0","143","<p><br>Is there any way to refer more than one widget (ui controls) by a single id<br>For example<br>i have many <code>ImageView</code> with same  <code>android:id=""myimageview""</code><br>And in my activity  </p><pre><code> myimageview = (ImageView)findViewById(R.id.myimageview);</code></pre><p>So if i set an image using   </p><pre><code>myimageview.setImageBitmap(somebitmap);  </code></pre><p>i need that image in all of my Imageview with id myimageview<br>But when i tried this only one of imageview got this change.<br>Any idea to do this.<br>Thank you.</p>","477754","","375209","","2011-01-05 08:33:49","2011-01-05 08:33:49","one id for more than one widget android","<android>","1","0","","",""
"4601825","1","4601909","","2011-01-05 07:46:49","1","4059","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2621395/more-efficient-way-of-updating-ui-from-service-than-intents"">More efficient way of updating UI from Service than intents?</a>  </p></blockquote><p>I have a RSS Feed reader application. I am handling the feed reading in a service, but I don't know how to update the UI. What would be the best way to handle this?</p><p>Thanks a lot</p><p>Gratzi</p>","460611","","","","","2012-10-08 12:08:55","Update UI from service","<android>","1","0","1","2012-10-08 18:05:11",""
"4601829","1","","","2011-01-05 07:47:19","0","1679","<p>I am very new to android development, now i am developing an app in android which needs to beshare with the social network like facebook but i haven't got any clue that how to take this step, i hope i can get a proper solution for my doubt.</p><p>Thanks,Balaram.</p>","563593","","","","","2011-01-05 10:04:46","How to share my android app with facebook?","<android>","2","1","","",""
"4601917","1","","","2011-01-05 08:02:56","0","2894","<p>How can I know if the database has been created or not in Android?  Does anyone have an example?</p>","550488","","1288","","2011-01-05 14:07:39","2011-06-30 06:12:00","Check if the database has been created on Android","<android><database>","4","0","","",""
"4601939","1","","","2011-01-05 08:07:51","1","1763","<p>I have a listview which is part of an Activity. I want user to have a choice for batch deleting the items in the listview, so when he chooses the corresponding option from the menu, every list item gets a checkbox next to it. When user clicks any checkbox, a button bar is to slide up from bottom (as in gmail app) and clicking delete button deletes the selected items, however clicking cancel button on the bar would uncheck all the checked items.</p><p>This is my page 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""        android:background=""@android:color/transparent""    &gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    &gt;    &lt;LinearLayout      android:id=""@+id/list_area""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:layout_weight=""1""        &gt;      &lt;ListView          android:id=""@+id/mylist""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:background=""@android:color/transparent""           android:drawSelectorOnTop=""false""          android:layout_weight=""1""      /&gt;      &lt;TextView        android:id=""@+id/empty_list_message""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textColor=""#FFFFFF""        android:layout_gravity=""center_vertical|center_horizontal""        android:text=""@string/msg_for_emptyschd""        android:layout_margin=""14dip""        android:layout_weight=""1""         /&gt;  &lt;/LinearLayout&gt;  &lt;RelativeLayout    android:id=""@+id/bottom_action_bar""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""@drawable/schedule_bottom_actionbar_border""    android:layout_marginBottom=""2dip""    android:layout_gravity=""bottom""    android:visibility=""gone""    &gt;        &lt;Button        android:id=""@+id/delete_selecteditems_button""        android:text=""Deleted Selected""        android:layout_width=""140dip""        android:layout_height=""40dip""        android:layout_alignParentLeft=""true""        android:layout_marginLeft=""3dip""        android:layout_marginTop=""3dip""    /&gt;    &lt;Button    android:id=""@+id/cancel_button""        android:text=""Cancel""        android:layout_width=""140dip""        android:layout_height=""40dip""        android:layout_alignParentRight=""true""        android:layout_marginRight=""3dip""        android:layout_marginTop=""3dip""    /&gt;         &lt;/RelativeLayout&gt;       &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;</code></pre><p>so far, I have got everything working except that when the bottom bar becomes visible upon checkbox selection, it overlaps the last element of the list. All other list items can be scrolled up, but you cant scroll up the very last item of the list, therefore user can not select that item if he intends to. Here is the <a href=""http://img829.imageshack.us/img829/498/overlap.png"" rel=""nofollow"">screenshot of the overlap</a>.</p><p>I have tried using the listview footer option, but that appends the bar to the end of the list instead of keeping it fixed at the bottom of the screen. Is there a way I could ""raise"" the listview enough so that the overlap wont happen?? BTW, I have already tried adding the bottom-margin to the listview itself, or the LinearLayout wrapping the listview right before making the button-bar visible, but it introduces other bugs like clicking one checkbox checks some another checkbox in listview.</p>","553267","","","","","2011-01-07 09:06:10","Bottom button bar overlaps the last element of Listview!","<android><listview><checkbox><buttonbar>","2","1","","",""
"4602070","1","","","2011-01-05 08:26:56","1","1008","<p>Is it possible?<br>I mean when I get close some specific place,I get a Notification.<br>Proximity Alerts will fire a Intent,but I don't know how to start a Notification with a Intent.<br>Someting like Intent(String action) and IntentFilter?</p>","509138","","","","","2011-01-05 08:58:10","How to use Proximity Alerts to trigger a Notification?","<android>","2","0","","",""
"4602078","1","","","2011-01-05 08:28:51","3","2385","<p>Suppose I have an xml definition for a button with id as <code>@+id/send_button</code></p><p>How I can get this id attribute value in Java code? I tried getXXX methods on <code>AttributeSet</code> class but doesn't provide any value which has ""send_button"" in it. </p><p>Edit1:</p><p>Let me make it a little bit more clear.</p><p>I am creating a custom <code>View</code> component and I want to know what's the id value that the user of this component provided in xml file.</p><p>Edit2:</p><p>I'm not using custom attributes due to a particular reason but using </p><pre><code>&lt;mycomponent     android:id=""@+id/my_id""/&gt;</code></pre><p>Edit 3:</p><p>There is a <code>getIdAttribute()</code> method on <code>AttributeSet</code> but it  just doesn't work. Anyone know any reason?</p>","563632","","512958","","2012-12-12 12:24:20","2013-03-14 11:20:44","How to get the android xml view element id attribute in java code","<android>","2","0","1","",""
"4602096","1","","","2011-01-05 08:31:48","-1","522","<p>this is my code of animation in Android and Iam getting the following errors</p><pre><code> package com.viewslide;import java.io.File;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.net.Uri;import android.os.Bundle;import android.os.CountDownTimer;import android.provider.MediaStore;import android.view.ContextMenu;import android.view.MenuItem;import android.view.View;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.ImageView;import android.widget.Toast;public class slideview extends Activity {  private Animation Animationtype;    /** Called when the activity is first created. */   int i=0;   ImageView img1,img2;   int PICK_REQUEST_CODE=0;   MyCount counter;   Uri startDir1;  @Override     public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Animationtype= AnimationUtils     .loadAnimation(this, R.anim.slide_top_to_bottom);        openSdcard();         counter=new MyCount(2000,1000);      }  public void openSdcard()  {   Intent intent = new Intent();      intent.setAction(Intent.ACTION_GET_CONTENT);      Uri startDir1= Uri.fromFile(new File(""/""));      intent.setDataAndType(startDir1, ""vnd.android.cursor.dir/lysesoft.andexplorer.file"");      intent.putExtra(""browser_filter_extension_whitelist"", ""*.txt,*.mp3,*.jpg"");       intent.putExtra(""explorer_title"", ""Select a file"");         // Optional colors      intent.putExtra(""browser_title_background_color"", ""440000AA"");      intent.putExtra(""browser_title_foreground_color"", ""FFFFFFFF"");      intent.putExtra(""browser_list_background_color"", ""66000000"");      intent.putExtra(""browser_list_fontscale"", ""120%"");      intent.putExtra(""browser_list_layout"", ""1"");     //if( Uri startDir1== Uri.fromFile(new File(""/"")))    //  if(startDir1==Uri.fromFile(new File(""/sdcard/DCIM"")))   //  {     startActivityForResult(intent,PICK_REQUEST_CODE);     onActivityResult(PICK_REQUEST_CODE, PICK_REQUEST_CODE, intent);     //}  }  protected void onActivityResult(int requestCode, int resultCode, Intent intent) {          super.onActivityResult(requestCode, resultCode,intent);           if (requestCode == PICK_REQUEST_CODE)          {           if (resultCode == RESULT_OK)           {                StartTimer();           }          }  }        public void slideshow()        {        String[] filePathColumn = {MediaStore.Images.Media.DATA};        Cursor cursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, filePathColumn, null, null, null);        int count= cursor.getCount();         if(i&lt;count-1){             cursor.moveToPosition(i);        int columnIndex = cursor.getColumnIndex(filePathColumn[0]);        String filePath = cursor.getString(columnIndex);        cursor.close();        BitmapFactory.Options options = new BitmapFactory.Options();        options.inTempStorage = new byte[16*1024];      //  bitmapImage = BitmapFactory.decodeFile(path,opt);        Bitmap yourSelectedImage = BitmapFactory.decodeFile(filePath,options);        img1 = (ImageView)findViewById(R.id.img1);        img1.setImageBitmap(yourSelectedImage);       img1.startAnimation(Animationtype);       registerForContextMenu(img1);       i=i+1;  }         else         {          img1.setImageBitmap(null);         // Toast.makeText(getBaseContext(), ""End of SlideShow"", 1000).show();         }  }public void StartTimer(){    counter.start();        }private void pause() { counter.cancel();}private void resume() { counter = new MyCount(2000,1000); counter.start();}private class MyCount extends CountDownTimer {public MyCount(long millisInFuture, long countDownInterval) {    super(millisInFuture, countDownInterval);    // TODO Auto-generated constructor stub   }   @Override   public void onFinish() {   // TODO Auto-generated method stub    slideshow();    StartTimer();    }   @Override   public void onTick(long millisUntilFinished) {    // TODO Auto-generated method stub   }        }public void onCreateContextMenu(ContextMenu menu, View v,ContextMenu.ContextMenuInfo menuInfo) {           super.onCreateContextMenu(menu, v, menuInfo);         pause();         menu.setHeaderTitle(""Animation"");           menu.add(0, v.getId(), 0, ""hyperspace_jump"");           menu.add(0, v.getId(), 0, ""shake"");           menu.add(0, v.getId(), 0, ""rotate"");           menu.add(0, v.getId(), 0, ""magnify"");           menu.add(0, v.getId(), 0, ""zoom_enter"");           menu.add(0, v.getId(), 0, ""zoom_exit"");           menu.add(0, v.getId(), 0, ""hyperspace_in"");       }public boolean onContextItemSelected(MenuItem item){     if(""hyperspace_jump"".equals(item.getTitle()))          {            resume();           slideshow();           Animationtype= AnimationUtils           .loadAnimation(this, R.anim.hyperspace_jump);           img1.startAnimation(Animationtype);           }       else if(""shake"".equals(item.getTitle()))           {         resume();           slideshow();           Animationtype= AnimationUtils              .loadAnimation(this, R.anim.shake);              img1.startAnimation(Animationtype);             }       else if(""rotate"".equals(item.getTitle()))              {         resume();           slideshow();           Animationtype= AnimationUtils              .loadAnimation(this, R.anim.rotate);               img1.startAnimation(Animationtype);             }else if(""magnify"".equals(item.getTitle()))               {                      resume();               slideshow();               Animationtype= AnimationUtils                  .loadAnimation(this, R.anim.magnify);                  img1.startAnimation(Animationtype);                 }                   else if(""zoom_enter"".equals(item.getTitle()))                  {                   resume();                  slideshow();                  Animationtype= AnimationUtils                  .loadAnimation(this, R.anim.zoom_enter);                  img1.startAnimation(Animationtype);                  }                   else if(""zoom_exit"".equals(item.getTitle()))                  {                   resume();                  slideshow();                  Animationtype= AnimationUtils                  .loadAnimation(this, R.anim.zoom_exit);                  img1.startAnimation(Animationtype);                  }                   else if(""hyperspace_in"".equals(item.getTitle()))                  {                   resume();                  slideshow();                  Animationtype= AnimationUtils                  .loadAnimation(this, R.anim.hyperspace_in);                  img1.startAnimation(Animationtype);                  }                   else                     {                    return false;                     }         return true;   }}  </code></pre><p>And the errors which i get are</p><pre><code>E/AndroidRuntime(26250): FATAL EXCEPTION: mainE/AndroidRuntime(26250): java.lang.OutOfMemoryError: bitmap size exceeds VM budgetE/AndroidRuntime(26250): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)E/AndroidRuntime(26250): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)E/AndroidRuntime(26250): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:271)E/AndroidRuntime(26250): at com.viewslide.slideview.slideshow(slideview.java:91)E/AndroidRuntime(26250): at com.viewslide.slideview$MyCount.onFinish(slideview.java:131)E/AndroidRuntime(26250): at android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:118)E/AndroidRuntime(26250): at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(26250): at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(26250): at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(26250): at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(26250): at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(26250): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)E/AndroidRuntime(26250): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)E/AndroidRuntime(26250): at dalvik.system.NativeStart.main(Native Method)W/ActivityManager(18078): Force finishing activity com.viewslide/.slideview</code></pre><p>please help as soon as u canthank u in advance</p>","545982","","536148","","2011-12-21 04:31:25","2011-12-21 04:31:25","Error of force to close during animation in android?","<android>","1","0","","",""
"4602120","1","4602127","","2011-01-05 08:35:54","1","795","<p>I'm trying to reach internet through my Android app, but I both succeed and fail.</p><p>I start the emulator when I build my app, and the app is installed just fine. I can use the browser to access the internet, however, when I try this small code snippet ...</p><pre><code>            InetAddress inet;            try {                inet = InetAddress.getByName(""www.google.com"");                System.out.println (""IP  : "" + inet.getHostAddress());            } catch (UnknownHostException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }</code></pre><p>... it all fails.</p><p>Is there any setting you must do to make the app reach the internet?</p>","521050","","52626","","2011-03-27 21:09:21","2011-03-27 21:09:21","Network access in Android emulator","<android><networking>","1","0","1","",""
"4602189","1","","","2011-01-05 08:47:08","6","3013","<p>I want to send push notification to my user,when will i update some information in my RSS Feed,Now i am using third party tool like urbanairship,but did not support RSS Feed,Have any third party tool for notification,please give some  idea about that.</p><p>Thanks,John</p>","500595","","","","","2011-12-11 04:40:10","push notification for RSS Feed?","<android>","3","1","2","",""
"4602191","1","4603956","","2011-01-05 08:47:23","2","1471","<p>i have a html output, wich is full screen at the start. With the zoom control i can zoom in/out. </p><p>I want only zoom in, and not out. So: the minimal zoom out i want is 100% of the full screen. And the maximal zoom in i want to 400%. </p><p>Is there a way to do it?</p><p>Thanks</p>","472537","","","","","2011-08-02 13:32:25","Android webview only zoom in","<android><webview>","2","0","","",""
"4602336","1","","","2011-01-05 09:08:23","1","3136","<p>When I try to play a video on my sd card, i get the error message ""Sorry, this video cannot be played"". Is there anything wrong with my code? None of the commented code seems to work.</p><pre><code>  public void PlayVideo(View view){       VideoView videoView = (VideoView) findViewById(R.id.videoView);MediaController mediaController = new MediaController(this);mediaController.setAnchorView(videoView);</code></pre><p>// final String MEDIA_PATH = new String(""/sdcard/yu5.mp4"");</p><pre><code>//videoView.setVideoPath(MEDIA_PATH);//videoView.setVideoURI(Uri.fromFile(new File(Environment.getExternalStorageDirectory(),""yu5.mp4"")));//videoView.setVideoURI(Uri.parse(""file:///sdcard/yu5.mp4""));videoView.setVideoURI(Uri.parse(""http://www.law.duke.edu/cspd/contest/finalists/viewentry.php?file=mfog""));videoView.setMediaController(mediaController);videoView.start();}</code></pre><p>When i stream from the web like in the code, the video is lagging a lot.</p>","557187","","","","","2011-01-05 13:46:22","Android 2.2: Problem playing video from SD card","<android><videoview><lag>","1","1","","",""
"4602359","1","","","2011-01-05 09:11:43","2","3442","<p>I have an XML to be parsed, which as given below</p><pre><code>&lt;feed&gt;    &lt;feed_id&gt;12941450184d2315fa63d6358242&lt;/feed_id&gt;    &lt;content&gt; &lt;fieldset&gt;&lt;table cellpadding='0'  border='0'  cellspacing='0'  style=""clear :both""&gt;&lt;tr valign='top' &gt;&lt;td width='35' &gt;&lt;a href='http://mypage.rediff.com/android/32868898'  class='space' onmousedown=""return enc(this,'http://track.rediff.com/click?url=___http%3A%2F%2Fmypage.rediff.com%2Fandroid%2F32868898___&amp;service=mypage_feeds&amp;clientip=202.137.232.113&amp;pos=0&amp;feed_id=12941450184d2315fa63d6358242&amp;prc_id=32868898&amp;rowid=674061088')"" &gt;&lt;div style='width:25px;height:25px;overflow:hidden;'&gt;&lt;img src='http://socialimg04.rediff.com/image.php?uid=32868898&amp;type=thumb'  width='25'  vspace='0'  /&gt;&lt;/div&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;span&gt;&lt;a href='http://mypage.rediff.com/android/32868898'  class=""space"" onmousedown=""return enc(this,'http://track.rediff.com/click?url=___http%3A%2F%2Fmypage.rediff.com%2Fandroid%2F32868898___&amp;service=mypage_feeds&amp;clientip=202.137.232.113&amp;pos=0&amp;feed_id=12941450184d2315fa63d6358242&amp;prc_id=32868898&amp;rowid=674061088')"" &gt;Android &lt;/a&gt; &lt;/span&gt;&lt;span style='color:#000000 !important;'&gt;testing&lt;/span&gt;&lt;div class='divtext'&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td height='5' &gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/fieldset&gt;&lt;br/&gt;&lt;/content&gt;    &lt;action&gt;status updated&lt;/action&gt;&lt;/feed&gt;</code></pre><p>Tag  contains HTML contents, which contains the data which i need. I am using a SAX Parser. Here's what i am doing</p><pre><code>private Timeline timeLine; //Objectprivate String tempStr;public void characters(char[] ch, int start, int length)        throws SAXException {    tempStr = new String(ch, start, length);}public void endElement(String uri, String localName, String qName)        throws SAXException {    if (localName.equalsIgnoreCase(""content"")) {        if (timeLine != null) {            timeLine.setContent(tempStr);        }}</code></pre><p>Will this logic work? If no, how should i extract embedded HTML data from XML using SAX Parser.</p>","548903","","548903","","2011-01-05 09:39:19","2011-10-02 06:52:31","SAX Parser : Retrieving HTML tags from XML","<java><android><saxparser>","4","2","1","",""
"4602387","1","4797061","","2011-01-05 09:14:51","2","895","<p>I have one activity which i am using for displaying Dialogs and as a normal layout.<br>So what i want to do is, sometimes i want to start activity as Theme Dialog and some times using setContentView.  </p><p>I can't use <code>&lt;activity android:theme=""@android:style/Theme.Dialog""&gt;</code> in manifest file as it will always display activity as dialog.  </p><p>So can we do it programmatic, i have also tried <code>setTheme()</code> method but it did't work.</p><p>Thanks,<br>PP.</p>","314247","","314247","","2011-01-05 11:49:59","2011-01-25 17:54:25","How to start an activity Dialog","<android>","1","0","","",""
"4602492","1","4634080","","2011-01-05 09:27:41","3","7026","<p>I am working on a custom Android library. I start off with a java project (in Eclipse) with another UI testing Android project. </p><p>In my UI testing project, I reference the library project in build path, and everything is good and I can test the library codes in the UI. </p><p>Later on, I decided I need to have the 'Gen' code (for custom styles attributes), so I try to change my library to an Android project (via Android-tools -> convert.. ), and disasters happens! After fixing up all the compile time problems, it finally 'let' me start the UI testing application, and bangs! When I try to create any objects from the library class, it said (in the Log) that <strong>Class not found</strong>. </p><p>Two questions:</p><ol><li><p>Any idea how to fix this? I tried  but seems it is for referencing another .apk that need to install separately. </p></li><li><p>If I just keep it to be java project (not android) for my library, can I use the resource generator? and how?</p></li></ol><p>PS: the dependency (my library) is installed before the UI test application, according to  the Console of Eclipse said. </p><p>Update: I tried to compile the library project to jar and reference it from the UI testing, and in this way, it works. But I don't want to use this approach since it is very slow in terms of testing. </p>","109112","","","","","2013-04-08 07:21:51","Referencing Android custom library cause runtime class not found error in Application","<android><classnotfoundexception>","2","1","2","",""
"4602541","1","4604745","","2011-01-05 09:33:29","0","318","<p>I have registered my app to send a broadcast at some particular time using the alarm manager, and have set a receiver to listen to that broadcast. </p><p>Now there can be 2 cases:</p><ol><li>The OS feels there is a memory crunch and removes the app from the background. The android documentation says that the OS will ensure that my receiver receives my broadcast. Is it true ? How can I test such case ?</li><li>A user decides to close my app using any task killer. Will I receive broadcast in such case too ? If not then is there any way to handle such case ?</li></ol>","266272","","","","","2011-01-05 13:49:13","Android handling broadcasts in different scenarios","<android><broadcastreceiver>","1","0","0","",""
"4602542","1","4602815","","2011-01-05 09:33:30","0","605","<p>I have a response in html form from the server, now I want to read the characters or say data of between particular tag, for example: font tag starting---(The data that I want to read)----font tag ending.</p><p>I have stored the string in a String Variable named ""response"".</p><p>How can I do this in android?</p><p>Thanks,david</p>","422859","","422859","","2011-01-05 09:50:11","2011-01-05 10:06:05","how to read the string of a particular <html> tag in android","<android><string>","2","0","","",""
"4602601","1","4602750","","2011-01-05 09:40:32","0","1356","<p>If there are many control in a window which can not appear at same time on window. There may be an option to show them to use view as scrollable, but I don't know how to use it. In my design 5 Edittext in horizontal view and two buttons in vertical view. how can I manage them?</p>","550966","","550966","","2013-05-02 07:50:53","2013-05-02 07:50:53","Make scrollable View of window using .xml file : Android","<android><android-layout><scrollview>","2","1","","",""
"4602693","1","4603339","","2011-01-05 09:51:32","2","832","<p><strong>Following is my understanding:</strong></p><p>With the help of iPhone and Android library, we can pay the amount from one Pay pal account to another account.</p><p><strong>This is my doubt:</strong></p><p>Then how can let the user pay the amount using his credit card details in an iPhone or Android App? Are you providing any Web service APIs to achieve it?</p><p>If this is not possible, how can we let the user pay using his/her credit card?</p>","189006","","","","","2011-01-05 11:04:10","Is checkout with Credit card details possible through iPhone and Android Library?","<iphone><android><paypal>","1","7","","",""
"4602703","1","","","2011-01-05 09:53:26","0","351","<p>i have successfully implemented custom rounded tabs but now i want to shape up my tab as follows.</p><p>Please see the read marked i want to shape up the bottom right corner like this</p><p><img src=""http://i.stack.imgur.com/YxWIG.png"" alt=""alt text""></p>","405383","","","","","2011-01-05 09:53:26","shape up custom tabs","<android><tabs>","0","3","1","",""
"4602739","1","4602938","","2011-01-05 09:57:45","1","692","<p>i am new to android,when i create a project with 1.5 to 2.1, i gives me the same error that proguard is missing from there path.according to recently asked questions here, i am searching for defualt.properties file,,,, but it is not present,, where i can find this, please give me full solution.</p>","563724","","","","","2011-01-05 10:18:47","i am searching for default.properties file for missing proguard.cfg","<android>","1","0","1","",""
"4602769","1","4602879","","2011-01-05 10:01:14","0","385","<p>i have an option to ""mute"" in my menu options like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;CheckBoxPreference android:summary=""Mute all sound effects"" android:title=""Mute""android:key=""muteSound""&gt;&lt;/CheckBoxPreference&gt;&lt;/PreferenceScreen&gt;</code></pre><p>now how can i check if that checkbox is checked or not?</p>","486086","","","","","2011-01-05 10:18:25","how do i reference a checkbox in my options menu from my main activity in android?","<android><menu><checkbox>","2","0","0","",""
"4602827","1","","","2011-01-05 10:07:06","0","451","<p>How can I set the list view just scroll 5 items on each scroll? <br /> Or I just want to slow down the scroll speed. <br /> The reason for this is I want my scrolling smoother.</p>","364210","","","","","2011-01-05 10:07:06","Android - How to control numbers of item on each scroll on ListView?","<android>","0","2","1","",""
"4602841","1","","","2011-01-05 10:08:46","0","498","<p>I am trying to retrieve the contents of database into a <code>List</code> view but not able to display them. Since the cursor contains only one item, don't know why, but it is not getting displayed in the list.</p><p>I also took reference of <code>ListActivity</code> on <code>developer.android</code> but could not solve the problem. Can some one here help me!!</p><p>I am posting my code: </p><pre><code>setContentView(R.layout.simple_list_item_1);    System.out.println(""Creating db"");     mDatabase = openOrCreateDatabase(Helper.DATABASE_NAME,                     SQLiteDatabase.CREATE_IF_NECESSARY, null);    System.out.println(""Created db"");  //String[] args= {Long.toString(id)};  mDatabase.execSQL(Helper.CREATE_TABLE);    System.out.println(""Creating table"");  addContents();  addContents();  addContents();  String[] fields = {Helper.ID, Helper.DESC, Helper.DOSAGE};  calendarData = mDatabase.query(Helper.TABLE_NAME, fields, null, null,                        Helper.DESC, null, null);  int count = calendarData.getCount();    System.out.println(""Queried db: ""+count);  startManagingCursor(calendarData);  int[] fieldTextViews = {android.R.id.text1,android.R.id.text2};  ListAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.two_line_list_item,                               calendarData, fields, fieldTextViews);  setListAdapter(adapter);  </code></pre>","521380","","250259","","2012-09-10 14:02:32","2012-09-10 14:02:32","Database cursor retrieves only one row always","<android><database>","2","1","","",""
"4602898","1","","","2011-01-05 10:14:39","0","671","<p>I'm creating a login registration page with username &amp; password edittext fields .i need to store the values from that fields into sqlite database.How could i do this?coding is much better for me.Thanks..</p>","555948","","135152","","2011-07-05 17:50:29","2011-07-05 17:50:29","Login page in android","<android><sqlite>","0","7","","",""
"4602902","1","4602929","","2011-01-05 10:14:58","143","220857","<p>In XML, we can set a text color by the <code>textColor</code> attribute, like <code>android:textColor=""#FF0000""</code>. But how do I change it by coding?</p><p>I tried something like:</p><pre><code>holder.text.setTextColor(R.color.Red);</code></pre><p>Where <code>holder</code> is just a class and <code>text</code> is of type <code>TextView</code>. Red is an RGB value (#FF0000) set in strings.</p><p>But it shows a different color rather than red. What kind of parameter can we pass in setTextColor()? In documentation, it says <code>int</code>, but is it a resource reference value or anything else?</p>","415865","","63550","","2014-03-16 16:50:24","2014-03-16 16:50:24","How to set the text color of TextView in code?","<android><colors><textview>","15","0","43","",""
"4602997","1","4603756","","2011-01-05 10:24:22","0","516","<p>Hi i need to use ACRA for crashreporting , am using my company email account provided by google, the problem ACRA send crashreport to "" Connect to <a href=""http://spreadsheets.google.com/formResponse"" rel=""nofollow"">http://spreadsheets.google.com/formResponse</a>?... "" in my case my sphreadsheet link contain my company name also how can use ACRA in this case</p>","487219","","741249","","2012-02-02 13:27:31","2012-02-02 13:27:31","Android ACRA SphreadSheet link","<android><google-spreadsheet><crash-reports><acra>","1","0","","",""
"4603031","1","","","2011-01-05 10:28:30","14","5099","<p>the xml element ""enabled"" for a checkbox is deprecated. Eclipse tells me to use state_enabled instead. I tried to add</p><pre><code>android:state_enabled=""false""</code></pre><p>to my checkbox within my xml instead of</p><pre><code>android:enabled=""false""</code></pre><p>But it doesn't show any effect. The latter one does the desired. I don't want to use a deprecated method. Am I doing something wrong?</p><p>Thanks.</p>","481493","","741249","","2012-05-03 12:07:30","2012-05-03 12:07:30","Android checkbox state_enabled","<android><eclipse><checkbox><deprecated>","1","0","1","",""
"4603085","1","","","2011-01-05 10:34:08","0","695","<p>I am developing an alarm based app. In this I need to set the alarm start time and stop time. For this I am using 2 alarms. Everything is working fine except one point.</p><p>I need to initiate the alarm on next day (at the user selected time) if the user selected time is past the current time.</p><p>Example: </p><pre><code>Current time:  6:00 PMUser selected start time:  9:30 AM</code></pre><p>Now alarm should initiate  on next day at 9:30 AM. For this I added 24 hours time to the alarm initiation time (24*60*60*1000). But it is not working.  Any one of you please suggest me what to do for this. Below is the code I wrote,        ................................................................................................................................................................................</p><pre><code>PendingIntent alarmPending =         PendingIntent.getBroadcast(this,STARTREQUEST,startIntent,1);if (currenttime&gt;usersettime) {    //initiate after 24 hours at the usersettime        alarmMan.setRepeating(AlarmManager.RTC_WAKEUP,            usersettime+(24*60*60*1000),alarmIntervalTime, alarmPending);} else {    ****//initiate immediately****    alarmMan.setRepeating(AlarmManager.RTC_WAKEUP,            usersettime,alarmIntervalTime, alarmPending);}</code></pre><p>Thanks  </p>","540798","","382763","","2011-01-05 10:57:04","2011-01-05 10:57:04","How to initiate Alarm after 24 hours in Android","<android><alarm>","0","8","","",""
"4603113","1","4603258","","2011-01-05 10:37:42","0","2680","<p>I am trying to record call in my android application but when I use UPLINK, DOWNLINK  as audio source both time it record voice  from the MIC. When I used VOICE_CALL it produced noise in recording, is it bug or can anybody help me with this?</p><p>Thanks</p>","533863","","261560","","2012-07-17 11:52:58","2012-07-17 11:52:58","Record Call in android","<android><android-sdk-2.2>","1","0","","",""
"4603148","1","","","2011-01-05 10:42:22","1","467","<p>Hi everyoneI am creating a greeting card application wherein the user can choose from a set of backgrounds and add text to it.Now my question is how can I convert this screen as a JPEG image which can be sent as a mail to someone.That is the entire greeting card (image+text) is a jpeg image for the viewer.</p><p>Thanks everyone in advance</p>","563778","","","","","2011-01-05 10:58:25","Convert an android acreen as Jpeg image","<android>","1","0","","",""
"4603217","1","4603317","","2011-01-05 10:51:20","4","5952","<p>When I changed some design in .xml file, R.java file automatically deleted. How can I get back that file and what is the solution to resolve this problem, that in future this problem does not occure.</p>","550966","","","","","2014-03-10 09:49:21","R.java deleted automatically: Android","<android>","7","0","2","",""
"4603227","1","6532706","","2011-01-05 10:52:08","0","601","<p>I am unable to open google in my android emulator.  i have set the proxy        in debug configuration...--> application--> target tab--?aditional emulator command line options(-http-proxy  http://:/)</p><p>still i am not open google in my emulator</p><p>help me</p><p>thanks in advance.</p>","489902","","","","","2011-06-30 09:27:50","Unable to open google in android emulator's browser","<android><proxy>","1","0","","",""
"4603371","1","","","2011-01-05 11:08:00","0","184","<p>do you know project libs-for-android hosted on google code <a href=""https://code.google.com/p/libs-for-android/"" rel=""nofollow"">https://code.google.com/p/libs-for-android/</a>?</p><p>Well, i want to use it, but i need tutorials.</p><p>Can you give me tutorials on how to use feeds.jar?</p><p>Thanks.</p>","251434","","","","","2011-01-05 11:08:00","Need tutorials on libs-for-android","<android><feed><cache-control><libs><imagelibrary>","0","3","","",""
"4603426","1","","","2011-01-05 11:15:39","2","588","<p>I have one problem in the Tabbar with text box, when i click on text box keyboard comes but the tabbar comes over the keyboard, and i want to get the keyboard only tabbar should not be comes over the keyboard.</p><p>Screen scroll automatically when keyboard comes.</p>","554837","","","","","2011-09-26 13:58:25","Keyboard comes with tabbar.. how to get only keyboard","<android>","1","3","2","",""
"4603427","1","4603640","","2011-01-05 11:15:47","5","17898","<p>I've never developed for Android before, so please consider me 100% dumb when you answer :)</p><p>I would like to create an application launcher that will open the default web browser to a given url.In other words, I want to make an icon with my website logo, and when you click on it, it opens the site in your default web browser.</p><p>Could someone direct me towards a tutorial/documentation page to achieve this?Or if it's really simple, maybe show me some code here?</p><p>Thanks for your time!</p><p>P</p>","206808","","","","","2012-08-17 05:29:53","Android: How to create a launcher","<android><mobile-website><launcher>","3","0","2","",""
"4603459","1","","","2011-01-05 11:18:15","0","4809","<p>After I try different way, i cannot able to retrieve all data from <code>HttpResponse</code>.</p><p>Here is my code :</p><pre><code>private static final DefaultHttpClient httpClient =    new DefaultHttpClient();public void get() throws Exception {    HttpPost httpPost = new HttpPost(""https://dt.abc.net/abc.exe"");    httpPost.addHeader(""Accept"", ""text/xml"");    httpPost.setHeader(""Content-Type"",""application/xml;charset=UTF-8"")    List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();    nameValuePairs.add(new BasicNameValuePair(""XML"",             getRequestTypeStringBuilder()));    // In here ""XML"" is parameter value that is required send to the server     // before request data from server.    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));    HttpParams params = new BasicHttpParams();    HttpConnectionParams.setStaleCheckingEnabled(params, false);    HttpConnectionParams.setConnectionTimeout(params, 5000);    HttpConnectionParams.setSoTimeout(params, 5000);    httpClient.setParams(params);    httpClient.getParams().setParameter(            ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109);    HttpResponse response = httpClient.execute(httpPost);    InputStream is = response.getEntity().getContent();    ByteArrayOutputStream os = new ByteArrayOutputStream();    byte[] buf;    int ByteRead;    buf = new byte[1024];    String xmldata = null;    while ((ByteRead = is.read(buf, 0, buf.length)) != -1) {        os.write(buf, 0, ByteRead);        totalSize += ByteRead;                          }    xmldata =  os.toString().replaceAll("" "", """");    os.close();    is.close();}</code></pre><p>A problem is, if i set content-type = ""application/xml"" and try to retrieve data  from remote server, which is in large amount, it could not retrieve all data. However, if data is reletively small, then it works perfect.</p><p>All return data are in XML format</p><p>Another problem if i change content-type=""application/x-www-form-urlencoded"", it throws and exception :</p><pre><code>01-05 18:59:53.165: WARN/System.err(372): javax.net.ssl.SSLProtocolException: Read error: ssl=0x2f9698: Failure in SSL library, usually a protocol error01-05 18:59:53.195: WARN/System.err(372):     at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)01-05 18:59:53.208: WARN/System.err(372):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:786)01-05 18:59:53.215: WARN/System.err(372):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)01-05 18:59:53.236: WARN/System.err(372):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)01-05 18:59:53.236: WARN/System.err(372):     at org.apache.http.impl.io.IdentityInputStream.read(IdentityInputStream.java:86)01-05 18:59:53.246: WARN/System.err(372):     at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)01-05 18:59:53.286: WARN/System.err(372):     at com.epsilon.android.dreammailandroid.remoteserver.AsyncDownloadDataInsert.doInBackground(AsyncDownloadDataInsert.java:111)01-05 18:59:53.295: WARN/System.err(372):     at com.epsilon.android.dreammailandroid.remoteserver.AsyncDownloadDataInsert.doInBackground(AsyncDownloadDataInsert.java:1)01-05 18:59:53.316: WARN/System.err(372):     at android.os.AsyncTask$2.call(AsyncTask.java:185)01-05 18:59:53.316: WARN/System.err(372):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)01-05 18:59:53.335: WARN/System.err(372):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)01-05 18:59:53.335: WARN/System.err(372):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)01-05 18:59:53.346: WARN/System.err(372):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)01-05 18:59:53.396: WARN/System.err(372):     at java.lang.Thread.run(Thread.java:1019)01-05 18:59:55.764: WARN/InputManagerService(61): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4065a640</code></pre><p>I couldn't understand why i couldn't get all data in response. </p><p>Could you help me, figure out what is problem in my code.</p><p>Note: I retrieve data from android application.</p><p>Thank you,</p><p>""May all being be happy""</p><p>Regards and Metta,Ichirohang Limbu</p>","553710","","271357","","2011-01-05 11:26:06","2014-03-28 00:31:28","unable to retrieve all data from httpResponse","<java><android><http><httpwebresponse>","2","3","1","",""
"4603465","1","4608414","","2011-01-05 11:18:58","2","2894","<p>I am trying to run a simple SIP program using android 2.3 emulator.</p><p>When i am trying to create an instance of SipManager i get a return value as null(which means the SIP API isn't supported).</p><p>Pls suggest how i can test SIP in emulator.</p>","552712","","","","","2012-03-01 09:51:24","SipManager.newInstance not working for android Gingerbread","<android><android-emulator><sip>","1","0","4","",""
"4603486","1","","","2011-01-05 11:21:30","0","1934","<p>How can I add images to array list, and then add that array list to a view, in Android?</p>","562237","","651104","","2012-06-19 06:08:29","2012-06-19 06:08:29","How can I add images to array list, and then add that array list to a view, in Android?","<android>","1","0","","",""
"4603508","1","4603866","","2011-01-05 11:23:22","0","459","<p>in my app which is distributed outside of the market, the user can upgrade by downloading an apk. My app notifies the user when an upgrade is available, and if he/she clicks 'Upgrade', a VIEW intent is then launched with the apk URL. </p><p>Server-side, the apk is delivered statically, with mimetype <code>application/vnd.android.package-archive</code>.</p><p>All this works fine. However, starting from Froyo, the browser exits immediately and performs the download in background. That's quite confusing for the user. Before Froyo, the download was performed in the foreground, and when done it was natural for the user to tap on the downloaded item.</p><p>Is there a way to have the browser download in the foreground in Froyo?</p>","377478","","","","","2012-04-10 12:02:11","How to to force the browser to download in foreground?","<android><browser>","1","0","","",""
"4603578","1","","","2011-01-05 11:32:01","0","2289","<p>I'm writing an application that displays large bitmaps in tiles like Google Maps does. A server sends bitmaps that I draw into a scaled/translated canvas. I want this bitmaps to be drawn anti-aliased, but if I enable anti aliasing on the canvas, the edged of the bitmaps are mixed up with the background (none/black) and produce ugly dark lines between the tiles.Is there a way to tell Android not to antialias the edges of the bitmap on drawing? Or what other soulutions exist for that problem?</p>","471069","","881229","","2014-01-31 05:17:09","2014-01-31 05:17:09","Android partially anti alias","<android><bitmap><android-canvas><draw><antialiasing>","2","0","0","",""
"4603647","1","","","2011-01-05 11:41:54","1","213","<p>I  want to add a video as a child  in the expandable list view in android. In order to achieve this i had  wrote the following piece of code </p><pre><code>    children = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();    curChildMap = new HashMap&lt;String, Object&gt;();    curChildMap.put(""MyVideo"", getResources().getMovie(R.raw.test));    children.add(curChildMap);            childData.add(children); </code></pre><p>// And I had defined the following code in getChildView method. </p><pre><code> else if (groupPosition == 3)                        {                         LayoutInflater li = getLayoutInflater();                         v = li.inflate(R.layout.recipe_video, null);                         VideoView videoView = (VideoView)findViewById(R.id.VideoView01);                         videoView.setKeepScreenOn(true);                             videoView.setVideoPath((String)((Map&lt;String,Object&gt;)getChild(groupPosition, childPosition)).get(""MyVideo""));                             videoView.start();                             }</code></pre><p>But somehow i am not able to see the video. It is showing me, that the application has stopped unexpectedly. Can anybody please tell me that what i had done wrong in this code snippet ?</p><p>Thanks,</p><p>Neha</p>","535026","","424413","","2011-01-05 18:23:06","2011-01-05 18:23:06","Need Help in Adding a video as a child element in the expandable list view in android?","<android><expandablelistview><videoview>","0","1","0","",""
"4603720","1","","","2011-01-05 11:53:04","0","1445","<p>im new to android development and im trying to build my first app which looks for a online generated xml file to display information. In the first activity i created a ListView with all the entries from an XML file, as soon as i click on an entry it passes the id and goes to the 2nd activity which should access another XML file with the details. However i keep getting this error when trying to fetch the XML for the details:</p><blockquote>  <p>java.lang.ClassCastException:  org.apache.harmony.xml.dom.ElementImpl</p></blockquote><p>Any ideas whats wrong? Here is the source for the ""details"" activity:</p><pre><code>package en.android.itleaked.com;import java.io.InputStream;import java.net.URL;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.InputSource;import android.app.Activity;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.sax.Element;import android.widget.ImageView;import android.widget.TextView;public class showReleases extends Activity { protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.releasedetails);  getFeed(); } public void getFeed() {  Bundle extras = getIntent().getExtras();  try {      URL url2 = new URL(""http://www.it-leaked.com/app/details.php?id="" + extras.getString(""id""));   DocumentBuilderFactory dbf2 = DocumentBuilderFactory.newInstance();   DocumentBuilder db2 = dbf2.newDocumentBuilder();   Document doc2 = db2.parse(new InputSource(url2.openStream()));   doc2.getDocumentElement().normalize();   NodeList nodeList2 = doc2.getElementsByTagName(""item"");   String relTitle[] = new String[nodeList2.getLength()];   String relCover[] = new String[nodeList2.getLength()];   for (int i = 0; i &lt; nodeList2.getLength(); i++) {    Node node2 = nodeList2.item(i);    Element fstElmnt2 = (Element) node2;    NodeList nameList2 = ((Document) fstElmnt2).getElementsByTagName(""title"");    Element nameElement2 = (Element) nameList2.item(0);    nameList2 = ((Node) nameElement2).getChildNodes();    relTitle[i] = ((Node) nameList2.item(0)).getNodeValue();    NodeList coverList2 = ((Document) fstElmnt2).getElementsByTagName(""cover"");    Element coverElement2 = (Element) coverList2.item(0);    coverList2 = ((Node) coverElement2).getChildNodes();    relCover[i] = ((Node) coverList2.item(0)).getNodeValue();   }   TextView txtView = (TextView)findViewById(R.id.TextView01);   txtView.setText(relTitle[0]);         ImageView imgView =(ImageView)findViewById(R.id.ImageView01);   Drawable drawable = LoadImageFromWebOperations(relCover[0]);         imgView.setImageDrawable(drawable);  }   catch (Exception e) {    TextView txtView2 = (TextView)findViewById(R.id.TextView02);    txtView2.setText(""Error: "" + e);   }}  private Drawable LoadImageFromWebOperations(String url)    {   try   {    InputStream is = (InputStream) new URL(url).getContent();    Drawable d = Drawable.createFromStream(is, ""src name"");    return d;   }catch (Exception e) {    System.out.println(""Exc=""+e);    return null;   }  }}</code></pre><p>Here is the URL for the XML with an attached id so you can see what it looks like:<a href=""http://www.it-leaked.com/app/details.php?id=50969"" rel=""nofollow"">http://www.it-leaked.com/app/details.php?id=50969</a></p><p>Any ideas whats going on? By the way i added the number 2 to every variable which has something to do with the XML parsing / fetching just to make sure theres no conflict with the other activity, but im still getting the same error..I hope you can help me out.Thanks in advance</p>","563020","","","","","2012-04-05 14:30:51","Error when fetching a second XML from the web","<android><xml><parsing>","2","2","","",""
"4603826","1","","","2011-01-05 12:07:59","6","2027","<p>I sometimes get reports of this error shown above in my applications. I never see this error during development and test. The applications is for 2.1 and higher. I test in 2.1, 2.2 and 2.3 (emulator) and real devices (except 2.3).</p><p>Here's the part of a layout file that produces this error (the view is part of a TableLayout):</p><pre><code> &lt;TextView style=""@style/ActivityTitleBar"" android_layout_span=""2"" android:layout_weight=""2"" android:text=""@string/txt_appname"" /&gt;</code></pre><p>Here's the style definition:</p><pre><code>&lt;style name=""ActivityTitleBar""&gt;&lt;item name=""android:background""&gt;@drawable/titlebar&lt;/item&gt;&lt;item name=""android:gravity""&gt;center&lt;/item&gt;&lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;&lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;&lt;item name=""android:singleLine""&gt;true&lt;/item&gt;&lt;item name=""android:textColor""&gt;#fff&lt;/item&gt;&lt;item name=""android:textSize""&gt;14sp&lt;/item&gt;&lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;&lt;/style&gt;</code></pre><p>In res/drawable is a XML file with this content:</p><pre><code>&lt;nine-patchxmlns:android=""http://schemas.android.com/apk/res/android""android:dither=""true""android:src=""@drawable/titlebar"" /&gt;</code></pre><p>The titlebar.png is located in my drawable-hdpi, drawable-ldpi and drawable-mdpi folders.</p><p>I don't have any clue what device or Android release causes this error.</p><p>Any ideas?</p><p>Many thanks in advance.</p><p>HJW</p><p>Here's the stack-trace-report:</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{de.x.y.android/de.x.y.android.Main}: android.view.InflateException: Binary XML file line #18: Error inflating class android.widget.TextViewat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2781)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2797)at android.app.ActivityThread.access$2300(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2132)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:4914)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:858)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)at dalvik.system.NativeStart.main(Native Method)Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class android.widget.TextViewat android.view.LayoutInflater.createView(LayoutInflater.java:513)at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)at android.view.LayoutInflater.inflate(LayoutInflater.java:407)at android.view.LayoutInflater.inflate(LayoutInflater.java:320)at android.view.LayoutInflater.inflate(LayoutInflater.java:276)at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)at android.app.Activity.setContentView(Activity.java:1654)at de.x.y.android.MyActivity.onCreate(MyActivity.java:46)at de.X.Y.android.Main.onCreate(Main.java:190)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1065)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2745)... 11 moreCaused by: java.lang.reflect.InvocationTargetExceptionat android.widget.TextView.&lt;init&gt;(TextView.java:332)at java.lang.reflect.Constructor.constructNative(Native Method)at java.lang.reflect.Constructor.newInstance(Constructor.java:446)at android.view.LayoutInflater.createView(LayoutInflater.java:500)... 25 moreCaused by: android.content.res.Resources$NotFoundException: File res/drawable/titlebar.xml from drawable resource ID #0x7f020003at android.content.res.Resources.loadDrawable(Resources.java:1697)at android.content.res.TypedArray.getDrawable(TypedArray.java:601)at android.view.View.&lt;init&gt;(View.java:1885)at android.widget.TextView.&lt;init&gt;(TextView.java:338)... 29 moreCaused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: &lt;nine-patch&gt; requires a valid src attributeat android.graphics.drawable.NinePatchDrawable.inflate(NinePatchDrawable.java:262)at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)at android.content.res.Resources.loadDrawable(Resources.java:1694)... 32 more</code></pre>","471681","","180538","","2011-01-05 13:42:40","2013-04-04 10:03:22","Sometimes: <nine-patch> requires a valid src attribute","<android><resources><png><styles>","2","1","","",""
"4603941","1","4612781","","2011-01-05 12:23:27","9","7024","<p>I have save file in <code>sdcard/media/audio/ringtone</code>s folder. That file will appear in list of ringtone selection from <code>settings/sound/phone</code> Ringtone.</p><p>But I want to set that file as a ringtone from my code.Here is my code.</p><pre><code>  File k = new File(path, filename);  ContentValues values = new ContentValues();  values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());  values.put(MediaStore.MediaColumns.TITLE, ""TwiAppclip"");  values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/*"");  values.put(MediaStore.Audio.Media.ARTIST, ""cssounds "");  values.put(MediaStore.Audio.Media.IS_RINGTONE, true);  values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);  values.put(MediaStore.Audio.Media.IS_ALARM, false);  values.put(MediaStore.Audio.Media.IS_MUSIC, false);  Uri uri = MediaStore.Audio.Media.getContentUriForPath(k       .getAbsolutePath());  Uri newUri = getApplicationContext().getContentResolver().insert(uri, values);  RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(),      RingtoneManager.TYPE_RINGTONE, newUri);</code></pre><p>here <code>uri</code> I am getting But I got <code>newUri = null</code>. I think that's why its is not setting as ringtone.</p><p>Anyone know where is the problem? how do I get <code>newUri</code> proper?</p>","543022","","18061","","2012-10-01 07:52:48","2014-03-20 02:40:22","setting audio file as Ringtone","<android><ringtone>","2","1","9","",""
"4604011","1","","","2011-01-05 12:33:11","2","6737","<p>Hi I have two imageviews in a LinearLayout(Vertical orientation). I am setting setOnTouchListener for both the Imageviews.This way i am able to observe the Multi touch zoom as well as all the dragging of the ImageViews.The problem comes when i try to implement OnDoubletapListener.OnDoubleTapListener works only without the use of setOnTouchListener.</p><p>However if i comment the setOnTouchListner then i am able to perform Double Tap..</p><p>Can't the two feartures work simultaneously?????</p><p>If You want i can provide the source code as well..Pl Help</p><p>Ankit Verma</p>","563911","","","","","2011-12-03 08:01:47","Android multi touch and double tap working together for an imageview","<android><double><multi-touch><tap>","3","0","1","",""
"4604025","1","4604145","","2011-01-05 12:35:02","4","5735","<p>Iam planing to give create 3 buttons with layout_weight=1, not interested in custom dialog.So I have written below code.It is not working.Always yes button gives me null.Whats wrong in this code?</p><pre><code>  AlertDialog dialog= new AlertDialog.Builder(this).create();            dialog.setIcon(R.drawable.alert_icon);            dialog.setTitle(""title"");            dialog.setMessage(""Message"");            dialog.setButton(AlertDialog.BUTTON_POSITIVE,""Yes"", new DialogInterface.OnClickListener() {                @Override                public void onClick(DialogInterface arg0, int arg1) {                                                }            });            Button yesButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);            Log.w(""Button"",""""+yesButton);//here getting null            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1f);            yesButton.setLayoutParams(layoutParams);            dialog.show();</code></pre><p>Regards,Android developer.</p>","486216","","486216","","2011-01-05 12:59:13","2013-01-30 10:16:04","alertDialog.getButton() method gives null pointer exception android","<android><alertdialog>","3","0","2","",""
"4604039","1","4621536","","2011-01-05 12:37:16","6","2488","<p>I want track install referer for my application using google analytics.<br>I don't want use the Tracking Pageviews and Events feature, only install.<br>So I added the sdk jar in my app, add these lines to the manifest :</p><pre><code>&lt;receiver android:name=""com.google.android.apps.analytics.AnalyticsReceiver""      android:exported=""true""&gt;      &lt;intent-filter&gt;          &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;      &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>And publish the app.<br>But how can see the stats ? I never entered my UA-xxxxxxx id.  </p><p>For the Pageviews and Events tracking it's here :</p><pre><code>tracker.start(""UA-YOUR-ACCOUNT-HERE"", this);</code></pre><p>But as thew readme says : <em>(NOTE: do not start the GoogleAnalyticsTracker in your Application onCreate()method if using referral tracking).</em></p><p>But with referer where do I put my id ?<br>And what is the url to watch in the google analytics console ?</p><p>Thx</p>","404289","","","","","2011-08-23 19:26:31","Google Analytics, Install Tracking android","<android><google-analytics><install><referer>","2","0","2","",""
"4604066","1","","","2011-01-05 12:41:30","5","1489","<p>I'm trying to create a <strong>custom Android control</strong> that <strong>contains a LinearLayout</strong>. You can think of it as an extended LinearLayout with fancy borders, a background, an image on the left...</p><p>I could do it all in XML (works great) but since I have dozens of occurences in my app it's getting hard to maintain. I thought it would be nicer to have something like this:</p><pre><code>/* Main.xml */&lt;MyFancyLayout&gt;    &lt;TextView /&gt;   /* what goes inside my control's linear layout */&lt;/MyfancyLayout&gt;</code></pre><p>How would you approach this? I'd like to avoid re-writing the whole linear layout onMeasure / onLayout methods. This is what I have for the moment:</p><pre><code>/* MyFancyLayout.xml */&lt;TableLayout&gt;    &lt;ImageView /&gt;    &lt;LinearLayout id=""container"" /&gt;   /* where I want the real content to go */&lt;/TableLayout&gt;    </code></pre><p>and </p><pre><code>/* MyFancyLayout.java */public class MyFancyLayout extends LinearLayout{    public MyFancyLayout(Context context) {        super(context);        View.inflate(context, R.layout.my_fancy_layout, this);    }}</code></pre><p>How would you go about inserting the user-specified content (the TextView in main.xml) in the right place (id=container)?</p><p>Cheers!</p><p>Romain</p><p>----- edit -------</p><p>Still no luck on this, so I changed my design to use a simpler layout and decided to live with a bit of repeated XML. Still very interested in anyone knows how to do this though!</p>","51473","","51473","","2011-01-11 02:48:57","2011-05-18 09:45:46","Custom Android control with children","<android><border><android-linearlayout>","4","0","2","",""
"4604107","1","","","2011-01-05 12:46:30","0","812","<p>I found out that when I browse my site in Android's default browser, the site is loaded without the design defined in the css file.<br>(The same site looks well designed on IE7, IE8, FireFox, Chrome and Safari) </p><p>I'm not really sure what the problem can be...<br>I'll appreciate any idea</p><p>Thanks</p>","319713","","319713","","2011-01-05 18:15:34","2011-01-05 18:15:34","My site has no css on android default browser","<android><css><mobile-safari>","2","7","","",""
"4604114","1","4645139","","2011-01-05 12:47:15","1","479","<p>I'm currently playing around with the memory allocation tracker of the DDMS tool.In my project i insert the following line in a button's <code>onClickListener</code>:</p><pre><code>memTrackerTest = new byte[1024*1024];</code></pre><p><code>memTrackerTest</code> is a private variable of the Activity.</p><p>I would expect to see the allocation in the tracker but unfortunately it doesn't appear.Other parts of my code, like the creation of a <code>ProgressDialog</code> show up fine.</p><p>Any idea why my big allocation is not displayed in the allocation tracker?</p>","373138","","1288","","2012-08-04 17:26:32","2012-08-04 17:26:32","Android - Memory Allocation Tracker not tracking my test allocation","<android><memory-management><ddms>","1","3","","",""
"4604215","1","4853462","","2011-01-05 12:57:40","3","4791","<p>I need to install the market app on the android emulator on Mac Os X. How can it be done?</p><p>Thanks</p>","171911","","","","","2011-11-03 11:06:37","Android: Installing the Market app on the emulator?","<android><osx><install><emulator><google-play>","2","3","1","",""
"4604223","1","4605075","","2011-01-05 12:58:02","6","2528","<p>Is it possible to detect folder changes in Android? I mean detect when files are deleted or changed and know wich application are doing these? In Windows you have system events for this, it's not necesary to permanently watch the files to detect changes. It's very important to know which application is doing the changes.</p><p>Thanks</p>","219558","","2360535","","2014-01-09 12:16:26","2014-01-09 12:16:26","How to detect file or folder changes in Android?","<android><file><detect><changes>","1","0","1","",""
"4604235","1","","","2011-01-05 12:58:43","1","1372","<p>I am working on the GPS application. Till now, I am getting the Location by using the LocationManager like latitude and longitude, But, I need to get the location data as NMEA 0183like:</p><p>$GPRMC,090248,A,4745.012742,N,01304.143827,E,0.0,0.0,310710,5.3,E,A*48</p><p>how get that I dont know</p><p>if any body knows about this help to get that.</p>","546107","","759866","","2014-02-20 17:21:51","2014-02-20 17:21:51","NMEA format String of GPS data","<android><android-emulator>","1","0","","",""
"4604239","1","4604922","","2011-01-05 12:59:03","58","44978","<p>I`m interested in knowing if it is possible to programmatically install a dynamically downloaded apk from a custom Android application.</p>","128418","","622391","","2013-05-10 00:41:14","2014-03-25 13:34:47","Install Application programmatically on Android","<android><apk>","6","1","53","",""
"4604338","1","","","2011-01-05 13:09:10","0","728","<p>I have an app which uses a webView to display a flash web page.  Every now and then on loading the webpage containing the flash, the app stops and the log cat is repeating the message : </p><blockquote>  <p>WARN/SharedBufferStack(26309): waitForCondition(LockCondition) timed  out (identity=397, status=0). CPU may be pegged. trying again.</p></blockquote><p>Once in this state the app will either fail to load on subsequent runs or return to the same state.</p><p>Currently Using -Android 2.2 - Advent Vega, although same issue arises on Samsung Galaxy S.  </p><pre><code>/***********************LOG CAT OUTPUT***************************/INFO/(27019): View::CreateDisplayContext original wmode = wWindowINFO/(27019): View::CreateDisplayContext using wmode = wGPUINFO/FlashEGL(27019): calling CreateWindowSurfaceINFO/FlashEGL(27019): created window surface com.google.android.gles_jni.EGLSurfaceImpl@44362598DEBUG/dalvikvm(27019): GC_FOR_MALLOC freed 2604 objects / 152424 bytes in 51msDEBUG/dalvikvm(27019): GC_FOR_MALLOC freed 156 objects / 6648 bytes in 30msDEBUG/WifiService(967): ACTION_BATTERY_CHANGED pluggedType: 0WARN/SharedBufferStack(27019): waitForCondition(LockCondition) timed out (identity=409, status=0). CPU may be pegged. trying again.WARN/SharedBufferStack(27019): waitForCondition(LockCondition) timed out (identity=409, status=0). CPU may be pegged. trying again.WARN/SharedBufferStack(27019): waitForCondition(LockCondition) timed out (identity=409, status=0). CPU may be pegged. trying again.WARN/SharedBufferStack(27019): waitForCondition(LockCondition) timed out (identity=409, status=0). CPU may be pegged. trying again.DEBUG/dalvikvm(1388): GC_EXPLICIT freed 4277 objects / 199168 bytes in 85msWARN/SharedBufferStack(27019): waitForCondition(LockCondition) timed out (identity=409, status=0). CPU may be pegged. trying again.WARN/SharedBufferStack(27019): waitForCondition(LockCondition) timed out (identity=409, status=0). CPU may be pegged. trying again.</code></pre>","563946","","44729","","2012-02-14 06:32:38","2012-02-14 06:32:38","Android Webview deadlock when loading flash based webpage","<android><flash><opengl-es><webview><android-2.2-froyo>","0","2","","",""
"4604480","1","","","2011-01-05 13:23:57","1","832","<p>I need your help to explore few topics in Android.</p><p>My understanding is Widget is View and Layout is ViewGroups in Android.</p><p>I described the problems as below-</p><ol><li>Please go through the below links-</li></ol><p>developer.android.com/guide/topics/ui/custom-components.html- (add http:// in the beginning)</p><p>developer.android.com/resources/tutorials/views/index.html - (add http:// in the beginning)</p><p>In the first link ListView is included as Widget and in the Second link ListView has been shown as Layout.</p><p>So, is ListView is Widget(View) or Layout(Viewgroup)?</p><ol><li><p>Same is the case for Spinner in Andriod</p><p>developer.android.com/resources/tutorials/views/hello-spinner.html- (add http:// in the beginning)(Link- says Spinner is Widget(View))</p></li></ol><p>developer.android.com/guide/topics/ui/layout-objects.html- (add http:// in the beginning)says Spinner is Layout(ViewGroup)</p><p>So, Spinner is View or ViewGroup?</p><p>Please update me with your views?</p>","563954","","","","","2011-01-05 13:51:23","ListView is Widget(View) or Layout(Viewgroup)?","<android><android-layout>","1","0","","",""
"4604538","1","4604615","","2011-01-05 13:28:27","3","3332","<p>In my code I let users fill in a form and I save that form in a XML file on the SD-card.</p><p>Now I need to send the information on the XML-file as POSTdata to a server.</p><p>How can I do that.</p><p>I already searched the internet and found some sample-code, but I don't know how to add the XML file located on my SD-card.</p><pre><code>public void sendtoRoutemobiel() {    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(""http://mysite/"");    try {        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); //&lt;-- need to replace this with        nameValuePairs.add(new BasicNameValuePair(""id"", ""12345""));            //&lt;-- the data on the XML-file         httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));         //&lt;-- (I think)        HttpResponse response;        response = httpclient.execute(httppost);        String temp1 = EntityUtils.toString(response.getEntity());        Log.d(""Gabug"", ""Response: "" + temp1);    } catch (ClientProtocolException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }}</code></pre>","517460","","","","","2011-01-05 13:35:57","Send XML for POST-request in Android","<android><xml><http><post><http-post>","1","0","3","",""
"4604562","1","4621807","","2011-01-05 13:30:16","7","8295","<p>Let's see,</p><p>i know how to change the style of a ListView (the orange color when an item is selected):</p><p>android:listSelector=""@drawable/xxx"" and a drawable with a bitmap or a @color</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true"" android:drawable=""@drawable/image"" /&gt;    &lt;item android:drawable=""@android:color/transparent"" /&gt;  &lt;/selector&gt; </code></pre><p>The thing is, in order to have a coherent design, i have to do the same thing for a context menu but i just can't see where to change it. There is no listSelector, nothing to change.</p>","495904","","495904","","2011-01-05 13:54:10","2011-01-07 01:43:30","Override context menu colors in Android","<java><android><user-interface>","1","2","4","",""
"4604657","1","4632655","","2011-01-05 13:40:27","0","6556","<p>I am facing an difficulty in decoding an json string. Below is my json string:</p><pre><code>{    ""udeals"":""[{\""vName\"":\""bussinessname3\"",\""vAddress\"":\""address3\"",\""vState\"":\""Kerala\"",\""vZip\"":\""232\"",\""vCountry\"":\""Algeria\"",\""id\"":\""3\"",\""dealCategoryID\"":\""2\"",\""dealCaption\"":\""deal3\"",\""dealurl\"":\""http:\\/\\/192.168.0.8\\/ppppp\\/deals\\/deal3-3\\/\"",\""dealImage\"":\""http:\\/\\/192.168.0.8\\/ppppp\\/images\\/deals\\/thumb390x256\\/Duizl1.jpg\"",\""dealPrice\"":\""50.00\"",\""dealCost\"":\""100.00\"",\""dealSave\"":-50,\""dealOfferRate\"":\""50.00\"",\""jsDeadLine\"":{\""seconds\"":0,\""minutes\"":0,\""hours\"":0,\""mday\"":5,\""wday\"":3,\""mon\"":1,\""year\"":2011,\""yday\"":4,\""weekday\"":\""Wednesday\"",\""month\"":\""January\"",\""0\"":1294165800},\""unlockedStamp\"":{\""seconds\"":53,\""minutes\"":56,\""hours\"":18,\""mday\"":5,\""wday\"":3,\""mon\"":1,\""year\"":2011,\""yday\"":4,\""weekday\"":\""Wednesday\"",\""month\"":\""January\"",\""0\"":1294234013},\""description\"":\""Google URL Shortener at goo.gl is used by Google products to create short URLs that can be easily shared, tweeted, or emailed to friends.\""},{\""vName\"":\""bussinessname20010\"",\""vAddress\"":\""address20010\"",\""vState\"":\""Kerala\"",\""vZip\"":\""232\"",\""vCountry\"":\""Argentina\"",\""id\"":\""20010\"",\""dealCategoryID\"":\""2\"",\""dealCaption\"":\""deal20010\"",\""dealurl\"":\""http:\\/\\/192.168.0.8\\/ppppp\\/deals\\/deal20010-20010\\/\"",\""dealImage\"":\""http:\\/\\/192.168.0.8\\/ppppp\\/images\\/deals\\/thumb390x256\\/oCcfTj.jpg\"",\""dealPrice\"":\""50.00\"",\""dealCost\"":\""100.00\"",\""dealSave\"":-50,\""dealOfferRate\"":\""50.00\"",\""jsDeadLine\"":{\""seconds\"":0,\""minutes\"":0,\""hours\"":0,\""mday\"":28,\""wday\"":2,\""mon\"":12,\""year\"":2010,\""yday\"":361,\""weekday\"":\""Tuesday\"",\""month\"":\""December\"",\""0\"":1293474600},\""unlockedStamp\"":{\""seconds\"":53,\""minutes\"":56,\""hours\"":18,\""mday\"":5,\""wday\"":3,\""mon\"":1,\""year\"":2011,\""yday\"":4,\""weekday\"":\""Wednesday\"",\""month\"":\""January\"",\""0\"":1294234013},\""description\"":\""this is\""}]""}</code></pre><p>Can any one please give me an solution for how to parse this in Android...</p>","567795","","690952","","2012-12-03 16:54:39","2014-02-01 02:28:22","Json decoding in Android","<android><json>","2","0","1","",""
"4605130","1","7061981","","2011-01-05 14:26:45","2","396","<p>I am currently developing an App which needs to look up a number of contacts (name and photo) via their phone number.However, this takes several seconds (For each contact: Look up the contact via their phone number, get contact's name &amp; photo).</p><p>What would be a good strategy to speed this process up? I realize that I could use my own sqlite db which contains a list of exactly those names and photos I need. With such a database I could only do one query, then get the data for all contacts I need at once. This however would add quite some overhead I am hoping to avoid.</p><p>Is there a better (speak: simpler) solution?</p><p>Thank you.</p>","321116","","","","","2012-06-30 21:01:36","Android: Quickly look up a list of contacts","<android><database><contact><android-contentprovider>","3","1","1","",""
"4605249","1","4605304","","2011-01-05 14:37:53","18","41235","<p>I have started to build my own apps on iPhone and iPad using the iPhone SDK. The next question that is always asked by the client is, ""Can we have it on Android?""</p><p>So my question to you, 'the internet', is: what are my options? </p><p>I don't have the time to learn another language (learning iOS has been enough!), so are there companies who specialize in this, or are there any online services that do a conversion?</p><p>Any help on this welcome, just need to know which way to turn...</p>","164769","","1113772","","2012-08-29 18:08:43","2013-04-18 06:45:04","Converting iPhone/iPad apps onto Android","<android><ios><ios4><cross-platform><porting>","9","4","1","2013-03-04 15:42:59",""
"4605325","1","4607824","","2011-01-05 14:44:39","9","6681","<p>I'm beating my head against a wall here, and I'm fairly certain I'm doing something stupid, so time to make my stupidity public.</p><p>I'm trying to take two images, blend them together into a third image using standard blending algorithms (Hardlight, softlight, overlay, multiply, etc).</p><p>Because Android does not have such blend properties build in, I've gone down the path of taking each pixel and combine them using an algorithm. However, the results are garbage. Below is the results of a simple multiply blend (images used, and expected result).</p><p>BASE: <img src=""http://i.stack.imgur.com/C0tmS.jpg"" alt=""alt text""></p><p>BLEND: <img src=""http://i.stack.imgur.com/ALPfm.jpg"" alt=""alt text""></p><p>EXPECTED RESULT: <img src=""http://i.stack.imgur.com/jIr4a.jpg"" alt=""alt text""></p><p>GARBAGE RESULT: <img src=""http://i.stack.imgur.com/wCNiZ.png"" alt=""alt text""></p><p>Any help would be appreciated. Below is the code, which I've tried to strip out all the ""junk"", but some may have made it through. I'll clean it up if something isn't clear.</p><pre><code>    ImageView imageView = (ImageView) findViewById(R.id.ImageView01);    Bitmap base = BitmapFactory.decodeResource(getResources(), R.drawable.base);    Bitmap result = base.copy(Bitmap.Config.RGB_565, true);    Bitmap blend = BitmapFactory.decodeResource(getResources(), R.drawable.blend);    IntBuffer buffBase = IntBuffer.allocate(base.getWidth() * base.getHeight());    base.copyPixelsToBuffer(buffBase);    buffBase.rewind();    IntBuffer buffBlend = IntBuffer.allocate(blend.getWidth() * blend.getHeight());    blend.copyPixelsToBuffer(buffBlend);    buffBlend.rewind();    IntBuffer buffOut = IntBuffer.allocate(base.getWidth() * base.getHeight());    buffOut.rewind();    while (buffOut.position() &lt; buffOut.limit()) {        int filterInt = buffBlend.get();        int srcInt = buffBase.get();        int redValueFilter = Color.red(filterInt);        int greenValueFilter = Color.green(filterInt);        int blueValueFilter = Color.blue(filterInt);        int redValueSrc = Color.red(srcInt);        int greenValueSrc = Color.green(srcInt);        int blueValueSrc = Color.blue(srcInt);        int redValueFinal = multiply(redValueFilter, redValueSrc);        int greenValueFinal = multiply(greenValueFilter, greenValueSrc);        int blueValueFinal = multiply(blueValueFilter, blueValueSrc);        int pixel = Color.argb(255, redValueFinal, greenValueFinal, blueValueFinal);        buffOut.put(pixel);    }    buffOut.rewind();    result.copyPixelsFromBuffer(buffOut);       BitmapDrawable drawable = new BitmapDrawable(getResources(), result);    imageView.setImageDrawable(drawable);}int multiply(int in1, int in2) {    return in1 * in2 / 255;}</code></pre>","157921","","157921","","2011-01-06 16:46:21","2012-03-22 05:01:22","Blending pixels from Two Bitmaps","<android><bitmap><blending>","2","0","6","",""
"4605354","1","4606804","","2011-01-05 14:47:36","0","150","<p>I am creating an Android application which requires to view contacts from phone's contact and add contacts or sync it into my application. Is it possible to do this? How?</p><p>Thanks..</p>","516160","","516160","","2011-01-05 14:53:38","2011-01-05 16:56:18","View and add contact in created application","<java><android><eclipse>","1","1","","",""
"4605356","1","4605389","","2011-01-05 14:47:38","5","10744","<p>I have build a Java appliction which is using ant.jar (ant 1.8.2) classes for building android application from it's build.xml file with release as target.My Android project has been built by using android create project command, using sdk 2.2.When I run my application for building the Android application I get the following message - </p><p>build.xml:46: taskdef class com.android.ant.SetupTask cannot be found</p><p>I have verified the sdk.dir path and the sdk-location path and both are correct.</p><p>How it can be solved?</p><p>Thanks,Eyal.</p>","341497","","","","","2011-11-16 00:28:07","Ant failed to build","<java><android><ant>","4","1","5","",""
"4605390","1","","","2011-01-05 14:51:00","0","734","<p>I encountered a problem in android, for example: </p><p>Number <code>78900000</code> will show <code>7.8E7</code> and not the number itself.</p><pre><code>DecimalFormat df2 = new DecimalFormat(""#########.00"");dd2dec = new Double(df2.format(number).doubleValue());</code></pre><p>How can I format the number and show it in original form without in scientific form ?</p>","471567","","679954","","2013-10-10 11:58:04","2013-10-10 11:58:04","Format long number in Android","<android><formatting>","1","0","","",""
"4605527","1","","","2011-01-05 15:04:27","157","133427","<p>I have created my application with the height and width given in pixels for a Pantech device whose resolution is 480x800.</p><p>I need to convert height and width for a G1 device. I thought converting it into dp will solve the problem and provide same solution for both devices. </p><p><strong>Is there any easy way to convert pixels to dp?</strong> Any suggestions?</p>","504712","","1073386","","2013-10-14 12:30:32","2014-02-28 14:40:59","Converting pixels to dp","<android>","16","2","80","",""
"4605571","1","4605604","","2011-01-05 15:09:02","4","3311","<p>I want to write a utility where the user can select a set of installed apps and clear their data caches i.e. like the way you can do manually using the built-in Settings->Applictions settings screen with the ""Clear cache"" button.</p><p>How can I access how much cached data each app has and programmatically clear these caches?</p>","564120","","","","","2014-03-27 04:44:44","Clearing app cache programmatically?","<java><android><mobile>","2","0","1","",""
"4605588","1","4605639","","2011-01-05 15:10:14","6","3481","<p>Good evening, programmers. I am writing an android application and have a problem.  I divide a spannable object into 3 parts, do different operations, and then I need to merge them.</p><pre><code>Spannable str = editText.getText();            Spannable selectionSpannable = new SpannableStringBuilder(str, selectionStart, selectionEnd);Spannable endOfModifiedSpannable = new SpannableStringBuilder(str, selectionEnd, editText.getText().length());             Spannable beginningOfModifiedSpannable = new SpannableStringBuilder(str, 0, selectionStart);            </code></pre><p>How can I do it? I haven't found the required method or constructor to do it.</p>","564122","","","","","2011-01-06 12:58:02","How to merge some spannable objects?","<android>","2","0","4","",""
"4605760","1","","","2011-01-05 15:23:47","0","888","<p>I'm browsing <a href=""http://android.git.kernel.org/"" rel=""nofollow"">http://android.git.kernel.org/</a> find the source for the Android ""Home screen tips"" widget -but have been unsuccessful. I am looking for either or:</p><ul><li>A link to the source [good]</li><li>A zip of the source [better yet!]</li></ul>","564140","","","","","2011-05-27 01:09:44","Where can I find the source for the Android ""Home screen tips"" widget?","<java><android><source-code><android-widget>","2","0","","",""
"4605783","1","4605972","","2011-01-05 15:26:03","3","575","<p>Recently google introduced push-to-device service, but it's only available 2.2 and up.</p><p>I need a similar system in my app, and I'm trying to get around limitations.</p><p>The issue is battery life. Since the user must be notified immediately about the changes on the server, I thought to implement a service that would live in the background (standard Android service) and query the server for updates.</p><p>Of course, querying the server, even each second, will cost a lot of bandwidth, as well as battery, so my question is this: does it make a difference if the server is holding the response for some period of time? (the idea behind Comet type ajax request)</p><p>Works like this: </p><ul><li>Device sends request for data update</li><li>Server gets the request and goes in the loop for one minute, checking if there are updates on each iteration<ul><li>If there are updates, server sends response back with updates</li><li>If not, service goes on to the next iteration. </li></ul></li><li>After a minute, it finally sends the response that no data is yet available</li><li>After response (no matter whether empty or with data) Android fires another such request.</li></ul><p>It will definitely cost less bandwidth, but will it consume less (or even more) battery?</p>","495663","","418613","","2012-06-07 05:41:25","2012-06-07 05:41:25","Android battery when working with http","<android><power-management>","2","0","0","",""
"4605855","1","4605982","","2011-01-05 15:32:35","0","596","<p>I have some problem with multiple screen support, I work with dp(dpi) for specify the layout_heigth and layout_width and I hope that is the better way to support multiple screen, but when I tried with two smartphone I meet two different result.</p><p>I give an example, this is a layout I use:</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/cities_main_layout""          android:orientation=""vertical""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""&gt;       &lt;ListView          android:id=""@+id/citieslist""          android:layout_width=""wrap_content""           android:layout_height=""320dip""          android:layout_gravity=""center_vertical""          android:layout_below=""@id/cities_main_layout""       /&gt;       &lt;LinearLayout           android:id=""@+id/cities_button_layout""          android:orientation=""horizontal""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_below=""@id/citieslist""          android:layout_gravity=""center_vertical""&gt;           &lt;Button            android:id=""@+id/bycountry""           android:layout_height=""50dip""           android:layout_width=""105dip""           android:background=""@drawable/buttonmarket""           android:text=""@string/button_bycountry""          /&gt;        &lt;Button            android:id=""@+id/top10""           android:layout_height=""50dip""           android:layout_width=""105dip""           android:background=""@drawable/buttonmarket""           android:text=""@string/button_top10""          /&gt;        &lt;Button            android:id=""@+id/recommended""           android:layout_height=""50dip""           android:layout_width=""105dip""           android:background=""@drawable/buttonmarket""           android:text=""@string/button_recommended""          /&gt;       &lt;/LinearLayout&gt;    &lt;/RelativeLayout&gt;</code></pre><p>The button are at the bottom of the layout, and I see two different result:</p><p><img src=""http://img600.imageshack.us/img600/5513/htcmagicg2.png"" alt=""http://img600.imageshack.us/img600/5513/htcmagicg2.png""></p><p><img src=""http://img441.imageshack.us/img441/6440/samsunggalaxys.png"" alt=""http://img441.imageshack.us/img441/6440/samsunggalaxys.png""></p><p>In the last smartphone I can see the buttons, instead in the first I cannot...what's wrong?</p><p>I have to write a layout for any set of screen??!!!</p>","554892","","321697","","2011-01-05 16:00:53","2011-01-05 17:07:33","Multiple Screen Support","<java><android>","4","0","1","",""
"4605962","1","4606845","","2011-01-05 15:43:17","0","458","<p>I am trying to access resources in the <code>/res/raw</code> folder programmatically (specifically... mp3 files). In the emulator, the following template works for me.</p><pre><code>Uri uri = Uri.parse(""android.resource://com.foo.bar/raw/name_of_resource"");MediaPlayer mp3 = MediaPlayer.create(this, uri);</code></pre><p>On an actual phone, the <code>MediaPlayer.create()</code> method returns null. What gives? Is there a better way of accessing resources programmatically?</p><p>P.S.</p><p>I am not using <code>MediaPlayer.create(this, R.raw.name_of_resource)</code> for a reason. In my particular situation, is much much easier for me to generate the name of the resource than figure out the <code>id</code> of the resource. (i.e. I can figure out the <code>String</code> <code>name_of_resource</code> fairly easily, but deducing the actual <code>integer id</code> <code>R.raw.name_of_resource</code> would involve a a lot more work and a lot more <code>switch</code> statements.</p>","382252","","","","","2011-01-05 17:00:35","Problem accessing res/raw resources on phone... works fine in emulator","<java><android><resources>","1","2","","",""
"4605999","1","","","2011-01-05 15:46:50","2","333","<p>my app includes a service, and I'm looking for a way to gracefully exit when the app is installed on the sd-card, and that the sd-card gets unmounted. I don't need the service to restart after the sd-card gets mounted again. I just need to release some files/resources, etc.. </p><p>I thought about listening for Intent.ACTION_MEDIA_EJECT, but this is apparently broadcast after the external apps have been forced to exit.</p><p>Any solution?</p>","377478","","","","","2011-01-05 15:46:50","How to cleanly exit an external app when the sd-card gets unmounted?","<android><app2sd>","0","4","1","",""
"4606141","1","4606879","","2011-01-05 15:59:16","1","3053","<p>In my application I have a service in which rss feeds are read. After the service finishes the reading I need to update my application and populate a list view with the downloaded information. Using a broadcast receiver, and intents would not work, because the data is stored in a custom object. What is the best way to do that?</p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2011-01-05 18:57:32","Getting data from the Service to the Activity","<android>","2","0","4","",""
"4606168","1","4606224","","2011-01-05 16:00:29","5","452","<p>We are developing a web application intended for use on smartphones and other mobile devices, and we are thinking about running all traffic through HTTPS to make security simpler.</p><p>I know that the CPU cost of HTTPS encryption for bigger computers is fairly trivial, but is this also true for modern smartphones like iPhone and Android?</p>","396038","","","","","2011-01-05 16:04:47","Do mobile devices have enough CPU to support HTTPS for all of a website's traffic?","<android><performance><ios><mobile><https>","1","1","","",""
"4606259","1","","","2011-01-05 16:07:50","1","2216","<p>I wanna to redirect to the Android Activity from java class..</p><p>here my code</p><pre><code>class A {    getContext().startActivity(                        new Intent(Intent.ACTION_VIEW, Uri.parse(""http://www.google.com"")));}</code></pre><p>from the code,it's redirected to webview instead i need it to redirect it into Android Activity something like this..</p><pre><code>getContext().startActivity(                        new Intent(A.this,My.class));</code></pre>","561368","","321116","","2011-01-27 12:12:32","2011-01-27 12:12:32","Android Redirect from Java Class to Android Activity","<android>","3","0","1","",""
"4606403","1","4606601","","2011-01-05 16:19:21","1","2380","<p>Now I am at the stage of preparing my android app for publishing I discover that jarsigner.exe is not on my hard disk ( done a full search)  I have the jave sdk and java jre and keytool.exe but no jarsigner.  I have googled and followed thro links that appeared to offer download of jarsigner but none of them acftually do.   I have been to the official java site but cant find an option to download this file - can anyone help?</p><p>I am using Eclipse and thought that when I did the various downloads for Eclipse, Android and Java I would have all the necessary files. </p><p>From the reading I have done it seems that the Eclipse export wizard only prepares debug signed .apk and I must follow the unsgned/keytool/jarsigner route to get a distrbutable file.</p>","538847","","","","","2011-01-05 16:37:17","using Eclipse for Android development - cant find jarsigner.exe4","<android>","2","0","","",""
"4606473","1","","","2011-01-05 16:25:18","0","1131","<p>How can I programmatically create a new Calendar in Android?</p>","564235","","667810","","2012-06-16 09:25:15","2012-06-16 09:25:15","Android create programmatically a new Calendar?","<android>","1","1","0","",""
"4606557","1","4607025","","2011-01-05 16:33:06","1","758","<p>I have a listview that contains a couple of taxi companies. When a user clicks on the taxi name, it shows an alertdialog box asking them to either book, show map or cancel. What im trying to achieve is when the user clicks show map, it grabs the location from a string array already set, and then points to it on the map. I dont want it to find my current location as of yet. is this possible to do? i already have a mapview setup which at present just points to a random location set from the tutorial. </p><p>This is my code for both: </p><pre><code>    ListTaxi Class :              class Taxi {    private String taxiName;    private String taxiAddress;    private String taxiDist;    public String getName() {        return taxiName;    }    public void setName(String name) {        taxiName = name;    }    public String getAddress() {        return taxiAddress;    }    public void setAddress(String address) {        taxiAddress = address;    }    public String getDist() {        return taxiDist;    }    public void setDist(String dist){        taxiDist = dist;    }    public Taxi(String name, String address, String dist) {        taxiName = name;        taxiAddress = address;        taxiDist = dist;    }}public class TaxiAdapter extends ArrayAdapter&lt;Taxi&gt; {    private ArrayList&lt;Taxi&gt; items;    private TaxiViewHolder taxiHolder;    private class TaxiViewHolder {        TextView name;        TextView address;         TextView dist;    }    public TaxiAdapter(Context context, int tvResId, ArrayList&lt;Taxi&gt; items) {        super(context, tvResId, items);        this.items = items;    }    @Override    public View getView(int pos, View convertView, ViewGroup parent) {        View v = convertView;        if (v == null) {            LayoutInflater vi = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.taxi_list_item, null);            taxiHolder = new TaxiViewHolder();            taxiHolder.name = (TextView)v.findViewById(R.id.taxi_name);            taxiHolder.address = (TextView)v.findViewById(R.id.taxi_address);            taxiHolder.dist = (TextView)v.findViewById(R.id.taxi_dist);            v.setTag(taxiHolder);        } else taxiHolder = (TaxiViewHolder)v.getTag();         Taxi taxi = items.get(pos);        if (taxi != null) {            taxiHolder.name.setText(taxi.getName());            taxiHolder.address.setText(taxi.getAddress());            taxiHolder.dist.setText(taxi.getDist());        }        return v;    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.listtaxi);    final String[] taxiNames = getResources().getStringArray(R.array.taxi_name_array);    final String[] taxiAddresses = getResources().getStringArray(R.array.taxi_address_array);    final String[] taxiDist = getResources().getStringArray(R.array.taxi_array_dist);    ArrayList&lt;Taxi&gt; taxiList = new ArrayList&lt;Taxi&gt;();    for (int i = 0; i &lt; taxiNames.length; i++) {        taxiList.add(new Taxi(taxiNames[i], taxiAddresses[i], taxiDist[i]));    }    setListAdapter(new TaxiAdapter(this, R.layout.taxi_list_item, taxiList));      final ListView lv = getListView();    lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; a, View v, final int position, long id)        {                   final int selectedPosition = position;            AlertDialog.Builder adb=new AlertDialog.Builder(ListTaxi.this);              adb.setTitle(""Taxi Booking"");             adb.setMessage(""You Have Selected: ""+taxiNames[selectedPosition]);              adb.setPositiveButton(""Book"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(ListTaxi.this, Booking.class);                     intent.putExtra(""booking"",  taxiNames[selectedPosition]);                     intent.putExtra(""address"",  taxiAddresses[selectedPosition]);                     intent.putExtra(""distance"", taxiDist[selectedPosition]);                     startActivity(intent);                 }             });             adb.setNeutralButton(""Show Map"", new DialogInterface.OnClickListener() {                 public void onClick(DialogInterface dialog, int id) {                     Intent intent = new Intent(ListTaxi.this, Map.class);                     startActivity(intent);                 }             });             adb.setNegativeButton(""Cancel"", null);              adb.show();         }     });     }</code></pre><p>}</p><p>and my map class is :                /** *  */package com.taxime;</p><pre><code>    public class Map extends MapActivity{LinearLayout linearLayout;MapView mapView;List&lt;Overlay&gt; mapOverlays;Drawable drawable;ItemizedOverlay itemizedOverlay;public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.mapviews);        mapView = (MapView) findViewById(R.id.mapView);        mapView.setBuiltInZoomControls(true);        mapOverlays = mapView.getOverlays();        drawable = this.getResources().getDrawable(R.drawable.androidmarker);        itemizedOverlay = new ItemizedOverlay(drawable);        Intent intent = getIntent();        if (intent != null) {            if (Intent.ACTION_VIEW.equals(intent.getAction())) {                if (intent.getData() != null) {                    int selectedPosition = Integer.parseInt(intent.getData().getHost());                    GeoPoint point = new GeoPoint(selectedPosition, selectedPosition);                    OverlayItem overlayitem = new OverlayItem(point, """", """");                    itemizedOverlay.addOverlay(overlayitem);                    mapOverlays.add(itemizedOverlay);                    //...                }            }        }</code></pre><p>Also my strings come from :</p><pre><code>    &lt;string-array name=""taxi_name_array""&gt;    &lt;item&gt;Barrys Taxi&lt;/item&gt;    &lt;item&gt;Boom Taxi&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""taxi_address_array""&gt;&lt;item&gt;24 test address, Uxbridge, UB8 2JY&lt;/item&gt;&lt;item&gt;14 test 2 address, Uxbridge, UB91JD&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name = ""taxi_array_dist""&gt;&lt;item&gt;0.4 miles&lt;/item&gt;&lt;item&gt;0.8 miles&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name =""location""&gt;&lt;item&gt;(19240000,-99120000)&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>If anyone has any ideas that would be awesome.</p><p>Thanks again everyone     </p>","560679","","560679","","2011-01-05 18:21:32","2011-01-05 18:33:23","Android - Pinning location to map when clicking a listview item?","<android><listview><android-mapview><alertdialog>","2","0","","",""
"4606573","1","4606665","","2011-01-05 16:34:23","2","467","<p>I'm writing an app to do some logging on android, processes aren't killed as is the android way. </p><p>Can I detect which ones are dead though?</p>","62709","","","","","2011-01-05 16:41:23","How to detect dead processes on android","<android><process><processes><task>","1","0","","",""
"4606613","1","4607808","","2011-01-05 16:38:22","14","1863","<p>Setting two or more elements of a linear layout the same height seems to be a great problem.</p><p>I want to set four buttons in a row to the same height.</p><p>android:layout_height=""wrap_content"" does it for the moment but when the text on one of the buttons is longer than one line this button is increased and therefore bigger than the other ones. Due to different localisations I don't know, when and which button may have a second line.</p><p>So my idea is, to <strong>set the parent linearlayout to android:layout_height=""wrap_content"" and all (!) child heights to android:layout_height=""fill_parent""</strong>.</p><p>This works (all buttons have the same size), but I'm not sure if this causes any other problems? Because it the parent gets it's height from the childs and vice-versa.</p>","564256","","564256","","2011-01-05 17:14:21","2013-02-21 01:16:12","combining wrap_content on parent and fill_parent on child","<android><xml><position><android-linearlayout>","2","1","4","",""
"4606634","1","","","2011-01-05 16:39:38","1","343","<p>I am using Google Maps API level 7 (which corresponds to Android 2.1) to display a map on my app. The code displays the map perfectly when I run it using Android 1.1, but when I run it using Google Maps API 7, I only see X's all over the place. I have to say that the map displays correctly for only 1 second then disappears. The code is exactly the same that I am using in Android 1.1 and Google Maps API 7, so why would this problem occur?</p>","522559","","","","","2011-01-05 16:39:38","Android: Google API map problem","<android><google-maps><mapactivity>","0","4","","",""
"4606653","1","4690212","","2011-01-05 16:01:39","3","1765","<p>I'm trying to get the orientation of a Galaxy Tab by reading the informations from various sensors.</p><p>It should be possible to get the orientation with:</p><ul><li>the accelerometer and the compass (magnetic field)</li><li>the gyroscope</li></ul><p>The emulator has accelerometer and gyroscope enabled in config.ini, but it uses API 8 (Android 2.2). The gyroscope seems to be supported in 2.3.</p><p>When I list the available sensors, I only get the accelerometer, no gyroscope or compass.</p><p>The only solution I can think of is to switch the emulator to API 9 (2.3). Is this the only solution ?</p><p>How can NOVA from Gameloft use the gyroscope ?</p>","564079","Syl","564079","","2011-01-06 19:47:29","2011-01-14 10:45:14","Sensors on Galaxy Tab emulator","<android><tabs><sensor><galaxy><gyroscope>","2","3","","",""
"4607204","1","4607270","","2011-01-05 17:32:45","12","3905","<p>I'm new to programming androids but I have quite a bit of experience programming blackberries. </p><p>I created an app that has an activity class (main.java) and a view class (game.java).</p><p>Inside the view class I have some bitmaps being drawn to the screen. I created a thread and I'm moving the images around in the thread. However when I call invalidate() inside the thread it never redraws the screen. </p><p>Are you not able to invalidate() the screen from a thread? I know the thread is running and the invalidate is being called, it just never makes the changes on the screen.</p>","562537","","","","","2011-01-05 17:38:44","invalidate() inside of a thread android app","<android><invalidate>","1","0","","",""
"4607228","1","4608013","","2011-01-05 17:34:43","2","2701","<p>I have an app who's UI takes a little work to build (has to process some stuff).  So, I build the UI using an AsynchTask (it shows a progress dialog while doing some background processing, then does the UI update).  I would like to be able to call this AsynchTask from OnRestoreInstanceState(), so that I can rebuild the UI on a rotation.  However, when I call  MyAsynchTask.execute() from the onRestorInstanceState() method, I get the below exception:</p><pre><code>01-05 12:28:45.194: ERROR/WindowManager(409): android.view.WindowLeaked: Activity com.MyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e70368 that was originally added here01-05 12:28:45.194: ERROR/WindowManager(409):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:247)01-05 12:28:45.194: ERROR/WindowManager(409):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)01-05 12:28:45.194: ERROR/WindowManager(409):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)01-05 12:28:45.194: ERROR/WindowManager(409):     at android.view.Window$LocalWindowManager.addView(Window.java:424)01-05 12:28:45.194: ERROR/WindowManager(409):     at android.app.Dialog.show(Dialog.java:241)01-05 12:28:45.194: ERROR/WindowManager(409):     at com.MyClass$MyAsynchTask.onPreExecute(MyClass.java:428)</code></pre>","426493","","","","","2011-01-05 18:51:19","Android: AsynchTask fails when called from onRestoreInstanceState()","<android><android-asynctask>","1","0","2","",""
"4607344","1","4607435","","2011-01-05 17:46:56","1","843","<p>I implemented a PhoneStateListener how stops audio if you are called and starts it again after you finished.When i exit my app by finish() the PhoneStateListener seems to be still active. After finishing a call the music starts to play.Even if I set the listener=null in onDestroy() it keeps working...</p>","562328","","857361","","2012-07-26 10:11:46","2012-07-26 10:11:46","PhoneStateListener() isn´t finished","<android><phone-state-listener>","1","0","","",""
"4607452","1","4746415","","2011-01-05 17:56:37","0","1677","<p>Alright, another weird problem. I have activity Main.java and DialogLikeActivity.java.</p><p>In <b>Main</b> I have</p><pre><code>EditText (articleNumber) - phone input type (in .XML)Button (articleOK)list (list)</code></pre><p>On <b>DialogLikeActivity</b> (activity but styled with a Dialog theme and with <b>android:windowSoftInputMode=""stateAlwaysVisible""</b> tag in Manifest) I have</p><pre><code>EditText (articlePackaging) - phone input type (in .XML)Button (finish)</code></pre><p>What I want? When I enter Main activity keyboard is open with phone input type and that's fine. When I click on EditText field, fill in something and click OK static varible becomes in state 1 (always show keyboard) - it's just static variable in Main activity.</p><pre><code>public static int keyboardMode = 1;</code></pre><p>Clicking on OK opens up DialogLikeActivity with keyboard open (phone input type). When I click OK onResume of Main kicks in</p><pre><code>@Overridepublic void onResume() {    super.onResume();    if (keyboardMode == 1) {        showKeyboard(articleNumber);    } else {        hideKeyboard(articleNumber);    }}   public static void showKeyboard(View view) {    InputMethodManager mgr = (InputMethodManager) myContext.getSystemService(Context.INPUT_METHOD_SERVICE);    mgr.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);    ((InputMethodManager) myContext.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(view, 0);    articleNumber.setInputType(InputType.TYPE_CLASS_PHONE);}public static void hideKeyboard(View view) {    InputMethodManager mgr = (InputMethodManager) myContext.getSystemService(Context.INPUT_METHOD_SERVICE);    mgr.hideSoftInputFromWindow(view.getWindowToken(), 0);    articleNumber.setInputType(0);}// Listener to showKeyboard if user clicks on EditText field and set InputType to PHONE, insted it would remain (0)    articleNumber.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            showKeyboard(articleNumber);        }    });// Listener so when user touches the list - it hides the keyboard and sets variable on 2 so keyboard is always HIDDEN    list.setOnTouchListener(new View.OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            hideKeyboard(articleNumber);            keyboardMode = 2;            return false;        }    });// Listener so when user clicks on ArticleOK - keyboard is always OPENarticleOk.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {                               keyboardMode = 1;                    Intent i = new Intent(NewOrderArticles.this, NewQuantityDialog.class);                    i.putExtra(""articleid"", articleId);                    startActivity(i);            }        }    });</code></pre><p>And ensures that keyboard is open with phone input type. If I howewer click/scroll through the list in Main keyboardMode variable becomes 2 (always hide) - so the keyboard hides (with hideKeyboard method called list.onTouch listener). If I click on some item in the list it again opens DialogLikeActivity with open keyboard and phone input type. If I click OK onResume in Main kicks in and hides keyboard (see code upthere).</p><p>How does that look like please see video (OK button in video is articleOK button) - <a href=""http://www.svebee.com/android_razvoj/putnik_video.wmv"" rel=""nofollow"">Video (3,24 MB)</a>.</p><p>So actually - if I click OK (articleOK) button - <b>keyboard always must be shown</b>, if I, however start scrolling thorugh the list or click on some item in the list - <b>keyboard must be shown only in DialogLikeActivity activity</b>, otherwise in Main it must stay hidden (ofcourse if I click on EditText field on the top it opens up again).</p><p>On video you can see HTC Desire and everything works just the way I want, but - on Galaxy S the <b>always show part</b> is working, but if I tap/scroll the list, <b>it open's up keyboard with letter type (!) instead of hiding it</b>. Where's the problem?</p><p>So OK button - always show keyboard (in Main and DialogLikeActivity). If tap/scroll the list show keyboard only in DialogLikeActivity.</p>","455268","","","","","2011-01-20 14:48:53","Open/close softkeyboard (Galaxy S)","<android><android-softkeyboard><galaxy>","1","2","","",""
"4607553","1","","","2011-01-05 18:06:40","1","694","<p>I'm designing my first Android IME and am a bit overwhelmed. My goals are accessibility-related, and as such I wonder if perhaps I'm trying things with the IME framework that just aren't possible. I've taken the default softkeyboard example and have it working along with some of my modifications, so I've definitely understood at least some of this, but there isn't a whole lot of documentation on some of the things I'm attempting. Here's what I mean:</p><p>Currently, Android phones with touchscreen-only keyboards are inaccessible. I currently have an accessible touchscreen keyboard using methods similar to those used in IOS/VoiceOver, so that part of the project is done and fairly straight-forward to accomplish in the IME framework.</p><p>Currently, Android's accessibility API doesn't provide accessible feedback for navigating text fields. That is, with an Android screen reader loaded, if you type the word ""this"", you'll hear individual characters spoken as you type them, but if you then try left-arrowing over the ""s"", that isn't spoken. So I want to trap movements and provide spoken feedback for the elements navigated past. Here's where I start encountering problems.</p><p>I currently have speech feedback for left and right arrowing, using getCurrentInputConnection.getTextBeforeCursor(1, 0) for arrowing left, and a similar call for arrowing right. This gets the character currently under the cursor after the movement is processed, and all is good.</p><p>My challenge, though, comes when arrowing up and down between lines. Ideally, I'd like to grab the current line of text and speak that, but I don't see any way to do that. The only thing I can think of is some combination of getTextBefore/AfterCursor(Integer.MAX_VALUE, 0) and combining those values, determining the current line by filtering for the previous and next \n. Is there another way--getting the entire text content of the field as a single block of text and using the cursor position to determine which piece of that text represents the current line? I'm seeing something about extracted text in the various input method classes, and it seems like there may be a way to monitor that, but I don't know if that is at all useful to me (I.e. would that return the entire field content?)</p><p>My next goal is providing standard text navigation capabilities. Android accessibility doesn't currently include touchscreen exploration, so it is impossible to otherwise scroll a large block of text. I don't necessarily expect folks to write novels on their phones, but I'd like to provide quick gestures or commands to move up/down paragraphs, and to the top/bottom of longer fields. Does the IMF provide methods for cursor movement, or is that outside of its authority?</p>","277144","","","","","2011-01-05 20:01:47","Cursor movement and text retrieval in input methods","<android><ime>","1","0","","",""
"4607702","1","4607779","","2011-01-05 18:23:03","4","1279","<p>If an Android Spinner is not empty, and has a selection, can a user do anything to put the spinner into the ""nothing selected"" state?</p>","219159","","","","","2011-01-05 18:28:40","Can user unselect the value in the spinner?","<android><spinner>","1","0","","",""
"4607743","1","14444271","","2011-01-05 18:26:04","3","2062","<p>I have a voice recognition part in my application to capture users voice input.</p><p>This is what I do</p><pre><code>Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);startActivityForResult(voiceIntent, REQUEST_CODE);</code></pre><p>This works fine on most of the devices but now since the tablets are getting popular and some of them do not have a mic, it throws an error</p><blockquote>  <p>W/dalvikvm(  408): threadid=1: thread  exiting with uncaught exception  (group=0x40015560) E/AndroidRuntime(   408): FATAL EXCEPTION: main  E/AndroidRuntime(  408):  android.content.ActivityNotFoundException:  No Activity found to handle Intent {  act=android.speech.action.RECOGNIZE_SPEECH  (has extras) } E/AndroidRuntime(   408):     at  android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)  .....</p></blockquote><p>So I want to detect if the microphone is present before I let the user access the voice input feature. How can I detect if a microphone is present on the device.</p><p>Thank you.</p>","229266","","","","","2014-02-14 15:59:25","How to detect if a microphone is present in android?","<android>","2","3","1","",""
"4607922","1","","","2011-01-05 18:41:54","1","865","<p>Let me first give you the whole picture: I am developing a location based application, that invokes a constant recreation and exchange of objects, among several activities and services. The necessary data to create the objects being exchanged, is stored in an SQLite database, that in its turn gets populated by retrieving data from a remote SQL database.</p><p>It got quickly obvious, that passing raw attributes of an object to activities/services (via intents), was a huge coding overhead, diminishing every extension prospects the application might have. So, soon i decided to extend my main object class to implement a <a href=""http://developer.android.com/reference/android/os/Parcelable.html"" rel=""nofollow"">Parcelable</a> one, as shown below:</p><pre><code>public class MyProduct implements Parcelable {    //MyProduct Attributes    private int myProductId;    private String myProductDescription;    private float myProductRadius;    //More attributes...    public MyProduct() {        myProductId=-1;        myProductDescription=""defaultProductDescription"";        myProductRadius=10;        //More attributes    }    public int describeContents(){        return 0;    }    // write your object's data to the passed-in Parcel    public void writeToParcel(Parcel out, int flags){        //Product attributes        try{        out.writeInt(myProductId);        out.writeString(myProductDescription);        out.writeFloat(myProductRadius);        //More attributes        }          catch (Exception e){}    }    // this is used to regenerate your object. All Parcelables must have a CREATOR that implements these two methods    public static final Parcelable.Creator&lt;MyProduct&gt; CREATOR = new Parcelable.Creator&lt;MyProduct&gt;() {        //public class MyCreator implements Parcelable.Creator&lt;MyProduct&gt; {            public MyProduct createFromParcel(Parcel in) {            return new MyProduct(in);        }        public MyProduct[] newArray(int size) {            return new MyProduct[size];        }    };        // example constructor that takes a Parcel and gives you an object populated with it's values        private MyProduct(Parcel in) {        //in.readParcelable(MyProduct.class.getClassLoader());        try{            //MyProduct.class.getClassLoader();            myProductId=in.readInt();            myProductDescription=in.readString();            myProductRadius=in.readFloat();            //More attributes        }        catch(Exception e){}    }    //Setters and Getters}//endOfMyProduct.class</code></pre><p>Although i checked every data entry to the parcel fields, the following exception keeps spawning: </p><pre><code>01-05 19:35:11.570: ERROR/Parcel(59): Class not found when unmarshalling: com.nifo.distribution.MyProduct, e: java.lang.ClassNotFoundException: com.nifo.distribution.MyProduct</code></pre><p>For this reason, i consider of the MyProduct.class implementing <a href=""http://developer.android.com/reference/java/io/Serializable.html"" rel=""nofollow"">serializable</a>, hoping that it will turn to be a more error-forgiving structure. What would be the pros and cons of such alternation in the case described above?</p>","485328","","1606729","","2013-02-23 10:33:00","2013-02-23 10:33:00","Parcel vs. Serializeable for exchanging objects among services/activities","<android><serialization><location><parcelable>","0","6","","",""
"4608177","1","","","2011-01-05 19:08:15","1","375","<p>Here is my code: (""Apagar"" means ""Turn off"", ""reiniciar"" means ""restart"")</p><pre><code>public void uncaughtException(Thread thread, Throwable ex){    try    {        AlertDialog alertDialog;        alertDialog = new AlertDialog.Builder(iAct).create();        //alertDialog.setTitle("""");        alertDialog.setMessage(""Se ah producído un error y la aplicación no puede continuar funcionando."" +                               ""¿Desea reiniciarla o finalizarla?"");        alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, ""Reiniciar"", new ReiniciarOnClickListener(iAct));        alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE,""Apagar"", new ApagarOnClickListener(iAct));        alertDialog.show();    }catch(Exception e){        Thread.setDefaultUncaughtExceptionHandler(iDefaultHandler);        iDefaultHandler.uncaughtException(thread, ex);    }}</code></pre><p>All the code inside <code>Try</code> block is executed, but the alert is never shown, and the screen stays grey.</p><p>In <code>iDefaultHandler</code> I saved the result of <code>getDefaultUncoughtException()</code> before seting mine.</p><p>Any information that is missing, please ask for it. I don't know how to solve this.</p>","470498","","1606729","","2013-02-23 10:29:35","2013-02-23 10:29:35","Why my aplication get stuck when i show an alert in my own ""uncoughtException()"" method?","<android><exception><alertdialog>","2","5","","",""
"4608179","1","","","2011-01-05 19:08:40","4","803","<p>Is there an app or another possibility to watch for ALL Intents and Broadcast flowing in an android system? </p><p>Maybe another app which uses a special intent (not the standart ones) you want to use or broadcast yourself.</p>","142405","","","","","2011-01-05 19:56:58","Possible to watch all Intents/Broadcasts on the phone","<android><android-intent>","2","2","1","",""
"4608262","1","","","2011-01-05 19:16:41","0","723","<p>I am trying to extend a sample I found at <a href=""http://developer.android.com/resources/articles/layout-tricks-efficiency.html"" rel=""nofollow"">http://developer.android.com/resources/articles/layout-tricks-efficiency.html</a>.  I am a brand new MonoDroid developer, just installed it yesterday, and trying to jump right into UI design and so far it is not clicking for me completely.</p><p>I have this main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android: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=""fill_parent""      android:layout_alignParentTop=""true""      android:layout_alignParentBottom=""true""      android:layout_marginRight=""6dip""      android:src=""@drawable/icon"" /&gt;  &lt;TextView      android:id=""@+id/secondLine""      android:layout_width=""200dip""      android:layout_height=""26dip""      android:layout_toRightOf=""@id/icon""      android:layout_alignParentBottom=""true""      android:layout_alignParentRight=""true""      android:singleLine=""true""      android:ellipsize=""marquee""      android:text=""Second line which is a long line of text and needs to scroll"" /&gt;  &lt;TextView      android:id=""@+id/firstLine""      android:layout_width=""200dip""      android:layout_height=""wrap_content""      android:layout_toRightOf=""@id/icon""      android:layout_alignParentRight=""true""      android:layout_alignParentTop=""true""      android:layout_above=""@id/secondLine""      android:layout_alignWithParentIfMissing=""true""      android:singleLine=""true""      android:ellipsize=""marquee""      android:gravity=""center_vertical""      android:text=""First line"" /&gt;  &lt;Button      android:id=""@+id/logonButton""      android:layout_width=""50dip""      android:layout_height=""wrap_content""      android:layout_toRightOf=""@id/secondLine""      android:layout_alignParentRight=""true""      android:layout_alignParentTop=""true""      android:gravity=""center_vertical""      android:text=""Login"" /&gt;      /&gt;&lt;/RelativeLayout&gt;</code></pre><p>What I am trying to do is have an icon on the left, 2 lines of text stacked in the middle and a button on the right.  When I run this in my emulator I am seeing:<br> <img src=""http://i.stack.imgur.com/6jZFG.png"" alt=""alt text""></p><ol><li>The second line is not scrolling.</li><li>The button does not show up.</li></ol><p>Is there by any chance a simple WYSIWYG editor for layout?  Or is there an app to give me a quick view of my layout XML?  Something like FireBug in FireFox would be fine.</p><p>Barring the slim chance there are UI helpers for Droid, what am I doing wrong?  :)</p><p><strong>NOTE</strong>:  I found <em>hierarchyviewer</em> and the button is not showing up at all (visible) though it does show in the heirarchy.  <a href=""http://screencast.com/t/rdjaR0tCM6"" rel=""nofollow"">http://screencast.com/t/rdjaR0tCM6</a></p>","86555","","1320510","","2011-01-08 11:52:28","2011-01-08 11:52:28","Newbie question: How do you layout an icon, 2 text lines and a button?","<android><android-layout><monodroid>","2","0","","",""
"4608376","1","4608537","","2011-01-05 19:30:28","1","2469","<p>I'm developing an Android application.</p><p>I have an activity <code>parentActivity</code> and a <code>subclass</code> for some tasks.</p><p>I also have a hidden textView in <code>parentActivity</code>. I want to show this textView from subclass, but I don't know how to do that.</p><p>I think I can call a <code>parentActivity</code> method from <code>subclass</code>. How can I do that?</p><pre><code>public class ParentActivity extends Activity{   private SomeClass mSomeClass;   ...}</code></pre><p>I want to call <code>ParentActivity</code> from <code>mSomeClass</code>.</p><p>In C# I use event listener to do that.</p><p>I you need more details tell me.</p><p>Thanks.</p>","68571","","115145","","2011-01-05 19:39:56","2011-01-06 16:21:45","How can a property class can call a method for its 'parent' class in Java?","<java><android><events>","3","2","","",""
"4608381","1","4608725","","2011-01-05 19:30:58","0","1795","<p>I've searched dozens of manuals and tutorials but I haven't managed to do it.</p><p>What I need is just change the background / textcolor of a row from a ListView.</p><p>It's only one row different from the others but it can be in any position (which I already know) so I just need to know how to acces to the desired row..</p><p>I'm sorry if it's been already asked/answered but I haven't find anything that solves my case.</p><p>Thanks.</p>","564468","","","","","2011-01-05 20:42:38","How can I change one specific row from a ListView?","<android>","5","0","","",""
"4608524","1","4610107","","2011-01-05 19:49:49","1","8092","<p>I've got my main startup class loading main.xml but I'm trying to figure out how to access the TextView from another class which is loading information from a database. I would like to publish that information to the TextView.</p><p>So far I've not found any helpful examples on Google.</p><p>EDIT:This is my class that is doing the Database work:</p><pre><code>import android.widget.TextView;import android.view.View; public class DBWork{    private View view;...TextView tv = (TextView) view.findViewById(R.id.TextView01);tv.setText(""TEXT ME"")</code></pre><p>Yet, everytime I do that I get a nullpointerexception</p>","508902","","508902","","2011-01-05 20:36:06","2013-09-19 20:47:15","Accessing TextView from another class","<android><view><textview>","5","2","","",""
"4608531","1","","","2011-01-05 19:50:45","0","219","<p>I am using <code>onCreateOptionsMenu()</code> in my activity and trying to add the menu items using <code>menu.add()</code>.</p><p>Eg: <code>menu.add(0,INFO,0,""Info"")</code>. Suppose i have this line in my code, i am getting error on INFO. What should be done to solve this?</p>","564493","","1606729","","2013-02-23 10:24:04","2013-02-23 10:24:04","Error on adding the Menu items","<android>","1","5","","",""
"4608557","1","4608620","","2011-01-05 19:53:42","2","1193","<p>I have a base class that extends ListActivity, that I want to use to implement a lot of common code used on multiple different Activity implementations.</p><p>I want to make this base class abstract to enforce implementation of a method on the subclasses.</p><p>If I write a base implementation of the method, and override it in the subclasses, everything works fine.</p><p>If I make the method abstract, I get the following compile error:</p><pre><code>XXXX.subapps.athletics.AthleticsNewsActivity is not abstract and does not override abstract method getListItems() in XXXX.subapps.BaseCategoryListActivity</code></pre><p>Base Class:</p><pre><code>public abstract class BaseCategoryListActivity extends ListActivity{    ....    abstract ArrayList&lt;String&gt; getListItems();    ....}</code></pre><p>Example subclass:</p><pre><code>public class AthleticsNewsActivity extends BaseCategoryListActivity{    ....    public ArrayList&lt;String&gt; getListItems()    {       ...implementation details....    }}</code></pre>","564496","","260990","","2011-01-05 19:57:01","2011-01-05 20:01:24","Android Activity with Abstract Base Class throws a compile error ""is not abstract and does not overrid abstract method...""","<java><android>","3","1","","",""
"4608719","1","","","2011-01-05 20:12:26","1","939","<p>I am trying to create a simple game. I would like to populate a LinearLayout which I have defined in an XML with several RelativeLayouts. Each time the user presses a button I would like a child View to be added to the LinearLayout. Each RelativeLayout would change slightly based on the users input (which buttons were pressed, etc). </p><p>I essentially want to create a new RelativeLayout based on an XML layout file. I then want to manipulate some attributes of the RelativeLayout's child Views (specifically the src of some ImageViews) and add it to a LinearLayout. This in itself is not particularly difficult. I can get at each of the RelativeLayout's children using findViewById but I start having problems when I want to create n number of RelativeLayouts based on the same XML. I'm pretty sure duplicate IDs are causing crashes. Can a RelativeLayout work without using IDs? Should I try and find a different way of constructing the interface using different ViewGroups?</p><p>I'm not sure if what I am asking is even possible but I know that creating these items on-the-fly using the code alternative to the XML layouts is a horrible thought.</p><p>Thank you in advance.</p>","564519","","","","","2011-01-06 14:49:49","How can I reuse a ViewGroup defined in an XML file multiple times in Android?","<android><android-layout>","3","0","","",""
"4608891","1","","","2011-01-05 20:33:11","0","809","<p>Is there a way to draw text on the android with a set width.</p><p>I'm trying to draw text inside a box that is 300px wide. I want to set the text box to 300px and right align it. That way it lines up with the right side of the box.</p><p>I would set a default value for it, but the text wont always be the same and as the characters grow it wont be aligned anymore.</p>","562537","","","","","2011-01-05 21:07:18","android drawText set width?","<android><canvas><drawtext>","2","0","","",""
"4608922","1","4691568","","2011-01-05 20:37:00","0","243","<p>I need to build a cross platform mobile app (iphone, android, etc). The app is for a company like a cellular operator (Tmobile, ATT). The app needs to do the following:</p><ol><li>Show previous bills (cached so that it does not have to download everytime)</li><li>Need an internet connection to download newer bills, view recent data, etc.</li></ol><p>Can I build a mobile web app to handle this? I understand that there is offline storage and iPhone has good support for web apps (full screen, good icons, offline, etc). Will a web app be the best approach to take as the app requires to be online? The app will not be used by lots of people, just customers of the website who don't want to use an existing website. We are all web developers and a mobile web app looks like the best way to approach this.</p>","170883","","","","","2011-01-14 13:35:42","Mobile web apps - Is this the right approach?","<iphone><android><web-applications>","3","3","","",""
"4609043","1","","","2011-01-05 20:50:48","2","3909","<p>For my <code>AutoCompleteTextView</code> I need to fetch the data from a webservice. As it can take a little time I do not want UI thread to be not responsive, so I need somehow to fetch the data in a separate thread. For example, while fetching data from SQLite DB, it is very easy done with <code>CursorAdapter</code> method - <code>runQueryOnBackgroundThread</code>. I was looking around to other adapters like <code>ArrayAdapter</code>, <code>BaseAdapter</code>, but could not find anything similar...</p><p>Is there an easy way how to achieve this?  I cannot simply use <code>ArrayAdapter</code> directly, as the suggestions list is dynamic - I always fetch the suggestions list depending on user input, so it cannot be pre-fetched and cached for further use...</p><p>If someone could give some tips or examples on this topic - would be great!</p>","283037","","283037","","2011-01-06 08:01:41","2011-11-01 17:49:32","Fetch AutoCompleteTextView suggestions from service in separate thread","<android><multithreading><autocompletetextview>","3","0","2","",""
"4609115","1","","","2011-01-05 20:57:54","0","1019","<p>Can you please help me find out how to call 911 without going through the Dialer user interface in Android?</p><p>I used the below code..but it's going through Dialer. I want to call directly to emergency number through my application.</p><pre><code>Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(""tel:911"")); startActivity(intent);</code></pre>","564565","","321697","","2011-01-05 21:08:38","2013-09-03 07:15:05","how to call 911 without going through the Dialer user interface in android","<android>","2","4","1","",""
"4609129","1","4609566","","2011-01-05 21:00:08","3","1566","<p>I'm trying to delete a temporary file after sharing it via android's Intent.ACTION_SEND feature. Right now I am starting the activity for a result and in OnActivityResult, I am deleting the file. Unfortunately this only works if I am debugging it with a breakpoint, but when I let it run freely and say, email the file, the email has no attachment. </p><p>I think what is happening is my activity is deleting the file before it had been emailed. What I don't get is why, shouldn't onActivityResult only be called AFTER the other activity is finished?</p><p>I have also tried deleting the file in onResume, but no luck.</p><p>Is there a better way to do this?</p>","368845","","","","","2011-01-05 21:49:58","Delete file after sharing via intent","<android><email><file><delete><activity>","2","0","","",""
"4609194","1","4707458","","2011-01-05 21:07:37","2","1729","<p>can you give me a hint how to animate letters in the text string? For example, for a string ""Hello World"", scale H first from 0 to size, then e, then l etc? like a bouncing text effect if you know what I mean.</p><p>And I would the first letter in a string to be in a different color.</p><p>I do know how to animate the entire view or draw text on canvas, but that way animate the entire text string not the letters.</p>","473725","","372239","","2014-01-04 15:46:24","2014-01-04 15:46:24","animate text letters","<android><animation><text>","2","0","1","",""
"4609234","1","","","2011-01-05 21:12:00","0","755","<p>I'm in a bind. I need to make changes to an AIR for Android application, and I don't have the SDK. I was signed up for Adobe's AIR for Android prerelease program, but I never downloaded the files. Now I'm responsible for making some changes to an existing app, and the prerelease site is shut down now. Is there anywhere where I can still get the latest SDK, or can I get it from someone?</p><p>Thanks!</p>","417621","","773263","","2012-05-14 00:09:26","2012-05-14 00:09:26","Need to find the AIR for Android SDK","<android><air><air-android>","3","0","","",""
"4609309","1","","","2011-01-05 21:19:22","2","3605","<p>Wrote a simple program that prints out accelerometer output.  </p><pre><code>mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);     </code></pre><p>It turns out that:</p><ol><li><p>The accelerometer output is always set to ""lowest"" as determined by: </p><pre><code>public void onAccuracyChanged(Sensor sensor, int accuracy) {  if (collectingData){       accelPrecision.setText(""accelerometer accuracy: "" + accuracy);  }}</code></pre></li><li><p>The actual accelerometer readings are very inaccurate - about 2%-5% fluctuations even when it's resting on the table</p></li></ol><p>as far as I can tell it's the same problem on Nexus S, Nexus One and G1</p><p>Any idea how it could be made mode accurate / what sets a</p>","564594","","102937","","2013-08-07 18:54:24","2013-08-07 18:54:24","android accelerometer accuracy is extremely poor","<android><sensor>","2","2","1","",""
"4609396","1","4609463","","2011-01-05 21:28:49","0","720","<p>Is it possible to draw a image when touch and have a transparent BG so i see my homesceen with this:</p><pre><code>android:theme=""@android:style/Theme.Translucent.NoTitleBar""</code></pre><p>And here is my Project so far:</p><pre><code>    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.graphics.Bitmap.Config;import android.os.Bundle;import android.view.Display;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.Window;import android.view.WindowManager;import android.os.Bundle;public class main extends Activity {  private Panel mG; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);       // setContentView(new Panel(this));        setContentView(R.layout.main);        mG = new Panel(this);        setContentView(mG);    }    class Panel extends SurfaceView implements SurfaceHolder.Callback {        private TutorialThread _thread;        private ArrayList&lt;GraphicObject&gt; _graphics = new ArrayList&lt;GraphicObject&gt;();        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.myicon));                    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) {         Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();         int height = display.getHeight(); // not exactly correct            int width = display.getWidth(); // not exactly correct         //Bitmap bitmap = Bitmap.createBitmap(width, height, Config.ALPHA_8);//Config.RGB_565);            //canvas.drawColor(Color.Transparent);            Bitmap bitmap;          GraphicObject.Coordinates coords;           for (GraphicObject graphic : _graphics) {              bitmap = graphic.getGraphic();                coords = graphic.getCoordinates();               canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null);           }        }        @Override        public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {            // TODO Auto-generated method stub        }        @Override        public void surfaceCreated(SurfaceHolder holder) {            _thread.setRunning(true);            _thread.start();        }        @Override        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><p>However the background is black and i do not se my homescreen(or my background activity)</p><p>What do i do wrong?</p><p>//Your Friend!</p>","564612","","","","","2011-02-07 03:11:50","Android Development: 2d Graphic Transparent?","<android>","1","0","","",""
"4609456","1","","","2011-01-05 21:35:06","18","36201","<p>The images (icons) come in roughly the same size, but I need to resize them in order for the buttons to remain the same height.</p><p>How do I do this?</p><pre><code>Button button = new Button(this);button.setText(apiEventObject.getTitle());button.setOnClickListener(listener);/* * set clickable id of button to actual event id */int id = Integer.parseInt(apiEventObject.getId());button.setId(id);button.setLayoutParams(new LayoutParams(        android.view.ViewGroup.LayoutParams.FILL_PARENT,        android.view.ViewGroup.LayoutParams.WRAP_CONTENT));Drawable drawable = LoadImageFromWebOperations(apiSizeObject.getSmall());//?resize drawable here? drawable.setBounds(50, 50, 50, 50);button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);</code></pre>","375566","","390177","","2012-01-31 13:10:44","2014-02-07 08:26:45","Android - Set drawable size programatically","<java><android><mobile><android-sdk-2.2>","6","2","8","",""
"4609599","1","","","2011-01-05 21:55:32","1","2527","<p>When I try to parse my xml file</p><pre><code>&lt;item&gt;&lt;year&gt;1990&lt;/year&gt;&lt;chapter&gt;Chapter 1&lt;/chapter&gt;&lt;/item&gt;</code></pre><p>From a URL, it works fine, but when I try to load from a local file, it throws a SAXParseException unterminated entity ref error. </p>","1639706","","","","","2011-07-16 21:23:06","Parsing local XML file throws unterminated entity ref error","<android>","1","2","","",""
"4609793","1","4611885","","2011-01-05 22:19:40","5","3191","<p>Hey, I have been making an Android app which needs to send a text message. Here is the current code I have:</p><pre><code>public class getMessage extends Service {@Overridepublic IBinder onBind(Intent intent) {    return null;}@Overridepublic void onStart(Intent intent, int startId) {    super.onStart(intent, startId);    client Phone = new client();    String[] msg = Phone.getMsg(user[0],user[1]);    PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, getMessage.class), 0);    SmsManager man = SmsManager.getDefault();    Log.e(""GOT MESSAGE"", msg[0]+ "" : "" +msg[1]);    man.sendTextMessage(msg[0], null, msg[1], pi, null);    Log.e(""Message"", ""Sent the message?"");}</code></pre><p>Now, for some reason, the text message will not send using this code, and I'm not sure why. I was hoping that someone here could help me out in finding why this message won't send.</p><p>No error is raised, nothing appears in the log (except for the log messages that I make myself in the code). Also, the manifest does have the correct  tags.</p><p>Suggestions?</p>","556371","","","","","2011-01-21 20:36:41","Sending an SMS in Android","<java><android><sms>","3","5","2","",""
"4609825","1","","","2011-01-05 22:23:19","1","1972","<p>I want to draw a bitmap on a rectangle. I use the values below:</p><pre><code>    this.meshWidth = 1;    this.meshHeight = 1;    this.verts = new float[8];    this.points[0].x = (float)(this.getWidth()/4);    this.points[0].y = (float)(this.getHeight()/4);    this.points[1].x = (float)(this.points[0].x+this.getWidth()/2);    this.points[1].y = (float)(this.points[0].y);    this.points[2].x = (float)(this.points[0].x);    this.points[2].y = (float)(this.points[0].y+this.getHeight()/2);    this.points[3].x = (float)(this.points[1].x);    this.points[3].y = (float)(this.points[2].y);</code></pre><p>points array is my vertex array.</p><p>my onDraw method</p><pre><code>public void onDraw(Canvas canvas){    //canvas.drawBitmap(bitmap, 20,20, null);    Paint paint = new Paint();    paint.setColor(Color.BLUE);    canvas.drawLine(this.points[0].x, this.points[0].y, this.points[1].x, this.points[1].y, paint);    canvas.drawLine(this.points[1].x, this.points[1].y, this.points[3].x, this.points[3].y, paint);    canvas.drawLine(this.points[3].x, this.points[3].y, this.points[2].x, this.points[2].y, paint);    canvas.drawLine(this.points[2].x, this.points[2].y, this.points[0].x, this.points[0].y, paint);    canvas.drawBitmapMesh(this.bitmap, meshWidth, meshHeight, verts, 0, null, 0, null);}</code></pre><p>The output is this<img src=""http://i.stack.imgur.com/j4Mz3.png"" alt=""alt text""></p><p>I want to draw bitmap on rectangle surrounded with blue lines..</p>","459904","","1300214","","2012-11-06 16:16:24","2012-11-06 16:25:19","How drawBitmapMesh works in android canvas","<android><canvas>","3","0","","",""
"4609855","1","4610043","","2011-01-05 22:28:28","3","1397","<p>Is there any way of modifying a zip on android without having to extract its contents? I only need to add/remove about 10 files. If I had to extract the zip it could go up to 200mb.</p>","336983","","","","","2011-01-06 02:06:54","Android Modify Zip FIle","<java><android><zip><unzip>","2","3","","",""
"4609963","1","","","2011-01-05 22:44:55","3","2190","<p>Let's brute force your garden-variety Android 2.x Visible Contact ID/Names cursor (via <strong>ContactsContract</strong>):</p><pre><code>Cursor c = getContentResolver().query(  Contacts.CONTENT_URI,  new String[] { Contacts._ID, Contacts.DISPLAY_NAME },  Contacts.IN_VISIBLE_GROUP + "" = '1'"",  null,  Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"");</code></pre><p>Is there a way to filter this to get contacts that only have at least one email and/or phone number?</p><p>I see that I can use <strong>Contacts.HAS_PHONE_NUMBER</strong> ... but I don't see <strong>HAS_EMAIL</strong> anywhere. (Tell me this isn't going to get ugly.)</p><p>I can HAS_EMAILZ? <code>:\</code></p>","126660","","","","","2012-03-06 14:11:49","How to query Android 2.x Contacts with Emails and/or Phone Numbers?","<android><email><cursor><phone><contactscontract>","2","0","1","",""
"4610083","1","4627958","","2011-01-05 23:00:46","1","922","<p>I have a strange and inexplicable error with my prepared SQL statement, it doesn't deliver the same results as the noprepared statement.</p><p>Shouldn't these two versions return the same results?</p><p>Prepared version (with wrong results):<pre><code>sb.append("" WHERE c.deck_id=? AND c.next_date &lt; ? AND c.next_date > 0 AND c.active > 0 AND c.deck_level=?"");...return db.rawQuery(sb.toString(), new String[] { Long.toString(deckId), Long.toString(now), Long.toString(level)});</pre></code></p><p>Nonprepared version (works as expected with correct results):<pre><code>sb.append("" WHERE c.deck_id="").append(deckId).append("" AND c.next_date&lt;"").append(now).append("" AND c.next_date > 0 AND c.active > 0 AND c.deck_level="").append(level);...return db.rawQuery(sb.toString(), null);</pre></code></p><p><b>Where is the error in the preparted statement version?</b></p><p><b>Update</b>I made additional logs for both versions.<pre><code>Log.d(TAG, ""selectionArgs1:<em>"" + Long.toString(deckId) + ""</em>""+Long.toString(now)+ ""<em>""+Long.toString(level)+ ""</em>"");</pre></code>Output: selectionArgs1:*5*1294429481330*5*(SO: doesn't display * in the source?)</p><p><pre><code>StringBuffer d = new StringBuffer(""selectionArgs2:<em>"");d.append(deckId).append(""</em>"").append(now).append(""<em>"").append(level).append(""</em>"");Log.d(TAG, d.toString());</pre></code>Output: selectionArgs2:*5*1294429481330*5*</p>","513292","","513292","","2011-01-07 19:53:06","2011-09-13 00:54:08","SQLiteDatabase.rawQuery doesn't return correct results using prepared statement","<java><sql><android><sqlite><prepared-statement>","1","8","","",""
"4610235","1","4610322","","2011-01-05 23:18:00","0","1778","<p>I have a ListView and set a SimpleAdapter to show some formated items, then how could i add other items to the items Listview with the old format.</p>","564706","","","","","2011-01-05 23:46:00","ListView add more items","<android>","2","0","1","",""
"4610553","1","","","2011-01-06 00:08:17","0","1791","<p>I want to have a textview which can both have the marquee scrolling and the manual scrolling.I can add the marquee by just adding this to my xml:</p><pre><code>android:focusable=""true""  android:focusableInTouchMode=""true""  android:marqueeRepeatLimit=""marquee_forever""  android:ellipsize=""marquee""</code></pre><p>But... I want the user to be able to move the text with his finger as well.<br>This is what I tried but had no luck: </p><pre><code>TextView text = (TextView) findViewById(R.id.TEXT_VIEW);  text.setMovementMethod(new ScrollingMovementMethod()); </code></pre><p>The text can now move but its very limited.<br>I looked everywhere and just couldn't find anything...<br>If you have any ideas please let me know<br>Thanks!  </p><p><strong>UPDATE:</strong><br>I was able to get a little more scrolling by adding a touch listener but it seems to srew up the marquee. Once you touch it, the text continues scrolling to the left forever. It never starts again. </p><p>Here is what I have:</p><p>package com.android.favoriteshortcut;</p><p>import android.app.Activity;import android.os.Bundle;import android.text.method.ScrollingMovementMethod;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import android.widget.TextView;</p><p>public class Scrolling extends Activity {    TextView text;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    text = (TextView) findViewById(R.id.text);    text.setOnTouchListener(onTouch);}OnTouchListener onTouch = new OnTouchListener(){    @Override    public boolean onTouch(View v, MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN)        {            text.setSelected(false);            text.setMovementMethod(new ScrollingMovementMethod());        }        if (event.getAction() == MotionEvent.ACTION_UP){            text.setSelected(true);        }        return false;    }};</code></pre><p>}  </p><p>The textView:  </p><pre><code>android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:text=""Long Text Goes Here""  android:id=""@+id/text""   android:singleLine=""true""  android:textSize=""36px""  android:focusable=""true""  android:focusableInTouchMode=""true""  android:marqueeRepeatLimit=""marquee_forever""    android:ellipsize=""marquee""/&gt;  </code></pre>","564762","","564762","","2011-01-06 03:12:58","2011-01-06 03:12:58","Marquee scroll and manual scroll - Android","<android><scrolling><scroll><marquee><horizontal-scrolling>","0","4","","",""
"4610627","1","4623606","","2011-01-06 00:19:10","10","5817","<p>I have started using the Android StrictMode and find that it would be great to have it always running during development and not just on a special branch I created in git. The reason I did this is my apps requirement to run with 1.6 and up. </p><p>I read on the android developer blog that you can set it up so that you activate it via reflection. I was just wondering how that would actually look like and if it might be possible to have this documented here (or somewhere else) rather than having everybody that wants to use it work out themselves.</p>","136445","","","","","2012-09-04 15:04:48","StrictMode for lower platform versions","<android><strictmode>","6","2","4","",""
"4610715","1","13566511","","2011-01-06 00:33:29","0","2348","<p>I'm looking for a way to detect whether or not a WebView is zoomed out fully.  I know you can get a boolean return value from ZoomOut(), but that will perform the zoom out.  I just want to simply know whether or not it can.</p>","445348","","","","","2013-05-28 15:16:55","How to determine if a WebView is zoomed out all the way","<android><webview><scroll><zoom>","4","0","2","",""
"4610746","1","","","2011-01-06 00:39:12","0","933","<p>I have to confess that I don't understand 100% the concept of density, pixel, screen size but I believe that I have followed the general guidelines of designing for multiple screen from <a href=""http://developer.android.com/guide/practices/screens_support.html#range"" rel=""nofollow"">here</a>.</p><p>Now I have designed an application, tested on emulator with WVGA 240 dpi and QVGA 120 dpi and also on my GalaxyS WVGA Screen.</p><p>I have a layout (all sizes are in dip, or wrap_content, fill_parent, no px) and someone is telling me that he doesn't see right this XML layout on his HTC Desire phone, which I know is WVGA and also considered large screen as my GalaxyS. So I'm confused. Where is the problem.</p><p>I have 2 folders in my res, layout and layout-small where I have put 2 versions on the layout. The layout is used for a custom dialog.</p><p><strong>Could someone en-light me why on HTC Desire the layout doesn't seems to be ok ? It is about EditTO_hour and EditTO_minutes that seems to be to small and don't fit right.</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    &gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_height=""wrap_content""         android:layout_width=""270dp""         android:padding=""6dp""         &gt;        &lt;ImageView             android:id=""@+id/ImageView01""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_gravity=""center""            /&gt;          &lt;TextView             android:id=""@+id/TestText""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:text=""Adjust screen filter brightness by moving the slider""            android:paddingLeft=""10dip""             android:layout_marginBottom=""5dip""             android:textColor=""#ffffffff""            /&gt;              &lt;SeekBar             android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:id=""@+id/seekbar""            android:max=""255""            android:paddingLeft=""15dip""             android:paddingRight=""15dip""            /&gt;        &lt;TextView             android:id=""@+id/seekbarvalue""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:paddingLeft=""10dip""            /&gt;              &lt;CheckBox             android:id=""@+id/global_filter""            android:layout_height=""wrap_content""            android:layout_marginBottom=""10dip""            android:text=""Enable Screen Filter on all applications\n(This will override the individual settings for Screen Filter)""            android:textSize=""11dip""             android:layout_width=""wrap_content""             android:layout_centerHorizontal=""true""            /&gt;        &lt;CheckBox             android:id=""@+id/screenfilter_schedule""            android:layout_height=""wrap_content""            android:text=""Enable schedule (24h format)""            android:textSize=""12dip""             android:layout_width=""wrap_content""             android:layout_centerHorizontal=""true""            /&gt;              &lt;LinearLayout             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_marginBottom=""20dip""             android:id=""@+id/schedule_layout""            &gt;            &lt;TextView                 android:id=""@+id/from""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:paddingLeft=""10dip""                 android:text=""From""                 android:gravity=""center_vertical""                /&gt;                   &lt;EditText                 android:id =""@+id/editFROM_hour""                android:layout_width=""wrap_content""                android:maxLength=""2""                android:text=""00""                android:layout_height=""wrap_content""                 android:inputType=""numberDecimal""                 android:width=""41dip""                /&gt;             &lt;TextView                 android:id=""@+id/from""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text="":""                 android:gravity=""center_vertical""                /&gt;                &lt;EditText                 android:id =""@+id/editFROM_minutes""                android:layout_width=""wrap_content""                android:maxLength=""2""                android:text=""00""                android:layout_height=""wrap_content""                 android:inputType=""numberDecimal""                 android:width=""43dip""                /&gt;                          &lt;TextView                 android:id=""@+id/to""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:paddingLeft=""10dip""                 android:text=""To""                 android:gravity=""center_vertical""                /&gt;                          &lt;EditText                 android:id =""@+id/editTO_hour""                android:layout_width=""wrap_content""                android:maxLength=""2""                android:text=""00""                android:layout_height=""wrap_content""                 android:inputType=""numberDecimal""                 android:width=""41dip""                /&gt;             &lt;TextView                 android:id=""@+id/from""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text="":""                 android:gravity=""center_vertical""                /&gt;            &lt;EditText                 android:id =""@+id/editTO_minutes""                android:layout_width=""wrap_content""                android:maxLength=""2""                android:text=""00""                android:layout_height=""wrap_content""                 android:inputType=""numberDecimal""                 android:width=""43dip""                /&gt;           &lt;/LinearLayout&gt;        &lt;LinearLayout               android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            &gt;               &lt;Button                 android:id=""@+id/ButtonOK""                 android:layout_height=""wrap_content""                android:text=""OK""                  android:layout_width=""100dip""                 android:layout_marginLeft=""10dip""                 android:layout_marginRight=""10dip""                /&gt;            &lt;Button                 android:id=""@+id/ButtonCancel""                 android:layout_height=""wrap_content""                android:layout_marginLeft=""10dip""                android:layout_marginRight=""10dip""                android:text=""Cancel""                  android:layout_width=""100dip""                /&gt;        &lt;/LinearLayout&gt;              &lt;/LinearLayout&gt; &lt;/ScrollView&gt;</code></pre>","467780","","1140748","","2012-05-06 16:10:58","2012-05-06 16:10:58","Screen sizes / density","<android><layout><screen>","0","5","0","",""
"4610907","1","4610927","","2011-01-06 01:13:15","0","1009","<p>I have a button in my activity, when you click the button an if statement is ran against its text label;</p><pre><code>if(BTN_1.getText()==""firsttext""){    //do some stuff, then...    BTN_1.setText(""secondtext"");}else if(BTN_1.getText()==""secondtext""){    //do other stuff, then...    BTN_1.setText(""firsttext"");}</code></pre><p>Firstly, if I hit the home button and go back to the desktop and then click back onto my app the view has reset its self; if I press the button and leave it in a state where the text of the button is ""secondtext"", when I return to my app it says ""firsttext"", how can I stop the view of my app refreshing its self like this?</p><p>Secondly, under my XML layout I have defined the buttons text; android:text=""firsttext""But this won't actually match my if statement above, under onCreate of this app I have: BTN_CONNECT.setText(""Connect"");But visually the text of the button is exactly the same, why won't it match?</p><p>Thanks for reading :)</p>","560065","","","","","2011-01-06 01:49:23","Android, simply view question about view reset","<android><button><view><reset>","1","0","","",""
"4610992","1","4636189","","2011-01-06 01:31:12","0","447","<p>This is driving me a little crazy because it seems like a fairly straight forward thing.  The WebView has a method called getContentHeight(), but it does not have getContentWidth().</p><p>I asked this <a href=""http://stackoverflow.com/questions/4610715/how-to-determine-if-a-webview-is-zoomed-out-all-the-way"">question</a>, which is related but I also wanted to ask this and it seemed it is slightly different so I created a separate question.</p><p>I want to figure out some way to get the total width of the scrollable content.  This value is obviously known because it is used to determine the size of a horizontal scrollbar but why is there no public access to this value?  Is there any way to get this value or make these calculations?</p>","445348","","","","","2013-07-13 08:02:49","Is there anyway to get the scrollable width or getContentWidth?","<android><width><scroll>","2","0","","",""
"4611009","1","4611057","","2011-01-06 01:34:27","0","1958","<p>I'm using Google's exmaple of <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">Hello, TabWidget</a> but altered it to look like this:</p><p>main.xml:</p><pre><code>&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;TextView                 android:text=""@+layout/text""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" /&gt;            &lt;TextView                 android:id=""@+id/textview2""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text=""this is another tab"" /&gt;            &lt;TextView                 android:id=""@+id/textview3""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text=""this is a third tab"" /&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>java file:</p><pre><code>public class HelloTabWidget extends TabActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TabHost mTabHost = getTabHost();        mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""TAB 1"").setContent(R.layout.text));        mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(""TAB 2"").setContent(R.id.textview2));        mTabHost.addTab(mTabHost.newTabSpec(""tab_test3"").setIndicator(""TAB 3"").setContent(R.id.textview3));        mTabHost.setCurrentTab(0);    }}</code></pre><p>and here is the text.xml in res/layout:</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:layout_height=""wrap_content""            android:layout_width=""fill_parent""            android:text=""This is Tab 1"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>What I'm basically trying to do is have each tab refer to its own xml file rather than all in main.xml, but the text in the first tab doesn't show up.</p>","560983","","352841","","2012-09-02 11:04:46","2012-09-02 11:04:46","Hello, TabWidget each tab refer to new xml","<android><xml><android-textview><android-tabs><refer>","3","1","","",""
"4611012","1","","","2011-01-06 01:34:59","4","1485","<p>HelloI need to make DRM Image file using two image file.originally I was use bufferedImage class, but android is not support bufferedImage.</p><p>so please help me. how to compose two image in android?</p>","510250","","","","","2011-01-06 11:11:16","how to compose(combine) two photo image in android?","<android><image-processing>","1","0","2","",""
"4611054","1","","","2011-01-06 01:44:30","0","484","<p>I'm a beginner and am making a calculator (fairly easy), but it's happening the following problem: When Cline in ""1"" button for example, he enters this number in the EditText, but if you click again the number is overwritten instead of the inserted his side as desired. How do the numbers were placed side by side without overwriting those already there?</p><p>Note: The layout of buttons and etc. I did in. XML, so I'm not using the keyboard native Android.</p><p>Thanks!</p>","564830","","","","","2011-01-06 02:07:19","Text inserted in the edittext is overwritten","<android><edittext>","1","0","","",""
"4611125","1","4611136","","2011-01-06 02:00:56","2","159","<p>all.i want to know the phone‘s electricity cost in my apps.but the BatteryManagercan't give the information.how can i get this?</p>","549576","","418613","","2012-06-08 12:33:50","2012-06-08 12:33:50","how can i know the phone‘s electricity consumption","<android><power-management>","2","0","","",""
"4611208","1","5822359","","2011-01-06 02:21:33","0","872","<p>I wrote a simple Android program with 2 tabs. Tab 1 has a button which will open a new window. But I realized that when opening this new window, the Android tab bar will be hidden.</p><p>I'd like to always show the Android tab bar. Can anyone tell me how to do that?</p>","190309","","496830","","2011-03-08 13:21:26","2011-04-28 17:05:18","How to show Android tab bar when opening a new window","<android><tabbar>","1","1","","",""
"4611241","1","","","2011-01-06 02:30:22","0","89","<p>Is there any official presentation about the difference for launcher between platform 1.6 and 2.1?I wanna port some features to my launcher application based on 1.6 from 2.1. But it seems few difference between 1.6 and 2.1.</p>","493162","","","","","2011-01-12 04:24:16","Any official presentation about the difference for launcher between platform 1.6 and 2.1?","<android><launcher>","2","0","","",""
"4611287","1","","","2011-01-06 02:39:57","5","1603","<p>The old approach</p><pre><code>  Window window = getWindow();  LayoutParams layoutParams = window.getAttributes();  layoutParams.screenBrightness = newFloatValue;  window.setAttributes(layoutParams);</code></pre><p>doesn't work on HTC Desire with <strong>Automatic brightness</strong> checked in <strong>Settings > Display > Brightness</strong>.<br>Is there a HTC-specific workaround for that?</p>","15187","","15187","","2011-01-06 02:45:20","2012-08-25 23:57:41","Changing screen brightness on a HTC Sense device","<android><htcsense>","1","0","1","",""
"4611335","1","4611738","","2011-01-06 02:54:14","0","584","<p>I've got a basic GridView that I've set up as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/MainMenuGridview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:numColumns=""auto_fit""        android:verticalSpacing=""10dp""        android:horizontalSpacing=""10dp""        android:columnWidth=""90dp""        android:stretchMode=""columnWidth""        android:gravity=""center""    /&gt;</code></pre><p>Everything works fine until I add a ninepatch background.  Once I add the background image like this:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/MainMenuGridview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:columnWidth=""90dp""    android:stretchMode=""columnWidth""    android:gravity=""center""    android:background=""@drawable/mainbackground""/&gt;</code></pre><p>It breaks my gridview.  Instead of displaying 3-4 columns (depending on screen resolution and orientation) all icons in the gridview display in a single column in the upper left corner.  Furthermore, only two at a time are displayed and I have to scroll down to see the rest.  I suspect that the gridview is being bound by the dimensions of the ninpatch's center logo, but I'm not sure.</p><p>My ninepatch has a small area in the middle with a logo that I want to be displayed without any skewing.  The rest of the background is a small gradient that takes up the remainder of the screen.  Any ideas on what's causing this?</p>","564875","","","","","2014-04-15 07:09:46","Ninepatch Background shrinks display area of GridView","<android><gridview><nine-patch>","2","0","","",""
"4611351","1","","","2011-01-06 02:59:25","1","665","<p>As a developer, I have had pretty bad experiences when it comes to building apps (with web pages) that run on the Android webviewclient on 3G connection. A few of my users are saying that some pages take up to 10 minutes to load. (I don't know if they have exaggerated because they are frustrated.) Personally, I use HTC Desire running Android 2.2 and have tested my apps with my own phone. Indeed, even for apps that use locally stored web pages to make AJAX requests, it is extremely slow on 3G. Most of the time, it will just timeout and show up a blank page. When it's on WIFI, it works fine and is real fast.</p><p>I have heard many say that the native browser on Android 2.2 is extremely fast. For me, I must however say that the native browser app is also very slow on 3G. Sometimes, the Google mobile home page does not even finish loading. I'm in Singapore and so 3G coverage should be fine in most places.</p><p>Is it the device hardware that is causing the problem?</p>","561212","","","","","2013-12-16 07:36:40","Android - WebViewClient loads pages extremely slowly","<android><browser><native><webviewclient>","1","0","","",""
"4611388","1","4618414","","2011-01-06 03:09:29","1","880","<p>I am building an application to convert Latitude and Longitudesbetween various formats.  My layout is complete but my currentchallenge is this:</p><p>For the Degree values, as the user enters a value in EditText1, I wantit to replicate in EditText2 as they are typing, real-time, characterfor character.  I have beat myself up trying OnTouchListener,onKeyboardActionListener, etc.</p><p>Later, I will perform calculations on the Minutes, Seconds, anddecimal portions as they are typed in.  Since the Degree field doesnot require calculations I am just trying to replicate the users valueacross multiple EditText boxes for now.</p><p>SUMMARY:Capture the characters in EditText1 as they are typedPlace EditText1 captured characters into EditText2 on the fly.</p><p>Any help would be greatly appreciated.</p><p>Mike Murphy </p>","564884","","564884","","2011-01-06 17:05:13","2011-01-06 18:33:26","Copying text from one EditText box to another in the same Activity on the fly, character-by-character","<android><edittext><listeners>","1","0","","",""
"4611424","1","4611478","","2011-01-06 03:19:09","1","5163","<p>I've got a weird one for you guys...</p><p>When I plug my phone into my computer it begins charging but won't show up in Eclipse as a valid running Android device. My program works just fine in the emulator, but I can't test it on my Droid.  To clarify, I don't receive errors - I simply don't have the option to launch the app on my physical device.</p><p>This seems to have occurred after 2.3 was released. My phone got the update and if memory serves, this is when it quit working. I was developing primarily on the Emulator at the time, so I can't be sure. My phone shows Android version 2.2.1 though, which is further puzzling me as I assumed it would show v2.3. It's a Motorola Droid (the original one).</p><p>I upgraded the SDK through Eclipse and while it still works fine through the emulator, it patently refuses to recognize my Droid when I plug it in. I need to do some final testing on an app that I'm about to publish, but I'm at a standstill until I can use a physical phone.</p><p>I haven't yet tried downgrading to v2.2. I suppose it's possible that the old Droid just can't handle 2.3 and is thus incompatible with the upgrade. Just thinking out loud here, I'm really hoping someone can give me a better answer.</p><p>Has anyone else seen this?</p>","500069","","244296","","2011-01-06 03:23:53","2011-11-22 23:32:20","Physical device won't show up, Emulator works just fine","<android><eclipse><android-emulator>","2","1","","",""
"4611453","1","4612016","","2011-01-06 03:24:45","2","3183","<p>I am creating a dynamically Imageview.</p><pre><code>ImageView btnSend = new ImageView (this);</code></pre><p>I need to put a layout that contains the states of the images, this is the xml:</p><pre><code>&lt;? xml version = ""1.0"" encoding = ""utf-8""?&gt;&lt;selector      xmlns: android = ""http://schemas.android.com/apk/res/android""&gt;      &lt;item           android: state_focused = ""true""           android: state_pressed = ""false""           android: drawable = ""@ drawable/button_state3"" /&gt;      &lt;item           android: state_focused = ""true""           android: state_pressed = ""true""           android: drawable = ""@ drawable/button_state2"" /&gt;      &lt;item           android: state_focused = ""false""           android: state_pressed = ""true""           android: drawable = ""@ drawable/button_state2"" /&gt;      &lt;item           android: drawable = ""@ drawable/button_state1"" /&gt;&lt;/ selector&gt;</code></pre><p>I tested with setBackgroundResource property, but does not work.</p><p>how do I assign this layout to Imageview?</p><p>Thanks in advance.</p>","518657","","","","","2011-01-06 14:16:49","Setting Background to Imageview","<java><android><xml><layout><imageview>","2","0","1","",""
"4611540","1","","","2011-01-06 03:46:02","0","1130","<p>I'm building an alert dialog dynamically with an edit text field with two buttons. The dialog box is only wrapping the width which is very small, I want it to stretch to fill the parent width</p><pre><code>public void showMessageDialog(String name){    final AlertDialog.Builder alert = new AlertDialog.Builder(this);    this.etMessage = new EditText(this);    etMessage.setText("""");    alert.setMessage(""Message "" + name);    alert.setView(etMessage);    alert.setPositiveButton(""Message"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            updateLocation();        }    });    alert.setNeutralButton(""Map"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            showMap();        }    });    alert.show();}</code></pre>","461631","","","","","2011-01-06 05:00:39","How do I get my AlertDialog to fill parent width","<android><modal-dialog><alertdialog>","1","0","","",""
"4611572","1","4611651","","2011-01-06 03:52:34","0","719","<p>I need to find a way to modify attributes of widgets from within a for loop.  In particular, I need to go through and dynamically change the text on each button in a series.  </p><p>Changing the text is of no issue, I can do it with a single button very easily, but how can I get this loop to correctly find the next button?  It seems to need to be a direct reference to the button, but there's no way for me to just increment something and get the next button ID.</p><p>In a worst case scenario I can just take care of every button individually, but this is obviously very sloppy and that's not the kind of code I want to get used to creating, so any help is appreciated.</p>","564912","","244296","","2011-01-06 03:58:24","2011-01-06 04:12:42","Getting Widget ID's in a Loop","<android><loops><button><attributes><widget>","1","0","","",""
"4611588","1","4634302","","2011-01-06 03:55:03","0","1318","<p>I would like to create some instruments for Android using generative audio. I really like SuperCollider, but it doesn't seem to be that far along for Android. Are there any good libraries or techniques for programming audio? I have seen at least two apps in Market which seem to use generative audio. This, for example:</p><p><a href=""http://www.androlib.com/android.application.com-etherophone-DEBE.aspx"" rel=""nofollow"">http://www.androlib.com/android.application.com-etherophone-DEBE.aspx</a></p><p>Another possibility is just importing separate audio files for each note...but that seems less than ideal. </p>","191726","","191726","","2011-01-07 04:28:48","2011-01-08 14:25:10","Audio synthesis on Android?","<android><audio><sound-synthesis>","1","0","2","",""
"4611605","1","","","2011-01-06 03:58:46","1","767","<p>I'm trying to write a card game for Android and I'm running into layout difficulties. I'm coding the main game screen which consists of five cards arranged vertically across the left and right and five cards arranged horizontally across the top and bottom. The problem I'm having is I need the cards to all shrink horizontally and vertically if there isn't room for all the other cards to be shown.</p><p>Below is a picture of the problem (I'm omitting the cards along the left and bottom for clarity). As you can see only four cards are shown along the right side - the bottom card is partially obscured. The View has simply run out of space, so it drops the rest of the card that doesn't fit.</p><p>Here's a link to the screenshot, since I can't post images: <a href=""http://i.stack.imgur.com/C9h2U.png"" rel=""nofollow"">image</a></p><p>What I'd like in this situation is for Android to reduce the height of all the top cards and right cards until the bottom card is fully visible. It doesn't seem complicated, but I can't get it to work. I created the image below by using RelativeLayout and placing all top cards next to each other and all right cards below each other (with the top card on the right below the top cards). I tried adding all the cards to their own View but that didn't work either.</p><p>Any suggestions? Thanks!</p><hr><p>OK, I got it closer (see the image link at the bottom) but now I have the opposite problem - I need to increase it. I believe it's because I shrunk the images I'm using for the suits. As you can see they are all shrunk to a small size. I would like to be able to get the LinearLayout for each button set to expand horizontally/vertically to use up all free space, without drawing the last buttons off the visible part of the LinearLayout. Ideally I would be able to drop in any size image for the suit and have that resized appropriately as well, but I'm afraid I'm asking for some circular logic or something in the layout engine.</p><p>Here is my XML file. The HandView class is what holds the five cards in each set. The 5 cards have a 5 pixel margin between them.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:shrinkColumns=""*""    android:background=""#FF00FF00""&gt;    &lt;TableRow        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:background=""#FF0000FF""&gt;        &lt;com.herscher.euchre.ui.HandView          android:background=""#FFFF0000""            android:layout_column=""1""            android:orientation=""horizontal""            android:id=""@+id/northHandView""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:gravity=""center_horizontal"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""&gt;        &lt;com.herscher.euchre.ui.HandView            android:layout_column=""0""            android:orientation=""vertical""            android:id=""@+id/westHandView""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;        &lt;com.herscher.euchre.ui.PlayArea            android:layout_column=""1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:id=""@+id/playArea"" /&gt;        &lt;com.herscher.euchre.ui.HandView            android:layout_column=""2""            android:orientation=""vertical""            android:id=""@+id/eastHandView""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""&gt;        &lt;com.herscher.euchre.ui.HandView            android:layout_column=""1""            android:orientation=""horizontal""            android:id=""@+id/southHandView""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p><a href=""http://i.stack.imgur.com/C9h2U.png"" rel=""nofollow"">New image is here</a></p><p>Does anyone have any suggestions?</p>","472737","","1288","","2011-10-01 01:30:40","2011-10-01 01:30:40","How to force Android View to shrink children","<android><android-layout><relativelayout>","1","1","","",""
"4611609","1","","","2011-01-06 03:59:44","0","973","<p>I'm curious if there are any iris recognition libraries already existent for Java in Android, or at least in a similar language (or Java in general). I found a <a href=""http://www.advancedsourcecode.com/iris.asp"" rel=""nofollow"">matlab library</a>, but I'm having difficulty understanding it and I just wanted to see if there's something a little closer to my area of expertise.</p><p>Thanks!</p>","563805","","385950","","2011-01-06 05:20:42","2014-04-17 08:05:52","Are there any existent iris/eye recognition libraries for Android's Java or similar languages?","<java><android><eye-tracking><iris-recognition>","2","5","","",""
"4611667","1","4618222","","2011-01-06 04:10:51","0","958","<p>I have 4 <code>RadioButton</code>s in a <code>RadioGroup</code>. The <code>RadioButton</code>s have the same instance of <code>OnCheckedChangedListener</code> set. When any of the <code>RadioButton</code> is selected a dialog is popped up after 800ms using a handler. The problem is, sometimes any of the <code>RadioButton</code>s remains unchecked even after the checked state is changed, but the dialog pops up. I suspect this to be a bug. Any pointers will be greatly appreciated.</p>","421372","","421372","","2012-12-31 03:18:09","2012-12-31 03:18:09","Android Radio Button doesn't get checked sometimes","<android><multithreading><radio-button><radio-group>","1","0","","",""
"4611722","1","4611878","","2011-01-06 04:23:26","1","780","<p>I'm writing an app that has a main Activity which controls the main display that the user views and interacts with.   </p><p>It also has an options menu and each menu item has its own Activity and Layout to perform various subordinate tasks.   Some of these tasks may result in changes to the contents of the main display.    So I want those subordinate Activities to be able to signal the main Activity that it has to redraw or recompute the main display the next time control is transferred to the main Activity, say, it its <em>onResume()</em> handler.</p><p>What's a lightweight way for one activity to signal to another that it has to do something.   I come from a Windows background so I'm looking for the equivalent of sending a WM_PAINT message, or setting a flag or semaphore for the main activity to read.</p><p>I tried just putting a public boolean in the main Activity but it complained that it had to be static.   Thanks in advance!</p>","424690","","","","","2011-01-06 04:55:59","Android inter-Activity signalling (newbie question)","<android>","1","0","","",""
"4611822","1","","","2011-01-06 04:44:06","19","34736","<p>I am trying to change the layout of my application from portrait to landscape and vice-versa. But if i do it frequently or  more than once then at times my application crashes.. Below is the error log. Please suggest what can be done?</p><pre><code> 01-06 09:52:27.787: ERROR/dalvikvm-heap(17473): 1550532-byte external allocation too large for this process. 01-06 09:52:27.787: ERROR/dalvikvm(17473): Out of memory: Heap Size=6471KB, Allocated=4075KB, Bitmap Size=9564KB  01-06 09:52:27.787: ERROR/(17473): VM won't let us allocate 1550532 bytes  01-06 09:52:27.798: DEBUG/skia(17473): --- decoder-&gt;decode returned false 01-06 09:52:27.798: DEBUG/AndroidRuntime(17473): Shutting down VM 01-06 09:52:27.798: WARN/dalvikvm(17473): threadid=3: thread exiting with uncaught exception (group=0x4001e390) 01-06 09:52:27.807: ERROR/AndroidRuntime(17473): Uncaught handler: thread main exiting due to uncaught exception 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): java.lang.RuntimeException: Unable to start activity ComponentInfo{}: android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3812)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread.access$2300(ActivityThread.java:126)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1936)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.os.Handler.dispatchMessage(Handler.java:99)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.os.Looper.loop(Looper.java:123)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread.main(ActivityThread.java:4595)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at java.lang.reflect.Method.invokeNative(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at java.lang.reflect.Method.invoke(Method.java:521)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at dalvik.system.NativeStart.main(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.Activity.setContentView(Activity.java:1629)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at onCreate(Game.java:98) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     ...  12 more 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): Caused by: java.lang.reflect.InvocationTargetException  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:92)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at java.lang.reflect.Constructor.constructNative(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     ...  22 more 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:464)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:340)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.content.res.Resources.loadDrawable(Resources.java:1705)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.View.&lt;init&gt;(View.java:1850)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.View.&lt;init&gt;(View.java:1799)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:296)  01-06 09:52:27.857: ERROR/AndroidRuntime(17473):     ...  26 more </code></pre>","527933","","88442","","2011-01-06 04:56:08","2014-01-28 08:50:52","java.lang.OutOfMemoryError: bitmap size exceeds VM budget","<android><memory-leaks>","12","3","19","",""
"4611995","1","4932705","","2011-01-06 05:20:30","0","4514","<p>I have a mapview in my appn. I show some points on the map when the page gets loaded.I also have a search button in that page. So after I give something to search and click search button, map doesnt gets refreshed. It gets refreshed only when we touch anywhere on the map. I have given mapview.invalidate() also. Still not working...</p><p>Any idea why this problem occurs?</p>","504162","","504162","","2011-01-06 05:31:22","2011-02-08 11:57:04","mapview refresh","<android><google-maps><android-mapview>","1","2","","",""
"4612211","1","4612291","","2011-01-06 06:00:33","3","6842","<p>During the upgrade of my android application, I changed the package name. But Android market doesn't allow to upload the changed package name application as an upgrade. If I upload the application as a new application, will the user have two applications on his/her device? How can I make sure that the user doesn't have to download the application again from scratch without reverting the change of my package name?</p>","203018","","1284644","","2012-05-12 20:47:10","2012-05-12 20:47:10","Changing the package name of an upgraded Android application","<android><apk><google-play><android-install-apk>","3","0","2","",""
"4612287","1","4612345","","2011-01-06 06:14:36","1","2772","<p>I am using date picker but i have some problems with date and time picker. I need date picker dialog should appears with current date value. Similarly Time picker should appears with current time value. How to do this, please any body help.</p><p>Thnks. </p>","489762","","","","","2011-09-09 10:29:36","date picker with current date in android","<android>","1","1","0","",""
"4612421","1","4612520","","2011-01-06 06:32:04","0","2436","<p>I have a button. When I click that button I want show a animated menu in the top of that parent layout that includes an edit text and a button.  How can I do that?</p>","548218","","241475","","2011-01-06 06:51:54","2011-03-26 05:28:42","Show an animated menu in a the parent layout while clicking a button","<android><android-ui><android-animation>","1","0","","",""
"4612465","1","","","2011-01-06 06:39:31","0","570","<p>how to get 12 hrs format date picker with AM_PM value. Actualy when i am picking the date from date picker dialog it is coming in 24hrs format and AM_Pm is not coming.please help</p>","489762","","","","","2011-01-06 06:45:01","date picker 12 hrs format in android","<android>","1","0","","",""
"4612476","1","4612503","","2011-01-06 06:42:17","0","2617","<p>instead of it displaying google map it only display grid view.</p><p>->   i followed all the steps that are in following sites examples         <a href=""http://mobiforge.com/developing/story/using-google-maps-android"" rel=""nofollow"">http://mobiforge.com/developing/story/using-google-maps-android</a>                       or         <a href=""http://www.androidpeople.com/android-google-map-application-example/"" rel=""nofollow"">http://www.androidpeople.com/android-google-map-application-example/</a></p><p>->   i also set the proxy server         run --> run configuration.. --> myapplication-->target tab--> additional command line</p><pre><code>            -http-proxy http://192.68.100.101:8080/ Still i am not getting the google map.</code></pre><p>NOTE: i tried this in my mobile it works fine but not display in android emulator.</p><p>where i made mistake plz help me.</p><p>thank in advance</p>","489902","","457982","","2011-01-06 06:47:08","2013-01-21 19:14:02","google map in android emulator problem","<android><google-maps><android-emulator>","2","2","","",""
"4612497","1","4629053","","2011-01-06 06:45:26","1","4932","<p>friends,</p><p>i am using following custom adapter to show textview and checboxes in listview.now if textview is selectAll on clicking checbox infront of it in list i should select all checkboxes below in list.in my case selectall checkbox will be at position ""0"" and other below it.</p><p>any one guide me how to get all checkboxes array so that i could select or deselect them.any help would be appreciated.</p><pre><code>public  class EfficientAdapter extends BaseAdapter implements        Filterable {    private LayoutInflater mInflater;    //private Context context;    List&lt;DalCategories&gt; obj;    public EfficientAdapter(Context context,List&lt;DalCategories&gt; value) {        mInflater = LayoutInflater.from(context);        obj = value;        //this.context = context;    }    public View getView(final int position, View convertView,         final  ViewGroup parent) {        ViewHolder holder;        convertView = mInflater.inflate(R.layout.list_category_item, null);        holder = new ViewHolder();        holder.TextTitle = (TextView) convertView.findViewById(R.id.list_item_title);        holder.checkBoxes = (CheckBox) convertView.findViewById(R.id.chkSubCategory);        if(obj.get(position).isIs_Selected())        {            holder.checkBoxes.setChecked(true);        }        holder.checkBoxes        .setOnCheckedChangeListener(new OnCheckedChangeListener() {            @Override            public void onCheckedChanged(                    CompoundButton buttonView, boolean isChecked) {                if(select_all == true){                               // select all here........}                               }        });        convertView.setTag(holder);        holder.TextTitle.setText(obj.get(position).getTitle());        return convertView;    }     class ViewHolder      {        public TextView TextTitle;        public CheckBox checkBoxes;     }    @Override    public Filter getFilter() {        return null;    }    @Override    public long getItemId(int position) {        return 0;    }    @Override    public int getCount() {        return obj.size();    }    @Override    public Object getItem(int position) {        return obj.get(position);    }    }`enter code here`</code></pre>","249991","","","","","2011-01-14 08:45:15","how to select all checkboxes in custom list adapter programmatically?","<android><listview>","3","0","0","",""
"4612579","1","4612602","","2011-01-06 06:57:53","1","5249","<p>In my android application I want to call particular method at regular interval of time ie. ""after every 5 seconds""...how can i do that....?</p>","533863","","","","","2013-07-08 17:20:20","Call Particular Method after regular interval of time","<android><android-sdk-2.2>","2","0","1","",""
"4612580","1","9663367","","2011-01-06 06:58:18","1","5755","<p>I am using Android 2.2. I am trying following code to run:</p><pre><code>Uri uri=Uri.parse(""http://bluediamondring-s.com/wp-content/uploads/2010/08/gold-ring.jpg"");File f=new File(uri.getPath());image.setImageURI(Uri.parse(f.toString()));image.invalidate();</code></pre><p>But image is not visible on my android screen.</p><p>suggest something.</p><p>Regards,Rahul</p>","315140","","","","","2012-04-01 03:59:19","setImageUri is not working","<android><imageview>","3","0","1","",""
"4612588","1","4612656","","2011-01-06 07:00:14","0","252","<p>I have a</p><pre><code>Picture pic = webView.capturePicture();</code></pre><p>which is potentially huge and needs to be sliced into multiple chunks that will fit the screen.<br>The naive thing I'm currently doing is</p><pre><code>Bitmap bm = Bitmap.createBitmap(screenWidth, screenHeigth, RGB_565);Canvas canvas = new Canvas(bm);canvas.drawPicture(pic);fullScreenImageView.setImageBitmap(bm);</code></pre><p>What would be the efficient way to ""paginate"" the <code>Picture</code> to be displayed on screen (these ""pages"" will be later replacing one another)?</p>","15187","","","","","2011-01-06 07:11:40","Slicing a Picture","<android>","1","0","","",""
"4612613","1","4613988","","2011-01-06 07:04:29","0","1614","<p>I tried to use a receiver to get Information about battery when received a system broadcast, but it failed without doing anything.<br>Here is the code:<br><code>if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction()))  {//doing<br>1...<br>}</code></p><p>and in AndroidManifest.xml<br><code>&lt;receiver android:name="".BroadCastReceiver_battery""&gt;<br>    &lt;intent-filter&gt;<br>        &lt;action android:name=""android.intent.action.BATTERY_CHANGED"" /&gt;<br>    &lt;/intent-filter&gt;<br>&lt;/receiver&gt;</code></p>","542792","","","","","2011-01-06 10:36:46","How can I get Battery information in my app?","<android><battery>","1","0","","",""
"4612642","1","4612863","","2011-01-06 07:09:08","2","7420","<p>R cannot be resolvedR.layout.main cannot be resolvederror is repeating to me and i cant run any of my android program</p><p>pls give any instruction </p>","565106","","","","","2012-06-17 08:52:14","R cannot be resolved-android","<android>","3","0","1","",""
"4612791","1","","","2011-01-06 07:36:12","0","3445","<p>I am designing an app in android, for my app i created one database for data storage now i want to browse my app database from device so that i can monitor my tables and it's data. I am able to browse the database from AVD(using SQLite Database Browser) but it's not working for the device, so pls guide me.</p><p>Thanks,Balaram.</p>","563593","","","","","2011-01-06 10:04:17","how to Browse the database from android Device?","<android>","2","0","","",""
"4612829","1","4612921","","2011-01-06 07:42:19","1","160","<p>Accessing to android website in order to dowload SDK is blocked in my country!</p><p>One of programmers who live in other country is shared his Eclipse and SDK and says that you can use mine. He mentioned that after copy this on your computer go to <code>Help&gt;Install new software</code> in Eclipse, then click on <code>Available Software Sites</code> link and in <code>Preference</code> window, from the left list cick on <code>Android</code> and set the SDK Location.</p><p>My problem is, in Preference page I don't have Android in the list.</p><p>What should I do?Thanks</p>","513413","","","","","2011-01-06 08:00:53","android installation and problem in addressing of SDK","<android><sdk><installation>","1","3","","",""
"4612851","1","","","2011-01-06 07:47:17","1","3100","<p>I am developing a GPS app in that, I used location manager and able get the longitude and Latitude ... But, I need the NMEA 0183 format sentence for sending to the server.. how can I get that sentence help me if any one knows that</p><p>Thanks for reading</p>","546107","","","","","2011-03-09 13:57:42","How To Get NMEA Sentence of GPRMC in my application?","<android>","2","0","","",""
"4612887","1","4612915","","2011-01-06 07:55:38","2","1026","<p>I am trying to implement ""Listview with search"" functionality, in which i am successful to search with the word that we trying to enter in the edittext. But i want to implement to search with inner-text from a string. for that i have tried to implement:</p><pre><code>string.contains(txtSearch.getText().toString())</code></pre><p>I am successful in this as well. But <strong>there is a still problem of ""Case sensivity"", how do i search for inner-text with ignoring case ?</strong> </p><p>Can you suggest me what should do i with <strong><code>Contains()</code></strong> to ignore case ?</p>","379693","","","","","2011-01-06 09:11:00","Android - Listview search inner-text by ignoring Case","<java><android>","2","0","1","",""
"4613046","1","","","2011-01-06 08:27:24","8","18549","<p>I have some conflicts with the <code>JAVA_HOME</code> configurationWhen I using the following code -</p><pre><code>System.out.println(System.getenv(""JAVA_HOME""));</code></pre><p>I get - <code>C:\jdk1.6.0_23</code> which is the correct place.But, When I run Ant command on an Android build.xml, I got the following error message -</p><blockquote>  <p>C:\android-sdk-windows\tools\ant\main_rules.xml:361: Unable to find a javac compiler;  com.sun.tools.javac.Main is not on the  classpath. Perhaps JAVA_HOME does not  point to the JDK. It is currently set  to ""C:\jdk1.6.0_23\jre""</p></blockquote><p>How it can be resolved?</p><p>Thanks,</p><p>Eyal</p>","341497","","457982","","2011-02-02 10:31:29","2013-06-16 15:10:37","Setting JAVA_HOME at Android SDK","<java><android><windows><sdk><jre>","2","3","2","",""
"4613091","1","4961264","","2011-01-06 08:33:58","3","3101","<p>I am facing the problem of low memory. <code>Low memory:no more background process</code> And here is the scenario.</p><p>I am using a list which gets its data from a string array, it has a custom background, Clicking on item, the list gets another string array to display as second or third level. Information for three levels written in database. </p><p>After third level, there are two more levels for which data is going to be fetched from web services, </p><p>And that causes the low memory error. </p><p><strike>How can I get rid of the solution?</strike></p><p><em><strong>Edit :</em></strong> After having some digging I found that the GC is trying to (kill or) restart in case of its already crashed <code>com.android.inputmethod.latin/.latinIME</code>service. One notable point is that the application is translated in french and italian, but this screen does not have any text for translation, does this information helps??</p><p><strong>Edit 2:</strong> After a detailed study of traceview I found that all the text views have custom fonts applied in it. (There is a call of TypeFace.createFromAsset()) that IMO causes the crashes. </p><p>And the problem lies in the fact that I have to keep the fonts.... <strike>can It be possible to avoid crash and have the fonts??</strike> (Because i think the answer is no: But still waiting for some opinions)</p><p><strong>Edit 3</strong> : After removing the custom fonts the performance of application is much better. Hence I can suspect the font is the only culprit here. And that's why I am editing question. The font I use is helvetica.</p><p>Can using external fonts cause application to crash or running out of memory? If yes can you describe the cause in more detail??</p><p>Thanks</p>","246942","","246942","","2011-02-08 12:13:17","2011-04-04 18:18:28","android Low memory:no more background process ?? Need help","<android><memory-management><android-layout>","2","4","","",""
"4613104","1","","","2011-01-06 08:36:40","3","16178","<p>I'm new to android development, I'm trying to retrieve contact list with there name and phone numbers. I try following code :</p><pre><code> // Get a cursor over every contact.    Cursor cursor = getContentResolver().query(People.CONTENT_URI,                                                null, null, null, null);     // Let the activity manage the cursor lifecycle.    startManagingCursor(cursor);    // Use the convenience properties to get the index of the columns    int nameIdx = cursor.getColumnIndexOrThrow(People.NAME);     int phoneIdx = cursor. getColumnIndexOrThrow(People.NUMBER);    String[] result = new String[cursor.getCount()];    if (cursor.moveToFirst())      do {         // Extract the name.        String name = cursor.getString(nameIdx);        // Extract the phone number.        String phone = cursor.getString(phoneIdx);        result[cursor.getPosition()] = name + ""-"" +"" ""+  phone;      } while(cursor.moveToNext());</code></pre><p>This code should return an array with the all contacts name and its phone number but this only returns name of the contact and returns NULL in phone number,</p><p>Example Output:</p><pre><code> John - null</code></pre><p>Please help me in this regards thats whats wrong in this code. Any help in this regards will highly appreciated, and its urgent thanks in advance.</p>","565190","","366898","","2012-07-17 10:16:38","2014-03-13 10:56:10","How to retrieve Contact name and phone number in Android","<android><contacts>","7","1","2","",""
"4613173","1","4614454","","2011-01-06 08:50:25","0","6034","<p>unfortunately I lost cd accompanying with my cell phone model gt-i7500 galaxy android samsung</p><p>where can i get usb driver for this ? the adb is not recognising the device in windows xp</p>","565198","","","","","2011-01-06 11:35:51","gt-i7500 galaxy android samsung device usb driver","<android><galaxy>","1","2","","2011-08-13 23:40:49",""
"4613257","1","4613336","","2011-01-06 09:03:11","0","256","<p>I am basing my game off the lunarlander example. This is the run loop I am using (very similar to what is used in lunarlander). I am getting considerable performance issues associated with my drawing, even if I draw almost nothing.</p><p>I noticed the below method. Why is the canvas being created and set to null each cycle?</p><pre><code>    @Override    public void run()     {        while (mRun)         {            Canvas c = null;            try             {                c = mSurfaceHolder.lockCanvas();//null                synchronized (mSurfaceHolder)                 {                    updatePhysics();                    doDraw(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)                 {                    mSurfaceHolder.unlockCanvasAndPost(c);                }            }        }    }</code></pre><p>Most of the times I have read anything about canvases it is more along the lines of:</p><pre><code>mField = new Bitmap(...dimensions...);Canvas c = new Canvas(mField);</code></pre><p>My question is: why is Google's example done that way (null canvas), what are the benefits of this, and is there a faster way to do it?</p>","549859","","","","","2011-01-06 09:49:27","Simple question about the lunarlander example","<java><android><performance><graphics><drawing>","2","0","","",""
"4613266","1","","","2011-01-06 09:04:55","2","750","<p>I want to find the walking speed of a person using GPS. Is this possible? If so, how?</p>","543393","","496830","","2011-11-08 12:48:29","2011-11-08 12:48:29","How can I find a user's walking speed using GPS?","<android><gps>","1","1","","",""
"4613333","1","","","2011-01-06 09:14:10","6","20607","<p>i'm building an Android App that has many many TextView that i want to be clickable.I've tried to assign to the single TextView the properties android:clickable=""true"" and android:onClick=""clickHandler"" and when the app fires the clickHandler(View v) i correctly get, through the v.getId(), the clicked item.What i don't like is to define, for every TextView, the properties android:clickable and android:onClick ... is there something that i can do by code to say: ""all the textviews are clickable and click is handled in 'clickHandler' ?""</p><p>Thanks and greetingsc</p>","339500","","","","","2014-03-05 18:20:58","Clickable TextView in Android","<android><textview>","3","0","","",""
"4613383","1","4613503","","2011-01-06 09:21:55","0","137","<p>Maybe someone here had already done this before - I'm not sure how to solve this safely...My client want a kind of in-app-purchase for an Android application. But that's only subsidiary - my problem is: there should be a kind of ""rental"" system. That means someone buys i.e. an item for a certain timeframe (i.e. 10 days). The App is only online when he buys that item - so I need a safe way to let this item expire offline after 10 days. If I use the internal clock, there are to much ways to manipulate this. </p><p>Any advice how I can accomplish this (relative) safely?</p><p>Thank you,</p>","531840","","","","","2011-01-06 09:36:29","How to program a safe timer (in-app-purchase)?","<android><time><in-app-purchase>","1","0","","",""
"4613411","1","","","2011-01-06 09:25:17","2","3805","<p>I have written a first person camera class for android.</p><p>The class is really simple , the camera object has its three axesX,y and Z</p><p>and there are functions to create the ModelView matrix ( i.e. calculateModelViewMatrix() ), rotate the camera along its X and Y axis and Translate the camera along its Z-axis.</p><p>I think that my ModelViewMatrix calulation is correct and i can also translate the camera along the Z-axis. </p><p>Rotation along x-axis seems to work but along Y-axis it gives strange results. Also another problem with the rotation seems to be that instead of the camera being rotated, my 3d model starts to rotate instead along its axis. </p><p>I have written another implementation based on the look at point and using the openGL ES's GLU.gluLookAt( ) function to obtain the ModelView matrix but that too seems to suffer from the exactly the same problems.</p><p><strong>EDIT</strong></p><p>First of all thanks for your reply.</p><p>I have actually made a second implementation of the Camera class, this time using the rotation functions provided in android.opengl.Matrix class as you said. I have provided the code below, which is much simpler.</p><p>To my surprise, the results are ""Exactly"" the same. This means that my rotation functions and Android's rotation functions are producing the same results.</p><p>I did a simple test and looked at my data. I just rotated the LookAt point 1-dgree at a time around Y-axis and looked at the coordinates. It seems that my LookAt point is lagging behind the exact rotation angle e.g. at 20-deg it has only roatated 10 to 12 degree.And after 45-degrees it starts reversing back</p>","565223","","565223","","2012-06-19 11:38:37","2012-07-09 22:02:17"," First Person Camera rotation in 3D","<android><opengl-es><3d>","1","0","","",""
"4613427","1","4613456","","2011-01-06 09:27:08","0","3341","<p>I wanna to create hash key for Single Sign On Appliction in FaceBook.. If i enter this Commands in Command prompt </p><p>C:\Users\FSSD6>keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64</p><p>i am getting error ::</p><p>'openssl' is not recognized as an internal or external command,operable program or batch file. what can i do for it.. </p><p>I am having my openssl bin file in location (C:\Users\FSSD6\Desktop\openssl-0.9.8k_WIN32\bin) and i am having my keystore in  ( C:\Users\FSSD6.android\debug.keystore)</p><p>Please help me..thanks in Advance...</p>","558077","","","","","2013-03-28 09:03:47","Android Key Hash","<android>","4","0","","",""
"4613437","1","","","2011-01-06 09:27:46","2","938","<p>Is it possible to allow a griview to scroll both vertically and horizontally simultaneously in android? Please advise.</p>","193545","","","","","2011-01-06 09:33:23","Both way scrollable gridview in android","<android><gridview>","1","0","","",""
"4613469","1","4615583","","2011-01-06 09:31:56","1","345","<p>I have recently purchased a Samsung Galaxy Tab as an Android 2.x testbed (I am aware that 2.3 might not run on it, but it appears to be a good 1.x - 2.x device with a large enough screen to approximate the variety of screens on different phones).</p><p>I would wait for Honeycomb equipped devices (such as the Motorola XOOM mentioned at CES 2011), but these are slated for some time in Q1 (likely end of Q1 for the Canadian market).</p><p>If I get a multitouch capable PC and install the Android SDK and simulator, will I be able to use the multitouch functionality of the PC with the simulator to approximate a real device?  Does anyone use a multitouch touch screen PC for Android development?  I assume that this would work as the PC would recognize my fingers like the mouse, but I'd like to find out before purchasing the PC.</p>","229807","","114066","","2011-01-06 13:53:28","2011-01-06 13:53:28","Will a mulitouch touch screen equipped PC allow me to simulate real Android UI's without an Android device?","<android><android-emulator>","1","0","","",""
"4613497","1","","","2011-01-06 09:35:23","2","363","<p>I want to show log file by Textview and Textview log file content is called by jni.<br>But Textview nothing show(blank black screen),When give just ""hello /n How low"",was shown by Textview correct.<br>return (*env)->NewStringUTF(env, ""hello /n How low""); was shown.<br><strong>return (*env)->NewStringUTF(env, str); was not shown.</strong>  </p><p>--application.java--</p><pre><code>package com.showlog;import android.app.Activity;import android.widget.TextView;import android.os.Bundle;public class showlog extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView  tv = new TextView(this);        tv.setText( stringFromJNI() );        setContentView(tv);    }    public native String  stringFromJNI();    public native String  unimplementedStringFromJNI();    static {        System.loadLibrary(""showlog"");    }}</code></pre><p>--showlog.c--</p><pre><code>#include &lt;string.h&gt;#include &lt;stdio.h&gt;#include &lt;jni.h&gt;#define MAX 119 // MAX of one line length of log file#define Log_file ""./Log_file.log"" // log file pathjstringJava_com_showlog_stringFromJNI(JNIEnv* env, jobject thiz){    char line[120]; // one line length of Log_file    char str[2000]; // Log_file length    FILE *fin;    fin=fopen(Log_file, ""r"");    while( ! feof(fin)){        fgets(line, MAX, fin);        strcat(str, line);    }    fclose(fin);    return (*env)-&gt;NewStringUTF(env, str);}</code></pre><p>Then I try just c code(not be jni lib),It works.<br>--just show log file--</p><pre><code>#include &lt;string.h&gt;#include &lt;stdio.h&gt;#define MAX 119 // MAX of one line length of log file#define Log_file ""./Log_file.log"" // log file pathmain(){    char line[120]; // one line length of Log_file    char str[2000]; // Log_file length    FILE *fin;    fin=fopen(Log_file, ""r"");    while( ! feof(fin)){        fgets(line, MAX, fin);        strcat(str, line);    }    fclose(fin);        printf(""%s"", str);    return 0;}</code></pre><p>How does Textview show it ?<br>Thanks in advance.</p>","137869","","137869","","2011-01-07 06:07:45","2011-01-07 06:07:45","Textview show nothing with jni","<java><android><c><jni><android-ndk>","1","0","","",""
"4613553","1","","","2011-01-06 09:42:00","0","223","<p>I'm using fbrocket for facebook connect with my android app. It's working fine. For the first time when I'd logged in, the login webpage presented me with a keyboard on press of textareas for username and password. </p><p>But now, on the same page, it's showing me a strip of characters that I'm typing that too in different language and they are not rendered. </p><p>I'm really confused by this login screen behaviour. </p><p>Has anybody encountered the same issue?</p><p>Can anybody help me?</p><p>Thanx in advance.</p>","227943","","","","","2011-01-06 12:02:40","Why do clicking on textarea on facebook login screen in facebook connect using fbrocket not popping up keyboard?","<android><facebook>","1","0","","",""
"4613668","1","4614231","","2011-01-06 09:56:54","1","11895","<p>I've done Gallery of images displayed on emulator by static(i.e images from <code>drawable</code> folder).Now i need to add some images into the list of gallery, dynamically from the local path(for <strong>ex.from E:/anim.jpeg</strong> like that).How can i do that?Thanks..</p><p>My gallery code is shown below..</p><pre><code>public class GalleryAct extends Activity {private Gallery gallery;private ImageView imgView;private Integer[] Imgid = {        R.drawable.img1, R.drawable.img2, R.drawable.img3, R.drawable.img4, R.drawable.img5, R.drawable.img6, R.drawable.img7,        R.drawable.img1, R.drawable.img2, R.drawable.img3, R.drawable.img4, R.drawable.img5, R.drawable.img6, R.drawable.img7};@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    imgView = (ImageView)findViewById(R.id.ImageView01);        imgView.setImageResource(Imgid[0]);     gallery = (Gallery) findViewById(R.id.examplegallery);     gallery.setAdapter(new AddImgAdp(this));     gallery.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {            imgView.setImageResource(Imgid[position]);         }    });}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 Imgid.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 = new ImageView(cont);        imgView.setImageResource(Imgid[position]);        imgView.setLayoutParams(new Gallery.LayoutParams(80, 70));        imgView.setScaleType(ImageView.ScaleType.FIT_XY);        imgView.setBackgroundResource(GalItemBg);        return imgView;    }}}</code></pre>","555948","","1012284","","2014-01-22 08:45:46","2014-01-22 08:45:46","Add Gallery images dynamically in android","<android><android-gallery>","2","0","4","",""
"4613718","1","4614218","","2011-01-06 10:02:09","0","250","<p>I'm trying to create a service that should be a singleton - I need one of it for the entire application.</p><p>I tried to implement this using a START_STICKY flag, but each time I bind to the service from an activity its onCreate is called and the activity is stopped, the service's onDestroy is called. </p><p>What am I missing?</p><p>thanks</p>","102092","","","","","2011-01-06 11:06:02","Service created each time I'm binding to it - but I want a singlton service","<android>","1","0","1","",""
"4613745","1","4613858","","2011-01-06 10:05:22","0","590","<p>my problem is that i have 5 tables and need inserts and selects.</p><p>what i did is for every table a class and there i wrote the SQL Statements like this</p><pre><code>    public class Contactprivate static String IDCont = ""id_contact"";    private static String NameCont = ""name_contact"";    private static String StreetCont = ""street_contact"";    private static String Street2Cont = ""street2_contact"";    private static String Street3Cont = ""street3_contact"";    private static String ZipCont = ""zip_contact"";    private static String CityCont = ""city_contact"";    private static String CountryCont = ""country_contact"";    private static String Iso2Cont = ""iso2_contact"";    private static String PhoneCont = ""phone_contact"";    private static String Phone2Cont = ""phone2_contact"";    private static String FaxCont = ""fax_contact"";    private static String MailCont = ""mail_contact"";    private static String Mail2Cont = ""mail2_contact"";    private static String InternetCont = ""internet_contact"";    private static String DrivemapCont = ""drivemap_contact"";    private static String PictureCont = ""picture_contact"";    private static String LatitudeCont = ""latitude_contact"";    private static String LongitudeCont = ""longitude_contact"";    public static final String TABLE_NAME = ""contact"";        public static final String SQL_CREATE = ""CREATE TABLE IF NOT EXISTS "" + TABLE_NAME + ""("" +        IDCont + ""INTEGER not NULL,"" +        NameCont + "" TEXT not NULL,"" +        StreetCont + "" TEXT,"" +        Street2Cont + "" TEXT,"" +        Street3Cont + "" TEXT,"" +        ZipCont + "" TEXT,"" +        CityCont + "" TEXT,"" +        CountryCont + "" TEXT,"" +        Iso2Cont + "" TEXT,"" +        PhoneCont + "" TEXT,"" +        Phone2Cont + "" TEXT,"" +        FaxCont + "" TEXT,"" +                        MailCont + "" TEXT,"" +        Mail2Cont + "" TEXT,"" +        InternetCont + "" TEXT,"" +       //website of the contact        DrivemapCont + "" TEXT,"" +       //a link to a drivemap to the contact        PictureCont + "" TEXT,"" +            //a photo of the contact building (contact is not a person)        LatitudeCont + "" TEXT,"" +        LongitudeCont + "" TEXT,"" +        ""primary key(id_contact)"" +        ""foreign key(iso2)"";and my insert looks like this    public boolean SQL_INSERT_CONTACT(int IDContIns, String NameContIns, String StreetContIns,                    String Street2ContIns, String Street3ContIns, String ZipContIns,                     String CityContIns, String CountryContIns, String Iso2ContIns,                    String PhoneContIns, String Phone2ContIns, String FaxContIns,                    String MailContIns, String Mail2ContIns, String InternetContIns,                    String DrivemapContIns, String PictureContIns, String LatitudeContIns,                    String LongitudeContIns) {        try{        db.execSQL(""INSERT INTO "" + ""contact"" +                ""("" + IDCont + "", "" + NameCont + "", "" + StreetCont + "", "" +                 Street2Cont + "", "" + Street3Cont + "", "" + ZipCont + "", "" +                 CityCont + "", "" + CountryCont + "", "" + Iso2Cont + "", "" +                 PhoneCont + "", "" + Phone2Cont + "", "" + FaxCont + "", "" +                 MailCont + "", "" + Mail2Cont + "", "" + InternetCont + "", "" +                 DrivemapCont + "", "" + PictureCont + "", "" + LatitudeCont + "", "" +                 LongitudeCont + "") "" +                ""VALUES ("" + IDContIns + "", "" + NameContIns +"", "" + StreetContIns + "", "" +                Street2ContIns + "", "" + Street3ContIns + "", "" + ZipContIns + "", "" +                CityContIns + "", "" + CountryContIns + "", "" + Iso2ContIns + "", "" +                 PhoneContIns + "", "" + Phone2ContIns + "", "" + FaxContIns + "", "" +                 MailContIns + "", "" + Mail2ContIns + "", "" + InternetContIns + "", "" +                 DrivemapContIns + "", "" + PictureContIns + "", "" + LatitudeContIns + "", "" +                 LongitudeContIns +"")"");        return true;        }        catch (SQLException e) {            return false;           }    }</code></pre><p>i have a DBAdapter class there i created the database</p><pre><code> public class DBAdapter {         public static final String DB_NAME = ""mol.db"";            private static final int DB_VERSION = 1;            private static final String TAG = ""DBAdapter"";      //to log            private final Context context;            private SQLiteDatabase db;        public DBAdapter(Context context)             {                this.context = context;                OpenHelper openHelper = new OpenHelper(this.context);                this.db = openHelper.getWritableDatabase();        }     public static class OpenHelper extends SQLiteOpenHelper         {            public OpenHelper(Context context) {            super(context, DB_NAME, null, DB_VERSION);        }    @Override        public void onCreate(SQLiteDatabase db) {            // TODO Auto-generated method stub            db.execSQL(Contact.SQL_CREATE);            db.execSQL(Country.SQL_CREATE);            db.execSQL(Picture.SQL_CREATE);            db.execSQL(Product.SQL_CREATE);            db.execSQL(Project.SQL_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            // TODO Auto-generated method stub            Log.w(TAG, ""Upgrading database from version ""                    + oldVersion + "" to "" + newVersion                    + "", which will destroy all old data"");            db.execSQL(Contact.SQL_DROP);            db.execSQL(Country.SQL_DROP);            db.execSQL(Picture.SQL_DROP);            db.execSQL(Product.SQL_DROP);            db.execSQL(Project.SQL_DROP);            onCreate(db);        }</code></pre><p>i found so many different things and tried them but i didn't get anything to work...i need to know how can i access the database in my activityand how i can get the insert to workand is there sth wrong in my code?thanks for your help</p><p>thats how i tried to get it into my activity</p><pre><code>public class MainTabActivity extends TabActivity {private Context context;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.maintabactivity);    TabHost mTabHost = getTabHost();    Intent intent1 = new Intent().setClass(this,MapOfLight.class);    //Intent intent2 = new Intent().setClass(this,Test.class);              //Testactivity    //Intent intent2 = new Intent().setClass(this,DetailView.class);        //DetailView    Intent intent2 = new Intent().setClass(this,ObjectList.class);      //ObjectList    //Intent intent2 = new Intent().setClass(this,Gallery.class);           //Gallery    Intent intent3 = new Intent().setClass(this,ContactDetail.class);    mTabHost.addTab(mTabHost.newTabSpec(""tab_mol"").setIndicator(this.getText(R.string.mol), getResources().getDrawable(R.drawable.ic_tab_mol)).setContent(intent1));    mTabHost.addTab(mTabHost.newTabSpec(""tab_highlights"").setIndicator(this.getText(R.string.highlights),getResources().getDrawable(R.drawable.ic_tab_highlights)).setContent(intent2));    mTabHost.addTab(mTabHost.newTabSpec(""tab_contacts"").setIndicator(this.getText(R.string.contact),getResources().getDrawable(R.drawable.ic_tab_contact)).setContent(intent3));    mTabHost.setCurrentTab(1);    SQLiteDatabase db;    DBAdapter dh = null;    OpenHelper openHelper = new OpenHelper(this.context);    dh = new DBAdapter(this);    db = openHelper.getWritableDatabase();    dh.SQL_INSERT_COUNTRY(""AT"", ""Austria"", ""AUT"");}</code></pre><p>}</p><p>i tried it with my country table because it has only 3 columns</p><pre><code>public class Country {    private static String Iso2Count = ""iso2_country"";    private static String NameCount = ""name_country"";    private static String FlagCount = ""flag_image_url_country"";    public static final String TABLE_NAME = ""country"";    public static final String SQL_CREATE = ""CREATE TABLE IF NOT EXISTS "" + TABLE_NAME + ""("" +    Iso2Count + "" TEXT not NULL,"" +    NameCount + "" TEXT not NULL,"" +    FlagCount + "" TEXT not NULL,"" +    ""primary key(iso2_country)"";    public boolean SQL_INSERT_COUNTRY(String Iso2CountIns, String NameCountIns, String FlagCountIns) {        try{        db.execSQL(""INSERT INTO "" + ""country"" +                ""("" + Iso2Count + "", "" + NameCount + "", "" + FlagCount + "") "" +                ""VALUES ( "" + Iso2CountIns + "", "" + NameCountIns +"", "" + FlagCountIns + "" )"");        return true;        }        catch (SQLException e) {            return false;           }    }</code></pre><p>another question is it better to put the insert and select from each table into a separate class, so i have 1 class for each table or put them all into the DBAdapter class?</p>","565246","","243925","","2011-01-06 11:52:07","2011-01-06 11:52:07","Database with 5 Tables with Insert and Select","<sql><android><sqlite><select><insert>","1","5","","",""
"4613760","1","4613931","","2011-01-06 10:07:03","4","24350","<p>I want to make a button invisible, when i click another button then the invisible button will become visible and then perform onClick() actions on the visible button.</p><p>What onClick() actions I can use on the visible button. I used this method shown below:</p><pre><code>donebutton = (Button) findViewById(R.id.done);donebutton.setOnClickListener(this);donebutton.setVisibility(View.INVISIBLE);@Override public void onClick(View v) {// TODO Auto-generated method stub if(v.equals(remove)){    donebutton.setVisibility(View.VISIBLE);}if(v.equals(donebutton)){    Intent i=new Intent(One.this,Second.class);    startActivity(i);    finish();    donebutton.setVisibility(View.INVISIBLE);}</code></pre><p>}</p><p>In the above method the invisible and visible propertyes are working but onClick() action is not working. so please tell me an answer for the above problem or tell me if there is any other method for visible and invisible on button and onclick action on that button.</p><p>and I also used this method:</p><pre><code>       done.setClickable(true);       done.setOnClickListener(new OnClickListener(){         public void onClick(View v) {            Intent i=new Intent(One.this,Second.class);        startActivity(i);        finish();         }     });</code></pre>","745367","","8418","","2013-02-19 09:46:11","2013-03-07 03:32:12","how to use visible and invisible for a button in android","<android><button><visibility>","3","1","2","",""
"4613970","1","","","2011-01-06 10:33:28","0","419","<p>I am creating an Android game. Currently I'm using a ""normal"" View and draw, the onDraw() and have a Handler to process timed events and such. However Soon (tm) I will convert it to a SurfaceView with a Thread and a constant loop.</p><p>Anyway, when the player presses a certain button, I want to have a kind of edit box for the player to enter a value (a price). But I'm kind of lost on how to achieve this. First I thought, ok let's just make an EditText, position it on the screen, and done. But apparently I can't just put an EditText on an X,Y location and remove it afterwards.</p><p>I looked at the LunarLander example, which uses a TextView for displaying text. It is already defined in the layout XML and is turned visible and invisible by sending messages between the game thread and the UI thread. This seems awefully complicated and the edit box would exist all the time.</p><p>Furthermore I was thinking on making my own ""edit box"" by simply drawing a box on the screen, enabling the keyboard, and then capturing input from the keyboard. But I wouldn't even know where to begin with ""custom"" keyboard input (on screen vs physical, how to capture keyboard text input, how to hide the keyboard again when done, etc).</p><p>So I was wondering, what's the best way to do this?</p><p>Edit: maybe useful to know, but my game is fixed in landscape mode.</p>","504451","","","","","2011-01-06 11:11:37","Edit box for my game?","<android><edittext>","1","0","","",""
"4614089","1","","","2011-01-06 10:48:49","5","2380","<p>I am developing an application in which it is required to find the nature of a contact group means whether it is google group , phone group or sim group. How to find it.Please suggest me how to do it.Thanks in advance.</p>","555688","","","","","2014-02-21 05:11:33","Finding account nature of a contact group?","<android>","2","0","2","",""
"4614105","1","4614416","","2011-01-06 10:50:32","0","181","<p>I want to restrict the user to put more than 4 period(.) in a edit text.</p><p>how to do this. please any body help</p>","489762","","","","","2011-01-06 11:42:03","count a particular character in runtime in android","<android>","3","1","","",""
"4614196","1","4614286","","2011-01-06 11:03:56","0","1809","<p>Im having trouble getting some html 5 code to work on the android. It works on the ipad no problem:</p><pre><code>&lt;video id=""1"" height=""270"" width=""320"" poster=""http://vls.pete.videolibraryserver.com/thumbnails/56553550.jpg"" src=""http://helix.pete.videolibraryserver.com/flash/56553550_hi.mp4"" autostart=""false"" controls preload=""none"" /&gt;</code></pre><p>Any ideas why it just comes up with a thumbnail of the video rather than just playing it?</p><p>Regards,Pete</p>","223863","","","","","2011-01-06 11:13:49","Html 5 not working on Android","<android><html5><video>","1","2","","",""
"4614205","1","","","2011-01-06 11:04:40","0","535","<p>How to create the orange glow like the stock launcher has it when displaying the application list? </p><p>For example the highlighted aLogcat application below.</p><p><img src=""http://i.stack.imgur.com/1eMc0.png"" alt=""alt text""></p><p>Is it built-in or do I need to calculate and create a new bitmap/drawable myself?</p>","11238","","","","","2011-01-06 18:03:20","Creating orange glow to indicate focused widget in Android","<android><focus><widget><drawable>","2","0","","",""
"4614267","1","","","2011-01-06 11:11:23","1","862","<p>All, Im new to Android. here is my question. I want to send an email in the form of HTML. for that im using the following code. but it didnot work for me.</p><pre><code>final Intent emailIntent = new Intent(Intent.ACTION_SEND);emailIntent.setType(""text/html"");emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""subject"");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(data));startActivity(emailIntent);</code></pre><p>data is where i can get from the html file. so data contains the tags.when ever i used text/plain it is displaying tags but when i tried to use text/html it is closing the application.Do i need to change the manifest file ?i searched in google but i couldnot found the solution</p><p><em>EDIT:</em></p><p>Guys here is the answer</p><pre><code>final Intent emailIntent = new Intent(Intent.ACTION_SEND);emailIntent.setType(""text/html"");        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""subject"");emailIntent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile        (new File(Environment.getExternalStorageDirectory(),""/filename"")));startActivity(emailIntent);</code></pre><p>if you use <code>Intent.EXTRA_TEXT</code> you must use text/plain and this works to send mail in plain text format.***The above code works in real device not in the virtual (emulator) device.</p>","538482","","1606729","","2013-02-23 11:40:25","2013-02-23 11:40:25","How to send an email in the form of HTML using android intent","<android><android-intent>","0","1","","2013-02-26 00:40:17",""
"4614274","1","4614664","","2011-01-06 11:12:21","0","424","<p>I have generated key hash for Single Sign on In facebook.... I wanna to know that whether there is any way to check that the generated key is Correct or not.. Because Single sign on is Not working for me..</p>","558077","","","","","2011-03-24 23:17:39","Android Key Hash","<android>","1","1","1","",""
"4614354","1","4614497","","2011-01-06 11:23:31","4","1853","<p>i am working on image ,upload original image in this original image resize the small image this image saved in to database </p><p>original image --> resize it (small image )--> small image saved in to database</p><p>please forward solution</p><p>thanks</p>","254790","","","","","2011-01-06 11:40:53","how can resize the original image in android","<android><resize-image>","1","0","4","",""
"4614365","1","5644548","","2011-01-06 11:24:12","4","2004","<p>I am using a VideoView to play a video file kept in res/raw. I couldnt find a way to control the playback speed of the video. Basically i want to reduce and increase the playback while moving a scroll bar. Is there any work around for implementing this?</p>","409288","","","","","2012-10-20 01:45:21","Control the playback speed of video in android","<android><video><videoview>","2","1","1","",""
"4614368","1","4614468","","2011-01-06 11:24:50","0","524","<p>I want to add Buttons Above notification list in Notification bar,<br>as we see on galaxy tab buttons (Wi-fi, Bluetooth, GPS, Silent buttons)<br>I want to add buttons below these button not in notification list.  </p><p>Is it possible?<br>How to do it?  </p><p>Thanks.</p>","314247","","","","","2011-01-06 11:37:39","How to add Buttons above notification list","<android><android-widget><android-layout>","1","0","","",""
"4614392","1","4889988","","2011-01-06 11:27:06","1","273","<p>I am sending multiple PDF files through SOAP which will be received by an Android client. But when receiving the SOAP response, it is throwing OutOfMemoryException.</p><p>I want to know whether its a limitation of kSOAP or Android. Please guide me how to overcome it.</p><p>Thanks.</p>","556702","","","","","2011-11-15 05:12:35","OutOfMemoryException in kSOAP","<android><out-of-memory><ksoap>","1","0","","",""
"4614435","1","4614531","","2011-01-06 11:32:51","8","1094","<p>Is it possible to make a command line app for linux, and then run it on android with shell? Since android runs on linux, I don't see why there would be any problems running it. I know that /system/bin/* has all the things you can use from adb so this should be the same. </p>","336983","","","","","2011-01-06 11:44:38","C++ Command Line Apps on Android?","<c++><android><shell><command-line>","2","2","2","",""
"4614504","1","4614642","","2011-01-06 11:41:41","0","2947","<p>how can we use animation if i want one image after another image i had some code but it is not working </p><pre><code>Context mContext; protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.animationdemo);     Resources res = mContext.getResources();     TransitionDrawable transition = (TransitionDrawable) res.getDrawable(R.drawable.transitiondrawable);     ImageView image = (ImageView) findViewById(R.id.imgView);     image.setImageDrawable(transition);     transition.startTransition(1000); }</code></pre><p>and made one xml file transitiondrawable.xml file into drawable folder</p><pre><code>&lt;transition xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:drawable=""@drawable/endoscope_""/&gt;  &lt;item android:drawable=""@drawable/endoscope_2""/&gt;&lt;/transition&gt;</code></pre><p>and one layout file animationdemo.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:layout_gravity=""center""&gt;&lt;ImageView android:id=""@+id/imgView"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt; &lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>please give me idea where i m wrong</p>","432559","","489261","","2011-01-06 11:43:13","2012-03-11 11:36:05","how can we use animation one image after another image?","<android>","2","0","","",""
"4614636","1","","","2011-01-06 11:55:21","2","1206","<p>I have build whole android source code...with the help of make command....for dream htc product...now i want to deploy those files(system.img,recovery.img,userdata.img,boot.img) in my real device htc t mobile g1...how can i deploy those files....?</p>","533863","","","","","2013-08-16 07:00:38","Upload Android Source Code into real device","<android><android-sdk-2.2>","2","0","","",""
"4614752","1","","","2011-01-06 12:10:34","14","3524","<p>Eclipse Galileo,<br>ca 20 Android projects, with many dependencies between projects<br>(util, testutils, one testproject for each library and app, whitelabelling etc)</p><p>When starting Eclipse the following is displayed in the progressbar:<br>""Update SVN Cache"", - decent speed<br>""Android Library Update"", - SLOW, with loads of network access<br>""Building workspace"" - decent speed  </p><p><strong>Can the ""Android Library Update"" phase, somehow be sped up ?</strong></p><p><strong>Update 2011-06-14</strong><br>I'm now running Eclipse Helios, Ubuntu 32-bit 10.0.4 vbox guest on Win7 , Android SDK all fully patched as of 2011-06-14.<br>The same issue remains, ""Android Library Update"" is slow, BUT now the CPU is 100% with NO network traffic.<br>Sooo... JVM tweaking may work, or running Ubuntu 64-bit 10.0.4 vbox guest on Win7 host with ""apt-get install ia32-libs"" as an alternative. No time to investigate either of those options right now though.</p>","77115","","77115","","2011-06-14 15:05:26","2011-06-14 15:05:26","Can the ""Android Library Update"" phase, somehow be sped up?","<android>","1","1","4","",""
"4614825","1","4656513","","2011-01-06 12:20:33","0","2285","<p>I use OpenGL in LockScreen in android 2.2. When the device run in LockScreen, it get the following error : java.lang.IllegalArgumentException: Make sure the surfaceView or associated SurfaceHolder has a valid Surface...</p><p>Does anyone know what's problem causes it? I guess the context of LockScreen is different from the context of activty, so this reason causes this problem. But I am not sure.</p>","554270","","44729","","2011-01-06 14:22:42","2011-01-11 10:17:28","Make sure the surfaceView or associated SurfaceHolder has a valid Surface","<android><opengl-es><lockscreen>","1","0","","",""
"4614846","1","4615167","","2011-01-06 12:22:40","0","831","<p>I have a question regarding calling a method from one activity in a different activity. I have an activity which uses startActivityForResult and gets a result back after the second activity is finished, but before I call finish() on the second activity I want to call A refresh() method in the first activity. </p><p>My  initial thought is to pass the first activity as an extra in the intent so I can reference the methods for the activity but can't see how this is done.</p>","400406","","114066","","2011-01-06 14:00:18","2011-01-06 14:00:18","Call method from a different activity","<android><methods><activity>","1","0","","",""
"4615017","1","","","2011-01-06 12:45:08","0","873","<p>I have to send a bitmap in an intent as intent-extra. The problem is, that the maximum data size of an intent is 50KB. How can I scale down the bitmap to fit into the intent?</p><p>AFAIK the camera app does the same to put image previews into the result intent of <code>MediaStore.ACTION_IMAGE_CAPTURE</code>.</p>","272802","","","","","2011-11-29 05:49:33","Scale down image to fit in intent","<android><image><bitmap><android-intent><scale>","3","2","","",""
"4615040","1","4615088","","2011-01-06 12:47:46","3","822","<p>In my application I have an IntentService that reads rss feeds. I would like this operation to be done every 30 minutes. What is the best way to do this?</p><p>Thanks a lot</p><p>Gratzi</p>","460611","","","","","2011-01-06 13:00:07","Schedule an IntentService","<android>","1","0","","",""
"4615145","1","4615401","","2011-01-06 13:00:58","1","10460","<p>My Android device Ly-706 is not listed while running adb devices.</p><p>I can run emulator using eclipse and install application on emulatorusing adb except on Real device</p><p>I added :</p><pre><code>SUBSYSTEM==""usb"", SYSFS{idVendor}==""040d"", MODE=""0666""</code></pre><p>in <code>/etc/udev/rules.d/90-android.rules</code> ,still no luck</p><p>Same result for samsung galaxy 3(vendor id =""04e8"")</p><p>I installed GNU/Linux  (ubuntu 10.10) because it is not listing in windows.</p><p>What am i missing ?</p>","482604","","1583","","2011-12-14 10:26:00","2014-02-22 21:02:24","""Android device is not listed while running adb devices (ubantu 10.10)""","<android><adb><sudo><devices>","7","7","2","",""
"4615300","1","4615365","","2011-01-06 13:21:05","1","118","<p>In MNC company Interview this is the qusestion that  How many changes in  Desktop Application After it become  Android ApplicationQuestion by company Employer That I have cheply Android mobile Not As much Internal StorageInternal storage is around 5-10 MB.And Desktop App NFS its space like 1-2 GB &amp; I want to Same this App for Android so what r the changes to make that do this App for Android</p><p>In simple words Company want to Desktop App to Android App   so what r the efforts to do this ?</p><p>Advanced Thanks for Answer</p><p>Pls reply me </p>","545951","","545951","","2011-01-07 05:34:48","2011-01-07 05:34:48","How many changes in Desktop Application After it become Android Application","<android>","1","3","1","",""
"4615387","1","","","2011-01-06 13:31:30","2","192","<p>I retrieve the display name of a user via the <a href=""http://developer.android.com/intl/de/reference/android/provider/ContactsContract.html"" rel=""nofollow"">ContactsContract API</a> in Android.</p><p>Now I want to retrieve the given(first) name of this user. There are specific <a href=""http://developer.android.com/intl/de/reference/android/provider/ContactsContract.CommonDataKinds.StructuredName.html"" rel=""nofollow"">Rows</a> in the <a href=""http://developer.android.com/intl/de/reference/android/provider/ContactsContract.Data.html"" rel=""nofollow"">data</a> table that contain the name of the user. The problem is that there are multiple rows for every user because of the synchronization and aggregation of contacts. </p><p>The Contacts table <a href=""http://developer.android.com/intl/de/reference/android/provider/ContactsContract.Contacts.html"" rel=""nofollow"">documentation</a> states that there should be column containing the id of the raw contact that contributes the primary name for this user. But there is no constant name for this column defined and I couldn't find this column inside my data table. </p><p>How do I retrieve the Id of the raw contact that contributes the DisplayName to a contact?</p>","114066","","","","","2011-02-14 13:06:30","How to retrieve the best given name of a User in Android?","<android><contactscontract>","1","0","","",""
"4615425","1","4615487","","2011-01-06 13:35:09","0","2276","<p>I'm using following function to write a object to external storage.</p><p>After using it i want to delete that object from external storage to free memory. Can any one guide me what should i do?</p><pre><code>public boolean saveObject(List&lt;DalCategories&gt; obj) {   if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {      cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),""MyCustomObjectForSearchFilter"");   } else {      cacheDir= getCacheDir();      if(!cacheDir.exists()) {         cacheDir.mkdirs();      }      final File suspend_f = new File(cacheDir, ""test"");      FileOutputStream fos = null;      ObjectOutputStream oos = null;      boolean keep = true;      try {         fos = new FileOutputStream(suspend_f);         oos = new ObjectOutputStream(fos);         oos.writeObject(obj);      } catch (Exception e) {         keep = false;        } finally {         try {            if (oos != null) {                  oos.close();            }            if (fos != null) {                 fos.close();            }             if (keep == false) {               suspend_f.delete();            }         } catch (Exception e) {             keep = false;         }      }      return keep;    }</code></pre>","249991","","114066","","2011-01-06 14:08:05","2011-01-06 14:11:06","how to delete written data from external storage?","<android>","3","0","0","",""
"4615426","1","","","2011-01-06 13:35:14","5","8392","<p>I want to change 3G dns setting on Android 2.1 device. I managed to install busybox on my device, i can also get dns information by using <code>adb shell getprop | grep dns</code>. The only problem is that it shows me <code>net.pdp0.dns1</code> and <code>net.pdp0.dns2</code>, not <code>net.rmnet0.dns1</code> and <code>net.rmnet0.dns1</code> so i can't change the setting.</p><p>I know that <code>net.rmnet0.dns1</code> is for 3G connection, so what about <code>net.pdp0.dns1</code>? How can i change to <code>net.rmnet0.dns1</code>?</p><p>Thanks</p>","565498","","782094","","2013-02-22 08:29:25","2014-04-01 12:43:23","How to change 3g dns setting on Android?","<android>","2","0","","",""
"4615509","1","4735886","","2011-01-06 13:43:12","4","2242","<p>I have successfully integrated my app's country search into the global search facility and now I am trying to display each country's flag next to the search suggestions.  Search inside my app works this way but of course I have control of the list and its view binding myself.  So I know the flags are all there and I can use them in the rest of my app.</p><p>The trouble comes when I try to supply a Uri to a .gif file in my Assets.  According to the search documentation the value of the column with the key <code>SearchManager.SUGGEST_COLUMN_ICON_1</code> should be a Uri to the image.</p><p>Below is what the code looks like.  In response to the <code>ContentProvider</code> method <code>public Cursor query (Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)</code> I am creating a <code>MatrixCursor</code> that maps columns from my country database to those required by the search facility.  The country names show up fine and I can select them and correctly respond in my application.</p><p>I have tried forming the Uri three different ways:</p><pre><code>//                    String flagUri = ""file:///android_asset/"" + flagPath;//                    String flagUri = ""file:///assets/"" + flagPath;                    String flagUri = ""android.resource://com.lesliesoftware.worldinfo.WorldInfoActivity/assets/"" + flagPath;                    columnValues.add (flagUri);</code></pre><p>They all lead to the same thing - my application icon next to each suggestion which I can get by using a value of empty string.</p><p>Is there a Uri that will work?  How can I get the country flag icon next to the search suggestions?</p><p>Thanks Ian</p><p>The full source:</p><pre><code>private Cursor search (String query, int limit)  {    query = query.toLowerCase ();    String[] requestedColumns = new String[]  {            BaseColumns._ID,             SearchManager.SUGGEST_COLUMN_TEXT_1,            SearchManager.SUGGEST_COLUMN_ICON_1,    };    String[] queryColumns = new String[]  {            WorldInfoDatabaseAdapter.KEY_ROWID,             WorldInfoDatabaseAdapter.KEY_COUNTRYNAME,            WorldInfoDatabaseAdapter.KEY_COUNTRYCODE    };    return packageResults (query, requestedColumns, queryColumns, limit);}private Cursor packageResults (String query, String[] requestedColumns, String[] queryMappedColumns, int limit)  {    if (requestedColumns.length != queryMappedColumns.length)        throw new IllegalArgumentException (""Internal error: requested columns do not map to query columns"");    MatrixCursor results = new MatrixCursor (requestedColumns);    //  Query the country list returns columns: KEY_ROWID, KEY_COUNTRYNAME, KEY_COUNTRYCODE    Cursor dbResults = myDbHelper.getCountryList (query);    //  Verify that the query columns are available    for (int index = 0; index &lt; queryMappedColumns.length; index++)  {        int col = dbResults.getColumnIndex (queryMappedColumns[index]);        if (col == -1)            throw new IllegalArgumentException (""Internal error: requested column '"" +                     queryMappedColumns[index] + ""' was not returned from the database."");    }    //  Loop over the database results building up the requested results    int rowCount = 0;    while (dbResults.moveToNext ()  &amp;&amp;  rowCount &lt; limit)  {        Vector&lt;String&gt; columnValues = new Vector&lt;String&gt; ();        for (int index = 0; index &lt; requestedColumns.length; index++)  {            if (requestedColumns[index].compareTo (SearchManager.SUGGEST_COLUMN_ICON_1) == 0)  {                String flagPath = ""flags/small/"" + dbResults.getString (                        dbResults.getColumnIndexOrThrow (queryMappedColumns[index]))                        + ""-flag.gif"";//                    String flagUri = ""file:///android_asset/"" + flagPath;//                    String flagUri = ""file:///assets/"" + flagPath;                String flagUri = ""android.resource://com.lesliesoftware.worldinfo.WorldInfoActivity/assets/"" + flagPath;                columnValues.add (flagUri);            }  else  {                //  Add the mapped query column values from the database                String colValue = dbResults.getString (dbResults.getColumnIndexOrThrow (queryMappedColumns[index]));                columnValues.add (colValue);            }        }        results.addRow (columnValues);        rowCount++;    }    return results;}</code></pre><p>EDIT:I have tried other variations including moving the images from the assets to the raw folder.  Nothing worked.  Here are the uri's I tried:</p><pre><code>flagUriStr = ""android.resource://com.lesliesoftware.worldinfo/raw/flags/small/"" +     countryCode + ""-flag.gif"";flagUriStr = ""android.resource://com.lesliesoftware.worldinfo/assets/flags/small/"" +     countryCode + ""-flag.gif"";flagUriStr = ""android.resource://com.lesliesoftware.worldinfo/assets/flags/small/"" +     countryCode + ""-flag"";flagUriStr = ""android.resource://com.lesliesoftware.worldinfo/raw/"" +     countryCode + ""-flag.gif"";flagUriStr = ""android.resource://com.lesliesoftware.worldinfo/raw/"" +     countryCode + ""-flag"";</code></pre><p>The only uri that did work was if I moved a test flag into my drawable folder:</p><pre><code>flagUriStr = ""android.resource://com.lesliesoftware.worldinfo/"" +     R.drawable.small_ca_flag;</code></pre>","199818","","199818","","2011-01-13 13:33:29","2013-05-11 04:43:06","How do I get a Uri to an image in my Assets that will work for the SearchManager.SUGGEST_COLUMN_ICON_1 column?","<android><search>","4","0","2","",""
"4615613","1","","","2011-01-06 13:55:05","1","3969","<p>I have 3 classes: MainActivity,DrawView and SecondActivity.MainActivity just use DrawView to draw something on the screen. How can I start SecondActivity when i touch the screen on an Bitmap, I know where is the bitmap(in the code).The onTouchEvent function from DrawView class. </p><pre><code>@Overridepublic boolean onTouchEvent(final MotionEvent ev) {     switch (ev.getAction()) {        case MotionEvent.ACTION_DOWN: {            float posX = ev.getX();            float posY = ev.getY();            if(play.touched(posX, posY)==true){            } else {            }            return true;        }}     return false;}</code></pre><p>The function <code>play.touched(posX,posY)</code> return a boolean value(I made a class that handel the position of the Bitmap). How can I start Second Activity from here? </p>","565509","","565509","","2012-05-02 14:15:32","2012-05-02 14:15:32","Android: startActivity() in a class that extends View","<java><android><android-intent>","2","1","","",""
"4615667","1","4615699","","2011-01-06 14:00:41","3","7759","<p>one way to initialize charsequence[] is </p><pre><code>charsequence[] item = {""abc"",""def""};</code></pre><p>but i don't want to initialize it this way. can someone please suggest some other way like the way we initialize string[] array...</p><p>thanks</p>","542936","","","","","2014-03-11 22:15:41","how to add data in charsequence [] dynamically in java?","<java><android>","3","1","","",""
"4615684","1","4618969","","2011-01-06 14:02:17","0","1206","<p>In an anrdoid app, I've got a set of thumbnails to download. As the user uses the app, this set of thumbnails could get up to 100 or more items, potentially.</p><p>The thumbnails need to be displayed in a gallery and right now, when that gallery is shown, I start one thread to download all thumbnails from 0 to the end of the set. This is bad in a few ways - every image is downloaded even if it isn't required, and if the gallery has the 30th element centered, then the user won't see any image for it until all of the 1st 20 images are downloaded.</p><p>Ideally, I would like the images to download and display as required - so if the 30th element were centered when the gallery displayed, then the 29th,30th and 31st elements would be downloaded and displayed, then if the user scrolled left, the 28th, 27th, etc would be downloaded. I'm not sure if this is realistic/efficient.</p><p>I've tried starting a thread to download the image in the gallery adapter class (which extends ArrayAdapter), but this obviously starts a new thread for every image as it's scrolled, so the app becomes unusable.</p><p>Does anyone have thoughts/advice on how to achieve this?</p><p>Cheers,r3mo</p>","421636","","","","","2011-01-09 00:20:55","Android: Gallery with many images - how to download images as required?","<android><load><gallery>","3","0","1","",""
"4615693","1","4616480","","2011-01-06 14:03:03","2","16884","<p>I am finding that reading one line at a time from a text file on the SD card is rather slow. I imagine that it might be quicker if the file is in internal memory, so I want to copy files from the SD card to internal storage.</p><p>The file copy examples I can find on the web seem to involve copying one byte at a time from an InputStream to an OutputStream or from a FileReader to a FileWriter. Is this really the quickest and most efficient method?</p>","250845","","","","","2011-01-06 15:22:27","Android file copy","<android><file-io><copy>","3","2","","",""
"4615912","1","","","2011-01-06 14:24:17","1","1425","<p>I made a game in C++ with OpenGL ES rendering and using OpenAL for sound. To make it work on iPhone I could not use ALUT so I use only ""al.h"" and ""alc.h"".</p><p>I now try to build my game with the last Android SDK, that supports native applications and added sound support with OpenSL ES. (I believed OpenSL ES was to OpenAL what OpenGL ES is to OpenGL.)</p><p>I would like to know if by chance there is an equivalent to the ""alc.h"" file for OpenSL ES :</p><pre><code>#if defined (MYAPP_IOS)#include &lt;OpenAL/al.h&gt;#include &lt;OpenAL/alc.h&gt;#elif defined (MYAPP_ANDROID)#include &lt;EGL/egl.h&gt;    // alc.h equivalent for OpenSL ES here ?#else#include &lt;AL/al.h&gt;#include &lt;AL/alc.h&gt;#endif</code></pre><p>If not, does anybody know a way to handle context and device in OpenSL ES in a similar way than OpenAL (or maybe a way to handle that in both without needing ""alc.h"" ?). The two errors Android ndk-build returns are of that type :</p><blockquote>  <p>error: ISO C++ forbids declaration of 'ALCcontext' with no type</p></blockquote>","525732","","82320","","2011-01-06 14:27:24","2011-01-06 20:35:46","Is there an equivalent to OpenAL <alc.h> in OpenSL ES?","<c++><android><openal>","1","0","0","",""
"4615962","1","","","2011-01-06 14:28:58","3","457","<p>I have a scrollview, whose height is initially initialised with an approximate length and I set the <code>ScrollViewfullScroll(ScrollView.FOCUS_UP)</code> so that is starts from the bottom. This works fine as expected. </p><p>Now in the course of drawing (as I scroll up) I determine the exact size of the scrollview and reset its layoutparams. The problem is that now the chart moves to the bottom. How to avoid the scrollview from moving to the bottom ?</p>","266272","","","","","2011-01-06 14:28:58","Android scrollview resizing causes view to move to bottom of scrollview","<android><scrollview>","0","0","","",""
"4616095","1","","","2011-01-06 14:43:35","90","45980","<p>I need to figure out how to get or make a build number for my android application. I need the build number to display in the UI. </p><p>Do I have to do something with <code>AndroidManifest.xml</code>?</p>","565591","","1431239","","2012-08-01 01:41:00","2014-03-23 09:55:35","How to get the build/version number of your android application?","<android><android-emulator><android-manifest>","5","0","17","",""
"4616139","1","4617068","","2011-01-06 14:47:59","0","702","<p>I use SimpleXml to write XML file to internal storage in Android device. The file is created in <code>data/data/package_name/file_name.xml</code>, but the size is 0 KB. Here is my code:</p><pre><code>Room newroom = new Room();newroom.setRid(String.valueOf(numRoom));newroom.setRname(roomName);// serialize to XML using SimpleXML frameworkSerializer serializer = new Persister();File result = new File(""/data/data/de.dcj.wifi/files"", FILENAME);try {    serializer.write(newroom, result);} catch (Exception e1) {    e1.printStackTrace();}</code></pre><p>There's no error in the logcat. Can anyone point out where I do wrong? Thanks!</p>","404437","","404437","","2011-01-06 15:02:53","2011-01-06 16:19:53","using simplexml to write to internal storage","<android><xml><simplexml>","1","0","","",""
"4616144","1","4616190","","2011-01-06 14:48:46","0","217","<p>How to get the clock on notification bar size in pixel?Do anyone know?Thanks</p>","508197","","","","","2011-01-06 14:53:04","notification bar - clock width?","<android>","1","0","","",""
"4616176","1","","","2011-01-06 14:52:04","5","17243","<p>My tabbed app does not redisplay the view with an orientation change.</p><p>I added </p><pre><code>android:configChanges=""keyboardHidden|orientation""</code></pre><p>to the main tab activity and to each activity in the manifest.</p><p>I added to each activity this method:</p><pre><code>public void onConfigurationChanged(Configuration newConfig) {    super.onConfigurationChanged(newConfig);    setContentView(R.layout.active_alt);    mColorLegendBtn = (Button) findViewById(R.id.colorbtn);    mStatusView = (TextView) findViewById(R.id.celltitle1);    TextView mStatusView1 = (TextView) findViewById(R.id.celltitle2);    mStatusView1.setText(mStatusView1.getText()+""testcase1"");    mStatusView.setText(mStatusView.getText()+""testcase"");    initUI();}public void initUI() {    l1 = (ListView) findViewById(R.id.ListView01);    EfficientAdapter efficientAdapter = new EfficientAdapter(mContext);    l1.setAdapter(null);    l1.setAdapter(efficientAdapter);}</code></pre><p>On launch, the tabs, list, button and textview are displayed correctly.When I change the orientation in the emulator, only the tabs are displayed none of the other widgets, the screen is black.</p><p>What am I missing?</p>","327415","","321697","","2011-01-06 15:36:20","2013-09-21 05:59:35","Android Orientation Change","<android><screen-orientation>","4","1","4","",""
"4616445","1","4616592","","2011-01-06 15:18:33","3","5578","<p>the question is simple, i am creating a imageview dynamically using code.</p><pre><code>ImageView btnSend = new ImageView (this);</code></pre><p>and add it to a LinearLayout, the problem is that I want to leave right-aligned</p><p>how to do that?</p><p>Thanks in advance</p>","518657","","","","","2012-01-18 06:32:29","Align Imageview in LinearLayout by code","<java><android><eclipse><alignment><imageview>","2","0","","",""
"4616660","1","4622090","","2011-01-06 15:40:06","1","533","<p>I have the following View setup in one of my Activities:</p><p><code>&lt;LinearLayout</code><br><code>xmlns:android=""http://schemas.android.com/apk/res/android""</code><br><code>android:id=""@+id/photoLayout""</code><br><code>android:layout_width=""fill_parent""</code><br><code>android:layout_height=""fill_parent""&gt;</code><br><code>&lt;ImageView</code><br><code>android:id=""@+id/photoImageView""</code><br><code>android:src=""@drawable/backyardPhoto""</code><br><code>android:layout_width=""fill_parent""</code><br><code>android:layout_height=""fill_parent""</code><br><code>android:gravity=""center""</code><br><code>android:scaleType=""centerInside""</code><br><code>android:padding=""45dip""</code><br><code>&gt;</code><br><code>&lt;/ImageView&gt;</code><br><code>&lt;/LinearLayout&gt;</code><br></p><p>Without an animation set, this displays just fine. However I want to display a very simple animation. So in my Activity's onStart override, I have the following:</p><pre><code>@Overridepublic void onStart() { super.onStart();    mPhotoImageView = (ImageView) findViewById(R.id.photoImageView); float offset = -25; int top = mPhotoImageView.getTop(); TranslateAnimation anim1 = new TranslateAnimation(Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,Animation.ABSOLUTE, top, Animation.ABSOLUTE, offset); anim1.setInterpolator(new AnticipateInterpolator());    anim1.setDuration(1500);    anim1.setStartOffset(5000);    TranslateAnimation anim2 = new TranslateAnimation(      Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,      Animation.ABSOLUTE, offset, Animation.ABSOLUTE, top); anim2.setInterpolator(new BounceInterpolator());    anim2.setDuration(3500);    anim2.setStartOffset(6500);    mBouncingAnimation = new AnimationSet(false);    mBouncingAnimation.addAnimation(anim1);    mBouncingAnimation.addAnimation(anim2);    mPhotoImageView.setAnimation(mBouncingAnimation);}</code></pre><p>The problem is that when the Activity displays for the first time, the initial position of the photo is not in the center of the screen with padding around. It seems like the first frame of the animation is loaded already. Only after the animation is completed, does the photoImageView ""snap"" back to the intended location.</p><p>I've looked and looked and could not find how to avoid this problem. I want the photoImageView to start in the center of the screen, and then the animation to happen, and return it to the center of the screen. The animation should happen by itself without interaction from the user.</p>","565643","","","","","2011-01-07 02:47:39","Android animation's first frame is applied too early on ImageView","<android><animation><view><activity><imageview>","1","0","","",""
"4616675","1","5234710","","2011-01-06 15:42:03","1","1449","<p>This is a deep magic question.I understand that a call to a ContentResolver method takes a URI specific to the ContentProvider, but how does android actually make the association?</p><p>I am guessing that any URI matching the authority provided with the ContentProvider in the AndroidManifest.xml is involved.Is the request sent to every provider containing that authority?If I try to create providers whose authority prefixes another authority will that be a problem?</p><p>Is there a way to see if the ContentProvider is running?  I'm thinking maybe a dummy response on the getType() method would indicate liveness.</p>","345427","","633187","","2011-03-11 13:42:19","2011-03-11 13:42:19","How does a ContentResolver locate the corresponding ContentProvider?","<android><android-contentprovider><android-contentresolver>","1","1","","",""
"4616763","1","","","2011-01-06 15:50:09","0","302","<p>I have an application installed on my device. From my application i need to check whether any update is available in the Website or not, if any update is available, then i need to download the application and need to install it my device. How can i achieve this through my application? </p><p>How do i uninstall application through my application code and how to install the new upgraded .apk in the device?</p><p>Any help is appreciated..</p><p>CheersUday</p>","419389","","","","","2011-08-12 12:09:35","How To Upgrade the Android Application from the internet?","<android>","0","2","","",""
"4616819","1","4616875","","2011-01-06 15:55:29","1","3568","<p>I built a search widget based on the code, Searchable Dictionary v2. Everything is working fine, but there is one problem. </p><p>If I rotate the screen from portrait to landscape or vice versa when the search dialog box is on, the text edit box and keyboard screen get disappeared and runs again. </p><p>Is there any way that I can make that it switches the edit box into appropriated mode(landscape or portrait) without exiting and re-running the dialog box? </p><p>You can check the behavior with the searchable dictionary.I want something like the google search widget. It just switches edit box mode while it keeps the screen.</p>","419893","","","","","2014-03-27 21:56:50","How to keep android search dialog on when rotating screen?","<android><search><dialog>","2","0","1","",""
"4616905","1","","","2011-01-06 16:04:20","0","533","<p>I am very new to Android, my first app is so far a very simple Tab Host with an Activity for each Tab. My question is what is the best way to manage the Views I display within each Activity?</p><p>For example, the first tab loads an activity with four buttons, when a button is pressed I setContentView() to change the content.  However the next time I navigate to this activity it still displays the second view and not the original that is loaded when the onCreate runs (the menu).</p><p>As far as I can see OnCreate, and OnStart run only once, the first time you navigate to a activity.  I have also put Logs in to see if onDestroy or onPause ever run when chaning between tabs and it seems they dont run either.  I'm probably doing something stupid, but I can't seem to find the right approach to this!</p><p>Thanks</p>","565699","","","","","2011-01-06 17:40:35","Android - Changing Activity content when using Tab Host","<android>","1","0","","",""
"4616944","1","4619916","","2011-01-06 16:07:41","0","813","<p>I've run into an interesting problem with an android development project. I was charged to interface the company's online database to an android app. The database has a call to a javascript that looks like this.</p><pre><code>&lt;a href=""javascript:foo(9.7);""&gt;9.7&lt;/a&gt;</code></pre><p>The request of the app was to have the javascript be able to run locally on the app. I've been able to intercept the script call by overriding the onJsPrompt method but cannot retrieve the value that is sent to the java script in-order to process the user input.</p><p>I can parse the data once it is retreived, but I'm lost on how to get the actual call from the website to the script.</p><p>Tried getUrl function, but that returns the page that I'm on not the script call.</p><p>Any help/input would be appreciated. </p>","564259","","","","","2011-01-06 21:13:32","intercept javascript call","<javascript><android><webkit>","2","0","","",""
"4617049","1","4617240","","2011-01-06 16:17:36","2","15134","<p>I've just read that you can exit an android application by simply calling:</p><pre><code>finish();</code></pre><p>However this is not the case! When I do this I get the following errors:</p><pre><code>PackageInstallationReciever Remove /data/local/tmp/com._____.apk Fail!AndroidRuntime Uncaught handler: thread main exiting due to uncaught exceptionAndroidRuntime java.lang.NullPointerExceptionAndroidRuntime     at android.....dalvikvm Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre><p>So what is the proper way to force an application to exit? For the record, I'm calling it from a menu item but it doesn't seem to matter!</p>","143979","","","","","2013-05-18 10:22:36","How to exit from an android app?","<java><android><android-sdk-2.1><quit>","2","1","1","",""
"4617062","1","4617257","","2011-01-06 16:19:07","3","6755","<p>HI all. I have a problem with Eclipse, debugging an android application: all breakpoints I place doesn't work ( the applications doesn't stop. They are skipped as not placed ). There's a way to make them work?</p><p>I have Win7, JDK 6u23 64bit, Eclipse 3.6 64bit, all breakpoints are enabled ( skip isn't selected ).</p><p>Thanks in advance for the answers :)</p>","167194","","","","","2014-03-26 18:43:02","Eclipse Debugging Android doesn't work","<android><eclipse><android-emulator>","2","1","","",""
"4617073","1","12304231","","2011-01-06 16:20:15","9","5061","<p>Is there a way to create an Android Web Application like on the iPhone?</p><p>Using the ""apple-mobile-web-app-capable"" meta tag in the head element of an HTML page, it informs the Apple iOS that the application can be installed to the users springboard so that it starts the Safari Mobile browser without a menu bar.</p>","314472","","918414","","2012-01-29 03:45:55","2012-09-06 16:15:19","Meta Tag ""apple-mobile-web-app-capable"" for Android?","<android><html><web-applications><meta-tags><mobile-webkit>","3","0","2","",""
"4617105","1","","","2011-01-06 16:23:09","-1","1064","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3296850/android-how-to-store-images-from-url-save-it-in-sd-card"">Android: How to store images from url &amp; save it in SD card</a>  </p></blockquote><p>Hi....Im new to Android.....I dont know how to store the html report to SD Card and how to retrieve it. if u provide relevant code that will help me a lot.</p><p>Sry frnds.....Here is the link wat i found in google.<a href=""http://www.androidpeople.com/android-how-to-create-file-in-sd-card-part-1/"" rel=""nofollow"">http://www.androidpeople.com/android-how-to-create-file-in-sd-card-part-1/</a></p><p>and can u tell me how to read the file and where can i found the file....?</p><p>Thanks in Advance</p><p>Ash</p>","538482","","538482","","2011-01-06 17:14:09","2011-01-06 17:14:09","How to save files to SD card?","<android><fileoutputstream>","2","2","","2011-01-06 17:31:05",""
"4617138","1","4648028","","2011-01-06 16:27:12","22","7423","<p>This is really a two part question.  First, is it possible to detect if Flash is installed on an Android device?  Second, if it is installed, is it possible to display a flash video in an Activity?  I'm thinking you'd have to use a WebView widget within your Activity to display the Flash content instead of something like a VideoView.  Is Flash even supported within the WebView widget or is it only supported by the actual Browser app?</p>","13070","","190309","","2013-11-05 06:08:50","2013-11-05 06:08:50","Detect if Flash is installed on Android and embed a Flash video in an Activity","<android><flash><android-webview>","1","0","15","",""
"4617162","1","6329627","","2011-01-06 16:30:08","1","596","<p>I have a List collection of my objects. I need to display this collection as a table:</p><blockquote>  <p>First column | Second | Button</p></blockquote><p>TableLayout is not suitable because I need to receive chosen item.<br>I tried to extend BaseAdapter and return LinearLayout, which encapsulates row data.But I receive exception: </p><blockquote>  <p>android.widget.ListView.setupChild(ListView.java:1779)</p></blockquote><p>When I return TextView it work ok, but I need several view in a row.Any advices?</p>","427598","","436938","","2012-03-20 13:40:51","2012-03-20 13:40:51","Display table data","<android>","1","0","","",""
"4617368","1","4617813","","2011-01-06 16:49:01","4","1513","<p>I'm trying to compile a native program for android.</p><p>But when runnning the ndk-build command I got the following result.</p><pre><code>/home/marcos/dev/workspace/rmsdk.native.wraper/jni/include-all/uft_alloc.h:26:21: error: stdexcept: No such file or directory/home/marcos/dev/workspace/rmsdk.native.wraper/jni/include-all/uft_alloc.h:27:18: error: limits: No such file or directory</code></pre><p>stdexcept and limits are part of the std C++ lib.</p><p>This is my Android.mk</p><pre><code>LOCAL_PATH := $(call my-dir)MY_PATH := $(LOCAL_PATH)include $(call all-subdir-makefiles)LOCAL_PATH := $(MY_PATH)include $(CLEAR_VARS)LOCAL_LDLIBS := -llogLOCAL_MODULE    := rmsdkLOCAL_SRC_FILES := curlnetprovider.cpp RMServices.cpp  LOCAL_C_INCLUDES := $(LOCAL_PATH)/include-allLOCAL_STATIC_LIBRARIES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlibinclude $(BUILD_SHARED_LIBRARY)</code></pre><p>I should explicit tell that it's a C++ source?</p>","558433","","","","","2011-01-06 17:33:35","NDK do not find the standard C++ libraries","<java><android><android-ndk>","2","0","1","",""
"4617417","1","4617755","","2011-01-06 16:53:15","0","747","<p>I'm new to Fourier Transforms, so can someone explain what I need to do to replicate this behaviour in fftw:</p><pre><code>double* timeDomain = static_cast&lt; double* &gt;( fftw_malloc( sizeof( double ) * SEGMENTATION_LENGTH ) );fftw_complex* frequencyDomain = static_cast&lt; fftw_complex* &gt;( fftw_malloc( sizeof( fftw_complex ) * ( ( SEGMENTATION_LENGTH / 2 ) + 1 ) ) );    fftw_plan forward = fftw_plan_dft_r2c_1d( SEGMENTATION_LENGTH, timeDomain, frequencyDomain, FFTW_MEASURE );</code></pre><p>using <a href=""http://code.google.com/p/libgdx/source/browse/trunk/gdx/src/com/badlogic/gdx/audio/analysis/FFT.java?r=1298"" rel=""nofollow"">libgdx's FFT class</a></p><p>I'm assuming that I'll want to initialize my FFT object thus:</p><pre><code>//2048 is smallest power of 2 larger than SEGMENTATION_LENGTHFFT fourier = new FFT(2048,44100); </code></pre><p>but I can't find any methods relating to the frequency domain. I can do <code>fourier.forward(samples)</code>, but it doesn't take any other parameters. Can someone give me a hint as to what I need to do here?</p>","319618","","","","","2011-01-07 12:05:56","Setting Frequency Domain in libgdx FFT","<android><signal-processing><fft><fftw><libgdx>","1","0","1","",""
"4617506","1","","","2011-01-06 17:01:52","0","69","<p>I need to make an <code>Activity</code> in Android that has a grid (20x8) drawn in background with cells of different styles: i have 3 background images for the 3 ldpi-mdpi-hdpi resolutions.</p><p>The problem is that I need to place a <code>TextView</code> in every cell but if i put it in absolute position for a resolution (eg. ldpi) it is not in the right position for mdpi and hdpi.</p><p>Which is the Android approach to solve it?</p><p>Thanks !</p>","339500","","339500","","2011-01-06 22:53:41","2011-01-06 22:53:41","Layout problem with Android","<android><android-layout>","1","0","","",""
"4617658","1","","","2011-01-06 17:18:11","0","796","<p>I am trying to delete a folder in sdcard.I can delete normal directories, but a directory that starts with period cannot be deleted.(ex. "".helloDir"")</p><pre><code>    if (dir.isDirectory()) {        String[] children = dir.list();        for (int i = 0; i &lt; children.length; i++) {            new File(dir, children[i]).delete();        }    }</code></pre><p>children is null if dir starts with period (ex. "".helloDir"").</p>","432056","","21234","","2011-01-06 17:23:32","2011-01-06 17:51:34","Android: How do you delete a folder starts with period","<android><file-io>","1","3","","",""
"4617832","1","","","2011-01-06 17:35:01","0","324","<p>For single sign-on where should I include this below code to work..</p><p>In FACBOOK.Clas or somewhere else.. or in my main Activity .. I downloaded the code from <a href=""https://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">https://github.com/facebook/facebook-android-sdk</a></p><p>facebookClient = new Facebook(FB_APP_ID);</p><pre><code>    facebookClient.authorize(this,         new String[] {""publish_stream"", ""read_stream"", ""offline_access""}, this);</code></pre>","558077","","568266","","2011-12-31 08:54:51","2011-12-31 08:54:51","Android Facebook","<android>","3","0","","",""
"4617887","1","","","2011-01-06 17:40:15","0","5738","<p>Hi I'm following tutorial provided by google name hello-tabwidget.To create tab menu.Everything works fine but now I want to add a button to one tab but this button appears in all tabs.</p><p>Please can anyone help?</p><p>Thanks </p><p>this is what i have</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);Resources res = getResources(); // Resource object to get DrawablesTabHost tabHost = getTabHost();  // The activity TabHostTabHost.TabSpec spec;  // Resusable TabSpec for each tabIntent intent;  // Reusable Intent for each tab// Create an Intent to launch an Activity for the tab (to be reused)intent = new Intent().setClass(this, FirstTab.class);// Initialize a TabSpec for each tab and add it to the TabHostspec = tabHost.newTabSpec(""First Tab"").setIndicator(""First Tab"",                  res.getDrawable(R.drawable.ic_tab_artists))              .setContent(intent);tabHost.addTab(spec);// Do the same for the other tabsintent = new Intent().setClass(this, SecondTab.class);spec = tabHost.newTabSpec(""Second Tab"").setIndicator(""Second Tab"",                  res.getDrawable(R.drawable.ic_tab_albums))              .setContent(intent);tabHost.addTab(spec);intent = new Intent().setClass(this, ThirdTab.class);spec = tabHost.newTabSpec(""Third Tab"").setIndicator(""Third Tab"",                  res.getDrawable(R.drawable.ic_tab_songs))              .setContent(intent);tabHost.addTab(spec);intent = new Intent().setClass(this, NextTab.class);spec = tabHost.newTabSpec(""Next Tab"").setIndicator(""Next Tab"",                  res.getDrawable(R.drawable.ic_tab_next))              .setContent(intent);tabHost.addTab(spec);tabHost.setCurrentTab(0);}}</code></pre><p>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;FrameLayout android:id=""@android:id/tabcontent""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:padding=""5dp""&gt;       &lt;include layout=""@layout/tab1""/&gt;       &lt;include layout=""@layout/tab2""/&gt;       &lt;include layout=""@layout/tab3""/&gt;       &lt;include layout=""@layout/tab4""/&gt;    &lt;/FrameLayout&gt;  &lt;TabWidget android:id=""@android:id/tabs""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""      android:gravity=""bottom""/&gt; &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>I created xml layout for each tab this is one with the button others are exactly this same just with out a button tag and with different id</p><p>tab2.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:id=""@+id/tab2Layout"" android:orientation=""vertical""&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;/LinearLayout&gt;</code></pre><p>and i created class for each tab this is code from second tab where i want to have a buttonthe other classes are exactly this same just </p><pre><code>setContentView(R.layout.tab2);</code></pre><p>is set to point to different layouts</p><p>SecondTab.java</p><pre><code>public class SecondTab extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.tab2); }}</code></pre><p>Any ideas ??</p><p>Thanks</p>","565829","","565829","","2011-01-06 19:41:57","2011-01-06 21:18:20","using tab Layout in android - Button added to one tab appears in all tabs","<android>","1","0","","",""
"4617898","1","4618185","","2011-01-06 17:41:30","13","38732","<p>Hi I have imageview in my android app that i am using like button with onClick event given , but as you might guess it is not giving imageview a clickable effect when clicked , how can i achieve that ??</p>","155332","","","","","2014-03-17 13:22:51","How can i give imageview click effect like a button in Android?","<java><android><button><imageview>","17","1","8","",""
"4617922","1","","","2011-01-06 17:45:15","0","777","<p>I have an Android application with tab activity. There are 10 tabs to be added. I am using small icons on each tab so all tabs can be identified. What I am trying to achieve is that when a tab becomes a current tab it should show a title and it gets wide enough to fit whole title. All other tabs should have no title to save space. Question: how can I resize tabs dynamically?Any pointer, including reference to an earlier post will be greatly appreciated.Thank you.</p>","415268","","","","","2011-01-06 17:45:15","How to dynamically resize Android app tabs","<android><resize><android-tabhost><tabwidget><tabactivity>","0","3","","",""
"4618092","1","4618506","","2011-01-06 18:03:11","0","126","<p>i have this sqllite query in android .. </p><pre><code> //---retrieves all the titles---    public Cursor getAllMessages()     {        return db.query(true,DATABASE_TABLE, new String[] {                KEY_ROWID,                 KEY_FROMID,                KEY_TOID,                KEY_MESSAGE,                DIR},                null,                null,                 null,                 null,                 null,                 null);    }</code></pre><p>i want to order desc the result according to KEY_ROWID how ?</p>","508377","","508377","","2011-01-06 18:16:03","2011-01-06 18:43:37","how make ordring in this sqlite command?","<android><sqlite><sqlite3>","2","0","","",""
"4618239","1","","","2011-01-06 18:17:18","5","4235","<p>I bought myself a website where it is being hosted on a linux server which shares one IP address using cpanel. The problem that is, now, i want to use this code to upload a file to my site. Everytime i use the site address like www.site, i'll get an exception saying that the URL is malformed. When i use the ip address (since this is a shared server), i can't find my php code since i don't know how to link to my address.</p><p>Does anyone... anyone know how to link me to my site, just so i can upload an xml file?? Really need help here....... </p><p>Any help would be really appreciated as i have no knowledge in networking stuff.</p><pre><code>    HttpURLConnection connection = null;     DataOutputStream outputStream = null;    DataInputStream inputStream = null;    String pathToOurFile = ""/data/data/test.send/testsend.txt"";    String urlServer = ""http://www.site.com/filefortransfer.php"";    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary =  ""*****"";    int bytesRead, bytesAvailable, bufferSize;    byte[] buffer;    int maxBufferSize = 1*1024*1024;    try    {    FileInputStream fileInputStream = new FileInputStream(new File(pathToOurFile) );    URL url = new URL(urlServer);    connection = (HttpURLConnection) url.openConnection();    // Allow Inputs &amp; Outputs    connection.setDoInput(true);    connection.setDoOutput(true);    connection.setUseCaches(false);    // Enable POST method    connection.setRequestMethod(""POST"");    connection.setRequestProperty(""Connection"", ""Keep-Alive"");    connection.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+boundary);    outputStream = new DataOutputStream( connection.getOutputStream() );    outputStream.writeBytes(twoHyphens + boundary + lineEnd);    outputStream.writeBytes(""Content-Disposition: form-data; name=\""uploadedfile\"";filename=\"""" + pathToOurFile +""\"""" + lineEnd);    outputStream.writeBytes(lineEnd);    bytesAvailable = fileInputStream.available();    bufferSize = Math.min(bytesAvailable, maxBufferSize);    buffer = new byte[bufferSize];    // Read file    bytesRead = fileInputStream.read(buffer, 0, bufferSize);    while (bytesRead &gt; 0)    {    outputStream.write(buffer, 0, bufferSize);    bytesAvailable = fileInputStream.available();    bufferSize = Math.min(bytesAvailable, maxBufferSize);    bytesRead = fileInputStream.read(buffer, 0, bufferSize);    }    outputStream.writeBytes(lineEnd);    outputStream.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);    // Responses from the server (code and message)    String serverResponseCode = Integer.toString(connection.getResponseCode());    String serverResponseMessage = connection.getResponseMessage();    fileInputStream.close();    outputStream.flush();    outputStream.close();    }    catch (Exception ex)    {        Log.e(""MediaPlayer"", ""error: "" + ex.getMessage(), ex);    }    }</code></pre>","565870","","","","","2012-07-19 15:46:20","Android, http: How to upload a file to a site hosted by a shared server?","<java><php><android><networking><http-post>","1","0","","",""
"4618291","1","4646835","","2011-01-06 18:22:02","2","310","<p>Hi friends i am implementing FaceBook with Single Sign On and downloaded code from <a href=""https://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">https://github.com/facebook/facebook-android-sdk</a>.. I registeres apps in Facebook and generated Hash key but Still SINGLE SIGN ON not working..Any important thing i wanna to do.... I dont knw where i want to add the Authorize code.. Whether i want add authurize code in FACEBOOK.java or in  my mAIN activity APP.java extends Activity </p>","555221","","21234","","2011-01-10 11:34:09","2011-01-10 12:31:49","Android Single Sign On","<android><android-manifest>","1","0","1","",""
"4618513","1","4620582","","2011-01-06 18:44:36","3","1413","<p>Are there advantages of using Emacs instead of Eclipse for Android development?</p><p>If so, what are they?</p>","418055","","","","","2011-01-06 22:21:38","What are the advantages of using Emacs instead of Eclipse for Android development?","<android><eclipse><emacs>","3","0","","",""
"4618591","1","4742224","","2011-01-06 18:53:40","1","3747","<p>I am using a couple of listviews, each using a subclasses SimpleCursorAdapter to deal with results from a db. It's a simple diary viewer, activity 1 = day, activity 2 = week.</p><p>I am trying to delete an item in the day listview, and then have both the day and week views to refresh following the change.</p><p>If I call cursor.requery() in the activity I have deleted in, it reflects the change. However, the other activity doesn't know of the change.</p><p>I think I want to use Cursor.registerContentObserver as the docs claim ""Register an observer that is called when changes happen to the content backing this cursor. Typically the data set won't change until requery() is called.""</p><p>However, I naively wrote a content observer :</p><pre><code>private class dbObserver extends ContentObserver {    public dbObserver(Handler handler) {        super(handler);    }    @Override    public void onChange(boolean selfChange) {        lectureCursor.requery();        super.onChange(selfChange);    }}</code></pre><p>Then in the onCreate of each activity :</p><pre><code>dbObserver test = new dbObserver(new Handler());    lectureCursor.registerContentObserver(test);</code></pre><p>But onChange is never being called when I delete from the database. Am I doing something stupid here?</p>","565915","","","","","2012-04-04 16:07:37","Android Cursor.registerContentObserver()","<android><cursor>","2","0","","",""
"4618605","1","4619157","","2011-01-06 18:54:51","0","1650","<p>My app uses a StringBuilder to assemble paragraphs of text which are then displayed in a TextView within a ScrollView.</p><p>The displaytext.xml layout file is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""#FFFFFF""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ScrollViewandroid:id=""@+id/ScrollView01""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""&gt;  &lt;TextView      xmlns:android=""http://schemas.android.com/apk/res/android""      android:id=""@+id/display_text""       android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:textColor=""#000000""      &gt;  &lt;/TextView&gt;&lt;/ScrollView&gt;   &lt;/LinearLayout&gt;</code></pre><p>and the code that displays the StringBuilder object sbText is</p><pre><code>    setContentView(R.layout.displaytext);    TextView tv = (TextView)findViewById(R.id.display_text);    tv.setText(Html.fromHtml(sbText.toString()));</code></pre><p>This works OK, except that it gets very slow as the amount of text grows. For example, to display 50 paragraphs totalling about 50KB of text takes over 5 seconds just to execute those three lines of code.</p><p>Can anyone suggest how I can speed this up, please?</p>","250845","","","","","2011-01-06 19:50:09","Android: Speeding up display of (html-formatted) text","<android><html><textview><stringbuilder><scrollview>","1","2","","",""
"4618631","1","9461870","","2011-01-06 18:57:34","3","5985","<p>So I want to be able to write an app that can turn on and display logcat messages, dmesg, and also be able to run commands like 'ls' 'cat' 'echo' 'cd.'</p><p>If I do the following:</p><pre><code>nativeProc = Runtime.getRuntime().exec(""ls\n"");        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(nativeProc.getOutputStream()));        BufferedReader in = new BufferedReader(new InputStreamReader(nativeProc.getInputStream()));        String line = null;        while ((line = in.readLine()) != null) {              full = full + ""\n"" + line;        }</code></pre><p>I can put the text ""full"" to a Text View and see the root directory.</p><p>However, that's about all I can do. Let's say I want to find a directory, and change to it, I'm having trouble.</p><p>So if I do this:</p><pre><code>nativeProc = Runtime.getRuntime().exec(""ls\n"");        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(nativeProc.getOutputStream()));        BufferedReader in = new BufferedReader(new InputStreamReader(nativeProc.getInputStream()));        String line = null;        while ((line = in.readLine()) != null) {              full = full + ""\n"" + line;        }        /* Code here to confirm the existing of a directory*/        nativeProc = Runtime.getRuntime().exec(""cd tmp\n"");        BufferedReader in2 = new BufferedReader(new InputStreamReader(nativeProc.getInputStream()));        line = null;        String test = ""\nStart1:\n"";        while ((line = in2.readLine()) != null) {              test = test + ""\n"" + line;        }</code></pre><p>I get nothing for both ""full"" and ""text""</p><p>Any ideas?</p>","425962","","","","","2012-02-27 08:16:55","Android Runtime.getRuntime().exec() to nav through directories","<android><command-line><terminal><runtime.exec>","3","0","1","",""
"4618726","1","","","2011-01-06 19:06:38","2","338","<p>Basically, I'm trying to recreate the functionality of the MediaController in the native Music app (that I see on 2.2), where the back button immediately backs out of screen, instead of hiding the MediaController. There doesn't seem to be any good way to set a keylistener or override a method to intercept these keyevents though.</p><p>Any ideas?</p>","295675","","","","","2012-10-13 20:38:26","Intercepting keyevents to MediaController?","<android><mediacontroller>","1","0","","",""
"4618730","1","4619727","","2011-01-06 19:07:06","1","4450","<p>I have an Overlay extension which has 2 dialogs as private attributes - one Dialog and one ProgressDialog. After clicking on the Overlay in the MapView, the Dialog object appears. When the user clicks a button in the Dialog it disappears and the ProgressDialog is shown. Simultaneously a background task is started by notifying a running Service. When the task is done, a method (buildingLoaded) in the Overlay object is called to switch the View and to dismiss the ProgressDialog. The View is being switched, the code is being run (I checked with the debugger) but the ProgressDialog is not dismissed. I also tried hide() and cancel() methods, but nothing works. Can somebody help me?Android version is 2.2</p><p>Here is the code:</p><pre><code>public class LODOverlay extends Overlay implements OnClickListener {private Dialog overlayDialog;private ProgressDialog progressDialog;       ..............@Overridepublic void onClick(View view) {                   .......        final Context ctx = view.getContext();        this.progressDialog = new ProgressDialog(ctx);        ListView lv = new ListView(ctx);        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(ctx, R.layout.layerlist, names);        lv.setAdapter(adapter);        final LODOverlay obj = this;        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {                String name = ((TextView) view).getText().toString();        Intent getFloorIntent = new Intent(Map.RENDERER);        getFloorIntent.putExtra(""type"", ""onGetBuildingLayer"");        getFloorIntent.putExtra(""id"", name);        view.getContext().sendBroadcast(getFloorIntent);        overlayDialog.dismiss();        obj.waitingForLayer = name;        progressDialog.show(ctx, ""Loading..."", ""Wait!!!"");            }        });    .......}public void buildingLoaded(String id) {    if (null != this.progressDialog) {        if (id.equals(this.waitingForLayer)) {            this.progressDialog.hide();            this.progressDialog.dismiss();    ............            Map.flipper.showNext();  // changes the view        }    }}</code></pre><p>}</p>","565931","","","","","2012-02-24 00:19:31","ProgressDialog does not disappear after executing dismiss, hide or cancel?","<android><progressdialog>","2","4","1","",""
"4618929","1","4621149","","2011-01-06 19:28:18","1","6371","<p>I have a custom TextView which is clickable. It defines its own onClick handler in order to change its appearance based on clicks. However if I then define a second onClick handler in my activity in order to do something based on the button being clicked, only one of the onClick functions is called.  onClick is a void function - is there any way to say I didn't process this click, please pass it on to other onClick handlers? </p><p>To be more clear here is the code:</p><p>Inside MyCheckButton which extends TextView I have:</p><pre><code>    setOnClickListener( mClickListener );    private OnClickListener mClickListener = new OnClickListener() {        public void onClick(View v) {            toggle();        }    };</code></pre><p>However I include MyCheckButton into my Activity, and of course I need to do something when its clicked so I attach another OnClickListener to it:</p><pre><code>MyCheckButton button= (MyCheckButtonButton) findViewById(R.id.cb);button.setOnClickListener(new OnClickListener(){    @Override    public void onClick(View v) {        // do something in the app    }});</code></pre><p>By calling setOnClickListener twice it appears that I am replacing the original listener so toggle() which changes the appearance is never called.  How can I do something in my activity when this button is clicked if it is already using the onClick handler to change its appearance? I thought I would simply see both OnClickListeners getting called.</p>","317033","","317033","","2011-01-06 20:36:54","2012-04-24 08:39:43","Android - Two onClick listeners and one button","<android><event-bubbling>","5","3","","",""
"4619016","1","4619531","","2011-01-06 19:36:45","0","4582","<p>I am trying to do the following:</p><p>Create background service When a message is received on the inputQueue from the MQTT brokerShow a popup</p><p>So I have the subscription to the mqtt broker working fine. When a message arrives - an intent is started to show the popup however the following error shows:</p>  <pre><code>01-06 19:26:58.412: WARN/WindowManager(989): Failed looking up window    01-06 19:26:58.412: WARN/WindowManager(989): java.lang.IllegalArgumentException:                        Requested window null does not exist    01-06 19:26:58.412: WARN/WindowManager(989):     at    com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9408)    01-06 19:26:58.412: WARN/WindowManager(989):     at com.android.server.WindowManagerService.addWindow(WindowManagerService.java:1934)01-06 19:26:58.412: WARN/WindowManager(989):     at com.android.server.WindowManagerService$Session.add(WindowManagerService.java:6886)01-06 19:26:58.412: WARN/WindowManager(989):     at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:66)01-06 19:26:58.412: WARN/WindowManager(989):     at com.android.server.WindowManagerService$Session.onTransact(WindowManagerService.java:6858)01-06 19:26:58.412: WARN/WindowManager(989):     at android.os.Binder.execTransact(Binder.java:288)01-06 19:26:58.412: WARN/WindowManager(989):     at dalvik.system.NativeStart.run(Native Method)01-06 19:26:58.412: DEBUG/AndroidRuntime(5364): Shutting down VM01-06 19:26:58.412: WARN/dalvikvm(5364): threadid=1: thread exiting with uncaught exception (group=0x4001d878)01-06 19:26:58.412: WARN/WindowManager(989): Attempted to add window with token that is not a window: null.  Aborting.01-06 19:26:58.422: ERROR/AndroidRuntime(5364): FATAL EXCEPTION: main01-06 19:26:58.422: ERROR/AndroidRuntime(5364): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.andy.tabletsms.tablet/com.andy.tabletsms.work.SMSPopup}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.os.Handler.dispatchMessage(Handler.java:99)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.os.Looper.loop(Looper.java:123)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at java.lang.reflect.Method.invokeNative(Native Method)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at java.lang.reflect.Method.invoke(Method.java:521)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at dalvik.system.NativeStart.main(Native Method)01-06 19:26:58.422: ERROR/AndroidRuntime(5364): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.view.ViewRoot.setView(ViewRoot.java:505)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.view.Window$LocalWindowManager.addView(Window.java:424)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.widget.PopupWindow.invokePopup(PopupWindow.java:828)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.widget.PopupWindow.showAtLocation(PopupWindow.java:688)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at com.andy.tabletsms.work.SMSPopup.onCreate(SMSPopup.java:58)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)01-06 19:26:58.422: ERROR/AndroidRuntime(5364):     ... 11 more01-06 19:26:58.432: WARN/ActivityManager(989):   Force finishing activity com.andy.tabletsms.tablet/com.andy.tabletsms.work.SMSPopup01-06 19:26:58.432: WARN/ActivityManager(989):   Force finishing activity com.andy.tabletsms.tablet/.main01-06 19:26:58.932: WARN/ActivityManager(989): Activity pause timeout for HistoryRecord{444da2b8 com.andy.tabletsms.tablet/com.andy.tabletsms.work.SMSPopup}</code></pre><p>The queue is checked every 5 seconds and issues a start activity for the popup if there is an item as follows </p><pre><code> SMSPopup.msg = main.msgs.get(0);      Intent testActivityIntent = new Intent(context.getApplicationContext(), com.andy.tabletsms.work.SMSPopup.class);  testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  context.startActivity(testActivityIntent);</code></pre><p>The SMSPopup class looks as follows:</p><pre><code>package com.andy.tabletsms.work;import com.andy.tabletsms.tablet.R;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.Gravity;import android.view.LayoutInflater;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup;import android.widget.Button;import android.widget.PopupWindow;import android.widget.Toast;public class SMSPopup extends Activity{ public static String msg; private PopupWindow pw; @Override public void onCreate(Bundle bundle){  super.onCreate(bundle);  Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();  LayoutInflater inflater = LayoutInflater.from(this);  // inflate our view from the corresponding XML file  View layout = inflater.inflate(R.layout.popup, (ViewGroup)findViewById(R.id.popup_menu_root));  // create a 100px width and 200px height popup window  pw = new PopupWindow(layout, 100, 200, true);  // set actions to buttons we have in our popup  Button button1 = (Button)layout.findViewById(R.id.popup_menu_button1);  button1.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View vv) {          // close the popup          pw.dismiss();      }  });  Button button2 = (Button)layout.findViewById(R.id.popup_menu_button2);  button2.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View vv) {       Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();      }  });  Button button3 = (Button)layout.findViewById(R.id.popup_menu_button3);  button3.setOnClickListener(new OnClickListener() {      @Override      public void onClick(View vv) {          finish();      }  });  // finally show the popup in the center of the window  pw.showAtLocation(layout, Gravity.CENTER, 0, 0); }}</code></pre>","265683","","","","","2011-01-06 20:32:02","Android PopupWindow wont open properly","<android><layout><queue><mq>","2","2","","",""
"4619035","1","","","2011-01-06 19:38:06","0","109","<p>I want to create a ListActivity with 2 modes:</p><p>1 mode will have the ListView with some functionality for altering the list.1 mode will have the ListView with no functionality.  The user may only view the list.</p><p>There are several ways of designing this kind of behavior, but this is how I want it to look:</p><p>I want the user horizontally swiping the screen to switch between modes.  I also want an animation so it looks like one list is being scrolled off screen and the new one is scrolling onto the screen.</p><p>Should I...</p><p>A) Have these actually be the same list.  One would just hide some of the buttons.  Using some animation, it would appear that a new list is being brought onto the screen.  My problem with this approach is that I'm not really sure how to achieve such an animation.</p><p>B) Have the swipe gesture launch a new Activity with a new ListView.  There is already the built in animation to slide the Activity into view (and take it off by going back).  My problem with this is the lists would operate independent.  I would want the users to be in the same spot of the list in both modes and this isn't particularly easy to achieve.  You can jump to a position by asking the other list what its first visible position is, but it likely won't line up exactly as the other may.</p><p>Let me repeat that I do not want toggle buttons.  I want the swipe gesture to alter the mode and I want it to appear that a new list (whether it is actually new or not) slides into view.</p><p>Ideally, I would like a response on how to achieve the desired animation from option A, but I would also like to hear any other recommendations.</p><p>Thanks for your help</p>","406790","","","","","2011-01-06 19:38:06","How should I set up the following ListActivity","<android><listview><animation>","0","2","","",""
"4619049","1","","","2011-01-06 19:39:05","6","15681","<p>Why I have this error :</p><pre><code>ERROR/AndroidRuntime(854): Uncaught handler: thread main exiting due to uncaught exceptionERROR/AndroidRuntime(854): java.lang.RuntimeException: Unable to instantiate receiver com.android.GPS21.SmsReceiver: java.lang.ClassNotFoundException: com.android.GPS21.SmsReceiver in loader dalvik.system.PathClassLoader@43d02ef0ERROR/AndroidRuntime(854): Caused by: java.lang.ClassNotFoundException: com.android.GPS21.SmsReceiver in loader dalvik.system.PathClassLoader@43d02ef0</code></pre><p>This is my onReceive events:</p><pre><code>public void onReceive(Context context, Intent intent) {  // TODO Auto-generated method stub  Log.i(LOG_TAG, ""Recieved a message"");  if (intent.getAction().equals(ACTION)) {   // if(message starts with SMStretcher recognize BYTE)   StringBuilder sb = new StringBuilder();   // The SMS-Messages are 'hiding' within the extras of the Intent.   Bundle bundle = intent.getExtras();   if (bundle != null) {    // Get all messages contained in the Intent    // Telephony.Sms.Intents.getMessagesFromIntent(intent) does not    // work anymore hence the below changes    Object[] pduObj = (Object[]) bundle.get(""pdus"");    SmsMessage[] messages = new SmsMessage[pduObj.length];    for (int i = 0; i &lt; pduObj.length; i++)     messages[i] = SmsMessage.createFromPdu((byte[]) pduObj[i]);    // Feed the StringBuilder with all Messages found.    for (SmsMessage currentMessage : messages) {     sb.append(""SMS Received From: "");     // Sender-Number     sb.append(currentMessage.getDisplayOriginatingAddress());     sb.append(""\nMessage : "");     // Actual Message-Content     sb.append(currentMessage.getDisplayMessageBody());    }   }   // Logger Debug-Output   Log.i(LOG_TAG, ""[SMSApp] onReceive: "" + sb);   // Show the Notification containing the Message.   Toast.makeText(context, sb.toString(), Toast.LENGTH_LONG).show();  }</code></pre><p>In debug that onReceive() is error.</p><p>I just make BroadcastReceiver to receive SMS and show in notification Toast..</p><p>And I try send SMS from DDMS and that error appear..</p>","565970","","","","","2014-03-12 11:16:31","Unable to instantiate receiver in BroadcastReceiver SMS","<android><sms><broadcastreceiver>","7","0","1","",""
"4619096","1","4619160","","2011-01-06 19:43:28","3","864","<p>Bit of a newbie when it comes to android, only been working on it properly for a few days but even after all the searching I've done im stumped and nobody seems to know how to help me. I have this so far: </p><p><a href=""http://img263.imageshack.us/i/sellscreen.jpg"" rel=""nofollow"">http://img263.imageshack.us/i/sellscreen.jpg</a></p><p>How can I move the text to be besides each icon rather than underneath it? Hoping the gallery won't be moved either. Here is the code i have:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/scroller""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:fillViewport=""true"" &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/gallery""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""/&gt;    &lt;ImageView      android:id=""@+id/test_image""     android:src=""@drawable/icon""     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=""The offcial UK driving theory test application. Over 190 questions.""     /&gt;    &lt;ImageView      android:id=""@+id/test_image""     android:src=""@drawable/icon""     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=""The offcial UK driving theory test application. Over 190 questions.""/&gt;    &lt;ImageView      android:id=""@+id/test_image""     android:src=""@drawable/icon""     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=""The offcial UK driving theory test application. Over 190 questions.""/&gt;    &lt;ImageView      android:id=""@+id/test_image""     android:src=""@drawable/icon""     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=""The offcial UK driving theory test application. Over 190 questions.""/&gt;    &lt;ImageView      android:id=""@+id/test_image""     android:src=""@drawable/icon""     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=""The offcial UK driving theory test application. Over 190 questions.""        /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>Top half of my code doesn't seem to be showing for some reason but it's just the opening of the linear layout.I will be forever grateful to anyone that can help, i've been racking my brains for days and getting nowhere. Really getting stressed out by it. Thanks in advance!!</p>","565672","","565672","","2011-01-06 19:50:47","2011-01-06 19:52:55","LinearLayout - How to get text to be on the right of an icon?","<android><android-linearlayout>","2","0","1","",""
"4619162","1","","","2011-01-06 19:50:54","8","27591","<p>I downloaded few source codes from Google source codes.</p><p>I executed them on Eclipse but <code>R.java</code> file is not created and therefore I got many errors saying that <code>R</code> cannot be resolved. There is no <code>main.xml</code> in layout too. Some other XML files are there. How can I execute these programs?</p>","565989","","213269","","2011-09-23 14:56:51","2014-04-07 12:22:05","How to generate R.java","<android><eclipse><build><r.java-file>","10","6","","",""
"4619180","1","","","2011-01-06 19:52:28","0","937","<p>I need to insert some text underneath each picture in the gridview. Can anyone help withi this? I have tried to put a text view into the getView() but no success. I have commented out my attempt to do this.</p><p>This is my image adapter code:</p><pre><code>import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;//import android.widget.TextView;public class ImageAdapter extends BaseAdapter{    private Context mContext;    //private String[] texts = {""aaa"", ""bbb"", ""ccc"", ""ddd"", ""eee"", ""fff"", ""eee"", ""hhh"", ""iii""};    public ImageAdapter(Context c) {        mContext = c;    }    public int getCount() { //Constructor        return getmThumbIds().length; //+9    }    public Object getItem(int position) {        return null;    }    public long getItemId(int position) {        return 0;    }    // create a new ImageView for each item referenced by the Adapter    public View getView(int position, View convertView, ViewGroup parent) {        ImageView imageView;        //TextView tv;        if (convertView == null) {  // if it's not recycled, initialize some attributes            imageView = new ImageView(mContext);            imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); //Sets height and width for the view - Could use setAdjustViewBounds(boolean).             imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);//Image should be cropped towards centre            imageView.setPadding(8, 8, 8, 8); //Sets padding for all sides            //tv = new TextView(mContext);            //tv.setLayoutParams(new GridView.LayoutParams(85, 85));        } else {            imageView = (ImageView) convertView;            //tv = (TextView) convertView;            //tv.setText(texts[position]);            //return tv;        }        imageView.setImageResource(getmThumbIds()[position]); //Chooses image from the array        return imageView;    }    public void setmThumbIds(Integer[] mThumbIds) {        this.mThumbIds = mThumbIds;    }    public Integer[] getmThumbIds() {        return mThumbIds;    }    // references to our images     Integer[] mThumbIds = {            R.drawable.puma_boots, R.drawable.cricket_balls,            R.drawable.darts, R.drawable.paintballing_gloves,            R.drawable.ice_skates, R.drawable.skate_ramp,            R.drawable.manu_top, R.drawable.rugby_ball,            R.drawable.puma_boots, R.drawable.cricket_balls,            R.drawable.darts, R.drawable.paintballing_gloves,            R.drawable.ice_skates, R.drawable.skate_ramp,            R.drawable.manu_top, R.drawable.tennis_racket,            R.drawable.puma_boots, R.drawable.cricket_balls,            R.drawable.darts, R.drawable.paintballing_gloves,            R.drawable.ice_skates, R.drawable.skate_ramp,            R.drawable.rugby_ball, R.drawable.tennis_racket    };}</code></pre>","565991","","321697","","2011-01-06 20:11:55","2012-10-27 05:30:30","Does anyone know how to put text underneath each image in a gridview?","<android><gridview>","2","0","","",""
"4619301","1","4631181","","2011-01-06 20:04:43","4","3368","<p>I'm experimenting with proguard now that it's easier to use fromwithin eclipse. I've exported a signed version of my app with adeliberate bug that causes a crash for testing. After I get the stacktrace and run retrace -verbose mapping.txt stack.txt, instead ofgiving me where the error occurs, it gives me the class where errorhappens and list a of methods, one of which is the method where theexception happens.</p><p>I've used the official guide for all of this and edited the logcat stack trace capture to be in the same format as the dev console. Anyone know what the problem could be?</p>","240251","","1420279","","2013-05-09 13:08:00","2013-05-09 13:08:00","Proguard retrace tool's output","<android><eclipse><obfuscation><proguard>","1","0","3","",""
"4619374","1","","","2011-01-06 20:13:27","8","5862","<p>In Android, I've registered a BroadcastReceiver in my onCreate(). Where should I unregister so that I won't have leaked receivers?</p><p>Thank you.</p>","286802","","321697","","2011-01-06 20:27:59","2013-08-14 02:59:03","When To Unregister Broadcast Receiver?","<android><broadcastreceiver>","3","0","1","",""
"4619472","1","","","2011-01-06 20:24:05","4","5804","<p>How do open a remote Video file URL from a button click to play in the internal MediaPlayer without having to open a browser window?</p><p>The video plays fine, but it always opens a browser window 1st which is annoying. </p><p>This is what i am using already, but is it possible to launch the mediaplayer without the app opening a browser window first.</p><p>Hope someone can help</p><p>ThanksLucy</p><pre><code>final Button button = (Button) findViewById(R.id.play);       button.setOnClickListener(new Button.OnClickListener() {           public void onClick(View v) {               // Perform action on click              Uri uri = Uri.parse(""http://domain.com/videofile.mp4"");             Intent intent = new Intent(Intent.ACTION_VIEW, uri);             startActivity(intent);            }     });   }  </code></pre>","551784","","","","","2012-07-22 18:00:28","Android Help: How do open a remote Video file URL to play in MediaPlayer without having to open a browser window?","<android><media-player>","2","0","1","",""
"4619479","1","4619777","","2011-01-06 20:25:01","7","3502","<p>I want to list out the activity intent filters for the packages installed on my phone. This is just for a learning experience, I want to understand what apps can be started with implicit intents and how the intent filters are set up.</p><p>Google provides a table for the applications they provide at <a href=""http://developer.android.com/guide/appendix/g-app-intents.html"">http://developer.android.com/guide/appendix/g-app-intents.html</a>. I’m looking to create a similar list for other applications.</p><p>Can I use the PackageManager and dig this info up in code? Does anyone know of an existing app that can do this? Can anyone point me to an existing example to do what I want?</p><p>Sorry if this is a duplicate of similar questions like <a href=""http://stackoverflow.com/questions/3011454/listing-an-applications-activity-and-intent-filters"">Listing an application's activity and intent-filters?</a> and <a href=""http://stackoverflow.com/questions/4094109/android-how-to-i-get-a-list-of-all-available-intent-filters"">Android -- How to I get a list of all available intent filters ? </a> </p>","90236","","","","","2012-06-21 01:12:20","List intent filters for installed packages","<android><android-intent>","3","0","2","",""
"4619563","1","4855315","","2011-01-06 20:35:57","23","15128","<p>So I have extended VideoView's onMeasure to scale up the video to fit inside a fullscreen view.</p><p>here is how:</p><pre><code>public void setVideoAspect(int w,int h){    wVideo=w;    hVideo=h;    onMeasure(w, h);} @Override protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {     super.onMeasure(widthMeasureSpec, heightMeasureSpec);     if(wVideo!=0 &amp;&amp; hVideo!=0)     setMeasuredDimension(wVideo,hVideo); }</code></pre><p>I call setVideoAspect() with the display metrics (width, hight) of the screen.  The problem is that this method stretches the video to fit inside the screen. I want to be able to keep the aspect ratio. (I have 4:3 video and 3:2 screen size.)  I used the folowing code to give the retained ratio measurements to the view:</p><pre><code>int height =  (int) (metrics.widthPixels*3/(float)4);                        int width=  metrics.widthPixels;                           mVideoView.setVideoAspect(width,height);</code></pre><p>So this does the job but there is an issue: it gives me a 4:3 video with the width of the screen and scales the height correctly, but it doesn't center the video. (It just crops the bottom part of the video instead of the top and the bottom equally.) I have a relative layout containing the VideoView with the gravity of the VideoView set to center.</p>","448192","","25507","","2011-01-06 21:02:00","2013-11-29 11:35:35","Position Video Inside a VideoView","<android><layout><videoview>","3","0","11","",""
"4619724","1","4619772","","2011-01-06 20:51:36","0","860","<p>I have a Login Activity which stores credentials in its own SharedPreferences; then I added two getters for reading them, something like</p><pre><code>public String getUsername() {  return getPreferences(MODE_PRIVATE).getString(""#username"", null);}</code></pre><p>but this throws a NPE when I call it like this</p><pre><code>String mUser = (new Login()).getUsername();</code></pre><p>It seems that the Activity cannot read its preferences after a simple contructor call, as if it were in some uncompleted state. I read lots of related topics, but wasn't able to find a solution. Basically, I need to share these credentials among activities in my application</p>","315306","","38206","","2011-01-06 20:58:23","2011-01-06 20:58:23","Accessing another Activity's preferences","<android><android-preferences>","1","0","","",""
"4619746","1","","","2011-01-06 20:54:26","4","8892","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4963773/anyone-know-what-this-error-mean-for-android-tabs"">Anyone know what this error mean for android tabs?</a>  </p></blockquote><p>I have been trying to do the TabHost tutorial in the SDK but for some reason, is appears to break. On Step 4 I copy and paste the xml code, I get an error that prevents it from inflating properly. the error is:</p><pre><code> Error in an XML file: aborting build.</code></pre><p>This is in the graphical layout of the xml file. </p><pre><code>Error during post inflation process:TabHost requires a TabWidget with id ""android:id/tabs"",View found with id ""tabs"" is 'com.android.layoutlib.bridge.MockView'</code></pre><p>The xml file Itself has this in 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: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>Am I doing something wrong? </p>","566030","","1228","","2013-08-08 16:18:17","2013-08-08 16:18:17","Tabhost tutorial broken?","<android><xml><tabs><android-tabhost>","4","3","1","2012-07-16 17:26:11",""
"4619818","1","4624635","","2011-01-06 21:01:22","4","3803","<p>I was wondering whether it is possible to capture audio data from other sources like the system out, FM radio, bluetooth headset, etc. I'm particularly interested in capturing audio from the FM radio and already investigated all possibilities including trying to sniff the raw bluetooth communication between the phone and the radio device with no luck. It's too bad Android only allows recording audio from the MIC.</p><p>I've looked at the Android source code and couldn't find a backdoor to allow me to do that without rooting the device. Do you, at least, have any idea how to use other devices (maybe access somehow <strong>/dev/audio</strong>) say via NDK or even better - Java (maybe Reflection?) to trick the system to capture the audio stream from say, the FM radio. (in my case I'm trying to develop the app for the HTC Desire)</p><p>PS. And for those of you who are against using undocumented APIs, please don't post here - I'm writing an app that will be for my personal use or even if I ever publish it I will warn the user of possible incompatibilities.</p>","369531","","","","","2012-06-09 17:24:46","Record audio from various internal devices in Android (via undocumented API)","<audio><android-ndk><radio><android>","1","0","4","",""
"4619853","1","","","2011-01-06 21:05:16","3","4078","<p>I would like to make a TextView scrolling automatically but I did not succeed(as marquee in <a href=""http://www.csvt.qc.ca/patriotes/html/code_spec/xmpl_mrq.htm"" rel=""nofollow"">html</a>). Could you tell me how?</p><p>Best Regard</p>","566069","","","","","2011-03-29 00:37:51","Android - TextView scrolling","<android><textview>","2","0","1","",""
"4619899","1","4619943","","2011-01-06 21:11:08","207","67613","<p>What is the difference between a View's Margin and Padding?</p>","421372","","50776","","2013-03-07 13:20:09","2013-11-09 12:16:45","Difference between a View's Padding and Margin","<android><user-interface><view><padding><margin>","5","4","64","",""
"4619987","1","4630935","","2011-01-06 21:20:04","0","1146","<p>Hallo,</p><p>Anyone know how to specify 'special' or 'reserved' characters for a TextView object in the xml?</p><p>What I want to display in my text view is ?/? so I put:</p><pre><code>android:text=""?/?""</code></pre><p>but although this displays correctly in the eclipse 'Graphical Layout' of the xml file, it gives an error:</p><pre><code>error: Error: No resource found that matches the given name (at 'text' with value '?/?')</code></pre><p>I've tried using:</p><pre><code>""&amp;#63;&amp;#47;&amp;#63;""</code></pre><p>but the error is the same.</p><p>TIA,</p><ul><li>Frink</li></ul>","131209","","","","","2012-02-20 20:25:08","Specifying special/reserved characters in android textview xml","<android><xml><special-characters>","1","0","","",""
"4620001","1","","","2011-01-06 21:21:34","0","328","<p>When you long press Home button on Android device you get application switcher which partially covers screen.</p><p>The only way to detect it is listening on Activity.onWindowFocusChanged(boolean hasWindowFocus). The problem is that if your activity already lost focus, to same dialog for example, it will not be called again.</p><p>Application switcher does not behave as activity, since onPause() on current activity is never called.</p><p>If anybody knows how to detect long Home key press that will work as well.</p>","373760","","","","","2011-01-06 21:21:34","How to detect if application switcher is visible?","<android><home>","0","3","","",""
"4620031","1","4621759","","2011-01-06 21:24:51","0","719","<p>I made a listview with 3 columns by overriding the getView() method. I extended the class Arrayadaper for my own class and than used that for setListAdapter(Myclass). But i don't really understand how this works.. There is no for or while here. How does this go through every item in the list? How does setlistadaper and arrayadapter works? Where is the for or while? Int Position is one of the argument in the getview(), bet there is no loop. Can someone explain me please?</p><p>Class contenthandler goes also through an xml list? How it is possible without loop?</p>","566096","","","","","2011-01-07 11:37:50","How dos the setListAdapter(Arrayadaper) works for listView?","<android><class><listview><android-arrayadapter><listadapter>","1","0","","",""
"4620046","1","","","2011-01-06 21:25:51","1","413","<p>I would like to know if there is any way to turn off the screen on an android device on for example 19.00-22.00 every day. I have some tablets running in kiosk mode, and i want the screens to turn off when no one is using them and the store is closed.</p><p>Thanks</p>","557703","","","","","2011-01-08 14:08:01","Android 2.2: Turning of screen under certain times of the day by code","<android><screen>","1","0","1","",""
"4620134","1","","","2011-01-06 21:35:02","1","3446","<p>Does anybody know how to view the list of root certificates that an Android device supports?I would like to see that information.</p><p>I found that <code>/system/etc/security/carcerts.bks</code> contains the root certificates information,but I am not able to decode the contents using any available editors.</p><p>I have also tried KeyTool but couldn't succeed with that.</p><p>Please suggest how to decode this file's content.</p><p>Regards,</p><p>Durga</p>","566106","","1361399","","2013-02-13 18:49:14","2013-04-17 19:55:19","How to view the contents cacerts.bks (Certificate file /system/etc/security/carcerts.bks)","<android><root><client-certificates>","1","0","","",""
"4620154","1","8045313","","2011-01-06 21:36:59","5","994","<p>I want to monitor when someone moves to another place on the map in a <code>MapActivity</code> but I have no idea how to do that. Maybe some sort of OnMapChange() listener?</p>","355651","","","","","2013-06-21 20:17:12","Android MapActivity on map movement","<android><google-maps><mapactivity>","1","1","1","",""
"4620201","1","4620231","","2011-01-06 21:41:34","2","550","<p>When editing my strings.xml under res/values I can see them appearing in gen/my_package/R.java but they are static final int's, why is this? </p><p>-Why are they static final, presumably this means I couldn't update them, i.e. if I assign a string to a text box, can that string be updated from my code at some point to update the contents of the text box?</p><p>-Also why are these integers, specifically they appear to be hex values. If this is the preferable way of declaring these values, why don't we just declare them as hex values in the first place?</p>","560065","","210719","","2011-01-06 23:05:27","2011-01-06 23:05:27","Android: strings aren't strings, in strings.xml?","<android><string>","1","0","","",""
"4620353","1","","","2011-01-06 21:57:42","7","4527","<p>I am writing an Android App that has one main activity and one subactivity.  When I install the app on my phone to test it out, I get two icons instead of one.  The first icon is for the main activity and the second is for the subactivity.  I don't want/need an icon for the subactivity.  </p><p>Does anyone know how to turn this off in my app code, so that only the icon for the main activity is installed?  Any information you can provide is greatly appreciated!</p><p>Thanks,MobiKnow</p>","566132","","","","","2013-10-26 04:51:40","Android App Development: Two icons getting created and I only need one","<android><icons>","5","2","2","",""
"4620520","1","","","2011-01-06 22:14:40","0","200","<p>I have a very weird behaviour, which I cant find its cause.the last thing I do on onCreate() is to call a certain method.in that method i use<br><strong>progressDialog = ProgressDialog.show(this, null, ""Registering with Moish'd! server"", true, false);</strong>.<br>on the first run i get BadTokenException: Unable to add window on the <em>progressDialog</em> line.the second run it passes it.<br>I read in forums that if the activity is in the middle of ""finish"" process than it might cause such an excetion.<br>after a long debugging tests, i tried asking for isFinishing(). something odd accoured - before calling the method, <strong>isFinishing() returns false</strong>.in the first line of the method I ask again and now <strong>isFinishing() returns true</strong>. how can it be ?!?  in the last line before entering a method its not ""finishing"" and in the first line of the method its suddenly ""finishing"", when NOTHING is happening in between (certainly not calling finish()).  anyone ?!?</p>","566155","","","","","2011-01-07 00:19:07","enter ""finish"" state when not calling finish() causing BadTokenException","<android>","1","0","","",""
"4620525","1","4620589","","2011-01-06 22:14:55","0","851","<p>Desktop apps have top level menus (File, Edit, Search, ..., Help).</p><p>Web apps have very similar thing, menu tabs (Logo, Questions, Tags, Users, Badges, ...).</p><p>However I cannot find equivalent of top level menu in Android framework. Assume that my app has 5 main activities. According to <a href=""http://developer.android.com/guide/practices/ui_guidelines/menu_design.html"" rel=""nofollow"">menu design guidelines</a> options menu should contain actions related to current activity. So how an app should allow users to easily switch to one of five main activities.</p><p>It seems that different apps solve the problem in different ways. Some have a tab list at the top of the screen, some at the bottom. Even Google applications aren't consisted in that field. Google Listen has an options menu item called 'Listen Home', however Listen main activity has no that options menu item. Others have two icons in app luncher which start two different activities from one app.</p><p>I realize that due to small phone screens Android apps have to be designed in a slightly different way than web or desktop apps. But I have a feeling that the app top level menu topic was omitted in Android framework. And developers are on their own here. Or am I missing something?</p><p>Update: this is Google blueprint for a great app</p><p>Update2: this <a href=""http://code.google.com/p/iosched/"" rel=""nofollow"">an example app</a> of these patterns </p><p>Update3: <a href=""https://github.com/cyrilmottier/GreenDroid"" rel=""nofollow"">GreenDroid</a> library helps a lot implementing these patters in your apps. It seems that dashboard and action bar patterns are becoming quite popular. </p><p><img src=""http://i.stack.imgur.com/qZGw2.jpg"" alt=""alt text""></p>","3315","","3315","","2011-01-09 13:55:52","2011-01-09 13:55:52","Android equivalent of top level menu","<android><design-patterns><user-interface>","3","7","","",""
"4620533","1","4620875","","2011-01-06 22:15:34","0","1825","<p>I'm trying to create an animation which will slide a textview out to the left and slide in again from the right.  Essentially, this would be the same text effect used in the Stopwatch &amp; Timer app (sportstracklive is the developer).</p><p>I can use either of these animation sets exclusive of the other and it works fine, does exactly what I want.  But as soon as I try using them together, the TextView just blinks over the course about around 1 second.  Removing the startOffset works as expected.  Both animation sets run simultaneously.</p><p>Here's the XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;translate        android:fromXDelta=""0%""         android:toXDelta=""-25%""        android:fromYDelta=""0%""         android:toYDelta=""0%""        android:duration=""@android:integer/config_shortAnimTime""    /&gt;    &lt;alpha        android:interpolator=""@android:anim/decelerate_interpolator""        android:fromAlpha=""1.0""         android:toAlpha=""0.0""        android:duration=""@android:integer/config_shortAnimTime""    /&gt;    &lt;set&gt;        &lt;translate            android:fromXDelta=""25%""             android:toXDelta=""0%""            android:fromYDelta=""0%""             android:toYDelta=""0%""            android:startOffset=""@android:integer/config_shortAnimTime""            android:duration=""@android:integer/config_shortAnimTime""        /&gt;        &lt;alpha            android:interpolator=""@android:anim/decelerate_interpolator""            android:fromAlpha=""0.0""             android:toAlpha=""1.0""            android:startOffset=""@android:integer/config_shortAnimTime""            android:duration=""@android:integer/config_shortAnimTime""        /&gt;    &lt;/set&gt;&lt;/set&gt;</code></pre><p>And here's the lengthy Java code that runs it:</p><pre><code>    AnimationSet mSlideRightToLeft =         (AnimationSet) AnimationUtils.loadAnimation(this, R.anim.slide_right_to_left);    mMyTextView.startAnimation(mSlideRightToLeft);</code></pre>","110539","","","","","2011-01-07 02:41:04","Android animation startOffset makes the target view blink and not animate","<android>","1","1","","",""
"4620578","1","4620603","","2011-01-06 22:21:15","1","913","<p>I have and image (img1.png) in my drawable-hdpi folder, but im getting NullPointerException(?) when i use the following code. Did i miss something?</p><pre><code>int id = getResources().getIdentifier(""img1"", ""drawable"", getPackageName());      imgView.setImageResource(id); </code></pre><p>Thanks</p>","557703","","","","","2011-04-27 22:43:51","Android ImageView problem","<android><imageview>","4","0","","",""
"4620581","1","4621025","","2011-01-06 22:21:37","0","1431","<p>I am able to draw a Marker based upon a state (e.g. a field within my extended <code>OverlayItem</code> class) using the following code :</p><pre><code>@Overridepublic Drawable getMarker(int pStateBitset){  Drawable currentMarker = super.getMarker(pStateBitset);  Drawable[] toDrawLayers;  if (mSelected)  {    BitmapDrawable overlay = (BitmapDrawable) mSELECTED_OVERLAY;    overlay.setAntiAlias(true);    toDrawLayers = new Drawable[] { currentMarker, overlay };  }  else  {    toDrawLayers = new Drawable[] { currentMarker };  }  return new LayerDrawable(toDrawLayers);     }</code></pre><p>This works as expected (drawing a marker such as <img src=""http://i.stack.imgur.com/s6Gop.png"" alt=""Actual marker"">). The glow of the marker is the effect I wish to achieve. As per the code above, it is generated via two layered <code>Drawable</code>s, namely (for instance) <img src=""http://i.stack.imgur.com/ygg7a.png"" alt=""School Marker""> and <img src=""http://i.stack.imgur.com/khdFH.png"" alt=""Marker Overlay""> . </p><p>I had to ensure that the size of the glow is the same as the normal marker image, so that the resulting <code>Drawable</code> doesn't rescale (marker image size is 32x37 px).   </p><p>However, what I am aiming for is in fact a bigger glow (that would, indeed yield a bigger image), such as : <img src=""http://i.stack.imgur.com/mYdkl.png"" alt=""alt text""></p><p>How can I render a drawable which yields a bigger glow (thus using an image which is indeed bigger than the normal marker image) and does <em>not</em> result in a scaled / resized normal marker ? Is that feasable ?</p><p>Thanks in advance, I can provide any additional details if necessary.</p>","132735","","","","","2011-01-06 23:15:09","Change Marker icon depending on state correctly?","<android><google-maps>","1","0","","",""
"4620585","1","4620790","","2011-01-06 22:21:54","4","2047","<p>I'm writing a camera application that requires the same exposure regardless of ambient light.  Unfortunately, setExposureCompensation() only acts like an offset.  Can I turn off this auto adjustment, or is this more of a pre-user hardware correction?</p>","566160","","1085483","","2013-02-15 15:07:36","2013-02-15 15:07:36","Turning off auto-exposure compensation completely?","<android><android-camera>","2","0","2","",""
"4620586","1","4620697","","2011-01-06 22:22:10","1","887","<p>I need to pass some binary data between two android apps using Content Provider (sharedUserId is not an option).</p><p>I would prefer not to pass the data (a savegame stored as a file, small in size &lt; 20k) as a file (ie. overriding openFile()) since this would necessitate some complicated temp-file scheme to cope with concurrency with several content provider accesses and a running game.</p><p>I would like to read the file into memory under a mutex lock and then pass the binary array in the simplest way possible.How do I do this?</p><p>It seems creating a file in memory is not a possibility due to the return type of openFile().</p><p>query() needs to return a Cursor. Using MatrixCursor is not possible since it applies toString() to all stored objects when reading it.</p><p>What do I need to do? Implement a custom Cursor? This class has 30 abstract methods.Do I read the file, put it in a SQLite db and return the cursor?</p><p>The complexity of this seemingly simple task is mindboggling.</p>","17424","","","","","2011-01-06 22:52:48","How to pass binary data between two apps using Content Provider?","<android><binary-data><android-contentprovider>","2","2","","",""
"4620624","1","4620652","","2011-01-06 22:25:37","3","836","<p>i have an application where i order make a query to my database with an ORDER BY clause, it will order them in alphabetical order. i only have one small problem, it happens fairly often that one of the strings that the query is ordering by contains nothing (string="""") when sorting in alphabetical order these get populated at the top of the list infront om a,b,c... i plain and simple dont want this. after a lot of googling i found on an oracle forum that i should change the SORT BY part of the query to ""SORT BY xxx ASC NULLS LAST"" this caused a fatal error when querying.</p><p>how shall i go by fixing this seemingly small issue?</p><p>here is my query statement as is today.</p><p><code>public Cursor fetchAllDatesByTag() {return mdiktationsDb.rawQuery(""SELECT "" + KEY_DATEID + "","" +"" "" + KEY_DATE + "","" + "" "" + KEY_TIME + "","" + "" "" + KEY_DICTTAG + "","" + "" "" + KEY_DICTLISTIMAGE + "" FROM "" + DATABASE_TABLE + "" ORDER BY "" + KEY_DICTTAG + "" ASC"", null);}</code></p>","566165","","","","","2012-06-09 11:08:09","Sorting null-data last in database query","<sql><android>","3","3","","",""
"4620872","1","","","2011-01-06 22:55:44","4","1218","<p>I'm trying to figure out how to transfer frames rendered on a computer to an android phone. Wifi and Bluetooth aren't fast enough for a smooth framerate, but the data transfer speed across the USB connector is more than enough (up to 480 megabytes/ second). Thing is, I can't figure out how to do it- there's nothing in the Android docs and I haven't found anything online. How can I access the USB connection?</p>","566195","","","","","2011-01-26 18:33:33","Live data transfer over USB","<android><usb><data-transfer>","3","0","","",""
"4620983","1","","","2011-01-06 23:09:27","7","14481","<p>Im using the following code to keep the screen on:</p><pre><code>this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);</code></pre><p>Is there any way to disable/remove the <code>FLAG_KEEP_SCREEN_ON</code> later in the code? (I want the screen to fadeout normally).</p><p>Thanks!</p>","557703","","","","","2014-02-23 05:39:51","Android: WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON question","<android><flags>","2","0","3","",""
"4621050","1","7250723","","2011-01-06 23:19:13","4","568","<p>is it possible to listen for incoming SMS messages received via Google Voice?</p><p>Thanks.</p>","354607","","907685","","2011-12-29 08:38:07","2011-12-29 08:38:07","Android & Google Voice - Listening for incoming SMS messages","<android><sms><google-voice>","2","0","","",""
"4621067","1","","","2011-01-06 23:20:58","28","1117","<p>My question is: How can I update the display of the action button of the soft keyboard on the fly? </p><p>Another post seems to be about changing the editor action BEFORE the keyboard is shown: <a href=""http://stackoverflow.com/questions/1538331/android-cant-figure-how-to-use-setimeactionlabel"">Android: Can&#39;t figure how to use setImeActionLabel</a>. I would like to change the soft keyboard action button WHILE it is shown. </p><p>I have partially succeeded:- I can change the action by using: editText.setImeOptions(EditorInfo.IME_ACTION_GO);- I can also redraw the keyboard using: InputMethodManager.restartInput(editText); I do this using TextWatcher.afterTextChanged. - However, I have a problem with this. If I press a key, on top of that the keyboard shows which key has been pressed. But when I call restartInput(...), this also hides the view that shows which key has been pressed. This seems normal behaviour to me, but I need a way around it. </p><p>Extending EditText and overriding onKeyUp is not a good idea, see: <a href=""https://groups.google.com/forum/?fromgroups#!topic/android-developers/RIxGfx5qOjM"">https://groups.google.com/forum/?fromgroups#!topic/android-developers/RIxGfx5qOjM</a>.</p><p>The KeyboardView class has exactly what I need (invalidateKey), but I think that is only accessible when you create your own input method.  </p><p>Anybody else have some better ideas? </p>","313105","","508666","","2012-01-29 12:59:03","2012-11-08 20:08:59","How can I update the editor action button display on the fly?","<android><keyboard><key><action>","3","1","1","",""
"4621107","1","","","2011-01-06 23:26:57","2","1911","<p>I have found good examples on how to call the native Android camera app using an intent, and I know you can set the app to take black and white photos using the UI, but I couldn't find a way to take a BW photo using the intent. Is there a way?</p>","399741","","","","","2011-01-06 23:57:20","Capture black and white photo from native Android Camera App","<android><camera>","1","0","","",""
"4621145","1","4621446","","2011-01-06 23:32:19","0","2116","<p>What I want to create is a popup style application.</p><p>I have a service in the background - something arrives on the queue and i want an activity to start to inform the user - very very similar to the functionality of SMSPopup app.</p><p>So I have the code where something arrives on the queue and it calls my activity.</p><p>However for some reason the activity always shows on top of the originally started activity instead of just appearing on the main desktop of the android device.</p><p>As an example:</p><p>I have the main activity which is shown when the application is run</p><p>I have the service which checks queue</p><p>I have a popup activity.</p><p>When i start the main activity it starts the service - I can now close this.</p><p>I then have something on the queue and it creates the popup activity which launches the main activity with the popup on top of it :S How do I stop this and have it behave as i want...</p><p>The popup class is :</p><pre><code>public class SMSPopup extends Activity implements OnClickListener{ public static String msg; @Override public void onCreate(Bundle bundle){  super.onCreate(bundle); // Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();  this.setContentView(R.layout.popup);  TextView tv = (TextView)findViewById(R.id.txtLbl);  Intent intent = getIntent();  if (intent != null){      Bundle bb = intent.getExtras();      if (bb != null){          msg = bb.getString(""com.andy.tabletsms.message"");      }  }  if(msg == null){   msg = ""LOLOLOL"";  }  tv.setText(msg);  Button b = (Button)findViewById(R.id.closeBtn);  b.setOnClickListener(this); } @Override public void onClick(View v) {  this.finish(); }}</code></pre><p>and I call the activity from a broadcast receiver which checks the queue every 30 seconds or so :</p><pre><code>  if(main.msgs.size()>0){      Intent testActivityIntent = new Intent(context.getApplicationContext(), com.andy.tabletsms.work.SMSPopup.class);    testActivityIntent.putExtra(""com.andy.tabletsms.message"", main.msgs.get(0));    testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    context.startActivity(testActivityIntent);      }</code></pre><p>The layout is here : <a href=""http://pastebin.com/F25u6wdM"" rel=""nofollow"">http://pastebin.com/F25u6wdM</a></p>","265683","","1265724","","2013-01-22 09:35:22","2013-01-22 09:35:22","Android popup style activity which sits on top of any other apps","<java><android><android-layout>","1","3","","",""
"4621184","1","4621318","","2011-01-06 23:41:33","0","593","<p>Im using the following code in my android app to get the current time</p><pre><code>SimpleDateFormat dateFormatLocal = new SimpleDateFormat(""yyyy-MMM-dd HH:mm:ss"");    String time =  dateFormatLocal.format(new Date());</code></pre><p>I would like to know if theres an easy way to check timespans, for example if the clock is between 19:00 and 21:00. Thanks</p>","557703","","","","","2011-01-07 00:12:05","Android/Java: Time calculations","<java><android><time>","2","0","","",""
"4621221","1","4621451","","2011-01-06 23:46:01","1","680","<p>Can someone point me to right direction, how to create an adapter for AutoCompleteTextView, which would be getting data from JSON file on the intenet, using data, which user entered into the text field? I want to use the user-entered data to filter suggestions for autocompletion. I imagine that adapter should always take user-entered data as soon as changes appears and use it for fetching suggestions on-the-fly. Is that possible? So far I've seen many tutorials for autocompletion where static String arrays were used, but never seen them build dynamically. Is it possible to do it automatically or I need always fetch String array myself and pass as ArrayList to adapter on every AutoCompleteTextView change?</p>","508377","","","","","2011-01-07 00:30:03","Autocomplete list from JSON file with criteria","<android><json><authentication>","1","0","","",""
"4621265","1","","","2011-01-06 23:53:14","0","526","<p>I've a question regarding Android's Calendar event. </p><p>What key can I use to identify an event If it is sync-ed into 2 different phones from the same calendar (Google calendar for example..)? </p><p>I'm building an application for my project, so far it can create,update,delete a calendar event generated by the application, however, the method I use to identify it is by</p><p>searching for a keyword in the description with the start and end time. I figured this is not the perfect solution as problem may arise if people change the description content.</p><p>Any hint or tips will be appreciated. </p><p>Thank you</p>","566235","","21234","","2011-01-07 00:15:02","2011-03-01 03:20:20","Android Calendar Event - key to identify an event","<android><calendar>","2","1","1","",""
"4621316","1","4621351","","2011-01-07 00:02:41","5","1669","<p>I have a been working on a game for Android and debugging it on my N1.  The performance was patchy at first.  I then worked on cleaning up all allocations to prevent garbage collection.  This greatly improved things,  but I still saw some garbage collections occurring that caused very brief pauses in the animation.</p><p>After pulling my hair out for a while, I then noticed the process IDs that were doing garbage collection (GC_FOR_MALLOC) were not my process id.  The Process Ids belonged to ""Android System"" and android.process.acore (determined by using ""Android System Info"" app from the market).  The acore process was tied to a desktop widget called digital clock.  I uninstalled the widget and nearly made it through the entire game without any pauses.  There was one very brief pause for GC for ""Android System"".</p><p>Sorry for the long explanation, but now for my questions:</p><ol><li>How is it that other games don't occasionally have pauses due to the system process's GC (something out of the developer's control)?</li><li>Along the lines of the first question, how can I deal with a different application causing GC that slows my process down and causes hiccups in my game?</li></ol><p>I just feel like there is something I am missing since other games don't have this problem.</p><p>Thanks</p>","336681","","","","","2011-01-10 17:47:02","Android Game Development and Garbage Collection","<android><garbage-collection>","2","2","3","",""
"4621369","1","4621397","","2011-01-07 00:13:22","1","5641","<p>I'm making my own content-provider. In the documentation for the content-provider it says the methods like query, insert, and update need to be thread safe. So should I guard them with a mutex like so?</p><pre><code>private static Mutex cpMutex;public Cursor query(){  cpMutex.lock();  //do stuff  cpMutex.unlock();  return result;}public Uri insert(){  cpMutex.lock();  //do stuff  cpMutex.unlock();  return result;}</code></pre>","527288","","527288","","2011-01-07 00:15:20","2011-01-07 00:19:03","Do I need to use a mutex in Android Content-Provider methods?","<android><thread-safety><mutex><android-contentprovider>","2","0","","",""
"4621421","1","","","2011-01-07 00:21:52","1","815","<p>Anyone knows how to do that. Unlike youtube, there is no SEND intent coming form the the facebook android app.</p>","102092","","","","","2011-01-07 00:45:59","Uploading a video to facebook from an android phone","<android><facebook>","1","1","","",""
"4621439","1","5614987","","2011-01-07 00:25:36","3","14422","<p>I am using both onClickListener and onLongClickListener for a TextView in ListView. I see that in Android 1.6, longClick Listener is fired along with the on Click Listener. I mean both are fired when I long click. But this is not the case in the future versions. Is there any fix for this.</p><pre><code>    @Override     public View getView(int position, View convertView, ViewGroup parent){    if(convertView == null){    LayoutInflater inflater = getLayoutInflater();    row = inflater.inflate(R.layout.row, parent, false);   }    TextView tv= (TextView)row.findViewById(R.id.tv);    tv.setOnClickListener(new View.OnClickListener(){        @Override    public void onClick(View view) {     showMessage();    }       });    tv.setOnLongClickListener(new View.OnLongClickListener(){    @Override     public boolean onLongClick(View v) {  showLongMessage();    }        }</code></pre>","563306","","563306","","2011-01-07 00:33:21","2013-12-08 09:04:32","Use both onClickListener and onLongClickListener in listview Android 1.6","<android><listview><onlongclicklistener>","3","7","1","",""
"4621490","1","","","2011-01-07 00:37:32","2","7483","<pre><code>    public void SetBright(float value) {    Window mywindow = getWindow();    WindowManager.LayoutParams lp = mywindow.getAttributes();            lp.screenBrightness = value;            mywindow.setAttributes(lp);}</code></pre><p>I want to adjust the screen brightness. But nothing happens when i try using this method. Could it be because i use the KEEP_SCREEN_ON flag?</p>","557703","","","","","2012-10-17 16:00:12","Android 2.2: Adjusting screen brightness","<android><screen><brightness>","2","0","","",""
"4621580","1","5176535","","2011-01-07 00:58:41","15","39935","<p>I want to send signals via serial port using the JavaComm API classes on an Android device, and here is how I imagine it:</p><p>1- the Android device would be: Archos 3.2 which has android 2.2 and USB host mode.</p><p>2- include RxTx lib package with my Android app. and include RxTx native code using Android NDK.</p><p>3- a short cable which is usb-->serial.</p><p>Could you explain to me where I might face problems? </p>","566271","","1210260","","2012-06-14 19:53:49","2013-05-29 09:10:44","using serial port RS-232 in android?","<java><android><embedded><serial-port><communication>","8","0","8","",""
"4621655","1","","","2011-01-07 01:10:47","0","778","<p>i'm trying to create a new file in Android following some Java tutorial for sending files.</p><p>The problem is when i do this</p><pre><code>FileOutputStream wr = new FileOutputStream(new File(filename));</code></pre><p>It's launches me an IOexception  but i can't get what's wrong. Do i need to get a permition to create files??</p><p>Any ideas??</p><p>Thank you</p>","611363","","","","","2011-01-07 01:15:38","Creating Files in Android","<java><android><file>","0","2","","",""
"4621675","1","4621735","","2011-01-07 01:14:51","5","4059","<p>I have a custom listview made up of an ImageView and a TextView. Clicking works fine however it won't highlight the item like a normal ListView would. How would I add a highlight? I tried to rig it by setting the background color on click and then adding a timer to remove the background color. That worked but I want a better solution. Any ideas?</p>","114650","","","","","2013-05-04 04:24:48","Custom ListView not highlighting ListViewItem on click","<android><listview><android-layout><listviewitem>","2","1","1","",""
"4621786","1","","","2011-01-07 01:38:24","8","467","<p>I've got a problem when updating my widget manually via AppWidgetManager.updateAppWidget.Platform is Android 2.2.</p><p><strong>Here's the code:</strong><br>I declared the widget additionally to an existing Activity in the Manifest:</p><pre><code>&lt;receiver android:name="".Widget"" 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/widget"" /&gt;&lt;/receiver&gt;</code></pre><p>The widget-class was declared in Widget.java:</p><pre><code>public class Widget extends AppWidgetProvider {@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {    int use_static_ip;    RemoteViews remoteViews;    try {        use_static_ip = Settings.System.getInt(context.getContentResolver(), Settings.System.WIFI_USE_STATIC_IP);        if (use_static_ip == 0) { //DHCP            remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_dhcp);        } else { //static IP            remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_static);        }        Intent call_activity = new Intent(context, StaticIPToggle.class);        PendingIntent pending_call_activity = PendingIntent.getActivity(context, 0, call_activity, 0);        remoteViews.setOnClickPendingIntent(R.id.widget_icon, pending_call_activity);        appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);    } catch (SettingNotFoundException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }}}</code></pre><p>In the existing activity I added some lines to manually update the widget:</p><pre><code>        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getApplicationContext());        ComponentName componentName = new ComponentName(getApplicationContext(), Widget.class);        int[] ids = appWidgetManager.getAppWidgetIds(componentName);        Intent update_widget = new Intent();        update_widget.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);        update_widget.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);        getApplicationContext().sendBroadcast(update_widget);</code></pre><p>But now I have this bug:If the widget is onClicked, it shows the energy-settings-widget for a short period (~0,5sec-1sec) before the desired widget is shown.</p><p>Here a screenshot of this issue (sequence from left to right): <a href=""http://i.stack.imgur.com/rHkjw.jpg"">http://i.stack.imgur.com/rHkjw.jpg</a></p><p>First there's the widget as in the left picture, then changes to the middle picture and either stays there or changes to the right picture after ~0,5-1sec.</p><p>Unfortunately I can't see any mistake in the code, do you?</p><p>Hopefully you can help me to fix this problem ;)Thanks in advance,regards, Oli</p>","522623","","","","","2013-08-30 13:22:34","Power control widget shown for a short moment when updating my own widget via AppWidgetManager, what's the problem?","<android><control><widget>","2","2","3","",""
"4621881","1","","","2011-01-07 01:56:21","0","1410","<p>In my current app I use a couple of endless lists fed by web-request. For some reasons I'd like to switch to endless grids but I failed.</p><p>Can anyone provide me a tip (link to a tutorial, short example etc.).</p><p>P.S.: Here is some code what I have tried. Grid is shown with 96 fields, setValue is trigered but visible list does not grow :(</p><pre><code>public class FcShowPhotos extends Activity {FcPhotoAdapter fcPhotoAdapter = new FcPhotoAdapter();protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    FcPhotoAdapter fcPhotoAdapter = new FcPhotoAdapter();    fcPhotoAdapter.setValue(96);    GridView gridview = (GridView) findViewById(R.id.gridview);    gridview.setAdapter(fcPhotoAdapter);    gridview.setOnScrollListener(new EndlessListListener());}class EndlessListListener implements OnScrollListener {    public void onScroll(AbsListView view, int firstVisible, int visibleCount, int totalCount) {        boolean loadMore = /* maybe add a padding */        firstVisible + visibleCount &gt;= totalCount;        if (loadMore) {            fcPhotoAdapter.setValue(96);        }    }    @Override    public void onScrollStateChanged(AbsListView view, int scrollState) {        // TODO Auto-generated method stub    }}class FcPhotoAdapter extends BaseAdapter {    int count = 0; /* starting amount */    ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();    public int getCount() {        return count;    }    public void setValue(int increase) {        Log.d(""FcPhotoAdapter"", ""Notified"");        for (int i = 1; i &lt;= increase; i++) {            list.add(String.valueOf(i + count));        }        count += increase;    }    public Object getItem(int pos) {        return pos;    }    public long getItemId(int pos) {        return pos;    }    public View getView(int pos, View v, ViewGroup p) {        TextView view = new TextView(FcShowPhotos.this);        view.setText(list.get(pos));        Log.d(""FcPhotoAdapter"", list.get(pos));        return view;    }}</code></pre><p>}</p><p>The main.xml is simple and stupid:</p><pre><code>&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/gridview""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:columnWidth=""90dp""android:numColumns=""auto_fit""android:verticalSpacing=""10dp""android:horizontalSpacing=""10dp""android:stretchMode=""columnWidth""android:gravity=""center""/&gt;</code></pre>","545516","","321731","","2014-02-08 15:03:50","2014-02-08 15:03:50","How to create an endless gridview","<android><gridview>","0","2","","",""
"4621883","1","","","2011-01-07 01:56:48","1","276","<p>holder.text.setText(DATA[position]);            holder.icon.setImageBitmap((position &amp;1) == 1 ? mIcon1 : mIcon2);</p><pre><code>        return convertView;    }</code></pre><p>How can I add more Images as this list view only displays 2 images. I see the above code only allows 2 images to be added in that order. I want to add more images.</p><p>Please help, thank you.</p>","566316","","513838","","2011-01-07 02:17:45","2011-03-17 11:29:46","android list view image addition","<android><android-layout>","1","2","","",""
"4621911","1","4623197","","2011-01-07 02:02:54","0","548","<p>I am developing a chatting/messaging app and I want to let the user select an image that they've stored online (i.e. picasa, photobucket, flickr, etc) which will be shown as part of the chat User Interface for anyone that is chatting with the user.</p><p><strong>For example:</strong></p><ul><li><p>User_A is messaging/chatting withUser_B.</p></li><li><p>User_B will see a small thumbnailimage of User_A</p></li><li><p>User_A will see a small thumbnail ofUser_B.</p><p>note: my web server is facilitating the text exchange between the two users.</p></li></ul><p>At first I thought I would implement a photo upload function in my app and store the photo's on my server that each client would download. But then I realized that this is just re-inventing the wheel because there are now a lot of online picture sharing services.So I want my server to simply store the URL of the images that User_A and User_B have selected - my app is notified of the URL's and downloads the pictures.</p><p>However, how is this implemented ? (Specifically, the image selection to obtain the URL in a userfriendly manner)</p><p>I've visualized the following userfriendly use-case...</p><ul><li><p>user opens the options activity in myapp and pushes the button to selectan image to present in the chat UI.</p></li><li><p>an intent dialog is shown with all ofthe possible image hosting servicesinstalled on the mobile phone(picasa, photobucket, etc) - butlocal storage shall not be shown.</p></li><li><p>the image picker of the chosenapplication is shown and the userchooses the image.</p></li><li><p>the image picker closes and returnsthe URL to my app.</p></li></ul><p>If this can't be implemented, then my only alternative (that I know of) is to have users copy'n'paste the URL of the image they want to use - which is not userfriendly on mobile devices.</p><p>Any help is greatly appreciated.</p>","550471","","244296","","2011-01-07 02:13:46","2011-01-07 06:55:38","Need to implement an image selection dialog of web-based images","<android><select><android-intent><image>","1","2","","",""
"4621977","1","4622333","","2011-01-07 02:20:35","2","441","<p>I have an Android widget that needs internet access, fine and coarse permissions only. However, when I install the apk file, it says it also needs access to read the phone state and identity, and access to storage. It doesn't need access to either, and the only permissions that are in the mainfest are:</p><pre><code>&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;</code></pre><p>Any ideas on why this is happening? Thanks for the help.</p>","562697","","","","","2011-01-07 03:44:00","Android asking for unneeded permissions","<android><permissions><widget>","1","1","1","",""
"4622052","1","4622254","","2011-01-07 02:36:50","1","5380","<p>May anyone tell me the minimum hardware requirement for an embedded board to run Android 2.2. I have s3c2440 FriendlyARM board, I searched and found that it even cannot run Android 1.5 smoothly. Any suggestions are appreciated, Thank in advance. </p>","560431","","","","","2011-08-12 18:33:10","android 2.2 minimum hardware requirement","<android><embedded>","2","0","1","",""
"4622131","1","4622282","","2011-01-07 02:56:48","1","2277","<p>these are my codes to open GPS </p><p><code>LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);locationManager.setTestProviderEnabled(""gps"", true);</code></p><p>and the permission in my xml</p><p><code>&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_MOCK_LOCATION""/&gt;</code></p><p>but the apps crashed.</p><p><code>01-07 10:41:35.104: ERROR/AndroidRuntime(1823): java.lang.SecurityException: Requires ACCESS_MOCK_LOCATION secure setting01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.os.Parcel.readException(Parcel.java:1218)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.os.Parcel.readException(Parcel.java:1206)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.location.ILocationManager$Stub$Proxy.setTestProviderEnabled(ILocationManager.java:952)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.location.LocationManager.setTestProviderEnabled(LocationManager.java:1054)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.hisoft.battery.MainActivity.connGPS(MainActivity.java:118)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.hisoft.battery.MainActivity.access$2(MainActivity.java:114)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.hisoft.battery.MainActivity$2.onClick(MainActivity.java:62)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.View.performClick(View.java:2364)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.View.onTouchEvent(View.java:4179)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.widget.TextView.onTouchEvent(TextView.java:6607)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.View.dispatchTouchEvent(View.java:3709)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:883)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.os.Handler.dispatchMessage(Handler.java:99)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.os.Looper.loop(Looper.java:123)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at java.lang.reflect.Method.invokeNative(Native Method)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at java.lang.reflect.Method.invoke(Method.java:521)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-07 10:41:35.104: ERROR/AndroidRuntime(1823):     at dalvik.system.NativeStart.main(Native Method)</code></p><p>who knows why?</p>","549576","","","","","2011-05-19 04:14:13","how to open GPS","<android>","1","0","","",""
"4622277","1","4622520","","2011-01-07 03:30:09","1","535","<p>I encrypt, then decrypt an image that I then pass to my image util for resizing, (code graciously borrowed from somewhere) like so:</p><pre><code>public static Bitmap loadResizedBitmap(InputStream dis, int width, int height) {    BufferedInputStream bis = new BufferedInputStream(dis);    Bitmap bitmap = null;    BitmapFactory.Options options = new BitmapFactory.Options();    options.inJustDecodeBounds = true;    BitmapFactory.decodeStream(bis, null, options);    if (options.outHeight &gt; 0 &amp;&amp; options.outWidth &gt; 0) {        options.inJustDecodeBounds = false;        options.inSampleSize = 2;        while (options.outWidth / options.inSampleSize &gt; width &amp;&amp;                 options.outHeight / options.inSampleSize &gt; height) {            options.inSampleSize++;        }        options.inSampleSize--;        bitmap = BitmapFactory.decodeStream(bis, null, options);    }    return bitmap;}</code></pre><p>The issue is during the second <strong>decodeStream</strong>, the BitmapFactory returns <strong>null</strong>. I have verified the first one works, and outputs the correct size, etc. My guess is that CipherInputStream does not support mark and reset, so I wrapped it in a BufferedInputStream with no luck. Does anyone else have any suggestions?</p>","232240","","232240","","2011-01-07 04:29:00","2011-01-07 14:49:37","BitmapFactory cannot decode a CipherInputStream twice","<android><image><encryption>","1","0","0","",""
"4622306","1","","","2011-01-07 03:38:09","0","1365","<p>I want my application to call out from the phone. I already have it so that it will call out using ACTION_CALL. It brings up the the screen that makes the call. I want to know how to over ride that screen so when it calls out instead of showing that the application goes straight to the home screen, or even shows that screen for a split second or so then goes to the home screen.</p>","424421","","","","","2013-12-13 16:52:12","Making calls in background?","<android><methods><screen>","1","3","","",""
"4622367","1","","","2011-01-07 03:52:57","0","178","<p>I have a listview. which is mase by custome control..and custome control class extends baseadapter class.one of my custome control is button..so onclick of that particular button I have to find position of row..pleas tell me howz it possible</p>","566398","","","","","2011-01-07 04:59:27","custome control event in list view android","<android>","1","1","","",""
"4622464","1","9118682","","2011-01-07 04:17:23","1","1964","<p>I just crop the image to get part of it. But Android set the returned image as the wallpaper. Why? I track the android code, and in Gallery3D application(com.cooliris), I found this:</p><pre><code>    // TODO: A temporary file is NOT necessary    // The CropImage intent should be able to set the wallpaper directly    // without writing to a file, which we then need to read here to write    // it again as the final wallpaper, this is silly    mTempFile = getFileStreamPath(""temp-wallpaper"");    mTempFile.getParentFile().mkdirs();    int width = getWallpaperDesiredMinimumWidth();    int height = getWallpaperDesiredMinimumHeight();    intent.putExtra(""outputX"", width);    intent.putExtra(""outputY"", height);    intent.putExtra(""aspectX"", width);    intent.putExtra(""aspectY"", height);    intent.putExtra(""scale"", true);    intent.putExtra(""noFaceDetection"", true);    intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTempFile));    intent.putExtra(""outputFormat"", Bitmap.CompressFormat.PNG.name());    // TODO: we should have an extra called ""setWallpaper"" to ask CropImage    // to set the cropped image as a wallpaper directly. This means the    // SetWallpaperThread should be moved out of this class to CropImage</code></pre><p>Please focus on the last lines, The TODO. It tells that the crop intent will do the setting job. Well, I don't need it at all. So, HOW TO CROP AN IMAGE WITHOUT SETTING THE WALLPAPER? Thanks!</p>","414787","","95313","","2011-05-17 07:17:47","2012-02-02 19:30:33","android set the image I crop as wallpaper","<android><crop><wallpaper>","1","0","","",""
"4622517","1","4622525","","2011-01-07 04:29:22","15","38351","<p>I have a layout having the contact deatils of the phone. When i click the option menu i need make an edittext visible in that screen. I have done it. But there  is problem facing that the edit text height is occupied in the screen when its made invisible. How can i remove the space occupied by edit text, while its invisible in the screen(layout).. My code is given below</p><p>My xml is: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:paddingLeft=""10dp""android:paddingRight=""10dp""&gt;    &lt;ListView android:id=""@id/android:list"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:layout_weight=""1""    android:drawSelectorOnTop=""false""&gt;&lt;/ListView&gt;&lt;TextView android:id=""@id/android:empty"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:text=""No Entries available""&gt;&lt;/TextView&gt;&lt;TableRow android:id=""@+id/TableRow001""android:layout_width=""wrap_content"" android:background=""#C0C0C0"" android:layout_height=""wrap_content""&gt;        &lt;EditText android:id=""@+id/NumberEditText01""                                android:layout_width=""wrap_content""    android:paddingLeft=""20dip""     android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;Button android:layout_width=""wrap_content"" android:id=""@+id/callNow01""    android:layout_height=""wrap_content""   android:text=""Call now""&gt;&lt;/Button&gt;&lt;/TableRow&gt;      &lt;/LinearLayout&gt;</code></pre><p>Class : Listcontacts</p><pre><code>    public class ListContacts extends ListActivity {          TableRow tableRow;          EditText phoneNumber;          Button callNow;            public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);// Associate the xml with the activitysetContentView(R.layout.activitylist);     tableRow =  (TableRow) findViewById(R.id.TableRow001);tableRow.setVisibility(View.INVISIBLE);phoneNumber = (EditText) findViewById(R.id.NumberEditText01);phoneNumber.setVisibility(View.INVISIBLE);phoneNumber.setKeyListener(DialerKeyListener.getInstance());callNow = (Button) findViewById(R.id.callNow01);callNow.setVisibility(View.INVISIBLE);   } @Override   public boolean onOptionsItemSelected(MenuItem item) {switch (item.getItemId()) {case FIRST:     tableRow.setVisibility(View.VISIBLE);     phoneNumber.setVisibility(View.VISIBLE);    callNow.setVisibility(View.VISIBLE);    break;}}}</code></pre>","548218","","548218","","2011-01-07 05:24:50","2011-01-07 05:24:50","Hide a EditText & make it visible by clicking a menu","<android>","1","0","2","",""
"4622639","1","","","2011-01-07 04:57:22","0","1741","<p>i'm trying to implement a json rpc server, so after searching i decided to use <a href=""http://code.google.com/p/libjsonrpc/"" rel=""nofollow"">libjsonrpc</a>.I need help to debug this error:</p><pre><code>org.json.JSONException: JSONObject[""jsonrpc""] not found</code></pre><p>This error is thrown when i try to remotely request a string from the server.The client i'm using is <a href=""http://code.google.com/p/android-json-rpc/wiki/GettingStarted"" rel=""nofollow"">android-json-rpc-client</a> on google code site.</p><p>any help is appreciated as i have searched the internet with no good results.Thanks.</p><p>EDIT: The client side code is :</p><pre><code>JSONRPCClient client = JSONRPCClient.create(""http://service/uri"");client.setConnectionTimeout(2000);client.setSoTimeout(2000);try {  String string = client.callString(""mymethod"");  double d = client.callDouble(""pow"", x, y);  int i = client.callInt(""add"", 56, 25); ...}catch (JSONRPCException e){  e.printStackTrace();}</code></pre><p>and the server side code is basically the same one found in <a href=""http://code.google.com/p/libjsonrpc/"" rel=""nofollow"">libjsonrpc</a>.</p><p>So the servlet code is:</p><pre><code>package lib.jsonrpc;import java.io.IOException;import java.util.logging.Level;import java.util.logging.Logger;import javax.servlet.ServletException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpServlet;public class RPCServlet extends HttpServlet {        /**         *          */        private static final long serialVersionUID = -5274024331393844879L;        private static final Logger log = Logger.getLogger(RPCServlet.class.getName());        protected RPCService service = new AccountServiceImpl();        public void doGet(HttpServletRequest request, HttpServletResponse response)                        throws IOException, ServletException {                response.setContentType(""text/html"");                response.getWriter().write(""rpc service "" + service.getServiceName() +  "" is running..."");        }        public void doPost(HttpServletRequest request, HttpServletResponse response)                        throws IOException, ServletException {                try {                        service.dispatch(request, response);                } catch (Throwable t) {                        log.log(Level.WARNING, t.getMessage(), t);                }        }}</code></pre><p>and the class that we want to access its methods remotely is :</p><pre><code>package lib.jsonrpc;import java.util.Date;// annotation tells this class can be used as parameter or return value of rpc methods@JSONObjpublic class Account{        // annotation tells this property needs to be serialized in a rpc invocation.        @JSONProperty        private String name;        @JSONProperty        private Long id;        @JSONProperty        private Integer age;        @JSONProperty        private Date birthday;        @JSONProperty        private Double balance;        @JSONProperty        private String nickName;        public String getName() {                return name;        }        public void setName(String name) {                this.name = name;        }        public Long getId() {                return id;        }        public void setId(Long id) {                this.id = id;        }        public Integer getAge() {                return age;        }        public void setAge(Integer age) {                this.age = age;        }        public Date getBirthday() {                return birthday;        }        public void setBirthday(Date birthday) {                this.birthday = birthday;        }        public Double getBalance() {                return balance;        }        public void setBalance(Double balance) {                this.balance = balance;        }        public String getNickName() {                return nickName;        }        public void setNickName(String nickName) {                this.nickName = nickName;        }        // for debug convinence        public String toString(){                StringBuffer sb = new StringBuffer();                sb.append(""Account:{"");                if (name != null)                        sb.append(""name:"" + name + "","");                if (id != null)                        sb.append(""id:"" + id + "","");                if (age != null)                        sb.append(""age:"" + age + "","");                if (birthday != null)                        sb.append(""birthday:"" + birthday + "","");                if (balance != null)                        sb.append(""balance:"" + balance + "","");                if (nickName != null)                        sb.append(""nickName:"" + nickName);                sb.append(""}"");                return sb.toString();        }}</code></pre>","566279","","566279","","2011-01-09 05:07:48","2011-01-09 05:07:48","org.json.JSONException: JSONObject[""jsonrpc""] not found","<android><json><rpc><json-rpc>","0","2","","",""
"4622666","1","5039858","","2011-01-07 05:04:53","1","2522","<p>I am trying to add addwhirl in my app but I doesnt show up any ads, I am doing following things</p><p>Manifest.xml</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt; &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre><p>Layout.xml</p><pre><code>&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/com.liverpool.activities""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=""wrap_content""    android:id=""@+id/layout_ad"" /&gt;</code></pre><p>in code I am doing following</p><pre><code>try    {        AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR });        LinearLayout layout = (LinearLayout) findViewById(R.id.layout_ad);        AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, ""SDK key from adwhirl"");        Display d = this.getWindowManager().getDefaultDisplay();        RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(d.getWidth(), 72);        layout.addView(adWhirlLayout, adWhirlLayoutParams);    }    catch (Exception e)    {    }</code></pre><p>where I am doing wrong?</p>","517247","","","","","2011-06-02 19:39:11","Android admob and Adwhirl integration","<android><admob><adwhirl>","2","5","1","",""
"4622742","1","4622799","","2011-01-07 05:24:21","0","570","<p>I am developing an app which consists of functionality to take pictures using camera, store it on memory and mail it to the specified users.</p><p>I created a folder in the SD card and storing the images there. But some of the new devices like Nexus S are not consisting of any SD card. So, is it okay if we access the internal memory?</p><p>If so how can i do it?</p>","303155","","","","","2011-01-07 07:10:53","Is it okay to create app data in internal memory","<android>","2","0","","",""
"4622746","1","4623112","","2011-01-07 05:25:11","0","408","<p>I read several tutorials and the sqlite section in a book and applied it which works great. Now I messed with it to try and understand it but now it will just force close every single time and i'm not sure why. I've been over my code again and again but maybe I can't find the problem because i'm new to sqlite/databases in general. Any help would be appreciated:</p><pre><code>public class Events extends Activity {private TextView tv;private DataHelper dh;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    tv = new TextView(this);    dh = new DataHelper(this);    dh.deleteAll();    //dh.addEvent(""James"");    //Cursor c = dh.getEvent();    //startManagingCursor(c);    //tv.setText(dh.showEvent(c));    setContentView(tv);}</code></pre><p>}</p><pre><code>public class EventsData extends SQLiteOpenHelper {private static final String DATABASE_NAME = ""events.db"";private static final int DATABASE_VERSION = 1;private static final String DATABASE_CREATE = ""CREATE TABLE"" + TABLE_NAME + ""("" + TITLE + "" TEXT)"";private static final String DATABASE_UPGRADE = ""DROP TABLE IF EXISTS "" + TABLE_NAME;public EventsData(Context context) {    super(context, DATABASE_NAME, null, DATABASE_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db) {    // TODO Auto-generated method stub    db.execSQL(DATABASE_CREATE);}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    // TODO Auto-generated method stub    db.execSQL(DATABASE_UPGRADE);    onCreate(db);}</code></pre><p>}</p><pre><code>public class DataHelper {private Context context;private SQLiteDatabase db;private EventsData eventsData;public DataHelper(Context context) {    this.context = context;    eventsData = new EventsData(this.context);}public void addEvent(String name) {    db = eventsData.getWritableDatabase();    ContentValues cv = new ContentValues();    cv.put(TITLE, name);    db.insertOrThrow(TABLE_NAME, null, cv);}</code></pre><p>}</p><p>Commenting out addEvent() will run the app fine but once I uncomment it, it force closes.</p>","507007","","","","","2011-01-07 06:39:50","Android sqlite problem","<java><android><database><sqlite>","2","1","","",""
"4622804","1","","","2011-01-07 05:37:43","0","478","<p>I want to unistall Phone.apk file from My T Mobile G1......for that I have tried to it with adb shell command but there is error occured...that ""access permission denied"".....is there anybody idea about How can I Unsinstall Phone.apk file from my T Mobile G1 and again install my own Phone.apk file.......?</p>","533863","","","","","2011-01-07 05:37:43","Remove Phone.apk file from T Mobile g1 using Ubuntu terminal","<android><android-sdk-2.2>","0","2","","",""
"4622811","1","4622824","","2011-01-07 05:39:06","9","9493","<p>I was wondering if there exists/anyone has compiled a download of the Android Dev Guide and/or the class reference pages</p><p>The pages I'm referring to are:</p><p>(the dev guide)<a href=""http://developer.android.com/guide/basics/what-is-android.html"">http://developer.android.com/guide/basics/what-is-android.html</a></p><p>(the class reference)<a href=""http://developer.android.com/reference/android/package-summary.html"">http://developer.android.com/reference/android/package-summary.html</a></p><p>Would be quite helpful!</p><p>Thanks</p>","450153","","","","","2014-01-07 14:27:24","Offline Android Dev Guide","<android><reference><download><offline>","3","0","1","",""
"4622838","1","4623291","","2011-01-07 05:44:25","0","245","<hr><p>i am working on application in which i want to frequently change four imageviews images while thread is sleeping .</p><hr><p>is it possible for doing ui changes while thread sleeps for two seconds.?</p><hr><p>or there is another way to doing my purpose?</p>","544537","","","","","2011-01-07 07:11:25","android,working while thread","<android><multithreading>","2","0","","",""
"4622868","1","","","2011-01-07 05:51:15","1","1088","<p>i want to zoom in zoom out the group of images in galleryview.i have done zoom single image using imageview,here i need to zoom gallery view og images.how to do,please help me</p><p>gallery.setOnTouchListener(new View.OnTouchListener() {</p><pre><code>    @Override    public boolean onTouch(View v, MotionEvent event) {</code></pre><p>//here i need the zoom functionality</p><pre><code>        return false;    }});</code></pre>","563805","","563805","","2011-10-03 11:00:21","2013-03-24 15:37:14","how to zoom in and zoom out the images in gallery","<android>","1","2","","2013-03-24 15:41:47",""
"4622878","1","","","2011-01-07 05:52:55","0","923","<p>I am not able to pass intent in customized tabHost.Please anyone help me.I try to pass intent from customtabactivity.java to  firsttab.java which contains the firsttab.xml as setcontentview.</p><h2>Main.xml</h2><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;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;View android:layout_width=""fill_parent"" android:layout_height=""0.5dip""            android:background=""#ff0000"" /&gt;        &lt;TabWidget android:id=""@android:id/tabs""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:layout_marginLeft=""0dip"" android:layout_marginRight=""0dip"" /&gt;        &lt;View android:layout_width=""fill_parent"" android:layout_height=""2dip""            android:background=""#696969"" /&gt;        &lt;View android:layout_width=""fill_parent"" android:layout_height=""2dip""            android:background=""#000"" /&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt;            &lt;include layout=""@layout/firsttab""/&gt;            &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p></p><h2>CustomTabHost.java</h2><pre><code> import android.app.Activity; import android.content.Context;  import android.os.Bundle;  import android.view.LayoutInflater;  import android.view.View;  import android.view.Window; import android.widget.TabHost; import android.widget.TextView; import android.widget.TabHost.TabContentFactory; import android.widget.TabHost.TabSpec; import android.content.Intent; public class CustomTabActivity extends Activity {private TabHost mTabHost;private void setupTabHost() {    mTabHost = (TabHost) findViewById(android.R.id.tabhost);    mTabHost.setup();}/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // construct the tabhost     requestWindowFeature(Window.FEATURE_LEFT_ICON);        setContentView(R.layout.main);        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.headphones);    setupTabHost();    mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);    setupTab1(new TextView(this), ""Showcase"");    setupTab2(new TextView(this), ""Catalogue"");}private void setupTab1(final View view, final String tag) {    View tabview = createTabView(mTabHost.getContext(), tag);    TabSpec setContent1 = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(new TabContentFactory() {        public View createTabContent(String tag) {            return view;}    });    mTabHost.addTab(setContent1);}private void setupTab2(final View view, final String tag) {    View tabview = createTabView(mTabHost.getContext(), tag);    TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(new TabContentFactory() {        public View createTabContent(String tag) {            return view;}    });    mTabHost.addTab(setContent);}private static View createTabView(final Context context, final String text) {    View view = LayoutInflater.from(context).inflate(R.layout.tabs_bg, null);    TextView tv = (TextView) view.findViewById(R.id.tabsText);    tv.setText(text);    return view;}</code></pre><p>}</p><h2>firsttab.xml</h2><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/background""&gt; &lt;LinearLayoutandroid:orientation=""horizontal""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:paddingTop=""20dip"" android:id=""@+id/relative""&gt;&lt;TextViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""@string/New_Release""android:textSize=""15dip""android:typeface=""serif"" android:layout_weight=""1""/&gt;&lt;TextViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""@string/Featured_Artist""android:textSize=""15dip""android:typeface=""serif"" android:layout_weight=""1""/&gt;&lt;TextViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""@string/Crew_Picks""android:textSize=""15dip""android:typeface=""serif"" android:layout_weight=""1""/&gt; &lt;/LinearLayout&gt;       &lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""   android:orientation=""vertical""   android:paddingTop=""20dip""   android:layout_below=""@id/relative""&gt;  &lt;ImageView   android:layout_width=""55dip""   android:layout_height=""75dip""   android:layout_weight=""1""   android:src=""@drawable/da""    android:padding=""2dip""   android:id=""@+id/image1""/&gt; &lt;ImageView    android:layout_width=""55dip""    android:layout_height=""75dip""android:layout_toRightOf=""@id/image1""android:layout_weight=""1""    android:src=""@drawable/dd""    android:padding=""2dip""    android:id=""@+id/image2""/&gt;     &lt;ImageView    android:layout_width=""100dip""    android:layout_height=""148dip""    android:layout_toRightOf=""@id/image2""    android:src=""@drawable/dd""    android:padding=""2dip""    android:id=""@+id/image3""/&gt;    &lt;ImageView    android:layout_width=""55dip""    android:layout_height=""75dip""    android:src=""@drawable/da""     android:layout_weight=""1""     android:padding=""2dip""     android:id=""@+id/image4""     android:layout_alignParentRight=""true""/&gt;     &lt;ImageView     android:layout_width=""55dip""    android:layout_height=""75dip""android:layout_toLeftOf=""@id/image4"" android:padding=""2dip""android:layout_weight=""1""    android:src=""@drawable/dd""   android:id=""@+id/image5""    /&gt;          &lt;ImageView    android:layout_width=""55dip""    android:layout_height=""75dip""android:layout_below=""@id/image1"" android:padding=""2dip""android:layout_weight=""1""android:id=""@+id/image6""     android:src=""@drawable/dd""/&gt;   &lt;ImageView     android:layout_width=""55dip""    android:layout_height=""75dip""    android:layout_below=""@id/image2""android:layout_toRightOf=""@id/image6""android:padding=""2dip""android:layout_weight=""1""android:id=""@+id/image7""    android:src=""@drawable/da""     /&gt;                &lt;ImageView    android:layout_width=""55dip""    android:layout_height=""75dip""    android:layout_alignParentRight=""true""android:layout_below=""@id/image4"" android:padding=""2dip""android:layout_weight=""1""android:id=""@+id/image9""     android:src=""@drawable/da"" /&gt;   &lt;ImageView     android:layout_width=""55dip""    android:layout_height=""75dip""android:layout_toLeftOf=""@id/image9""android:padding=""2dip""android:layout_below=""@id/image5""android:layout_weight=""1""android:id=""@+id/image8""    android:src=""@drawable/dd""   /&gt;            &lt;/RelativeLayout&gt;  &lt;/RelativeLayout&gt;</code></pre><h2>firsttab.java</h2><pre><code>  public class firsttab extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    /* First Tab Content */    setContentView(R.layout.firsttab);}</code></pre><p>}</p>","366916","","","","","2011-05-05 11:01:00","Android-Customized TabHost","<android>","1","0","","",""
"4622942","1","","","2011-01-07 06:09:50","2","1240","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2203987/android-database-encryption"">android database encryption</a>  </p></blockquote><p>I have a sensitive-ish SQLite database that I'd like to be able to store on the SDCard for more storage. Seems like there isn't a documented way to do this. Anyone have a method that works? Open to any ideas.</p><p>Thanks!</p>","145279","","","","","2011-01-07 06:09:50","Encrypted Android Database (SQLite?)","<android><sqlite><encryption><sd-card>","0","1","1","2011-08-02 13:08:32",""
"4623044","1","","","2011-01-07 06:26:20","1","142","<p>hi i m creating a game in which images are changing with click.i read a little registerDataSetObserver and unregister it.can any one please provide example when data set is changong using registerDatasetObserverand how to use it .thanks in advance .</p>","566500","","","","","2011-01-07 06:26:20","Changing dataset frequently in GridView","<android>","0","0","","",""
"4623137","1","","","2011-01-07 06:43:54","0","1264","<pre><code>[ 01-01 08:29:02.954 1511:0x5e7 E/dalvikvm ]HeapWorker is wedged: 10330ms spent inside Landroid/content/ContentResolver$CursorWrapperInner;.finalize()V[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]DALVIK THREADS:    [ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]""main"" prio=5 tid=1 RUNNABLE    [ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]  | group=""main"" sCount=0 dsCount=0 s=N obj=0x400258c8 self=0xcd98[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]  | sysTid=1511 nice=0 sched=0/0 cgrp=default handle=-1345021912[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:Note: 0000662)[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.lang.StringBuilder.toString(StringBuilder.java:664)[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.io.File.join(File.java:264)[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.io.File.&lt;init&gt;(File.java:175)[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.io.File.&lt;init&gt;(File.java:142)[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.io.File.filenamesToFiles(File.java:1082)[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]  at java.io.File.listFiles(File.java:1008)</code></pre><p>How to resolve this issue?</p><p>I know the root cause is to much temporary variables be created.</p>","438633","","1352969","","2012-11-16 08:26:11","2012-11-16 08:26:11","HeapWorker Android performance","<android><performance>","1","0","","",""
"4623214","1","","","2011-01-07 06:59:08","0","564","<p>I am newbie to the platform of android. I am intending to make an application that will protected your desired folders and files through password to keep it access limited to your application. You cant access the content through file explorers on android and via SD card reader. I also want to know how to make a background service that cant be killed by task killers.</p><p>Looking forward for your comments and replyBest Regards,</p>","566537","","","","","2011-01-07 13:42:40","Folder and File Security on Android","<android>","1","1","","",""
"4623233","1","","","2011-01-07 07:02:03","1","2314","<p>Helo guys, I have the following problem trying to run my very first HeloWord app for Android, using Eclipse, the console says: </p><p>[2011-01-07 01:45:45 - HelloWorld] ERROR: Unknown option '--debug-mode'[2011-01-07 01:45:45 - HelloWorld] Android Asset Packaging Tool</p><p>I have in the SDK Manager, in Installed Packages:</p><p>Android SDK Tooks, revision 8Android SDK Platform-tools, revision 6SDK Platform Android 2.2, API 8, revision2Tools R06 Windows Package, revision 6</p><p>I can see the emulator just fine...but I can't just make this first tutorial run, even I haven't touched the Eclipse generated code! HELP!!! :)</p>","566529","","","","","2011-01-07 07:02:03","Android/Eclipse dev: Error trying to run: aapt Unknown option '--debug-mode'?","<android><run><aapt>","0","1","","",""
"4623274","1","4623421","","2011-01-07 07:07:53","4","1358","<p>I'm using TableLayout to display data.Text of the TextViews of the right column will be set when activity calls onCreate().</p><p>Now, as you can see in the following image that my address text can be long and it should be wrapped.So I set <code>android:layout_width=""wrap_content""</code>. but it still take a width of screen size to wrap data.How can I overcome from this issue?</p><p><img src=""http://i.stack.imgur.com/TlTp6.jpg"" alt=""alt text""></p><p>My xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5px""&gt;    &lt;TableRow&gt;        &lt;TextView android:text=""Job#""            android:paddingRight=""5px"" /&gt;        &lt;TextView android:id=""@+id/DetailJobNo"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView android:text=""Address""            android:paddingRight=""5px"" /&gt;        &lt;TextView android:id=""@+id/DetailAddress""            android:layout_width=""wrap_content""            android:text=""Address Address Address Address Address Address Address Address ""/&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","415865","","793522","","2011-12-07 01:01:35","2012-06-01 07:22:36","Android TableLayout width issue","<android><android-layout><android-tablelayout>","3","0","1","",""
"4623307","1","4623336","","2011-01-07 07:14:57","0","679","<p>I've read some Android docs including the official developer ones, and no doubt there is a lot of complexity to the art-asset problem involving DPI and screen sizes.</p><p>I'm simply looking for the answer to: is there any easy way to have good looking art assets without recreating ones for different screens?!</p><p>I've tried to make high-resolution assets, but have found the android-scaling always ends up looking like crap?</p><p>Is that always the case or am I doing something wrong?</p>","445432","","","","","2011-01-07 07:19:47","Android Screen Size Scaling","<android><size><screen><scaling><dpi>","1","0","","",""
"4623323","1","","","2011-01-07 07:17:21","0","370","<p>i'm developing an app that uses Box2d. i have a world with several blocks and an object thatcollides with them. at the moment the collision starts, the objects start to change their shape, they get more large. what could be causing that.</p><p>i'm creating the bodies in fixed positions and in sleep state. also shapeDef->friction = 0.8f;shapeDef->density = 1.0f; shapeDef->restitution = 0.2f;</p><p>maybe i'm not using the right physics parameters, i don't want that deformation. just the movement and the body keeping its original form.</p>","369372","","","","","2011-01-07 22:52:41","Box2d Collision. object gets deformed","<c++><android><android-ndk><box2d><game-physics>","1","2","","",""
"4623400","1","4623845","","2011-01-07 07:28:09","1","1438","<p>I have written the following code to initialize the GLview in android. I am relatively new to android application development. I want to use the code for getting the screen capture.</p><p>Here is the piece of code I have written:</p><pre><code>public class MainActivity extends Activity{    /** Called when the activity is first created. */    private EGL10 egl;    private EGLDisplay display;    private EGLConfig config;    Display disp ;    private EGLContext eglContext;    private GL10 gl ;    private EGLSurface surface;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        // ToDo add your GUI initialization code here            setContentView(R.layout.main);    disp = getWindowManager().getDefaultDisplay();    egl = (EGL10) EGLContext.getEGL();   display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);   int[] ver = new int[2];   egl.eglInitialize(display, ver);    int[] configSpec = {EGL10.EGL_NONE};    EGLConfig[] configOut = new EGLConfig[1];    int[] nConfig = new int[1];    egl.eglChooseConfig(display, configSpec, configOut, 1, nConfig);    config = configOut[0];    eglContext = egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, null);    SurfaceView view = new SurfaceView(this);    setContentView(view);       SurfaceHolder holder = view.getHolder();      holder.setType(SurfaceHolder.SURFACE_TYPE_NORMAL);      try{            surface = egl.eglCreateWindowSurface(display,config, holder , null);      }catch(Exception e)      {          e.printStackTrace();      }    egl.eglMakeCurrent(display, surface, surface, eglContext);    gl = (GL10) eglContext.getGL();    savePNG(0,0,disp.getWidth(), disp.getHeight(),""testpicture.png"",gl);    }</code></pre><p>But the application is terminating at</p><pre><code>      try{            surface = egl.eglCreateWindowSurface(display,config, holder , null);      }catch(Exception e)      {          e.printStackTrace();      }</code></pre><p>It is giving the exception</p><pre><code> IlligalArgument exception: Must use SurfaceHolder or SurfaceView  with proper format. not a valid surface.</code></pre><p>please rectify this problem.</p><p>Thank you.</p>","566539","","260990","","2011-01-07 07:30:31","2011-01-07 08:45:29","problem Initializing the GLview in android","<android>","1","0","","",""
"4623507","1","","","2011-01-07 07:45:07","1","2734","<p>I am trying to upload image from android phone to php server with additional values,the method is postmy php file look like this </p><pre><code>if($_POST['val1']){  if($_POST['val2']){     if($_FILE['image']){      ......     }  }}else{echo ""Value not found"";}</code></pre><p>I am doing is</p><pre><code>URL url=new URL(""http://www/......../myfile.php"");HttpURLConnection con=(HttpURLConnection) url.openConnection();con.setDoInput(true);con.setDoOutput(true);con.setUseCaches(false);con.setRequestMethod(""POST"");//Enable http POSTcon.setRequestProperty(""Connection"", ""Keep-Alive"");con.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+""****"");connection.setRequestProperty(""uploaded_file"", imagefilePath);DataOutputStream ostream = new DataOutputStream( con.getOutputStream());String res=(""Content-Disposition: form-data; name=\""val1\""""+val1+""****""+""Content-Disposition: form-data; name=\""val2\""""+val2+""****""""Content-Disposition: form-data; name=\""image\"";filename=\"""" + imagefilePath +""\""""+""****"");outputStream.writeBytes(res);</code></pre><p>my actual problem is values are not posting so first if condition get false and else section is executed that is it give value not foundplease help me</p>","566574","","1479606","","2012-11-15 12:40:30","2012-11-15 12:40:30","Post values and upload Image to php server in android","<java><php><android><image><upload>","2","5","1","",""
"4623508","1","4623602","","2011-01-07 07:45:33","90","143801","<p>I want to make a <code>TextView</code>'s content bold, italic and underlined. I tried the following code and it works, but doesn't underline.</p><pre><code>&lt;Textview android:textStyle=""bold|italic"" ..</code></pre><p>How do I do it? Any quick ideas?</p>","216431","","2390083","","2013-11-04 18:27:25","2014-04-14 10:27:25","How to set the font style to bold, italic and underlined in an Android TextView?","<android><textview><android-textview><text-styling>","6","4","21","",""
"4623526","1","","","2011-01-07 07:49:21","3","905","<p>I'm trying to build a radio player and the client is providing a stream which is a FLV container with the audio being AAC</p><p>When I read the headers it shows up as audio/aacp.</p><p>I have tried all possible ways such as using the </p><p>1) Streaming through mediaplayer  (Does not work)</p><p>2) Use the NPR mode of using a proxy stream  (I get a broken pipe exception)</p><p>3) Play it in chunks ( Plays but I need the SDCard and the playback is not very great)</p><p>4) Use the GPL'd FAAD2 Library but I would have to pay the royalty fee</p><p>Can some one help me out on figuring this issue out.</p><p>The last option that I have is to have my client change the stream to mp3 container (which I know that it works)</p><p>Regards,Hari</p>","320293","","","","","2011-01-07 07:49:21","Can FLV AAC stream be played in Android","<android><audio><stream><aac>","0","0","2","",""
"4623764","1","","","2011-01-07 08:30:18","1","1468","<p>Here is my question:- I have many pdf files in my application in files folder.I want to display them on web view when user clicks on its hyperlink from another web view.</p><p>That is I have one web view which dynamically generates a html page from html template stored in asset folder.In that there we have one hyperlink of pdf file corresponding to data displayed.When user clicks on hyperlink I want to display it in web view.Can it be possible?</p><p>Please reply.Thanks in Advance.</p>","536148","","","","","2011-01-31 15:59:12","To view pdf file in web view","<android><pdf><webview>","1","0","2","",""
"4623954","1","","","2011-01-07 09:05:44","1","285","<p>I wanna use medialets ad in my android app. I have faced some issues which are listed below,</p><ol><li><p>Got an sample with downloaded sdk, banner ads are not working in the sample itself, can anyone got this issue, whats wrong with the banner ads?</p></li><li><p>And Interstitial ads are working fine with the normal activity which extends AdActivity. If I load the following lines in oncreate then its getting crashed.</p><pre><code>InterstitialAdView view = new InterstitialAdView(AdDemo.this);view.setSlotName(""ViewTwoFull"");view.prepare();</code></pre><p>If I give that inside onclick() then its working fine.</p></li><li><p>Actually I want to load the interstitial ads when an item clicked in the list, my list activity is there with in the tab activity, in this case interstitial ad also not coming.</p></li></ol><p>Can anyone worked with medialets, how to solve these issues.</p><p>Thanks in advance.</p>","262523","","","","","2012-01-09 16:06:32","Android : Issues with medialets ads","<android><ads>","2","0","","",""
"4623962","1","4624446","","2011-01-07 09:07:59","0","1360","<p>How can i retrieve images from sdcard to display on emulator in gallery format.i don't know how to do it.code is much better for me.Thanks in adv.</p>","555948","","21234","","2011-01-07 10:02:43","2011-01-07 10:13:45","Retrieve images from sdcard in android","<android><android-sdcard>","1","0","","",""
"4623999","1","","","2011-01-07 09:14:29","3","4223","<p>I use a listview. Each item in the list contains one edittext. When I click on an edittext, the soft keyboard pops up, the edittext I clicked on gains the focus for a short time and then lose it. I have to click a second time to really get the focus (why?)</p><p>(<strong>focus on an editext</strong> and <strong>keyboard up</strong>) <strong>I scroll the listview</strong>...</p><p>Because the listview elements are recycled, the focus reappears on edittext at other positions in the list and I guess this is normal BUT <strong>why does Android not remove this damned focus</strong>!? How could I say to Android ok I do not want the focus anymore on an edittext if my user begins to scroll ?</p><p>Here is the code of the activity:</p><pre><code>public class SimpleList extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.user_picker);    ListView listview = (ListView)this.findViewById(R.id.user_picker_list);    new UserPickerAdapter(this, listview); }</code></pre><p>And the code of the adapter:</p><pre><code>public class UserPickerAdapter extends BaseAdapter {private final LayoutInflater mInflater;private String[] mUsers = {""Guib"", ""Jonas"", ""Fred"", ""Denis"", ""Arnold"", ""Francois"", ""David"", ""Alex"", ""Saskia"", ""Verner"", ""Anatole""};public UserPickerAdapter(Context context, ListView listview) {    mInflater = LayoutInflater.from(context);       listview.setAdapter(this);  }@Overridepublic int getCount() {    return mUsers.length;}@Overridepublic Object getItem(int position) {    return mUsers[position];}@Overridepublic long getItemId(int position) {    return position;}static private class Holder {    TextView username; }@Overridepublic View getView(int position, View convertView, ViewGroup arg2) {    Holder holder;      if (convertView != null) {          holder = (Holder) convertView.getTag();     } else {            holder = new Holder();          convertView = mInflater.inflate(R.layout.user_picker_list_item,null);        holder.username = (TextView) convertView.findViewById(R.id.user_picker_list_item_name);        convertView.setTag(holder);    }    String str = (String)getItem(position);    holder.username.setText(str);    return convertView;}</code></pre><p>Just in case, here is the code in 'user_picker.xml'</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:orientation=""vertical"" android:padding=""0dp""&gt;&lt;ListView android:background=""@color/color_grey1"" android:cacheColorHint=""@color/color_grey1"" android:id=""@+id/user_picker_list"" android:divider=""@color/color_blueGrey1"" android:layout_height=""match_parent"" android:layout_width=""match_parent""/&gt;</code></pre><p> </p><p>And the one in 'user_picker_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=""fill_parent"" android:orientation=""vertical"" android:layout_height=""fill_parent""&gt;&lt;EditText android:layout_height=""wrap_content""android:id=""@+id/user_picker_list_item_name"" android:layout_width=""wrap_content"" android:minWidth=""200dp"" android:layout_gravity=""center""&gt;&lt;/EditText&gt;&lt;/LinearLayout&gt; </code></pre>","532116","","532116","","2011-01-07 12:25:47","2013-07-23 01:34:12","Edittext keeps focus when keyboard up AND scrolling the listview","<android><listview><keyboard><focus><edittext>","2","1","1","",""
"4624023","1","4624935","","2011-01-07 09:17:47","5","490","<p>I have EditText view in android .. i want when the enters a letter the application get the letter .. </p><p>that mean the need to have a listener or event handler to get each letter is entered </p><p>hope my question is clear</p>","508377","","","","","2011-01-07 11:18:45","how to get letter entered instantly in android?","<android>","4","0","3","",""
"4624046","1","4624189","","2011-01-07 09:22:00","0","62","<p>i have have added rows in tables... but after adding some rows table have stop showing rows even though i have defined some textview....</p><p>i have also added touch screen support in both emulator and xml... but still its not working in emulator and mobile both...</p>","566590","","","","","2011-01-07 09:40:22","table in android is not extending?","<android>","1","0","","",""
"4624281","1","","","2011-01-07 09:52:20","0","740","<h2>Hey all,</h2><p>1). Best way to notify user when application is focused(Note: redirection is required means a button click) and even when application is not focused</p><p>2). Guidance for notifying user through making changes in Launcher Icon(Like happens in many iPhone Apps and Android Apps as well), overlay kind of thing, an incremented number or something..</p><p>Thanks in advance..</p>","457146","","","","","2011-01-07 13:41:02","How to notify user through Launcher Icon overlay","<android><notifications>","1","0","","",""
"4624327","1","","","2011-01-07 09:57:38","0","481","<p>I'm writing a piece of software for android OS that connects to a server and should stay connected until the program is closed. The connection is running in the background as a service and as far as i've gathered services in android should stay connected indefinitely.</p><p>However after several hours (timeframe appears random) the service disconnects for no apparent reason but doesn't seem to fire any of the disconnection events. The server regularly pings the connected device which I would have thought would keep the service alive.</p><p>Ive tried using WakeLocks which dont seem to make any difference and also startForeground() which also doesnt seem to work. I'm attempting to use the AlarmManager to wake up the application after a period of time but this feels like a bit of a work around. Has anyone got any suggestions? or is there anything obvious ive missed?</p><p>thanks for your help in advance.</p>","566701","","","","","2011-01-07 13:38:09","Android service sleeping after a prolonged period of time","<android><service><timeout><alarmmanager>","1","0","","",""
"4624351","1","4627282","","2011-01-07 10:01:28","0","1290","<p>I want to set images of my gallery using files in assest folder. </p>","517247","","","","","2011-01-07 16:51:29","Android gallery setting image from assest folder","<android><gallery>","1","1","1","",""
"4624436","1","4627767","","2011-01-07 10:12:26","2","308","<p>I want to implement something that does/check some things every time an activity (or application) is lunched and goes in the foreground.Something similar to those Application Protection solutions that you use to protect any installed applications on your phone and they intercept when an application is lunched and prompt you with a password, PIN, etc.. (example : <a href=""http://www.appbrain.com/app/app-protector-pro/com.carrotapp.protectpronew"" rel=""nofollow"">http://www.appbrain.com/app/app-protector-pro/com.carrotapp.protectpronew</a>)I believe that this is the mechanism I need and those protection applications use, they have a running service and somehow (this is what I'm interested) the are notified when an application is lunched . I believe that the service from these application just poll every second what is running, this would be a big battery usage, they have somehow to be notified when this happens.So my question is how this can be achieved ?Thanks.</p>","467780","","","","","2011-01-07 16:31:03","How to be notified when an activity is lunched","<android><activity><run><notify><foreground>","1","1","0","",""
"4624440","1","4624588","","2011-01-07 10:12:50","4","5453","<p>I currently have a piece of code in my Android application that picks up the devices IMEI and sends that IMEI as a parameter to a PHP script that is hosted on the Internet. </p><p>The PHP script then takes the IMEI parameter and checks a file to see if the IMEI exists in the file, if it does I want to be able to let my Android application know that the IMEI exists. So essentially I just want to be able to return True to my application.</p><p>Is this possible using PHP?</p><p>Here is my code so far:</p><p>Android/Java</p><pre><code>//Test HTTP Get for PHP        public void executeHttpGet() throws Exception {            BufferedReader in = null;            try {                HttpClient client = new DefaultHttpClient();                HttpGet request = new HttpGet();                request.setURI(new URI(""http://testsite.com/"" +                        ""imei_script.php?imei="" + telManager.getDeviceId()                        ));                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 = sb.toString();                System.out.println(page);                } finally {                if (in != null) {                    try {                        in.close();                        } catch (IOException e) {                        e.printStackTrace();                    }                }            }        }</code></pre><hr><p>The above sends the IMEI as a parameter to the PHP script which picks it up successfully and runs a check against the file successfully, however I neeed to then be able to send a positive response back from the PHP script if the IMEI matches one in the file.</p><p>Here is the PHP:</p><pre><code>&lt;?php    // to return plain text    header(""Content-Type: plain/text"");     $imei = $_GET[""imei""];    $file=fopen(""imei.txt"",""r"") or exit(""Unable to open file!"");    while(!feof($file))     {    if ($imei==chop(fgets($file)))     echo ""True"";     }    fclose($file);?&gt;</code></pre><hr><p>So instead of echo True I want to be able to let my application know that the IMEI was found, is this possible and if so what should I be using to achieve it?</p>","243999","","491044","","2011-03-11 07:54:57","2012-02-10 22:48:12","Sending a response from PHP to an Android/Java mobile app?","<java><php><android>","3","0","2","",""
"4624516","1","4625220","","2011-01-07 10:21:44","2","1018","<p>I am trying to create a list similar to that in the call log activity (in Froyo). Here repeated calls from the same person are grouped into a expandable list item while others are normal elements in the list. How to create such a list? Can it be done with the <code>ExpandableListView</code> class?</p>","177890","","995926","","2012-05-22 08:14:33","2012-05-22 08:14:33","Mix of expandable and normal listViews in android","<android><listview><android-2.2-froyo>","1","0","1","",""
"4624531","1","4625618","","2011-01-07 10:23:23","6","4737","<p>I have the following problem. I have a charting program, and it's design is black, but the charts (that I get from the server as images) are light (it actually uses only 5 colors: red, green, white, black and gray).</p><p>To fit with the design inversion does a good job, the only problem is that red and green are inverted also (green -> pink, red -> green).</p><p>Is there a way to invert everything except those 2 colors, or a way to repaint those colors after inversion?And how costly are those operations (since I get the chart updates pretty often)?</p><p>Thanks in advance :)</p><p><strong>UPDATE</strong></p><p>I tried replacing colors with setPixel method in a loop </p><pre><code>for(int x = 0 ;x &lt; chart.getWidth();x++) {        for(int y = 0;y &lt; chart.getHeight();y++) {            final int replacement = getColorReplacement(chart.getPixel(x, y));            if(replacement != 0) {                chart.setPixel(x, y, replacement);            }        }    }</code></pre><p>Unfortunetely, the method takes too long (~650ms), is there a faster way to do it, and will setPixels() method work faster?</p>","495663","","495663","","2013-09-17 12:12:04","2013-09-17 12:12:04","Invert bitmap colors","<java><android><colors>","4","3","4","",""
"4624627","1","4626004","","2011-01-07 10:36:34","3","7525","<p>I am trying to create a Directory in the internal memory of the device... </p><p>I have done like this ...</p><pre><code>File testDir = new File(Environment.getRootDirectory(),""Sample"");    testDir.mkdir();</code></pre><p>But i cant see a folder created in the file explorer of DDMS when i run it in the emulator. I have also added </p><pre><code>  &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""/&gt; </code></pre><p>to the manifest file. Is anything else to be added... Is this the right way? If no plz suggest me the correct procedure.</p>","303155","","","","","2011-02-28 14:50:35","Creating a directory in Internal memory (Root Folder)","<android>","3","1","3","",""
"4624656","1","4624729","","2011-01-07 10:40:53","1","584","<p>I'm reading an xml file from resources, that file contains a list of travel agencies location and adresses and i'm trying to put this list after parsing in an arraylist to use it with maps. So each time I use agencies.add(agency) it adds it to the array but also changes all previous items with the new value. Here's my code if someone can help or explain :</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);      TextView myXmlContent = (TextView)findViewById(R.id.my_xml);      String stringXmlContent; try {  stringXmlContent = getEventsFromAnXML(this);  myXmlContent.setText(stringXmlContent); } catch (XmlPullParserException e) {  // TODO Auto-generated catch block  e.printStackTrace(); } catch (IOException e) {  // TODO Auto-generated catch block  e.printStackTrace(); }  }  boolean na=false;  List&lt;Agency&gt; agencies = new ArrayList();  Agency agency=new Agency();  int i=0;  private String getEventsFromAnXML(Activity activity)  throws XmlPullParserException, IOException  {   StringBuffer stringBuffer = new StringBuffer();   Resources res = activity.getResources();   XmlResourceParser xpp = res.getXml(R.xml.hotels);   xpp.next();   int eventType = xpp.getEventType();   while (eventType != XmlPullParser.END_DOCUMENT)   {    if(eventType == XmlPullParser.START_DOCUMENT)    {     stringBuffer.append(""--- Start XML ---"");    }    else if(eventType == XmlPullParser.START_TAG)    {        if (xpp.getName().equals(""DataBase"")){            agency.ResetTsp();            String name=xpp.getAttributeValue(null, ""name"");            agency.setTspTitle(name);            na=true;            stringBuffer.append(""\nAgence : ""+ name);        }        if (xpp.getName().equals(""Title"")){            xpp.next();            agency.setTitle(xpp.getText());            stringBuffer.append(""\nFiliale: ""+xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Address"")){            xpp.next();            agency.setAddress(xpp.getText());            stringBuffer.append(""\nAdresse: ""+xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Phone"") &amp;&amp; na==true){            xpp.next();            agency.setTspPhone(xpp.getText());            stringBuffer.append(""\nPhone: ""+xpp.getText());            xpp.nextTag();        }else{            if (xpp.getName().equals(""Phone"") &amp;&amp; na==false){                xpp.next();                agency.setPhone(xpp.getText());                stringBuffer.append(""\nPhone: ""+xpp.getText());                xpp.nextTag();            }        }        if (xpp.getName().equals(""Fax"")){            xpp.next();            agency.setFax(xpp.getText());            stringBuffer.append(""\nFax: ""+xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""e-Mail"")){            xpp.next();            agency.setMail(xpp.getText());            stringBuffer.append(""\ne-Mail: ""+xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Latitude"")){            xpp.next();            agency.setLatitude(Double.parseDouble(xpp.getText()));            stringBuffer.append(""\nLatitude: ""+xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Longitude"")){            xpp.next();            agency.setLongitude(Double.parseDouble(xpp.getText()));            stringBuffer.append(""\nLongitude: ""+xpp.getText());        }    }    else if(eventType == XmlPullParser.END_TAG)    {        if (xpp.getName().equals(""DataBase"") || xpp.getName().equals(""Agency"")){            agencies.add(i,agency);            i=i+1;            Agency agency = new Agency();        }    }    eventType = xpp.next();   }   stringBuffer.append(""\n--- End XML ---"");   return stringBuffer.toString();  }}</code></pre><p>thank you</p>","552264","","","","","2011-01-07 10:57:40","Problem with ArrayList","<android><arraylist>","1","0","","",""
"4624682","1","5322810","","2011-01-07 10:44:20","2","1699","<p>In my application, I have to send a mail when a button is clicked. I have all details for sending the mail except the ""from address"". This ""from address"" should be the gmail account configured in the android phone. How can I fetch those details? Can anyone please help?</p>","504162","","","","","2011-03-23 06:58:55","retrieve gmail account details configured in android","<android>","3","0","2","",""
"4624790","1","","","2011-01-07 10:59:09","0","936","<p>I have created an app which polls a server to fetch SMS that have to be sent to our users. For the polling functionality i have used the alarm manager to fire every 5 min to poll server</p><pre><code>AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);         Intent pintent = new Intent(this, SMSSender.class);        PendingIntent pIntent = PendingIntent.getBroadcast(this,0,pintent, 0);        if(checkbox.isChecked()) {            long interval = 60*Integer.valueOf(PreferenceManager.getDefaultSharedPreferences(this).getString(""pref_poll_interval"", ""5000""));//5mins;//5mins            long firstPoll = SystemClock.elapsedRealtime() + 60*Integer.valueOf(PreferenceManager.getDefaultSharedPreferences(this).getString(""pref_poll_interval"", ""5000""));            alarm.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstPoll, interval, pIntent);            Log.d(""SMS_GATEWAY"", ""alarm manager turned on ""+interval);        }else {            alarm.cancel(pIntent);            Log.d(""SMS_GATEWAY"", ""alarm manager turned off"");        }</code></pre><p>I have tested the application on the emulator against the 2.2 build and everything works fine, now test the final out of SMS going out i have installed the app on a Samsung Galaxy S phone. </p><p>Once the app is installed and the preference to poll server is selected, nothing really happens.</p><p>What could be the problem</p>","160108","","","","","2011-04-22 09:21:34","Android alarm manager not working on Samsung Galaxy phone","<android>","2","1","","",""
"4624829","1","","","2011-01-07 11:05:06","0","611","<p>holder.text.setText(DATA[position]);            holder.icon.setImageBitmap((position &amp;1) == 1 ? mIcon1 : mIcon2);</p><pre><code>        return convertView;    }</code></pre><p>The following code above lets me display only icons 1 and 2, I have added other images but dont know how to add those icons to the listview.</p><p>Any help would appreciated as I am just new here. </p>","566317","","","","","2011-01-07 14:12:32","android list view image addition","<android>","1","0","","",""
"4624834","1","","","2011-01-07 11:05:43","0","741","<p>I am currently looking to create an application in Android where a user can answer a questionnaire and that information is saved. The questionnaire will be in a sqlite database and can have different set on answers, and their can be several questionnaires the user can choose to fill. how do i go about firstly having the ability to create a dynamic questionnaire view for the user?</p>","566781","","","","","2011-01-07 11:34:26","Creating a dynamic app in Android","<android>","3","1","","",""
"4624993","1","4625266","","2011-01-07 11:24:55","1","1477","<p>I'm trying to draw a custom gps-location icon. I'm using <a href=""http://code.google.com/intl/sv-SE/android/add-ons/google-apis/reference/index.html"" rel=""nofollow""><code>MapView</code></a> and have created a class <code>MyLocationArrow</code> that extends <a href=""http://code.google.com/intl/sv-SE/android/add-ons/google-apis/reference/com/google/android/maps/MyLocationOverlay.html"" rel=""nofollow""><code>MyLocationOverlay</code></a>.</p><p>I override <code>drawMyLocation()</code> and draw a point at 100,100. But this is the coordinates on screen. How do I get the screen-coordinates from the current GPS-location?</p>","213269","","","","","2011-09-21 13:51:34","How to draw at the current GPS location on MapView using MyLocationOverlay?","<android><gps><location><android-mapview><mylocationoverlay>","1","0","3","",""
"4624997","1","","","2011-01-07 11:25:13","0","223","<p>I am creating a dynamic table which will represent a string array through adapter class..how to implement this ?</p>","542936","","","","","2011-01-07 11:25:13","how can I set adapter class for dynamice table?","<android><android-arrayadapter>","0","3","","",""
"4625002","1","4625371","","2011-01-07 11:25:41","0","3175","<p>I need to disable past dates in datepicker control. This control is opened in a dialog box, there I want to disable past dates so that it throws error if past date is picked.</p>","340002","","","","","2013-09-17 15:22:07","Android Disable past dates in datepicker","<android>","2","0","","",""
"4625167","1","","","2011-01-07 11:45:59","4","6189","<p>I'm writing a Widget that will display a countdown timer.  I have the widget working the way I want it until I flip the phone from landscape to portrait.  My widget does not update and goes to it's initial state at start of the widget until an onupdate is called by my recurring alarm.  I would like to call an onupdate manually once the orientation changes to update my widget  I've been researching this for a while now and I've found out that I need to use a Service which will monitor the orientation changes and call my onupdate for my widget.  </p><p>My problem is I can't find a straight answer as to how to use a service to monitor the change.  I've seen that with an activity I can add  <em>android:configChanges=""orientation|keyboardHidden""</em> to the manifest for an activity and use a <em>onConfigurationChanged</em>, but can I do this for a service. If so how?  Is there a better way to monitor the orientation change?  I've also read on the internet that a service isn't the best way to do this either. </p><p>I've seen tutorials for creating orientation listeners but they seem to use depreciated function calls.</p><p>Thanks in Advance </p>","566807","","","","","2012-07-02 09:59:14","How do I use a service to monitor Orientation change in Android","<android><service><android-widget><screen-orientation>","4","1","5","",""
"4625181","1","","","2011-01-07 11:48:37","3","144","<p>I have an app that implements a PhoneStateListner.  The code works on all phones except the AT&amp;T Samsung Galaxy.  Is there a special build for that phone?  Does anyone know of a way, besides buying a phone, to test this build on an emulator?</p><p>This may be indicative of android where the carriers can create their own build and distribute.</p>","289348","","1039361","","2012-04-18 13:46:42","2012-04-18 13:46:42","Is there a special android build for AT&T Samsung Galaxy?  PhoneStateListner not working.","<android><android-emulator>","1","0","","",""
"4625278","1","4625431","","2011-01-07 12:04:03","0","2033","<p>I'm sure I'm doing something stupid here, but the following code:</p><pre><code>...public void onClick(View v) {  extractThread et = new extractThread();  et.start();}...private class extractThread extends Thread{  public void run(){    expensiveOperation();    Message m = new Message();    Bundle b = new Bundle();    b.putString(""message"",""result"");    m.setData(b);    extractHandler.dispatchMessage(m);    }}private Handler extractHandler = new Handler(){  public void handleMessage(Message m){    Bundle b = m.getData();    String message = b.getString(""message"");    AlertDialog.Builder builder = new AlertDialog.Builder(context);    builder.setMessage(message)        .setCancelable(false)        .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                dialog.cancel();              }    });    builder.create().show();  }};</code></pre><p>is still getting </p><pre><code>01-07 11:55:02.791: ERROR/AndroidRuntime(18791): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>at the line <code>builder.create().show();</code>, despite the fact this is called inside a Handler in my main thread inside <code>handleMessage</code>. What am I doing wrong?</p>","319618","","","","","2011-01-07 12:25:56","Android Handler problem","<android><multithreading><handler>","2","0","1","",""
"4625305","1","","","2011-01-07 12:08:48","0","190","<p>I have a layout of a user entry form.when i enter username and password and hit the submit button.the content should be saved and another div with three textboxes and editboxes should appear in the same page.</p>","566842","","1320510","","2011-01-08 11:47:29","2012-05-08 13:01:32","Relative Layout Android","<android><android-layout>","3","0","","",""
"4625547","1","4626870","","2011-01-07 12:42:49","13","13193","<p>I am working on android application in which i have play online radio streaming.   i have gone through the media player classes but i don't think is there any method to online streaming of radio. If any know about this please help me.</p><p>Thank You.  Vikram  </p>","395627","","703851","","2011-05-10 09:14:17","2012-01-09 07:07:35","How to play online radio in android","<android><audio-streaming>","2","0","8","",""
"4625549","1","5168719","","2011-01-07 12:42:56","0","1037","<p>I'm porting a native library to a NDK application.</p><p>When I try to use the stl_tree.h #include, I got the following error.</p><pre><code>error: stl_tree.h: No such file or directory</code></pre><p>This is my Android.mk file.</p><pre><code>LOCAL_PATH := $(call my-dir)MY_PATH := $(LOCAL_PATH)include $(call all-subdir-makefiles)LOCAL_PATH := $(MY_PATH)include $(CLEAR_VARS)LOCAL_LDLIBS := -llog -la -lb -lc -lstdc++ -lgcc #I try to explicit declare the stdc++ and gcc but still doesn't works.LOCAL_MODULE    := rmsdkLOCAL_SRC_FILES := curlnetprovider.cpp RMServices.cppLOCAL_C_INCLUDES := $(LOCAL_PATH)/include-all \$(LOCAL_PATH)/include-all/opensslLOCAL_STATIC_LIBRARIES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlibinclude $(BUILD_SHARED_LIBRARY)</code></pre><p>And this is my Application.mk</p><pre><code>APP_MODULES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlib rmsdkAPP_STL := stlport_static</code></pre><p>My actual problem is, when compiling I get a: '_Rb_tree_increment' is not a member of 'std'This is why I try to include the stl_tree myself. It appears this lib don't get included.</p>","558433","","558433","","2011-01-07 15:31:11","2011-03-02 14:34:46","Using stl_tree.h on Android NDK results in ""No such file or directory""","<c++><android><android-ndk>","3","0","","",""
"4625642","1","","","2011-01-07 12:54:35","1","1562","<p>Let me tell you my problem. I want to change my screen resolution.I can change it in an application but it changes only application'sscreen. I wanna set system's resolution so it won't be important whichapplication is running on front. My device's resolution is set as 1280* 720 p. Can I make it 1260 * 680? If it requires to make changes inAndroid source code, I can. Just tell me where to change. Waiting foryour help. </p>","511853","","319618","","2011-01-07 16:09:18","2011-09-17 13:41:41","How to Change Screen Resolution Programmatically?","<java><android><resolution>","2","3","2","",""
"4625832","1","4629577","","2011-01-07 13:18:01","11","9676","<p>I found this <a href=""http://stackoverflow.com/questions/4317778/hide-footer-view-in-listview"">Hide footer view in ListView?</a>. As Yoni poited out correctly, you can hide a header in a <code>ListView</code> by wrapping it into a <code>FrameLayout</code> and <code>setVisibility()</code> of the inner <code>View</code> to <code>View.GONE</code>. This works almost perfect for me, BUT:As the <code>FrameLayout</code> still exists, the <code>ListView</code> adds two dividers to the displayed list. It seems like a single divider with a height of two dividers. Is there a way to hide a single divider of a <code>ListView</code>? Maybe it's possible to change the divider's color to the background, that would be fine for me, too. Any complete other ideas? Perfect! </p><p>Please help me. I'm not keen on spending two more hours of trial and error. </p><p>Thanks a lot! </p>","566904","","1507439","","2013-03-19 16:43:05","2013-03-19 16:43:05","Hiding ListView Header / Hiding Single Divider in a List","<android><android-listview><divider>","3","1","3","",""
"4625897","1","","","2011-01-07 13:26:51","2","739","<p>I'm trying to use XMLPullParser to parse a large XML document for an Android application.  Often I need to re-traverse the document from the beginning.</p><ol><li><p>How would I reset the parser?  It seems inefficient to call getResources.getXML() repeatedly.  What about calling calling setInput on the parser directly to reset?  Is there a code example.  </p></li><li><p>If the xml document needs to be traversed multiple times, is XMLPullParser still recommended for performance concerns.</p></li></ol><p>Regards</p>","566933","","","","","2011-01-07 13:26:51","Android XMLPullParser multiple passes through XML document","<android><traversal><xmlpullparser>","0","2","1","",""
"4625901","1","","","2011-01-07 13:27:04","0","1542","<p>On a pc i know it is possible to download a youtube video using javascript, but I don't kno how to do it on android, or if it is possible at all. </p><p>Would be nice if anyone could tell me how to do this or give me an alternative.</p>","645519","","","","","2012-02-29 10:56:42","download youtube video on android","<javascript><android><download><youtube>","0","4","","",""
"4626021","1","4626378","","2011-01-07 13:40:55","0","914","<p>In my android project I have an image that i want to rotate it and create animation for long time. I can run program and it works fine. but I don't know how can I stop it. if you know please tell me.</p><p>Thanks</p><p>This is my code, I have a menu with two items, When I click on Start item, startAnimation function runs and when I click on Stop item, stopAnimation runs.:</p><pre><code>public class Hypnagogic extends Activity {    ImageView imView;    Animation an;    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        imView = (ImageView)findViewById(R.id.imView);    }    private void startAnimation()    {        an = AnimationUtils.loadAnimation(this, R.anim.spin);        imView.startAnimation(an);    }    private void stopAnimation()    {        ;//there is no any stop function!    }}</code></pre><p>also, in res/anim I put spin.xml that is my animation</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;set&gt;    &lt;rotate    android:fromDegrees=""0""    android:toDegrees=""-18000""    android:pivotX=""50%""    android:pivotY=""50%""    android:duration=""50000"" /&gt;&lt;/set&gt;</code></pre><p></p>","513413","","321697","","2011-01-07 15:59:03","2011-01-07 15:59:03","Android, problem in stopping animation","<android><animation><stop>","1","0","","",""
"4626028","1","4626043","","2011-01-07 13:41:13","1","3413","<p>How can you disable pinch or multitouch functionality in an Android MapView?</p>","2450","","","","","2013-12-24 06:36:32","How to disable pinch in Android MapView","<android><google-maps><multi-touch>","2","0","1","",""
"4626103","1","","","2011-01-07 13:51:36","5","1197","<p>I'm trying to debug an AppWidget but I incurred in a problem :DIf not setting the breakpoint the widget works without ANR and the commands Log.v are executed flawlessly. Then I placed a breakpoint on the top of the method:</p><pre><code>    public void onReceive(Context context, Intent intent) {    Log.v(TAG, ""onReceive 1""); // BP on this line    super.onReceive(context, intent);    String action = intent.getAction();    // Checks on action and computations ...    Log.v(TAG, ""onReceive 2"");    updateWidget(context);    Log.v(TAG, ""onReceive 3"");}</code></pre><p>The breakpoint stops the execution as expected but then the process dies.The problem is that the breakpoint ( I guess xD )  cause an ANR and the ActivityManager kills the process. That's the Log:</p><pre><code>01-07 14:32:38.886: ERROR/ActivityManager(72): ANR in com.salvo.wifiwidget01-07 14:32:38.886: INFO/Process(72): Sending signal. PID: 475 SIG: 9............01-07 14:32:38.906: INFO/ActivityManager(72): Process com.salvo.wifiwidget (pid   475) has died.</code></pre><p>This cause the debug to stop.So the question is: there's a way to debug the widget without incurring in the ANR??thanks in advance for the answers</p>","167194","","","","","2012-02-16 23:02:05","Debugging Widget causes ANR","<android><eclipse><android-widget>","1","1","1","",""
"4626131","1","","","2011-01-07 13:54:52","0","460","<p>Hey,I'm trying to get a ProgressDialog working while im fetching a XML from the web. The problem is that the dialog shows up as soon as the XML is loaded and displayed. If I dismiss it afterwards it won't show up at all. Any ideas what to do? I'm new to android development and this is my first app, I've already searched the net but didn't find any working solution..Here is the shortened code:</p><pre><code>public class showReleases extends Activity {    SitesList sitesList = null;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.releasedetails);    ProgressDialog dialog = new ProgressDialog(showReleases.this);    dialog.setMessage(""please wait"");    dialog.setIndeterminate(true);    dialog.setCancelable(false);    dialog.show();    getFeed2();    dialog.dismiss();}public void getFeed2() {    Bundle extras = getIntent().getExtras();    try {        SAXParserFactory spf = SAXParserFactory.newInstance();        SAXParser sp = spf.newSAXParser();        XMLReader xr = sp.getXMLReader();        URL sourceUrl = new URL(""http://www.it-leaked.com/app/details.php?id="" + extras.getString(""id""));        MyXMLHandler myXMLHandler = new MyXMLHandler();        xr.setContentHandler(myXMLHandler);        xr.parse(new InputSource(sourceUrl.openStream()));    } catch (Exception e) {        System.out.println(""XML Pasing Excpetion = "" + e);    }    sitesList = MyXMLHandler.sitesList;    TextView txtView = (TextView)findViewById(R.id.TextView01);    txtView.setText(sitesList.getTitle().get(0));    TextView txtView2 = (TextView)findViewById(R.id.TextView02);    String myTracklist = sitesList.getTracklist().get(0);    myTracklist = myTracklist.replace(""||||"", ""\n"");    txtView2.setText(myTracklist);}}</code></pre><p>Thanks in advance</p>","563020","","321697","","2011-01-07 14:13:37","2011-01-07 14:13:37","ProgressDialog showing up after XML is fetched","<android><xml><progressdialog>","2","1","1","",""
"4626226","1","","","2011-01-07 08:10:10","1","1545","<p>I searched a lot for a perfect example of code that helps me understand how to integrate Facebook in my application. How can I integrate it?</p>","","Arslan","168175","","2012-06-05 10:05:13","2013-04-25 09:34:14","Integrating Facebook into my Android app","<facebook><android>","3","2","","",""
"4626402","1","","","2011-01-07 14:22:59","0","572","<p>Im trying to access the certificate/signature from inside an android app, so that I can do something with the certificate.I googled a bit and found the code below:</p><pre><code>Class c =  getClass();ProtectionDomain pd = c.getProtectionDomain();CodeSource cs = pd.getCodeSource();Certificate[] signingCertificates = cs.getCertificates();String st = signingCertificates[0].toString();</code></pre><p>but <code>c.getProtectionDomain()</code> returns null.</p><p>anyone can help? many thanks.</p>","566998","","15187","","2011-01-07 14:51:26","2011-01-07 15:06:28","how to access android app's certificate from inside the app?","<android><certificate>","1","0","","",""
"4626415","1","4626928","","2011-01-07 14:23:48","3","4447","<p>I need to change the background color of a TextView.</p><p>the font color using ColorStateList what I can change, but the background color does not accept ColorStateList</p><pre><code>lblEtiqueta.setTextColor (new ColorStateList (new int [] [] {new int [] {android.R.attr.state_pressed}new int [] {android.R.attr.state_focused}new int [0]}, new int [] {Color.rgb (255, 128, 192),Color.rgb (100, 200, 192),Color.White,}));</code></pre><p>how to make the background color?</p><p>TextView control is created dynamically at runtime.</p><p>Thanks in advance.</p>","518657","","","","","2011-01-08 22:32:21","Change Background Color of TextView on Click","<java><android><eclipse><colors><textview>","1","0","1","",""
"4626450","1","4627411","","2011-01-07 14:27:05","0","341","<p>Is it possible to communicate two instances of an app:</p><ul><li>In nearby devices (Android or iPhone) </li><li>Without user intervention (aside from starting the app once) </li><li>Without internet (but not network) connection? </li></ul><p>How?</p><ul><li>Android to Android?</li><li>iPhone to iPhone?</li><li>Android to iPhone and vice-versa?</li></ul>","143378","","143378","","2011-01-07 16:09:44","2011-02-04 10:08:47","App communication in nearby devices without user intervention","<iphone><android><ios>","3","0","","",""
"4626628","1","4626790","","2011-01-07 14:43:59","0","179","<p>I want to have a site, which contains of a vertical layout, that has a content part and a footer part. The footer part should be 20% of the height of the display height. I think that it is a very common usecase.</p><p>I have tried some ways, but was not successful in the end.</p><p>How would i implement this?</p><p>TU in advance!</p>","566994","","","","","2011-01-07 15:27:29","Android Layout LinearLayoutProblem","<android><android-layout>","3","0","","",""
"4626654","1","4626924","","2011-01-07 14:45:58","2","156","<p>I am using SAXParser and the characters after any Apostrof(') in the xml file will not be printed i the listview? Anybody know why?</p><p><strong>Example:</strong></p><p><code>&lt;title&gt;I'am a good Android programmer&lt;/title&gt;</code></p><p>The characters after ""I'"" will not bee printed...</p>","566096","","","","","2011-01-07 15:11:53","Im using a SAXParser and the Apostrof ( ' ) in <title> or <description> makeing problem","<android><xml-parsing>","1","0","1","",""
"4626665","1","","","2011-01-07 14:46:56","1","278","<p>I am developping a module with flash (openlaszlo for the client and red5 for the server) in order to make conference with webcam.</p><p>The module run correctly on desktop but I want it to run on Android. The issue is that the flash plugin for Android 2.2 doesn't allow to capture the webcam.</p><p>The solution I've found was to make the capture with an AIR app. Indeed, Adobe allow you to install and launch an AIR app from within a web page thanks to a file named ""air.swf"" hosted by Adobe.</p><p>Well, this system run correctly on Desktop, but on Android, the function that launch the AIR app fail or something because all the code that follows isn't executed.</p><p>My question is then : is the system of badge running on Android ?</p><p>Don't hesitate to ask for more informations.</p><p>I precise I've search for many hours on the web, (&lt;&lt;""badge.swf""+android>>, &lt;&lt;""launchApplication""+android>>, etc.) and zero helping result.</p>","567023","","","","","2011-02-05 03:50:10","Is the seamless install of an AIR application from a web page (badge, air.swf) running on Android?","<android><flash><air>","0","0","","",""
"4626676","1","4627219","","2011-01-07 14:48:32","1","999","<p>I've got a <code>ListActivity</code> that displays <code>WebView</code>s.<br>There is a menu option to copy text that will call <a href=""http://stackoverflow.com/questions/1111844"">this</a> on visible WebViews.<br>Everything works except for one thing. I can't perform text selection in vertical direction as <code>ListView</code> consumes corresponding <code>MotionEvent</code>s for it's own scrolling.<br>I've tried this:</p><pre><code>@Overridepublic boolean dispatchTouchEvent(MotionEvent ev) {    if (webViewsInTextSelectionMode) {        bypassEventToWebViews(ev);        return true;    } else {        return super.dispatchTouchEvent(ev);    }}</code></pre><p>Which will block scrolling but will also pass unadjusted <code>MotionEvent</code> coordinates to a <code>WebView</code>.<br>Is there a way to correctly prevent ListView from scrolling in this case?</p>","15187","","","","","2011-01-08 00:41:47","Temporary bypassing ListView scrolling","<android>","2","0","","",""
"4626692","1","4628298","","2011-01-07 14:49:57","1","1865","<p>I have an ImageView loading a picture in my Activity and want to draw some lines on it.  It seems like I'm not able to overlay the lines I draw onto the ImageView.  If I create a new class (myPainter) which extends 'View', hook myPainter.onDraw() and then setContentView(mp) in onCreate() from the activity, all I get are the drawn lines. My ImageView is gone from onCreate().  How do I get the ImageView and lines to show up in the same layout?  I'm also Override'ing onTouch() for the ImageView so I can get the xy click locations from it.</p><pre><code>    public class myPainter extends View    {    public myPainter (Context context)       {        super (context);       }     @Override       protected void onDraw(Canvas canvas)      {      super.onDraw (canvas);      Paint p = new Paint();          p.setColor(Color.RED);         canvas.drawLine (E_XMIN, E_YMIN, E_XMAX, E_YMAX, p);     }    }     @Override     public void onCreate (Bundle savedInstanceState)     {      super.onCreate (savedInstanceState);      setContentView (R.layout.main);      ImageView iv = (ImageView) findViewById(R.id.ImageView01);      iv.setOnTouchListener (this);// this draws my lines, but I loose the pic above ^^^      myPainter mp = new myPainter(this);              setContentView(mp);     }</code></pre><hr><p><strong>UPDATE:</strong>  </p><p>I think I've literally painted myself into a corner. How would I add a frameAnimation to this code now in the onTouchEvent() method? Like where the user touches the screen. The Android rocketAnimation example causes an exception if I add code to the myPainter() class: </p><pre><code>  @Override  public boolean onTouchEvent (MotionEvent event)  {        //Log.d (TAG, ""touchevent in myPainter"");        switch (event.getAction())        {            case MotionEvent.ACTION_DOWN:                    Log.d (TAG, ""down x:"" + event.getX() + "" y:"" + event.getY());                    int wClick = getClick (event.getX(), event.getY());                    AnimationDrawable touchAni;                    ImageView iv = (ImageView) findViewById (R.drawable.triangle);                    iv.setBackgroundResource (R.drawable.nova);                    touchAni = (AnimationDrawable) iv.getBackground ();                   touchAni.start ();                   return true;        }       return super.onTouchEvent (event);  }</code></pre>","566145","","214668","","2011-12-16 02:53:00","2011-12-16 02:53:00","Drawing a line in a class which extends ""Activity'","<android><imageview><draw><lines>","2","0","","",""
"4626698","1","4626786","","2011-01-07 14:50:26","2","3307","<p>I'm am doing a simple coding attempt trying to draw on a SurfaceView created on my main.xml layout. I can change background color and display an icon fine, but when I try to draw I get an error. I am a newbie so obvious I am missing something, please lend a helping hint, thanks!</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:id=""@+id/root"" android:orientation=""vertical""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;SurfaceView android:id=""@+id/Paper""            android:layout_height=""fill_parent""             android:layout_width=""fill_parent""&gt;        &lt;/SurfaceView&gt;&lt;/LinearLayout&gt;</code></pre><p>and code here;</p><pre><code>package com.example.SurfaceViewTest;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.os.Bundle;import android.view.SurfaceHolder;import android.view.SurfaceView;public class SurfaceViewTest extends Activity implements SurfaceHolder.Callback {    private SurfaceView mSurfaceView;    private SurfaceHolder mSurfaceHolder;    private Paint paint;    Bitmap mDrawing;    boolean mRun;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mSurfaceView = (SurfaceView) this.findViewById(R.id.Paper);        mSurfaceHolder = mSurfaceView.getHolder();        mSurfaceHolder.addCallback(this);        mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_NORMAL);    }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {        // TODO Auto-generated method stub    }    @Override    public void surfaceCreated(SurfaceHolder holder) {        mSurfaceView.setBackgroundColor(Color.rgb(0, 255, 0));        mRun=true;        thread.start();    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {        // TODO Auto-generated method stub    }    Thread thread = new Thread(){        public void doDraw(Canvas c){            mDrawing = Bitmap.createBitmap(200, 300, Bitmap.Config.RGB_565);            c.setBitmap(mDrawing);            paint = new Paint();            paint.setColor(Color.rgb(255, 255,255));            c.drawLine(1,1,200,300, paint);        }        public void run() {            while (mRun) {                Canvas c = null;                try {                    c = mSurfaceHolder.lockCanvas(null);                    synchronized (mSurfaceHolder) {                        doDraw(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) {                        mSurfaceHolder.unlockCanvasAndPost(c);                    }                }            }        }    };}</code></pre><p>UPDATE:</p><p>Ok I got it to works thanks!</p><pre><code>package com.example.SurfaceViewTest;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.os.Bundle;import android.view.SurfaceHolder;import android.view.SurfaceView;public class SurfaceViewTest extends Activity implements SurfaceHolder.Callback {    private SurfaceView mSurfaceView;    private SurfaceHolder mSurfaceHolder;    Bitmap mDrawing;    Canvas tempCanvas = new Canvas();    Paint paint;    boolean mRun;    int intCanvasWidth, intCanvasHeight;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mSurfaceView = (SurfaceView) this.findViewById(R.id.Paper);        mSurfaceHolder = mSurfaceView.getHolder();        mSurfaceHolder.addCallback(this);        mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_NORMAL);    }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width,            int height) {        intCanvasWidth = width;        intCanvasHeight = height;        mDrawing = Bitmap.createBitmap(intCanvasWidth, intCanvasHeight,                Bitmap.Config.RGB_565);        paint = new Paint();    }    @Override    public void surfaceCreated(SurfaceHolder holder) {        if (thread.getState() == Thread.State.TERMINATED) {            thread = new Thread();        }        mRun = true;        thread.start();    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {        boolean retry = true;        mRun = false;        while (retry) {            try {                thread.join();                retry = false;            } catch (InterruptedException e) {                // we will try it again and again...            }        }    }    Thread thread = new Thread() {        public void doDraw(Canvas c) {            tempCanvas.setBitmap(mDrawing);            paint.setColor(Color.rgb(255, 255,255));            tempCanvas.drawLine(1,1,200,300, paint);            c.drawBitmap(mDrawing, 0, 0, null);        }        @Override        public void run() {            Canvas c;            while (mRun) {                c = null;                try {                    c = mSurfaceHolder.lockCanvas(null);                    synchronized (mSurfaceHolder) {                        doDraw(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) {                        mSurfaceHolder.unlockCanvasAndPost(c);                    }                }            }        }    };}</code></pre>","556248","","556248","","2011-01-12 11:42:36","2011-01-12 11:42:36","Application error when drawing to SurfaceView","<android><xml><drawing><surfaceview>","1","0","0","",""
"4626767","1","","","2011-01-07 14:58:25","15","9924","<p>I'm trying to use the hierarchyviewer tool to see the layout of my Android app. </p><p>I can run hierarchyviewer, and see the emulator running. I click on """" and try to load the view hierarchy and get the error ""Unable to load window data for window  on device emulator-5554"". </p><p>I'm developing on OSX (10.6.5) using Eclipse 3.5.2. I'm currently debugging through Eclipse, in a custom-sized emulator. I have updated the Android tools to the latest (revision 8) with the AVD and SDK manager in Eclipse. I haven't found any threads searching for the error message, or for general heirarchy viewer problems.</p><p>Does anyone have an idea how to get the tool working?</p><p>Cheers</p>","567033","","","","","2013-11-24 11:17:33","Android hierarchyviewer unable to load window data","<android>","4","1","1","",""
"4626861","1","4627071","","2011-01-07 15:05:21","6","19570","<p>Is it possible to to put an object of type Object into an intent as a Extra? I have a variable of type object and won't know until it is assigned a value as to what the object datatype is. Maybe something to do with serialization or as a bundle i'm not sure? And then in the next activity how do I then get this value in order to store it in an <code>ArrayList&lt;Object&gt;</code> ? </p>","400406","","6391","","2011-01-07 15:40:54","2013-02-17 11:58:51","Put Object as intent for next activity","<android><object><android-intent><bundle><parcelable>","1","1","1","",""
"4626888","1","4626979","","2011-01-07 15:08:10","1","758","<p>I have a <strong>ListView</strong> with a <strong>divider</strong> of 1pd thickness. But somehow every second divider in the ListView is thicker then the others ...as you can see on the picture</p><p><img src=""http://i.stack.imgur.com/yQNDu.jpg"" alt=""alt text""></p><p>the code of the ListView is real simple :</p><pre><code> &lt;ListView          android:id=""@+id/directoriesListView""         android:choiceMode=""singleChoice""         android:clickable=""true""         android:layout_weight=""2.5""         android:cacheColorHint=""@null""         android:footerDividersEnabled=""false""         android:fadingEdge=""none""         style=""@style/ListView_NarrowItems""         /&gt;</code></pre><p>and the style :</p><pre><code>&lt;style    name=""ListView_NarrowItems""    &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;item name=""android:textColor""&gt;#FFFFFF&lt;/item&gt;    &lt;item name=""android:background""&gt;#000000&lt;/item&gt;    &lt;item name=""android:divider""&gt;#FFFFFF&lt;/item&gt;    &lt;item name=""android:dividerHeight""&gt;1px&lt;/item&gt;&lt;/style&gt;</code></pre><p>any idea what is wrong ? </p>","1205130","","","","","2011-09-05 12:34:40","Android ListView divider strange problem","<android><android-layout>","2","0","1","",""
"4626932","1","","","2011-01-07 15:12:52","2","7745","<p>please tell me where can i find twitter4j sdk for android and at least one example how to implement log-in and tweet in android application.</p><p>I have searched but not found the solution.</p>","565942","","21234","","2011-01-07 15:13:43","2012-12-18 11:18:41","using twitter4j for integration to tweet in android","<android><twitter4j>","4","0","2","",""
"4626957","1","","","2011-01-07 15:15:24","1","589","<p>The following sample code I am using from the API demo app for playing the streaming videos</p><p>public class VideoViewDemo extends Activity {</p><pre><code>/** * TODO: Set the path variable to a streaming video URL or a local media * file path. */private String path = """";private VideoView mVideoView;@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.videoview);    mVideoView = (VideoView) findViewById(R.id.surface_view);    if (path == """") {        // Tell the user to provide a media file URL/path.        Toast.makeText(                VideoViewDemo.this,                ""Please edit VideoViewDemo Activity, and set path""                        + "" variable to your media file URL/path"",                Toast.LENGTH_LONG).show();    } else {        /*         * Alternatively,for streaming media you can use         * mVideoView.setVideoURI(Uri.parse(URLstring));         */        mVideoView.setVideoPath(path);        mVideoView.setMediaController(new MediaController(this));        mVideoView.requestFocus();    }}</code></pre><p>}</p><p>I faced the following errors.</p><p>i> While playing the videos , if an incoming call comes &amp; the user receives &amp; then disconnects the call , then a black screen is displayed &amp; the video is no longer played again.</p><p>2> Similarly if an user rejects an incoming call , a black screen is displayed &amp; the video is no longer played.</p><p>3> When a low battery error message is displayed while a video is being played &amp; the user clicks on OK button of the error message , a black screen is displayed &amp; the video is no longer played.</p><p>4> When an incoming SMS comes while viewing the streaming video &amp; the user views the SMS &amp; closes it , a black screen is displayed &amp; the video is no longer played.</p><p>Kindly provide me the suggestions/sample code to handle the conditions to solve the errors.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-01-07 15:37:02","Errors while using VideoView in Android","<android>","1","1","1","",""
"4627085","1","5183851","","2011-01-07 15:26:17","5","3085","<p>I'm developing an Android 2.2 application. I use C++ to manage all OpenGL ES 2.0 stuff.</p><p>I want to show a text with OpenGL, but I don't know how (I'm very, very new with it).</p><p>I read that I can render common strings to textures, and simply draw those textures. But how can I do that?</p><p>Thank you.</p>","68571","","","","","2011-05-24 07:22:17","Show a text as texture with OpenGL ES 2.0","<android><opengl-es-2.0>","2","0","1","",""
"4627184","1","4627333","","2011-01-07 15:34:22","0","383","<p>I'm in the middle of debugging an issue where ANR message gets displayed when wi-fi connectivity is lost. So when the application starts it has WI-Fi connectivity. The connectivity drops and during the switching from wi-fi to 3G.. no data can be fetched from the sever. In my code i catch the exception and then after a brief sleep period i try again. But the application displays ANR message and crashes. My question is where should i even begin with. what's the lead . I looked in the LOGCAT.. but it has no indication which states the application is hanging at a particular place. Any inputs from expert on this.BTW my devise is Moto Droid Adroid 2.2</p>","260298","","6391","","2011-01-07 17:21:55","2011-03-02 04:40:12","Android app ANR when wi-fi connectivity is lost","<android>","1","0","","",""
"4627204","1","","","2011-01-07 15:36:14","0","289","<p>I need some help as i am just calling a method in a thread. now what i want is wait for reply form getData() method only for 15 seconds. If it reply before 15 seconds it should be terminated otherwise after 15 seconds it should be terminated. The code is given below:</p><pre><code>boolean networkStatus;private Runnable runnable; private ProgressDialog m_ProgressDialog = null;        private Runnable returnRes = new Runnable() {        @Override        public void run() {         if(networkStatus){          setData();         m_ProgressDialog.dismiss();        }    };private void callGetdata(){ runnable = new Runnable() {        @Override        public void run() {       networkStatus = getData();             runOnUiThread(returnRes);         }    };    Thread thread = new Thread(null, runnable, ""MovetoBackground"");    thread.start();    m_ProgressDialog = ProgressDialog.show(this, """", getString(R.string.loadMsg), true);}</code></pre>","565942","","21234","","2011-01-07 15:55:14","2011-01-07 16:04:43","Thread in android","<android><multithreading>","1","2","2","",""
"4627237","1","4627367","","2011-01-07 15:40:29","1","1447","<p>I've made a couple of apps for android, but none used graphics that much. I'm now trying to make an actual game. I have some bitmaps that are on my canvas. My problem is I'm not sure where to initialize their positions. and in OnTouch events I want to make sure the bitmaps don't stray outside the screen.For example, initializing one bitmap:</p><pre><code>canvas.drawBitmap(glider.getGraphic(), 30, 20, null);</code></pre><p>20 and 30 were arbitrary. But I want to be able to write something like screen.getWidth() so I know exactly where the bitmap is relative to the border of the screen. I can't find this in the developers reference.</p>","485498","","","","","2011-01-07 15:53:46","Android SurfaceView width/height","<android><bitmap><surfaceview>","1","0","1","",""
"4627341","1","4627420","","2011-01-07 15:50:55","2","2474","<p>I am currently developing an android application and every now and then I am checking my application if it runs smoothly on my android phone. Now, my problem is my desktop computer crashes and all the files on my computer were deleted including the source code of my application. I am wondering if I have a chance in accessing my source code just only by using my .apk file installed on my android phone?</p>","516160","","","","","2011-01-07 16:00:06","Accessing source code using .apk file","<android><eclipse><apk><android-install-apk>","1","2","","",""
"4627368","1","4627460","","2011-01-07 15:53:49","1","1094","<p>I currently have a Google Map Activity which is apparently working well but doesn't show the map (this sounds stupid!)</p><p>Here is a picture that will make you understand better my problem:<img src=""http://i.stack.imgur.com/Knjrs.png"" alt=""alt text""></p><p>I already confirmed my apiKey, checked the tutorial over and over and even the manifest seems not be missing anything.</p><p>I get only this on adb:</p><blockquote>  <p>276             MapActivity  W  Recycling dispatcher   com.google.googlenav.datarequest.DataRequestDispatcher@43ea39b0</p>    <p>276             MapActivity  V  Recycling map object.</p>    <p>51     GpsLocationProvider  D  setMinTime 1000</p>    <p>276             MapActivity  I  Handling network change notification:CONNECTED</p>    <p>276             MapActivity  E  Couldn't get connection factory client</p></blockquote><p>Does anyone have a clue about what may be causing this? </p><p>Thanks.</p>","508479","","","","","2011-09-24 13:56:14","Android Google Maps Activity only shows small crosses","<android><google-maps>","5","0","","",""
"4627381","1","5046511","","2011-01-07 15:55:13","1","879","<p>I've got a live wallpaper that I'd like to communicate with from an Activity in the same package.  I've never done any work with services.  Would I be able to use the <a href=""http://developer.android.com/reference/android/app/Service.html#LocalServiceSample"" rel=""nofollow"">Local Service pattern</a>, or am I restricted because my service is a live wallpaper, and need to use Intents or AIDL?</p><p>I think the flow would go something like this, please correct me where my process might fail:</p><ol><li>Preview the live wallpaper from the Live Wallpaper Chooser</li><li>Go into my custom Settings activity</li><li>Click on a ""Screen Shot"" button or preference to open up a ""Screen Shot"" activity</li><li>Send a message to my wallpaper, asking for a screen shot bitmap to be rendered</li><li>The wallpaper service receives the message and renders its current visuals to a bitmap in the app's data directory</li><li>The wallpaper sends a message back to the activity indicating success and location of the bitmap</li><li>The activity receives this message, loads the bitmap from the given location, and displays it to the user for further processing / sharing</li></ol><p>The parts I'm not sure about are the message passing in 4-7.</p>","335650","","19750","","2011-03-31 15:40:31","2011-03-31 15:40:31","Activity / Live Wallpaper communication in Android","<android><activity><communication><live-wallpaper>","1","0","","",""
"4627395","1","4628326","","2011-01-07 15:57:08","17","17085","<p>This is my first post and my last hope is in your's hands.</p><p>I have to download and parse XML files from http server <strong>with</strong> HTTP Basic authentication. Now I'm doing it this way:</p><pre><code>URL url = new URL(""http://SERVER.WITHOUT.AUTHENTICATION/some.xml"");     DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();     DocumentBuilder db = dbf.newDocumentBuilder();     Document doc = db.parse(new InputSource(url.openStream()));     doc.getDocumentElement().normalize();</code></pre><p>But in that way I can't get xml (or I'm just simply not aware of that ) document from server with http authentication.</p><p>I will be really grateful if you can show me the best and easiest way to reach my goal.</p>","567116","","893797","","2013-04-17 08:26:45","2013-06-12 19:46:00","HTTP requests with basic authentication","<java><android>","3","0","9","",""
"4627422","1","4628002","","2011-01-07 16:00:08","2","3455","<p>I'm programmatically putting various <code>TextView</code>s into a <code>LinearLayout</code> with a horizontal orientation. </p><p>After 2h of research I couldn't find out how to tell Android not to squeeze all the TextViews in one line but instead to ""float"" non-fitting <code>TextView</code>s into the next line.</p><p>I know there isn't something like actual ""lines"" in a <code>LinearLayout</code>, but how can I tell the <code>TextView</code>s to actually behave like floating DIVs from the HTML world?</p><p>Thanks alot!</p>","419501","","419501","","2012-06-09 21:05:15","2012-06-09 21:05:15","How to create ""floating TextViews"" in Android?","<android><alignment><textview><floating>","2","0","","",""
"4627446","1","","","2011-01-07 16:03:01","8","3839","<p>On some android devices, the browser actually supports pre-caching of website components using an HTML5 manifest. However, on those same devices, the webview component does not seem to support the HTML5 manifest. Does anybody know how I can make the webview component support the HTML5 manifest in the newest Android versions?</p>","1507543","","","","","2012-02-27 16:43:07","How can I make webview use the HTML5 cache manifest?","<android><webview>","0","4","5","2012-02-27 20:50:07",""
"4627730","1","4628941","","2011-01-07 16:29:06","3","761","<p><strong>SOLVED:</strong>I was using icons from sdk v9 (Android 2.3 Gingerbread) which seems to have different dimension. The asset studio also creates icons for 2.3. So I placed gingerbread icons to drawable-xxpi-v9 and for older versions I put icons from SDK v8 to drawable-hdpi and it works fine now</p><p>Original question:Hello I have a little problem.All the icons in my apk are smaller than the same icons in other apps (Gmail etc.)This is how it looks like in <a href=""http://dl.dropbox.com/u/5860650/small%20icons/myApk.png"" rel=""nofollow"">my apk</a> and this is the same icon in <a href=""http://dl.dropbox.com/u/5860650/small%20icons/gmail.png"" rel=""nofollow"">Gmail.apk</a>.I have copied these icons directly from SDK  to the specific folders for hdpi, mdpi and ldpi.</p><p>Here is an example of a hdpi <a href=""http://dl.dropbox.com/u/5860650/small%20icons/ic_menu_refresh.png"" rel=""nofollow"">icon</a> I use and my menu.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=""@string/refresh""  android:icon=""@drawable/ic_menu_refresh"" /&gt; &lt;item  android:id=""@+id/add""  android:title=""@string/add""  android:icon=""@drawable/ic_menu_add"" /&gt; &lt;item  android:id=""@+id/login""  android:title=""@string/account""  android:icon=""@drawable/ic_menu_login"" /&gt;&lt;/menu&gt;</code></pre><p>Does anybody know how to make these icon have the same size as in other apk's?I have tried the asset studio with no effect.</p><p><strong>UPDATE:</strong> If I reference an icon directly from android (android:drawable) then it has normal size. However not all icons can be referenced.</p>","522545","","497356","","2011-09-13 00:51:59","2011-09-13 00:51:59","Icons in menu are smaller than they should be","<android><menu><icons>","2","0","4","",""
"4627741","1","","","2011-01-07 16:29:41","2","906","<p>I have a TabHost with 3 TabSpecs. One tab is using a WebView and when I load a url that has an embedded youtube video and then click on another tab, the youtube video floats above its containing tab and is visible on subsequent tabs. I need the video to NOT be visible when another tab is selected. </p><p><a href=""http://www.jaydial.net/android/android_youtube_float.jpg"" rel=""nofollow"">Screenshot</a></p><p>The application is built using this tutorial : ""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html""</p><p>I have modified the ArtistsActivity to use a WebView:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;import android.webkit.WebViewClient;public class ArtistsActivity extends Activity{    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        WebView view = new WebView(this);        view.getSettings().setJavaScriptEnabled(true);        view.getSettings().setPluginsEnabled(true);        view.setWebViewClient(new MyWebViewClient());        view.loadUrl(""http://www.jaydial.net/android/youtube.htm"");        setContentView(view);    }    private class MyWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);                    return true;        }     } }</code></pre><p>Any suggestions on how to fix this?</p><p>Thanks</p><p>JayDial</p>","215526","","215526","","2011-01-07 19:15:28","2011-01-21 01:10:07","TabHost\WebView embedded youtube video float issue","<android><webview><android-tabhost>","1","0","","",""
"4627759","1","","","2011-01-07 16:30:29","1","237","<p>Hey I based my game off Google's Lunar Lander example. I have been getting considerable stuttering issues with my game even when I basically run a blank screen with a simple rectangle moving upwards.</p><p>I just grabbed the plain unmodified Lunar Lander example out of the SDK folder and ran it on my phone and noticed that I get noticable (albeit mild) stuttering on that too. It seems it isn't something I did to cause this. Does anyone else get stuttering with the basic Lunar Lander app? What could cause this? I have a Motorola Milestone.</p><p>Garbage collection is being called every 20 seconds or so while the stuttering is every 1-5 seconds so that doesn't seem to be the issue.</p><p>EDIT: if anyone would be willing to run a stripped performance-test version of my app on their phone to see if they get the same performance issues I will upload it somewhere.</p>","549859","","549859","","2011-01-07 16:59:48","2011-01-07 16:59:48","Lunar Lander example stutters on my phone","<java><android><performance>","0","2","","",""
"4627763","1","13229396","","2011-01-07 16:30:56","5","1391","<p>I have an application that contains a webview. Inside the webview the user must log into Facebook using the default login button and authentication. In my webview, after the user logs in the oauth handshake url contains an ""access denied...user denied your request"" error. However, when I visit the same url in the core browser, everything works as expected and the user successfully gets logged in. I assume there are some methods I need to implement in the WebViewClient or WebChromeClient to give my webview full browser ability. However, I do not know what to do. Thoughts?</p>","551729","","","","","2012-11-05 09:52:40","Android WebView with Facebook Login","<android><facebook><android-webview>","1","2","","",""
"4627830","1","4671405","","2011-01-07 16:35:47","0","257","<p>I've been trying to implement the C2DMReceiver to receive push notification. I have downloaded and used the Chrome To Phone code and looked at code of some different applications using this service. I have signed my application up at Google and received an e-mail that my application has been accepted. Now I've tried (too many times ;-)  ) just to register and receive some kind of answer, but nothing happens in the C2DMReceiver. It doesn't seem to get called if the service is even running (should I check that somewhere??). I haven't put up a server side application yet because I first just wanted to be able to register before trying to send messages. Now my question is: Should I be receiving anything from the registration request if I don't have a server side application yet? Could this be the problem or am I really doing something wrong in my Android application???</p><p>Thanks in Advance!</p>","562365","","","","","2011-01-12 16:45:13","When registering with Google for C2DM notifications can you get an answer even if the servers side is not setup?","<android><push-notification><android-c2dm>","1","0","","",""
"4627988","1","","","2011-01-07 16:49:57","4","1062","<p>Below my ListView, I have a bar with a trash can on it.</p><p>When some action is performed, suppose it is simply clicking on the item, I would like the item to animate down to the trash can.  This means both moving downward and shrinking horizontally to a width of 0.</p><p>How can this be achieved?  I suspect it involves creating a bitmap of the item and then animating that bitmap downward and ever smaller.  This also means, depending on where the list item is relative to the screen, it may need to shrink faster than other times (ie: if the list item is already close to the bottom of the screen instead of the top).  I'm just not sure how to achieve any of this.</p><p>The only animation I've done involves presenting a bar from the bottom of the screen.  I've no experience with moving around a free-floating object and altering its size.</p><p>Could someone provide me with some good direction?</p>","406790","","406790","","2011-01-07 21:02:48","2011-10-09 17:45:35","Animating ListView item to trash","<android><listview><animation>","2","0","2","",""
"4628058","1","5548593","","2011-01-07 16:55:47","1","1376","<p>I have a service that uploads file to a server. I acquire a wifilock on it but do I need a partial wakelock if the service is using 3G ?</p>","550393","","","","","2011-04-05 07:31:13","partial wakelock for 3G in Android","<android><networking><connectivity><3g>","2","1","1","",""
"4628102","1","4631810","","2011-01-07 17:01:35","0","1265","<p>On occasion links in the WebView will not respond.  The highlight press color will appear around them but nothing happens.  I am also using WebViewClient's shouldOverrideUrlLoading and that function is not called when this happens.</p><p><strong>Edit:</strong></p><p>I have narrowed this issue down to the following circumstances:</p><ul><li>The webpage is the first page a WebView opens.</li><li>The webpage uses meta name=""viewport"" attribute in the html head</li><li>The WebView is using WebView.getSettings().setUseWideViewPort(true);</li><li>Android 2.1 (Doesn't appear to happen in later versions, didn't test earlier)</li></ul><p>If a webpage meeting those above is opened no links will work.  If another similar page is loaded, those links will not work either.  It is not until you load a page without meta name=""viewport"" that links start to work.  After a page without that meta attribute is opened and then you load a page with the meta viewport attribute, the links start working.</p>","445348","","445348","","2011-01-08 02:40:29","2012-10-28 07:03:48","Links sometimes not working in WebView","<android><webview><links>","2","0","0","",""
"4628233","1","4628269","","2011-01-07 17:14:18","2","1899","<p>I'm having trouble using bool as a type compiling with ndk-build:</p><pre><code>bool test = true;</code></pre><p>error:</p><blockquote>  <p>48: error: 'bool' undeclared (first  use in this function)</p></blockquote><p>Any ideas?</p>","235708","","","","","2011-01-07 17:18:32","error using bool variable in android ndk","<android><c><jni><android-ndk>","1","0","1","",""
"4628246","1","4628441","","2011-01-07 17:15:39","3","2851","<p>I have an application with multiple activities. On one of them, I set up an alarm. I press the HOME button. When the alarm is triggered, a notification appears. When clicking on the notification, I start a dialogue-like Activity (@android:style/Theme.Dialog). Although I am on the desktop screen, Android opens my last activity and then shows my dialogue-like activity on top of that. I just want to show my dialogue activity wherever the user is.</p><p>Does anyone have an idea of what is wrong?</p><pre><code>Intent notificationIntent = new Intent(this, NotificationActivity.class);notificationIntent.putExtra(Constants.EXTRA_ALERT_MESSAGE, contentText);PendingIntent contentIntent = PendingIntent.getActivity(this, Constants.PENDING_INTENT_REQ_DIALOG, notificationIntent, 0);no.contentIntent = contentIntent;</code></pre>","292263","","111896","","2011-09-15 08:11:19","2011-09-15 08:11:19","Activity started from notification opened on top of the activity stack","<android><activity><notifications>","1","0","3","",""
"4628273","1","4628356","","2011-01-07 17:18:51","2","781","<p>I'm very new to OpenGL, so I'm sorry if this may be very basic (or not make sense).</p><p>I'm working on a 2D game in which there are a lot of sprites whose size are not powers of two. So I'll have textures like, say, 520x260, and which cannot be redesigned. Now my understanding is that since OpenGL ES 1 needs textures to be powers of two, I'll effectively be wasting a lot of memory (since the texture in my previous example would actually take up 1024x512 on the hardware).</p><p>What I've been thinking was that instead of having the sprite be two triangles with that one large texture, I could maybe have the sprite be made up of more smaller triangles, and that I could break down to large texture in smaller pow2 chunks (say 128x128) which could be used separately on those triangles (using something like a grid map). </p><p>So my question is: is it possible and feasible to use multiple textures for a single mesh? And if so, would the extra calculations (necessary for all the smaller triangles and texturing them) be worth the texture memory save?</p><p>P.S. I am working on Android, but I don't suppose that makes much difference.</p>","414251","","","","","2011-01-07 17:52:44","OpenGL ES 1.1 multiple textures per mesh","<android><opengl-es>","2","1","","",""
"4628284","1","","","2011-01-07 17:19:40","0","152","<p>I have one main activity and an xml file with 3 different buttons (three different gun sounds)</p><p>So, when the user clicks one of the buttons a gunsound will be played.</p><p>here's how it looks -</p><pre><code>public class gunstats extends Activity {    public gunstats(Bundle onSavedStateInstance) {        final MediaPlayer mp = MediaPlayer.create(this, R.drawable.deagle);        Button button3 = (Button)this.findViewById(R.id.button3);        button3.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mp.start();            }        });    }}</code></pre><p>the problem is that when I open the app in an emulator, it all force closes.When I check the logcat, it says ""Caused by: java.lang.InstantiationException: com.gunstats.gunstats""</p><p>What is causing this?</p>","567231","","6391","","2011-01-07 17:22:53","2011-01-07 17:42:53","Strange force close","<android><eclipse><audio>","3","1","","",""
"4628295","1","4628514","","2011-01-07 17:20:14","6","1210","<p>i'm thinking in something a la Appstore's Textsastic, this is, a full row of needed keys (parenthesis, slash, etc) right above the virtual keyboard, like it was an extention of it.</p><p>How can i accomplish something like that in Android?Is there at least a way to have a listener when the virtual keyboard shows?</p>","495904","","","","","2011-01-07 17:43:46","Extend Android virtual keyboard","<java><android>","1","1","1","",""
"4628376","1","4628523","","2011-01-07 17:28:23","1","4407","<p>At the moment, my app receives KML file from server and displays all the placemarks in the maps. But there is too much data going back and forth, so now i want to receive only a short string (lat,lang for a few points) from the server. </p><p>Is it possible to create KML file on an Android device (any API for this?</p>","324417","","","","","2011-01-07 19:36:57","How to create KML file in Android?","<android><google-maps><kml>","2","0","2","",""
"4628381","1","4631717","","2011-01-07 17:28:30","11","8556","<p>I want to make the vertical scroll bar permanently visible. Currently the scroll bar appears only when I attempt to scroll the text view enclosed inside the scroll view. This is my XML declaration.</p><pre><code>&lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_above=""@id/radio_group""    android:layout_margin=""5dp""    android:scrollbars=""vertical""     android:scrollbarAlwaysDrawVerticalTrack=""true"" &gt;    &lt;TextView        android:id=""@+id/question""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""20sp""        android:textColor=""#FF000000""        android:textStyle=""bold"" /&gt;&lt;/ScrollView&gt;</code></pre><p>Thank you for your time.</p>","421372","","","","","2013-08-12 12:32:27","Making the vertical scrollbar visible","<android><textview><scrollview>","3","0","3","",""
"4628402","1","4628692","","2011-01-07 17:30:41","3","1705","<p>I am starting a new application and I am willing to use the <a href=""http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html"" rel=""nofollow"">Dashboard pattern</a>.</p><p>For example: The <a href=""http://code.google.com/p/iosched/"" rel=""nofollow"">Google IO app</a> uses it:</p><p><img src=""http://i.stack.imgur.com/WcKUK.png"" alt=""alt text""></p><p>My issue is that the amount of buttons will be more than six.I'm not sure if I should use vertical or horizontal scrolling.</p><p>Vertical scrolling could be done with a <code>ScrollView</code> or a <code>GridView</code> but I am not sure which would be the easier way to implement the horizontal version.</p><p>I was thinking of using an <code>HorizontalScrollView</code> but it doesn't have pagination. It should feel similar to the tweetdeck app.</p><p>How would you implement it?</p>","119895","","","","","2011-01-07 18:06:53","Dashboard pattern: HorizontalScrollView with pagination or ScrollView?","<android><dashboard>","4","2","3","",""
"4628566","1","4628809","","2011-01-07 17:48:14","0","905","<p>i wrote a small program to crop an image that is stored in the drawable folder. I am not able to figure out how to save the cropped image to the drawable folder !! </p><p>this is what i tried after seeing another stackoverflow post ..</p><pre><code>try {        FileOutputStream out = new FileOutputStream(""/res/drawable/test2.png"");        bMap.compress(Bitmap.CompressFormat.PNG, 90, out);     } catch (Exception e) {        e.printStackTrace();     }</code></pre><p>where bMap is a bitmap object.</p>","567245","","","","","2011-01-07 18:15:29","Android saving pics to drawable","<android>","1","0","","",""
"4628580","1","4629147","","2011-01-07 17:49:19","0","559","<p>Whats the best practice when it comes to repopulating the List thats backing up the adapter and then, refreshing &amp; displaying it?</p><p>Thanks!</p>","2443607","","2443607","","2011-01-07 18:48:36","2011-01-07 18:54:23","Repopulating a SimpleExpandableListAdapter","<android><list><listview><expandablelistview>","1","2","","",""
"4628677","1","4629627","","2011-01-07 17:58:35","2","6196","<p>I need to email a coworker my android app as an .apk so that he can install &amp; test it on his Samsung Galaxy Tab.</p><p>How can I do this?</p>","382252","","","","","2011-01-07 19:49:56","How can I package my Android app into an .apk?","<android><apk>","3","3","1","",""
"4628736","1","4628791","","2011-01-07 18:06:54","0","180","<p>I have seen this post here (http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state). I am having a similar problem I believe. </p><p>I have an app which listens to an audio stream (using the mediaPlayer object). If I press the Home button it will continue streaming and hide my app. Then, at a later point I can go back to my app and press stop when I'm done. This is what I want. If however I press the Back button, when I later open my app again the app has been redrawn from fresh. Text boxes, buttons, everything has reset like I've just opened the app for the first time so I can't stop my audio stream. Clicking stop does nothing because the app has 'forgotten' it is streaming (the stream runs under a separate handler from the main UI thread, so I'm guessing since its been 'reset' it has lost track of its handlers?). </p><p>Why does this happen with the Back button, and how can I stop it?</p>","560065","","","","","2011-01-07 18:13:07","Android: Confused about application states","<android><instance><state>","1","0","","",""
"4628800","1","4629167","","2011-01-07 18:14:39","43","16280","<p>I have a ScrollView which holds a series of Views.  I would like to be able to determine if a view is currently visible (if any part of it is currently displayed by the ScrollView).  I would expect the below code to do this, surprisingly it does not:</p><pre><code>Rect bounds = new Rect();view.getDrawingRect(bounds);Rect scrollBounds = new Rect(scroll.getScrollX(), scroll.getScrollY(),         scroll.getScrollX() + scroll.getWidth(), scroll.getScrollY() + scroll.getHeight());if(Rect.intersects(scrollBounds, bounds)){    //is  visible}</code></pre>","426493","","53926","","2014-03-24 22:01:14","2014-03-24 22:01:14","Android: how to check if a View inside of ScrollView is visible?","<android><scrollview><visible>","4","2","24","",""
"4628821","1","","","2011-01-07 18:17:35","0","379","<p>Is there anyone there who can tell me how i can send a string (""example"") to an ipadress on a local network via wifi in as3 on air on adroid.  </p><p>Thanks in advance!</p><p>FlashCreated</p>","556086","","","","","2011-01-07 21:58:11","Sending string across network with as3 on mobile?","<android><flash><actionscript-3><send>","2","0","","",""
"4628822","1","4629827","","2011-01-07 18:17:43","1","8214","<p>I`m working on small Android application, trying to add Facebook support.</p><p>Main problem: I can get only basic info regarding user`s friends (id, name).List of app permissions (offline_access is here just for test, will be removed soon):</p><pre><code> String[] sPermissions = { ""friends_about_me""                         , ""friends_birthday""                         , ""friends_location""                         , ""friends_website""                         , ""offline_access"" }; mLoginButton.init(this, mFacebook,  sPermissions);</code></pre><p>Following request works fine - returns a list of id:name pairs,</p><pre><code> mAsyncRunner.request(""me/friends"", new SampleRequestListener());</code></pre><p>but if I change it in order to get more info</p><pre><code> mAsyncRunner.request(""me/friends?fields=id,name,birthday,hometown"", new SampleRequestListener());</code></pre><p>server returns error ""An active access token must be used to query information about the current user.""I tested these Graph API requests using browser - both of them work as expected.</p><p>Small remark: I`m using default debug cetificate to sign apllication and add it hash as facebook application hash according to Facebook instruction:</p><blockquote>  <p>Register your application's Android key hash. This is used by Facebook to ensure that another app can't impersonate your app when talking to the Facebook Android app.</p>    <p>Generate the key hash:</p>    <p>keytool -exportcert -alias [alias]  -keystore [keystore] | openssl sha1 -binary | openssl base64 In the Facebook developer settings, go to the  Mobile and Devices tab.</p>    <p>In the Android section, enter the key  hash in the Key Hash field.</p></blockquote><p>Maybe there is another way to get user`s frineds info (bday, location, gender and so on)?</p>","345835","","6391","","2011-01-07 19:45:17","2013-03-04 06:57:17","Facebook API for Android: how to get extended info regarding user`s friends?","<android><facebook-graph-api>","3","0","4","",""
"4628839","1","4628878","","2011-01-07 18:19:47","1","1516","<p>Here's the code that defines my custom dialog. When I show this dialog, it throws a NullPointerException at the commented line.</p><pre><code>    protected Dialog onCreateDialog (int id) {    Dialog dialog = null;        switch (id) {        case DIALOG_SUCCESS_ID:            Context thisContext = this;            dialog = new Dialog(thisContext);            dialog.setContentView(R.layout.win_dialog);            dialog.setTitle(""Stage One"");            TextView timeScore = (TextView) dialog.findViewById(R.id.TimeScore);            timeScore.setText (elapsedTimeSec + ""s"");            TextView bestScore = (TextView) dialog.findViewById(R.id.BestScore);            bestScore.setText (""Best Score: (n/a)"");            Button retry = (Button) dialog.findViewById(R.id.Retry);            retry.setOnClickListener(new View.OnClickListener() {                public void onClick (View v) {                    Intent retry = new Intent(v.getContext(), LevelOne.class);                    startActivityForResult(retry, 0);                    finish();                }            });            Button menu = (Button) dialog.findViewById (R.id.ReturnToMenu);            //Throws NullPointerException at this line            menu.setOnClickListener(new View.OnClickListener() {                public void onClick (View v) {                    Intent menu = new Intent(v.getContext(), Menu.class);                    startActivityForResult(menu, 0);                    finish();                }            });            break;        case DIALOG_GAMEOVER_ID:            break;        default:            dialog = null;        }        return dialog;}</code></pre><p>But when I remove my menu button and the menu.SetOnClickListener() method, it works fine! My retry button also works without a hitch. Why can't I add more than one button? Why does it throw the exception?</p>","567301","","","","","2011-01-07 18:24:13","Android - Custom Dialog throws NullPointerException when more than one button is defined","<java><android><exception><mobile><nullpointerexception>","1","2","","",""
"4628926","1","","","2011-01-07 18:27:31","0","356","<p>I am trying to use the Tab layout in android and I am having a real problem when trying to save pictures I want to use as the tab icons in the res/drawable directory! :( Can somebody help me with this please???? Any help would much appreciated!  </p><p>Thanks</p>","489655","","1320510","","2011-01-08 11:30:23","2011-01-08 11:46:18","Saving images in the res/drawable directory","<android><android-layout>","2","1","","",""
"4629120","1","4629186","","2011-01-07 18:50:53","0","858","<p>I have a db collection (SQLite) and i want to create an array of the ROW_IDS. I think the following should work:</p><pre><code>db.open();String Chapter = ""Something"";Cursor c = db.getSetsByChapter(Chapter);int[] ids = {};if (c.moveToFirst()){    int i = 0;      do { ids[i] = Integer.parseInt(c.getString(0)); i++; } while (c.moveToNext());}db.close();Toast.makeText(this,""The array contains "" + ids.length + "" elements"",Toast.LENGTH_LONG).show();</code></pre><p>but i keep getting:Unable to start activity Component ... java.lang.ArrayIndexOutOfBoundsException</p><p>I'm very new to java and android coding. I have been at this for 3 days and loosing it!</p>","567337","","210916","","2011-12-08 03:45:08","2011-12-08 03:45:08","Android: Create array of ROW_IDS from cursor - but how?","<android><arrays><sqlite><cursor>","2","0","1","",""
"4629125","1","","","2011-01-07 18:51:43","0","241","<p>I'm doing a relatively simple update after a bunch of batch insertions on different tables. The final update fails with an SQLiteException:</p><p>no such column: accontname: , while compiling: UPDATE accounts SET defaultuserpic=? WHERE accountname=?;</p><p>This doesn't make any sense to me because I'm not passing accontname, but rather accountname. I've tried both .execSQL() and .update() but they yield the same result. I'm not sure what to investigate.</p>","541104","","","","","2011-01-07 18:51:43","SQLite update mangles column name, complains about no such column","<sql><android><database>","0","3","","",""
"4629169","1","","","2011-01-07 18:56:44","4","628","<p>I'm developing an Android 2.2 application.</p><p>I have an event listener on an activity, and I want to set visible a TextView when I receive an event. But there is an error:</p><p>I only can set it visible from UI thread.</p><p>In C# and Windows Mobile there is a BeginInvoke. Is there something similar in Android?</p><p>Thanks.</p>","68571","","","","","2011-01-07 19:03:16","Setting TextView visible from another thread or BeginInvoke in Android","<android><events><ui-thread>","1","0","","",""
"4629184","1","","","2011-01-07 18:58:41","0","3167","<p><strong>I have two database related questions</strong></p><p><strong>Background:</strong></p><p>I can create and delete records.<br>I can display the entire table and or a single row using StringBuilder.<br>I can display the entire table in a List using SimpleCursorAdapter.<br>I can select a desired record from the displayed List, get it's record ID.<br>I can display the record ID (as a string) in a TextView.</p><p><strong>What I seem not able to do is:</strong></p><p>After selecting an item from the List, getting it's ID, I simply want to Display its <em>string value</em>.  I run into the problem of the Query returning a Cursor. When I change or parse the return, I have no success.</p><p>Displaying this value is just a step to being able to parse the returned string and use that for some calculations - both calculation and displaying it are the end goals.</p><p><strong>Question 1:</strong><br>How do I display the string value of a record at a particular row and column?</p><p><strong>Question 2:</strong><br>For this database, I'm using a SimpleCursorAdapter to display the List but, only the listed string is clickable - not the full displayed row (meaning, if the contents was only two characters, that's what you've got to click). </p><p>Previously, I used a ListAdapter with an ArrayAdapter and selecting anywhere on the Listed Row was acted upon.<br>So, the question is: how to make the full row clickable?</p><p>Any recommendations appreciated, Thanks.<br>Code follows - BUT, <strong>note</strong> that this snippet is only one of a bazillion try's and this snippet displays what the cursor returns - it wasn't one of the try's at casting or changing it's type to display the contents I want - it was just a test:</p><pre><code>//ON CLICK@Overridepublic void onListItemClick(ListView l, View v, int position, long id) {  super.onListItemClick(l, v, position, id);  // test for record id#   String penut = String.valueOf(id); // YES, it gets the record id#  //  Maincode.showItem.setText(penut);  // YES, it displays the record id#   Cursor myGirl = helpDude.db.query(DbAdapter.TABLE_NAME, null,     ""_id=?"", new String[]{penut}, null, null, null);   String outy = String.valueOf(myGirl);   Maincode.showItem.setText(outy);  }//end on click</code></pre>","382200","","382200","","2011-01-07 19:04:18","2011-01-08 02:52:28","How To Get The String Value Of A Particular Row/Column For TextView and Parsing","<android><sqlite>","3","0","","",""
"4629308","1","4629747","","2011-01-07 19:11:21","31","20247","<p>I'm looking for a way to easily debug C code in an Android NDK application using Eclipse.  I've read ways to debug the app using gdb or something similar but what I want is a way to push messages to Eclipse somehow.</p><p>I'm looking for a solution that's as simple as using a print function in C and seeing it in the DDMS Log or anything similar.  Does anyone have any experience doing this?</p>","235708","","","","","2013-12-02 21:08:36","Any simple or easy way to debug Android NDK code?","<android><c><eclipse><jni><android-ndk>","6","0","10","",""
"4629318","1","","","2011-01-07 19:13:01","0","506","<p>How can I check whether or not my application's database was created successfully?</p>","529146","","321697","","2011-01-07 21:17:09","2011-01-07 21:17:09","Check If Database Was Created Successfully","<android><database><sqlite3>","1","0","","",""
"4629345","1","","","2011-01-07 19:14:38","-1","7107","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4470936/how-to-do-a-http-post-in-android"">How to do a HTTP Post in Android?</a>  </p></blockquote><p>I want to send the two values to a server ,say <a href=""http://localhost/twoVal.php"" rel=""nofollow"">http://localhost/twoVal.php</a>, which will further process the  information.</p><p>for example,</p><p>i have got the val1 = 12 and val2 = 13i want to post these data to above mentioned URL.  (May be some URL need not be localhost) how to do it?Also, data  needs to be sent as part of HTTP header (POST) &amp; not as query parameters.</p>","567368","","","","","2011-01-08 20:18:57","how to post data to remote server in android app","<android>","1","1","0","2011-01-07 20:38:23",""
"4629423","1","4629455","","2011-01-07 19:24:31","0","599","<p>I've been trying to figure out how to stop all threads when my application is paused (when the 'Home' button is pressed) and I just can't figure it out.</p><p><strong>Here's what I have</strong>: one main activity containing a tab host, every tab host has a list, when one item in the lists is clicked a new activity with details is started. Each list is within its own activity which starts an updater thread that makes sure the list content is always up to date.</p><p><strong>Here's what I've tried</strong>: I've tried using the onPause(), onResume(), onStop() and onDestroy() events. The problem is that if I use either the main activity of the activity that holds a list to monitor for those events, they get called every single time an item from the list is clicked, as well as when the 'Home' button is actually pressed, so there's no way to distinguish between the situations.</p><p>Am I missing something? How is this usually done?</p>","552400","","","","","2011-01-07 19:28:46","How to make sure all threads pause when application pauses?","<android>","1","0","1","",""
"4629444","1","4993951","","2011-01-07 19:27:14","9","13041","<p>Can anyone share with sample/simple obfuscation ANT task for Android? Provided that I do have complete APK and I need just pass *class hru Proguard and then prepare *.dex to build APK</p>","472270","","472270","","2011-01-26 07:22:38","2013-11-17 10:08:24","ANT build for Android Proguard obfuscation","<android><ant><obfuscation><proguard>","4","0","5","",""
"4629456","1","4631237","","2011-01-07 19:29:02","2","6327","<p>I'm invoking a rest WS that returns XML. Some elements have strings include special characters like áãç etc...When I get the information via browser all of it is shown properly but when invoking it from Android I don't get the proper special characters.</p><p>Notice the 'decoded' and 'encoded' variables: </p><p>when I use<code>URLDecoder.decode(result, ""UTF-8"")</code>The result stays the same</p><p>when I use<code>URLEncoder.encode(result, ""UTF-8"")</code> The result changes to what it would be expected (full of %'s symbols and numeric representing symbols and special characters).</p><p>Here's the method to call the webservice:</p><pre><code>public void updateDatabaseFromWebservice(){    // get data from webservice    Log.i(TAG, ""Obtaining categories from webservice"");    HttpClient client = new DefaultHttpClient();    HttpGet request = new HttpGet(ConnectionProperties.CATEGORIES_URI);    ResponseHandler&lt;String&gt; handler = new BasicResponseHandler();    String result = """";    String decoded;    String encoded;    try {                           result = client.execute(request, handler);          decoded = URLDecoder.decode(result, ""UTF-8"");        encoded = URLEncoder.encode(result, ""UTF-8"");        String c = ""AS"";    } catch (Exception e) {          Log.e(TAG, ""An error occurred while obtaining categories"", e);    }    client.getConnectionManager().shutdown();}</code></pre><p>Any help would be appreciated</p>","320586","","","","","2011-01-07 23:31:18","UTF8 Encoding in Android when invoking REST webservice","<android><encoding><utf-8><decode><encode>","2","0","4","",""
"4629470","1","4630283","","2011-01-07 19:30:36","0","369","<p>Currently I believe I'm doing a ok job managing my applications remote service.  When I'm done using it I can see the onDestroy() called, perfect...  </p><p>Now the issue is I can see the remote process still hanging, via DDMS or via phone's running processes.  Users see this and think I'm doing stuff on the background etc... blaming my app and than asking for an exit button... Truth is they don't need an exit button!</p><p>So my question: </p><blockquote>  <p>How to gracefully terminate a remote  service process?</p></blockquote><p>I could get the PID and kill it but something tells me this might not be the nice way to do this since the service might be restarted again...</p><p>Any help would be greatly apreciated!</p><p>-Jona</p>","398248","","","","","2011-01-07 21:05:43","How to gracefully terminate a remote service process?","<android><service>","1","2","","",""
"4629603","1","4670866","","2011-01-07 19:47:23","2","202","<p>When the emulator hits the line below it takes 10 seconds + to complete.  Does anyone else have this problem?</p><pre><code>mChecker = new LicenseChecker( this, new ServerManagedPolicy(this, new AESObfuscator(SALT, getPackageName(), deviceId)), BASE64_PUBLIC_KEY);</code></pre>","528130","","","","","2011-01-12 15:57:38","LicenseChecker is slow in emulator","<android><google-play>","1","2","","",""
"4629662","1","4629724","","2011-01-07 19:53:42","1","6257","<p>I know it may not be best practice but this is what i want to do.</p><p>When my broadcast receiver is called - start a new activity which has is not fullscreen and has a transparent background - which opens on top of your current activity / desktop wallpaper.</p><p>The code I have so far is as follows:</p><p>I create + call a new activity with :</p><pre><code>  Intent testActivityIntent = new Intent(context, com.andy.tabletsms.work.SMSPopup.class);                testActivityIntent.putExtra(""com.andy.tabletsms.message"", main.msgs.get(i));                testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);                context.startActivity(testActivityIntent);</code></pre><p>And then the activity has a theme of :  </p><p>android:theme=""@android:style/Theme.Translucent.NoTitleBar""</p><p>And the code of the activity is just a bog standard activity with a simple layout. However when that broadcast receiver starts the activity - it appears on top of the previous activity which was started when the applicaiton started.....as per this image shows :<img src=""http://i.stack.imgur.com/a0T6v.jpg"" alt=""alt text""></p>","265683","","6391","","2011-01-07 20:02:21","2012-06-07 04:42:00","Android launch an activity from a broadcast receiver","<android><broadcastreceiver><activity-stack><taskaffinity>","3","0","1","",""
"4629699","1","","","2011-01-07 19:57:25","4","2219","<p>Whilst trying to get one of the API demos to work I deleted the source files of said demo by mistake.'No problem', I thought, 'I'll just reinstall the API level and get the source back.'So after removing the 2.1 APIs from the Android SDK I found that it won't let me redownload and install them, they just don't appear.So, does anyone know how I can get the SDK to forget that the 2.1 API has been installed and then removed, or do I have to remove the entire SDK and install again, including APIs.Pretty standard insta</p><p>Many thanks for any help you can give me.</p>","448270","","","","","2012-03-04 20:42:52","Is it possible to reinstall removed Android APIs?","<android>","4","1","","",""
"4629755","1","4629877","","2011-01-07 20:03:48","1","574","<p>I have a simple sample game that has a menu with buttons to all levels. I wanted to have it where only level 1 is ""unlocked"" or clickable and the user unlocks the levels 1 by 1. So, i've thought about using preferences and setting a boolean property to each level but I also wanted to learn SQL and so, implemented it into the game. Now I can add values into the database but when reading them back and comparing them to a string it's not doing anything:</p><pre><code>public String getValue(Cursor cursor) {    String id = new String();    while (cursor.moveToNext()) {        id = cursor.getString(0);    }    return id;}</code></pre><p>I then compare it using string.toString().equals(""something""); Is there a better way of doing what I would like to do? and why does it not compare?</p>","507007","","","","","2011-01-07 20:19:13","Android sqlite read and compare question","<java><sql><android><compare>","1","2","","",""
"4629768","1","","","2011-01-07 20:05:40","2","1441","<p>I have been trying out SSL session reuse on iOS, Java desktop and Android. iOS appears to try to reuse SSL sessions (but not all the time). Java appears to always reuse sessions as long as you pass the hostname/port when you create an SSLEngine.</p><p>When I get to Android I have some problems. The code which I used to test Java SSL session reuse (create a connection, send a couple of messages, drop the connection and wait one second, repeat) didn't work properly at all on Froyo, worked in the Gingerbread emulator but didn't reuse sessions.</p><p>I then looked a little deeper into the Android code and I see there is an alternate method of storing SSL sessions using the SSLSessionCache/SSLCertificateSocketFactory which are used by the AndroidHttpClient. So I set up a test to use the AndroidHttpClient which made multiple requests over multiple connections to an apache server (which I know supports SSL session reuse), and it still didn't reuse sessions in Froyo or in Gingerbread.</p><p>If anyone has been able to get this working and could show some sample Android client code I would be much appreciated. I am considering creating a bug report for Android, but I just want to make sure I am not missing something obvious here.</p>","567417","","","","","2011-04-15 03:25:05","SSL Session Reuse Problems In Android (J2SE works fine)","<java><android><ssl>","1","3","","",""
"4629789","1","4630595","","2011-01-07 20:08:18","0","441","<p>I'm trying to make my overlay toast information when an item is tapped, however when I try to give it the context of the activity it will be in the compiler is yelling at me saying that ElonMap.this is out of scope and I do not know why.</p><pre><code>public boolean onTap(int i) { Toast.makeText(ElonMap.this, items.get(i).getSnippet(),  Toast.LENGTH_SHORT).show(); return(true);    }</code></pre>","180825","","","","","2011-01-07 21:45:41","OnTap for a custom overlay says that my context is out of scope, why?","<android>","1","2","","",""
"4629797","1","6109761","","2011-01-07 20:09:44","5","2593","<p>I'm trying to create a SlidingDrawer with LinearLayout content over a FrameLayout.  </p><p>At first it all seems fine, I get my SlidingDrawer's handle at the bottom of the screen.But then, if I start dragging the handle up and the content starts showing, it gets clipped by the border rectangle of the handle. If I drag the handle all the way up the entire content eventually gets shown, however if I now drag the handle down, it will be clipped by the border rectangle of the content. Also, if the handle is all the way up, as soon as I start dragging it the whole content disappears.<br>I can still click on where the handle should be on the screen, drag it and the content would show, but I need to guess where the handle is.   </p><p>What seems to be causing this is the fact that I have a SurfaceView in the xml file just before SlidingDrawer.<br>Removing the view from the xml solves this problem, however I need this view.  </p><p>Here's the xml:  </p><pre><code>&lt;FrameLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;    &lt;!--  Removing this DrawView from here solves the problem --&gt;    &lt;com.package.DrawView         android:id=""@+id/main""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;    &lt;SlidingDrawer          android:id=""@+id/SlidingDrawer""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:allowSingleTap=""true""        android:animateOnClick=""true""        android:handle=""@+id/slideHandleButton""        android:content=""@+id/contentLayout""         android:padding=""10dip""&gt;        &lt;Button            android:id=""@+id/slideHandleButton""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""@drawable/sliding_button""&gt;        &lt;/Button&gt;        &lt;LinearLayout            android:id=""@+id/contentLayout""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:orientation=""vertical""&gt;            &lt;Button                 android:id=""@+id/clearButton""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Test""&gt;            &lt;/Button&gt;        &lt;/LinearLayout&gt;    &lt;/SlidingDrawer&gt;&lt;/FrameLayout&gt;   </code></pre><p>Java:</p><pre><code>package com.package;import android.app.Activity;import android.os.Bundle;public class SlideTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}package com.package;import android.content.Context;import android.util.AttributeSet;import android.view.SurfaceView;public class DrawView extends SurfaceView{    public DrawView(Context context, AttributeSet attrs) {        super(context, attrs);    }}</code></pre><p>Edit: I just noticed that if DrawView extends View and not SurfaceView this problem goes away.However, I'm using a dedicated drawing thread and according to the documentation (and LunarLander example) when using a dedicated drawing thread, it should draw to a SurfaceView.</p><p>Any help would be greatly appreciated!</p>","567372","","567372","","2011-01-07 20:33:56","2012-12-12 18:05:05","Android: SlidingDrawer disappears under SurfaceView","<android><slidingdrawer>","2","0","1","",""
"4630221","1","4630629","","2011-01-07 20:58:01","3","3486","<p>I have a wave file in 16bit PCM form. I've got the raw data in a <code>byte[]</code> and a method for extracting samples, and I need them in float format, i.e. a <code>float[]</code> to do a Fourier Transform. Here's my code, does this look right? I'm working on Android so <code>javax.sound.sampled</code> etc. is not available.</p><pre><code>private static short getSample(byte[] buffer, int position) {  return (short) (((buffer[position + 1] &amp; 0xff) &lt;&lt; 8) | (buffer[position] &amp; 0xff));}...float[] samples = new float[samplesLength];  for (int i = 0;i&lt;input.length/2;i+=2){    samples[i/2] = (float)getSample(input,i) / (float)Short.MAX_VALUE;  }</code></pre>","319618","","","","","2011-05-31 15:45:26","Correct way to Convert 16bit PCM Wave data to float","<java><android><pcm><audio-processing>","2","1","2","",""
"4630396","1","","","2011-01-07 21:19:24","0","538","<p>At runtime I use getSupportedPreviewSizes() and it returns a single size (320x240).  When I initialize a new camera however, it sets the Preview size to the size of the display (320x480) which isn't listed under the returned supported sizes.  Why is this?  Are you just simply able to override the supported preview sizes, and that's what's done by default? Or is this emulator related? (I would think it's an emulator thing).</p>","567498","","","","","2011-12-18 22:29:46","Android Emulator Camera Preview Sizes","<android><camera>","1","0","","",""
"4630440","1","4632208","","2011-01-07 21:24:15","46","44135","<p>I have an android app on which, when the user taps a <code>TextView</code>, I would like to apply a defined style.</p><p>I thought to find a <code>textview.setStyle()</code> but it doesn't exists. I tried </p><pre><code>textview.setTextAppearance();</code></pre><p>but it does not work.</p>","339500","","228755","","2012-10-03 07:59:57","2013-07-12 12:27:30","How to change a TextView's style at runtime","<java><android><textview>","5","4","13","",""
"4630490","1","4630528","","2011-01-07 21:30:28","0","4436","<p>I'm creating an android application that gets the current time in a different country/time-zone. I'm making it as there aren't many other apps on the marketplace that do the same job.</p><p>I've got an analogue clock with a digital clock underneath on my app, how do I change the time on the clocks - take on or off a number of hours? For example, I may want the clock to display the time in Florida, so for me that'd be -6 hours.</p><p>Although I'm proficient in other programming languages; mainly .NET I'm new to Java, so please excuse the simple questions!</p><p>Thankyou!</p>","567390","","567390","","2012-07-24 14:51:41","2012-07-24 14:51:41","How do I set the time on an android analogue clock?","<java><android><clock>","2","0","","",""
"4630531","1","","","2011-01-07 21:35:22","1","3413","<p>I want to execute some functions when the program is exited by hitting the back button.This is now done by onDestroy() which works in every case but one. When coming back from another activity in some cases on exiting the program, onDestroy is not called.</p><p>I know that in theory onDestroy should only be called when Android closes the app due to low memory, but for me, onDestroy works always and only in a very special case it does not. </p><p>Using onPause or onStop does not work because I only want to call the function when the program is exited but not when just another activity is called.</p><p>So is the last way to catch the back-button-click and call the function there? Or is there any other solution?</p>","567517","","194894","","2011-09-03 10:09:09","2011-09-03 10:09:09","call method when program exits - onDestroy not reliable","<android><activity-lifecycle><ondestroy>","1","1","","",""
"4630643","1","","","2011-01-07 21:54:34","4","1507","<p>I am trying to use watchpoints to debug an Android problem in Eclipse.  I'm settings a watchpoint by settings a breakpoint on my variable definition.  However the execution never pauses even though the variable is accessed.  Has anyone else come across this problem?  Could someone please try setting a watch point on a variable in an Android project and see if it works?</p><p>Thanks</p>","483445","","","","","2011-01-07 22:09:56","Android debugging - Watch points","<android><eclipse>","2","2","0","",""
"4630747","1","4630793","","2011-01-07 22:10:44","0","619","<p>How can I get the transparent region in an image in android?</p><p>My problem is that I have images with transparent areas and I need to let the user click on regions and handle the click event only when they clicked on the actual colored regions of the image. How can I do this in android?</p><p>I saw that Drawable Has a getTrasnsparentRegion method but the default implementation returns null. So I need to overwrite it and put this implementation there.</p><p>Thank you,</p>","229266","","","","","2011-01-07 22:38:41","Android: How can I get the transparent region in an image","<android>","2","0","","",""
"4630750","1","4630792","","2011-01-07 22:11:49","0","1090","<p>I have a boolean method returning true or false to check whether or not data exists inside of strings.  Everything works ok if the user enters all data or does not run through the dialogs.....BUT....if the user DOES NOT enter data in the ""getItemsEditText"" dialog popup AND still clicks ""OK"", this boolean is resolving to true, even though ""pricePerItemText"" still has nothing stored.  This is the boolean method:</p><pre><code>public Boolean doesAllDataExistCheckBool (){  if (pricePerItemText != """" &amp;&amp; itemsPerDayText != """" &amp;&amp; sleepTimeText != """" &amp;&amp;      wakeTimeText != """")    {        SharedPreferences.Editor editor = mySharedPreferences.edit       (); //opens shared preference editor        editor.putBoolean(""storedDoesAllDataExist"", true);        editor.commit();  //commit changes to mySharedPreferences        //End storing shared preferences        return true;    }    else    {        SharedPreferences.Editor editor = mySharedPreferences.edit        (); //opens shared preference editor        editor.putBoolean(""storedDoesAllDataExist"", false);        editor.commit();  //commit changes to mySharedPreferences        //End storing shared preferences        return false;    }}</code></pre><p>Here is where the boolean is being tested to see if true or false:</p><pre><code>if (position == 4)  {    allDataExists = doesAllDataExistCheckBool ();  //checks if true or false    if (serviceStarted == true)     {       Context context = getApplicationContext();       String text = ""Schedule is already running"";       int duration = Toast.LENGTH_SHORT;       Toast toast = Toast.makeText(context, text, duration);       toast.show();     }   if (serviceStarted == false &amp;&amp; doesAllDataExistCheckBool () == true)     {     startScheduleService();     }   if (serviceStarted == false &amp;&amp; doesAllDataExistCheckBool () == false)     {       Context context = getApplicationContext();       String text = ""Please enter all data before starting!"";       int duration = Toast.LENGTH_SHORT;       Toast toast = Toast.makeText(context, text, duration);       toast.show();     }}</code></pre><p>Here is how the dialog with EditText and OK/Cancel buttons is written:</p><pre><code>case ITEMS_PER_DAY :LayoutInflater li = LayoutInflater.from(this);final View itemsEntryView = li.inflate(R.layout.settings_dialog_input, (ViewGroup)findViewById(R.id.layout_root));final EditText getItemsEditText = (EditText)itemsEntryView.findViewById(R.id.DialogEditText);return new AlertDialog.Builder(SettingsActivity.this) .setTitle(""This is the title"") .setView(itemsEntryView) .setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {  public void onClick(DialogInterface dialog, int whichButton)  {    itemsPerDayText = getItemsEditText.getText().toString();  //gets input from     edittext and saves it to a string itemsPerDayText    //Initialize shared preferences    SharedPreferences.Editor editor = mySharedPreferences.edit(); //opens editor   editor.putString(""storedItemsPerDayText"", itemsPerDayText);    editor.commit();  //commit changes to mySharedPreferences   //End storing shared preferences   } }) .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener(){  public void onClick(DialogInterface dialog, int whichButton)   {    //user click cancel   }}).create();</code></pre><p>Is there another way to do this?  Why can the user still click ""OK"" if they did not enter anything at all?  Any ideas?  Thanks guys!</p>","239932","","239932","","2011-01-08 01:31:50","2011-01-08 01:31:50","Java /Android Dialog with EditText - Boolean check on strings","<java><android><dialog><boolean><edittext>","1","0","","",""
"4630865","1","4631555","","2011-01-07 22:27:05","3","1299","<p>Hey all I've created Google's exmaple of a <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">tab layout</a></p><p>HelloTabWidget.java:</p><pre><code>public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);Resources res = getResources(); // Resource object to get DrawablesTabHost tabHost = getTabHost();  // The activity TabHostTabHost.TabSpec spec;  // Resusable TabSpec for each tabIntent intent;  // Reusable Intent for each tab// Create an Intent to launch an Activity for the tab (to be reused)intent = new Intent().setClass(this, ArtistsActivity.class);// Initialize a TabSpec for each tab and add it to the TabHostspec = tabHost.newTabSpec(""artists"").setIndicator(""Artists"",                  res.getDrawable(R.drawable.ic_tab_artists))              .setContent(intent);tabHost.addTab(spec);// Do the same for the other tabsintent = new Intent().setClass(this, AlbumsActivity.class);spec = tabHost.newTabSpec(""albums"").setIndicator(""Albums"",                  res.getDrawable(R.drawable.ic_tab_albums))              .setContent(intent);tabHost.addTab(spec);intent = new Intent().setClass(this, SongsActivity.class);spec = tabHost.newTabSpec(""songs"").setIndicator(""Songs"",                  res.getDrawable(R.drawable.ic_tab_songs))              .setContent(intent);tabHost.addTab(spec);tabHost.setCurrentTab(2);</code></pre><p>}</p><p>I know how to create my own icon to use instead of their grey and white microphone, but I can't figure out how to make my custom icon fill the entire tab.  When the tab is selected it's a light grey with my pic in the middle and when not selected its a dark grey with my pic in the middle.  I prefer to have my own pic fill the entire tab, and for more knowledgeable; my own choice in color to fill the tab.</p>","560983","","173327","","2011-01-08 12:03:02","2011-01-08 22:27:27","Fill Android Tab with custom pic and/or colour","<android><colors><tabs><fill>","1","1","","",""
"4631115","1","4631790","","2011-01-07 23:10:31","1","725","<p>I have a preference group called ""Credentials"" and I'd like to change the color of that header based on whether the credentials are valid or not.</p><p>I keep a reference to the credentials item by grabbing it when I start up my PreferenceActivity</p><pre><code>// ... code ...public enum CredentialsInfo {    VALID, INVALID, UNKNOWN}private Preference credentials;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.my_preferences);    credentials = findPreference(getString(R.string.credentials));    // ... etc ...}</code></pre><p>Once I am done verifying my credentials I run a function called <code>updateCredentialsBarColor</code> that is supposed to load the correct drawable and set the credentials Preference to the appropriate color.  Though when I try to change the color nothing happens.  Am I getting the view incorrectly and if so, what is the proper way to get it?</p><pre><code>private void updateCreditialsBarColor(CredentialsInfo state) {    Drawable background = null;    switch(state) {    case VALID:        background = getResources().getDrawable(R.drawable.credentials_state_valid);        break;    case INVALID:        background = getResources().getDrawable(R.drawable.credentials_state_invalid);        break;    case UNKNOWN:    default:        background = getResources().getDrawable(R.drawable.credentials_state_unknown);        break;    }    if(background != null) {        View credentialsView = credentials.getView(null, null);        credentialsView.setBackgroundDrawable(background);    }}</code></pre>","480475","","","","","2011-01-08 01:25:57","Change the Background of a Specific Preference Item","<android><android-preferences>","1","0","1","",""
"4631146","1","4631274","","2011-01-07 23:14:17","0","129","<p>What classes would I need for a simple widget to do the following:</p><ol><li>Display on a home screen and run some code when it is clicked</li><li>Run some code and update the widget at a specific time every day</li><li>Run some code and update the widget when an SMS is received</li></ol><p>I currently have a Receiver which extends AppWidgetProvider, and another Receiver which is called when a SMS is received.How should this program be structured? Is it possible to have all the code in one place, or does it have to be in separate classes?</p><p>Thanks for any help,</p><p>-Frink</p>","131209","","","","","2011-01-08 00:13:02","Structure for a widget code","<android><architecture>","2","0","","",""
"4631380","1","4631463","","2011-01-07 23:55:51","1","1482","<p>I want to create the database and all the data ONCE and update some data maybe later when needed. Throughout most of the tutorials I have read, they use two classes: one that extends SQLiteOpenHelper and another to simplify manipulating data. For example:</p><pre><code>public class EventsData extends SQLiteOpenHelper {private static final String DATABASE_NAME = ""events.db"";private static final int DATABASE_VERSION = 1;private static final String DATABASE_CREATE = ""CREATE TABLE "" + TABLE_NAME + ""("" + ID + "" INT, "" + TITLE + "" TEXT, "" + UNLOCK + "" INT)"";private static final String DATABASE_UPGRADE = ""DROP TABLE IF EXISTS "" + TABLE_NAME;public EventsData(Context context) {    super(context, DATABASE_NAME, null, DATABASE_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db) {    // TODO Auto-generated method stub    db.execSQL(DATABASE_CREATE);}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    // TODO Auto-generated method stub    db.execSQL(DATABASE_UPGRADE);    onCreate(db);}</code></pre><p>}</p><pre><code>public class DataHelper {private static final String[] FROM = {ID, TITLE, UNLOCK};//private static final String ORDER_BY = UNLOCK + "" DESC"";private Context context;private SQLiteDatabase db;private EventsData eventsData;public DataHelper(Context context) {    this.context = context;    eventsData = new EventsData(this.context);}public void addEvent(int id, String name, int unlocked) {    db = eventsData.getWritableDatabase();    ContentValues cv = new ContentValues();    cv.put(ID, id);    cv.put(TITLE, name);    cv.put(UNLOCK, unlocked);    db.insertOrThrow(TABLE_NAME, null, cv);}public void updateEvent(int id, String name, int unlocked) {    db = eventsData.getWritableDatabase();    ContentValues cv = new ContentValues();    cv.put(ID, id);    cv.put(TITLE, name);    cv.put(UNLOCK, unlocked);    db.update(TABLE_NAME, cv, ID + ""="" + id, null);}public Cursor getEvent() {    db = eventsData.getReadableDatabase();    Cursor cursor = db.query(TABLE_NAME, FROM, null, null, null, null, null);    return cursor;}public StringBuilder showEvent(Cursor cursor) {    StringBuilder sb = new StringBuilder();    while (cursor.moveToNext()) {        String id = cursor.getString(0);        String title = cursor.getString(1);        String unlock = cursor.getString(2);        sb.append(id).append("": "");        sb.append(unlock).append("": "");        sb.append(title).append(""\n"");    }    return sb;}public void deleteAll() {    db = eventsData.getWritableDatabase();    db.delete(TABLE_NAME, null, null);}</code></pre><p>}</p><p>In my main activity, I create an instance of DataHelper and call addEvent() to create and add data to the database. But everytime the application starts, it's going to ""reset"" all the data even if I were to call updateEvent().</p>","507007","","507007","","2011-01-08 06:57:34","2011-01-08 06:57:34","Android sql creating database once","<java><sql><android><database><data>","3","0","","",""
"4631448","1","","","2011-01-08 00:09:34","-1","2055","<p>I've been working in an Android project that makes use of accelerometer values.</p><p>However the output of accelerometer is defined in terms of the phone's coordinate system. but I need them to be in the world's coordinate system ,,</p><p>does any body know a method to convert the output values of acceleometer to be in terms of the world's coordinates ?</p><p>Regards,</p><p>Moustafa</p>","373023","","","","","2011-02-04 17:38:26","Android : Converting accelerometer output from phone's coordinate into the world coordinate system","<android><accelerometer>","2","0","1","",""
"4631475","1","4716233","","2011-01-08 00:15:09","3","524","<p>I'm writing a program that involves a ton of images, over 100 per screen density.  Fortunately, they aren't very big in terms of space.  I use roughly 11 at any given time.  I also use the function <code>Bitmap.createScaledBitmap</code> on every image which seems to take up a lot of memory.</p><p>So far in debugging this app, I seem to be able to use it indefinitely without running into a memory problem, which I'm hoping means I'm not leaking memory.</p><p>However, the one thing I've noticed is that if I ""exit"" my app through the back button (I'm not running anything in the background), and then restart the app shortly after, I sometimes get a out of memory error at a call to <code>Bitmap.createScaledBitmap</code></p><pre><code>01-07 19:01:24.935: ERROR/AndroidRuntime(27419): java.lang.OutOfMemoryError: bitmap size exceeds VM budget</code></pre><p>So basically my question is, what am I doing wrong here?  Do I need to be cleaning up my own garbage, like in onDestroy when the user presses the back button?  I would have thought the GC would automatically take care of this when the back button was pressed and the activity was destroyed.  This leads me to believe I am doing something else wrong, like a memory leak.  But then I come back to the fact my app can take heavy memory use for 20 minutes but then kill itself in 5 seconds after a restart, which is what is baffling me.</p><p>Thanks all.</p><p>Edit:  I implemented a couple quick and dirty fixes.</p><p>First I tried this, and it was harder to get the application to force close.</p><pre><code>@Overridepublic void onBackPressed() {    finish();}</code></pre><p>Next I tried this combined with the onBackPressed and I could no longer duplicate my problem.  Note that the method call is just a loop that basically does <code>allImages = null;</code></p><pre><code>protected void onStop () {    super.onStop();    mComponent.releaseImages();}</code></pre><p>At this point it appears that after calling finish(), there are still objects in memory from the activity.  Rather strange.</p>","432209","","432209","","2011-01-08 01:36:42","2011-01-17 17:58:48","Cleaning up a program on exit and dealing with the GC","<java><android><memory><memory-management>","3","1","0","",""
"4631645","1","4631652","","2011-01-08 00:48:29","1","642","<p>I'm embarrassed to ask this question, but after 45 minutes of not finding a solution I will resort to public humiliation. </p><p>I have a number that is being divided by another number and I'm storing that number in a double variable. The numbers are randomly generated, but debugging the app shows that both numbers are in fact being generated. </p><p>Lets just say the numbers are 476 &amp; 733. I then take the numbers and divide them to get the percentage 476/733 = .64</p><p>I then print out the variable and it's always set to 0. I've tried using DecimalFormat and NumberFormat. No matter what I try though it always says the variable is 0. I know there is something simple that I'm missing, I just can't find it =/. </p>","562537","","","","","2011-01-08 00:50:07","Double # showing 0 on android","<android><math><double>","2","0","","",""
"4631693","1","4631785","","2011-01-08 00:58:59","3","3308","<p>I would like to write an application that is triggered when a calendar reminder occurs. I realize there is no officially documented way of doing this, but I have seen in the log that when my calendar alarm goes off on my phone (Droid X), AlertReceiver indicates that it has received an android.intent.action.EVENT_REMINDER:</p><pre><code>01-03 11:03:00.029 D 1523 AlertReceiver onReceive: a=android.intent.action.EVENT_REMINDER Intent { act=android.intent.action.EVENT_REMINDER dat=content://com.android.calendar/129407058000 flg=0x4 cmp=com.android.calendar/.AlertReceiver (has extras) }</code></pre><p>So, I set up a simple BroadcastReceiver:</p><pre><code>package com.eshayne.android;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;public class CalendarTest extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {       android.util.Log.i(""CalendarTest"", ""CalendarTest.onReceive called!"");    }}</code></pre><p>with this 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.eshayne.android""    android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.READ_CALENDAR"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;receiver android:name=""com.eshayne.android.CalendarTest""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.EVENT_REMINDER"" /&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt;</code></pre><p>Unfortunately, when I put this on my phone and set up a calendar event with a reminder - when the reminder alerts, I still see the AlertReceiver log entry, but not mine.</p><p>I have also read here about some system intents that require registering via code rather than in the manifest. So, I tried the following instead:</p><pre><code>package com.eshayne.android;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;public class CalendarTestDisplay extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        registerReceiver(new BroadcastReceiver() {                        @Override                        public void onReceive(Context context, Intent intent) {                            android.util.Log.i(""CalendarTestDisplay"", ""received broadcast"");                        }                                },                     new IntentFilter(""android.intent.action.EVENT_REMINDER""));    }}</code></pre><p>with this modified 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.eshayne.android""    android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.READ_CALENDAR"" /&gt;        &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;activity android:name="".CalendarTestDisplay""              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>with no better result.</p><p>Any ideas what I may be missing? Or any other ideas of how I might be able to capture calendar alarm occurrences?</p><p>Thanks,Ethan </p>","562080","","","","","2013-05-19 10:32:26","Unable to receive android.intent.action.EVENT_REMINDER broadcast","<android><calendar><broadcast>","3","0","1","",""
"4631778","1","","","2011-01-08 01:21:51","0","79","<p>I have a list that fills up nicely after entering data from an input panel that uses a regular layout style.  </p><p>But, if use a Dialog or Transparent style theme defined in the manifest for the activity, the list won't update until go back to the parent activity that called the list activity.</p><p>One: Why is this different than when using a standard layout?</p><p>Two: How can I update the list when finished with the dialog?  Note: I've tried onResume, onRestart, onthis and onthat and oneverything else... but, it doesn't take care of it.</p><p>Thanks</p>","382200","","","","","2011-01-08 02:18:38","How To Update A List After Using A Style Theme","<android><coding-style><dialog>","1","0","","",""
"4631791","1","4631957","","2011-01-08 01:26:12","1","351","<p>What is differences between onCreate and onStart cycle ?I got confuse to put the proper code for these cycles.for example in my case, I have main activity listview to display data from database and other activity to create data to database.Activity to create data is called by listactivity. After creating data is succeeded, it would be back to listactivity. And the data in listview should be updated. </p><p>When I put initialization database, cursor and adapter on onCreate method, the listActivity wouldn't update the latest data after creation the data.But if I put it on onStart method, it's updated.</p><p>my question: Is it correct in this case to put all initialization on OnStart method ?Because I'm thinking it would be expensive to reinitialize for each database record to listview if there is one updated data.</p>","436498","","","","","2011-01-08 02:08:23","How to put the proper code for each android's life cycle?","<android>","2","0","0","",""
"4631814","1","","","2011-01-08 01:31:42","0","174","<p>Dear ..I doing some app for android and Iphone .. so i need to redirect web pages to the news mobile style web.. I got some htaccess code from internet but not work in my site cause of regex</p><pre><code>sample: origin link:http://www.xaluan.com/modules.php?name=News&amp;file=article&amp;sid=236233mobi  link:http://www.xaluan.com/modules.php?name=News&amp;file=article_mobi&amp;sid=236233</code></pre><p>here the htacess i'm working on</p><pre><code>#Redirect if mobile deviceRewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [NC,OR]RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(\ |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(\ |\/)|klon|kpt\ |kwc\-|kyo(c|k)|le(no|xi)|lg(\ g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-|\ |o|v)|zz)|mt(50|p1|v\ )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v\ )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|\ )|webc|whit|wi(g\ |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-) [NC]RewriteRule (.*)file=article&amp;sid=([0-9]+)$ /modules.php?name=News&amp;file=article_mobi&amp;sid=$1 [R,L]</code></pre><p>I'm trying to corect the RewriteRule but not work .. what im doing worng .. please corectthanks</p>","525068","","","","","2011-01-08 02:21:00","Help for htacess redirect rgex ( im use for redirecting web page to mobile device)","<iphone><android><.htaccess><redirect><mobile>","1","1","","",""
"4631936","1","","","2011-01-08 02:01:09","0","226","<p>Could someone post some example code for the Facebook authorize code for android.  I've been at it for a while and I can't get it to work.</p><pre><code>    facebook = new Facebook(APP_ID);    facebook.authorize(this, new LoginDialogListener());</code></pre><p>That's what I have.</p><p>Thanks</p>","445342","","","","","2011-01-08 02:10:57","Facebook SDK Integration","<android><facebook><sdk>","1","2","","",""
"4631966","1","4632566","","2011-01-08 02:08:46","13","23727","<p>I am inflating a RelativeLayout from XML and then attempting to programmatically sets its layout params and am receiving a ClassCastException.</p><p>Code:</p><pre><code>profileHeader = (RelativeLayout)mInflater.inflate(R.layout.user_profile_header, null);profileHeader.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT));</code></pre><p>throws</p><pre><code>E/AndroidRuntime( 2963): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParamsE/AndroidRuntime( 2963):  at android.widget.ListView.measureScrapChild(ListView.java:1119)E/AndroidRuntime( 2963):  at android.widget.ListView.measureHeightOfChildren(ListView.java:1202)E/AndroidRuntime( 2963):  at android.widget.ListView.onMeasure(ListView.java:1111)E/AndroidRuntime( 2963):  at android.view.View.measure(View.java:8222)E/AndroidRuntime( 2963):  at android.view.ViewGroup.measureChildWithMargins(V</code></pre><p>I've seen other notes on the net to try using LinearLayout.LayoutParams but that doesnt seem to help.</p><p>If you're wondering why I am doing this at all and NOT just setting it in the XML its because I am seeing something weird where the layout ""jumps"" to a wrap/wrap. I AM setting it to fill_parent/fill_parent in the XML and on scroll the view ""shrinks"" to what appears to be wrap/wrap. Its really weird. Looking at the foursquared android source code I found a comment where the developer says the same thing:</p><p>""Something odd is going on with the layout parameters though. If we don't explicitly set the layout to be fill/fill after inflating, the layout jumps to a wrap/wrap layout.""(FriendsActivity.java:258)</p><p>Which sounds just like my problem, hence I am trying to do the same (set layout via code), but in his case he is using LinearLayout, whereas I am using RelativeLayout.</p><p>What am I missing? Thanks in advance.</p>","25398","","","","","2013-03-28 17:22:59","Set RelativeLayout layout params programmatically - throws ClassCastException","<android><android-layout>","2","0","8","",""
"4632039","1","4632093","","2011-01-08 02:35:03","7","1499","<p>I want to let the user safely remove the SD card in my program, but it seems the Android 2.2 public API does not provide a way to do this. Does anyone know what's a proper way to do it?</p>","52603","","","","","2012-01-19 15:31:44","How to safely remove SD card programmatically on Android","<android><api>","2","0","1","",""
"4632143","1","4632164","","2011-01-08 03:15:16","1","3481","<p>I am trying to make it so that when a user clicks a button, it pops up a <code>dialog</code> with an <code>EditText</code> and an <em>OK</em> <code>Button</code>. When the user completes, the dialog, it should <em>add</em> the item they just typed in to the <code>ListView</code>. How do I do this?</p><p>I will need a large code example; this is my first application.</p>","560096","","958642","","2013-01-31 08:01:30","2013-01-31 08:01:30","How to let a user add and remove items to a ListView?","<android><listview>","2","0","","",""
"4632162","1","4632356","","2011-01-08 03:25:54","0","52","<p>I made a listviewlistener. </p><pre><code>protected void onListItemClick(ListView a, View v, int position, long id) {}</code></pre><p>How do I deliver the listname I checked to the textview?</p>","567732","","1288","","2011-01-09 03:43:15","2011-01-09 03:43:15","How do I deliver the listname I checked to the textview?","<android><listview>","1","1","","",""
"4632183","1","","","2011-01-08 03:35:46","0","11894","<p>What advantages would a real time operating system like QNX bring to the smart phone / tablet space vs what android and iOS are doing.</p><p>Is really going to be more reliable and secure and at the same time providing great performance and security?</p><p>Thanks</p>","567734","","","","","2011-08-22 19:20:49","Qnx vs Android Vs iOS","<android><ios><qnx>","4","0","1","2011-08-23 13:55:03",""
"4632184","1","4637724","","2011-01-08 03:36:43","2","949","<p>I wanted to create a layout like the CyanogenMod call log in that there is a list item with a couple of views and a clickable button on the right which gets focus separately (<a href=""http://i55.tinypic.com/358s1lc.jpg"" rel=""nofollow"">screenshot</a>).  Instead, I get <a href=""http://i55.tinypic.com/im4f2t.jpg"" rel=""nofollow"">this mess</a>.</p><p>Here's my code:</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:minHeight=""?android:attr/listPreferredItemHeight""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:paddingLeft=""4dip""    &gt;    &lt;DontPressWithParentImageView android:id=""@+id/play_icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:paddingLeft=""14dip""        android:paddingRight=""14dip""        android:layout_alignParentRight=""true""        android:gravity=""center_vertical""        android:src=""@drawable/sym_play""        android:background=""@drawable/play_background""        /&gt;    &lt;View android:id=""@+id/divider""        android:layout_width=""1px""        android:layout_height=""fill_parent""        android:layout_marginTop=""5dip""        android:layout_marginBottom=""5dip""        android:layout_toLeftOf=""@id/play_icon""        android:layout_marginLeft=""2dip""        android:background=""@drawable/divider_vertical_dark""        /&gt;    &lt;TextView android:id=""@+id/file_info""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_marginBottom=""8dip""        android:layout_marginTop=""-10dip""        android:layout_marginLeft=""10dip""        android:layout_alignWithParentIfMissing=""true""        android:singleLine=""true""        android:ellipsize=""marquee""        android:textAppearance=""?android:attr/textAppearanceSmall""        android:textStyle=""bold""        /&gt;    &lt;TextView android:id=""@+id/file_title""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_above=""@id/file_info""        android:layout_alignWithParentIfMissing=""true""        android:layout_marginBottom=""-10dip""        android:layout_marginLeft=""4dip""        android:textAppearance=""?android:attr/textAppearanceLarge""        android:singleLine=""true""        android:ellipsize=""marquee""        android:gravity=""center_vertical""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>For reference, the code I started with is <a href=""https://github.com/CyanogenMod/android_packages_apps_Contacts/blob/froyo-stable/res/layout-finger/recent_calls_list_item.xml"" rel=""nofollow"">here</a> and <a href=""https://github.com/CyanogenMod/android_packages_apps_Contacts/blob/froyo-stable/res/layout-finger/recent_calls_list_item_layout.xml"" rel=""nofollow"">here</a>, and the source to <code>DontPressWithParentImageView</code> is <a href=""https://github.com/CyanogenMod/android_packages_apps_Contacts/blob/froyo-stable/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java"" rel=""nofollow"">here</a> (but as you can see from my screenshot, that part is working).</p><p>What am I doing wrong?</p>","106302","","106302","","2011-01-08 03:54:59","2011-01-09 04:43:47","My Android ListView item layout looks terrible","<android><listview><relativelayout>","1","0","","",""
"4632222","1","4632305","","2011-01-08 03:47:46","0","932","<p>I'm reading contact data from ContractContacts, and can lookup TIMES_CONTACTED (which is useful to me), but this field only applies to calls to that contact. I'm also interested in the number of times a contact has been contacted via SMS or email.</p><p>Does anyone know if this information is available? I've been searching but haven't come across anything.</p>","301839","","","","","2011-01-08 04:19:32","For Android, is there a way to determine how many text messages have been sent to a contact?","<android><android-contacts>","1","0","","",""
"4632225","1","","","2011-01-08 03:48:25","0","929","<p>Can I test / debug andrid apps on an Android tablet. They are cheaper than buying an android phone. Obviously I won't be doing any of the phone features, just a touch screen game. Are the apps any different for the tablet??</p>","567743","","","","","2014-02-21 13:52:45","Android Tablet for App Testing","<android>","2","0","","",""
"4632231","1","4653859","","2011-01-08 03:49:51","6","2479","<p>I am using </p><pre><code>Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(externalFileObj));</code></pre><p>intent to call default camera activity. To get full image you need to specify intent.putExtra(). But this always requires URI that works only for external storage files.</p><p>I tried to create a temp.jpg image in internal memory and pass its URI </p><pre><code>Uri.fromFile(new File(getFilesDir() + ""/temp.jpg""));</code></pre><p>but the camera activity won't return back after the image is captured.</p><p><strong>So there is no way to get Full size image from default camera application in our activity without using any external storage ?</strong> Assuming that the device do not have SD card or currently in use is there no way I can avoid using it ?</p><p>Yes I know we can create our own camerapreview surface but I want to use the default camera application as it is natural with many more options.</p><p>Thanks.</p>","315619","","","","","2011-01-11 03:15:49","Is there any way to store full size image returned from camera activity in internal memory?","<android><camera><android-intent>","2","0","3","",""
"4632262","1","9765066","","2011-01-08 04:01:11","0","958","<p>I am very new to Java and android. my 1st app using canvas and paint. for some reason I get a force close whenever I try using the drawText method.. Please help.I am basically trying to display text in a specific x,y coordinate. which will need updates throughout game play, my code:</p><pre><code>public class MyGame extends Main { TextView timeDisplay; public String clock; int x_pos = 10;  int y_pos = 100;  int radius = 20; float x = 10; float y = 20; android.graphics.Paint p;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {     setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);         super.onCreate(savedInstanceState);       setContentView(R.layout.main);        // setup Drawing view        Bitmap b = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);        Canvas c = new Canvas(b);        c.drawText(""test"", 30, 0,x,y, p);   &lt;-- if I comment this out, no force close...</code></pre><p>Your help is appreciated.</p>","565644","","996493","","2012-03-19 04:35:54","2012-03-19 04:35:54","drawText Canvas method not working","<android>","2","0","0","",""
"4632412","1","4633165","","2011-01-08 04:53:37","0","6374","<p>I am totally a noob to this area, is it possible to play a custom music to a caller when I put him on hold in Android? If 'yes', how? If 'no', why? I feel the network operator has a role in this but not very sure. Please enlighten.</p>","421372","","421372","","2012-09-28 18:46:21","2013-12-27 15:53:49","Playing a song when I put a caller on hold","<android><telephony><telephone-api>","2","1","1","",""
"4632450","1","4634186","","2011-01-08 05:04:19","0","656","<p>I had it working until i tried to combine it with xml that is parsed from my webpage. No markers get added, yet i get no errors. Below is the new code. Any help is greatly appreciated!</p><p>LocationBasedServicesV2.java :</p><pre><code>private MapView myMap;private TextView tv;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv = (TextView) findViewById(R.id.tv);    try {           URL url = new URL(""MySiteGoesHere"");            SAXParserFactory spf = SAXParserFactory.newInstance();            SAXParser sp = spf.newSAXParser();            XMLReader xr = sp.getXMLReader();            ExampleHandler myExampleHandler = new ExampleHandler();            xr.setContentHandler(myExampleHandler);            xr.parse(new InputSource(url.openStream()));            ParsedExampleDataSet parsedExampleDataSet = myExampleHandler.getParsedData();            tv.setText(parsedExampleDataSet.toString());    } catch (Exception e) {        new AlertDialog.Builder(this)           .setMessage(e.toString())           .setTitle(""error"")           .setCancelable(true)           .setNeutralButton(android.R.string.cancel,              new DialogInterface.OnClickListener() {              public void onClick(DialogInterface dialog, int whichButton){}              })           .show();     }    initMap();    //initLocationManager();}private void initMap() {    myMap = (MapView) findViewById(R.id.mymap);    View zoomView = myMap.getZoomControls();    LinearLayout myzoom = (LinearLayout) findViewById(R.id.myzoom);    myzoom.addView(zoomView);    myMap.displayZoomControls(true);}/*private void initLocationManager() {    locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    locListener = new LocationListener() {        public void onLocationChanged(Location newLocation) {            createAndShowMyItemizedOverlay(newLocation);        }        public void onProviderDisabled(String arg0) {        }        public void onProviderEnabled(String arg0) {        }        public void onStatusChanged(String arg0, int arg1, Bundle arg2) {        }    };    locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,            locListener);}*/public void createAndShowMyItemizedOverlay(int Lat,int Long) {    //int Lat2;    //int Long2;    //Lat2 = Integer.parseInt(Lat);    //Long2 = Integer.parseInt(Long);    List overlays = myMap.getOverlays();    GeoPoint geopoint = new GeoPoint(Lat,Long);    Drawable icon = getResources().getDrawable(R.drawable.icon);    icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon            .getIntrinsicHeight());    MyItemizedOverlay overlay = new MyItemizedOverlay(icon);    OverlayItem item = new OverlayItem(geopoint, ""My Location"", null);    overlay.addItem(item);    myMap.getOverlays().add(overlay);    myMap.getController().animateTo(geopoint);        }@Overrideprotected boolean isRouteDisplayed() {    return false;} }</code></pre><p>MyItemizedOverlay.java:</p><pre><code> public class MyItemizedOverlay extends ItemizedOverlay {private List items;private Drawable marker;public MyItemizedOverlay(Drawable defaultMarker) {    super(defaultMarker);    items = new ArrayList();    marker = defaultMarker;}@Overrideprotected OverlayItem createItem(int index) {    return (OverlayItem)items.get(index);}@Overridepublic int size() {    return items.size();}@Overridepublic void draw(Canvas canvas, MapView mapView, boolean shadow) {    super.draw(canvas, mapView, shadow);    boundCenterBottom(marker);}public void addItem(OverlayItem item) {    items.add(item);    populate();} }</code></pre><p>ExampleHandler.java:</p><pre><code>public class ExampleHandler extends DefaultHandler{    private boolean in_lat = false;    private boolean in_long = false;    private boolean in_retailer = false;    private ParsedExampleDataSet myParsedExampleDataSet = new ParsedExampleDataSet();    public ParsedExampleDataSet getParsedData() {            return this.myParsedExampleDataSet;    }    @Override    public void startDocument() throws SAXException {            this.myParsedExampleDataSet = new ParsedExampleDataSet();    }    @Override    public void endDocument() throws SAXException {            // Nothing to do    }    @Override    public void startElement(String namespaceURI, String localName,                    String qName, Attributes atts) throws SAXException {            if (localName.equals(""Lat"")) {                    this.in_lat = true;            }else if (localName.equals(""Long"")) {                this.in_long = true;            }    }    @Override    public void endElement(String namespaceURI, String localName, String qName)                    throws SAXException {           if (localName.equals(""Lat"")) {                    this.in_lat = false;            }else if (localName.equals(""Long"")) {                this.in_long = false;}            else if (localName.equals(""Retailer"")) {                this.in_retailer = false;}    }    @Override    public void characters(char ch[], int start, int length) {            if(this.in_lat){            myParsedExampleDataSet.setExtractedString(new String(ch, start, length));}            else if(this.in_long){                myParsedExampleDataSet.setExtractedString2(new String(ch, start,     length));}}}</code></pre><p>ParsedExampleDataSet.Java:</p><pre><code>public class ParsedExampleDataSet extends LocationBasedServicesV2 {private String extractedString = null;private String OLDextractedString = null;String Long;String Lat;Double Long2;Double Lat2;int Lat3;int Long3;public void setExtractedString(String extractedString) {        Long = extractedString;        Long2 = Double.parseDouble(Long);        Long3 =  (int) (Long2 * 1E6);        /*if (OLDextractedString != null){        this.extractedString = OLDextractedString + extractedString + ',' ;     }    else    {        this.extractedString = extractedString + ',' ;    }        OLDextractedString = this.extractedString;*/}public void setExtractedString2(String extractedString) {   Lat = extractedString;   Lat2 = Double.parseDouble(Lat);   Lat3 =  (int) (Lat2 * 1E6);   createAndShowMyItemizedOverlay(Lat3,Long3);   /*if (OLDextractedString != null){     *         this.extractedString = OLDextractedString + extractedString + '\n' ;        }    else    {        this.extractedString = OLDextractedString + '\n' + extractedString  ;    }    OLDextractedString = this.extractedString;*/}   public int parseInt(){       return Lat3;}}</code></pre>","567772","","567772","","2011-01-08 18:12:06","2011-01-08 18:12:06","Android Map Overlays not working properly","<android><map><overlay><itemizedoverlay>","1","0","1","",""
"4632485","1","4754362","","2011-01-08 05:16:25","3","2524","<p>The following is the code I am using to take a screen shot using GLSurfaceView. But I dont know why the onDraw() method in the GLSurfaceView.Renderer Class is not being called.</p><p>Please if some one can look at the code below and point out what am I doing wrong.`public class MainActivity extends Activity {</p><pre><code>private GLSurfaceView mGLView;int x,y,w,h;Display disp;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    // ToDo add your GUI initialization code here    setContentView(R.layout.main);    x=0;    y=0;    disp = getWindowManager().getDefaultDisplay();    w = disp.getWidth();    h = disp.getHeight();   mGLView = new ClearGLSurfaceView(this);}class ClearGLSurfaceView extends GLSurfaceView {public ClearGLSurfaceView(Context context) {    super(context);    setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS);    mRenderer = new ClearRenderer();    setRenderer(mRenderer);}    ClearRenderer mRenderer;</code></pre><p>}</p><pre><code>class ClearRenderer implements GLSurfaceView.Renderer {public void onSurfaceCreated(GL10 gl, EGLConfig config) {    // Do nothing special.}public void onSurfaceChanged(GL10 gl, int w, int h) {    //gl.glViewport(0, 0, w, h);}public void onDrawFrame(GL10 gl) {    //gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    int b[]=new int[w*(y+h)];     int bt[]=new int[w*h];     IntBuffer ib=IntBuffer.wrap(b);     ib.position(0);     gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, ib);     for(int i=0, k=0; i&lt;h; i++, k++)     {//remember, that OpenGL bitmap is incompatible with Android bitmap      //and so, some correction need.          for(int j=0; j&lt;w; j++)          {               int pix=b[i*w+j];               int pb=(pix&gt;&gt;16)&amp;0xff;               int pr=(pix&lt;&lt;16)&amp;0x00ff0000;               int pix1=(pix&amp;0xff00ff00) | pr | pb;               bt[(h-k-1)*w+j]=pix1;          }     }     Bitmap bmp = Bitmap.createBitmap(bt, w, h,Bitmap.Config.ARGB_8888);     try            {                    File f = new File(""/sdcard/testpicture.png"");                    f.createNewFile();                    FileOutputStream fos=new FileOutputStream(f);                    bmp.compress(CompressFormat.PNG, 100, fos);                    try                    {                            fos.flush();                    }                    catch (IOException e)                    {                            // TODO Auto-generated catch block                            e.printStackTrace();                    }                    try                    {                            fos.close();                    }                    catch (IOException e)                    {                            // TODO Auto-generated catch block                            e.printStackTrace();                    }            }            catch (FileNotFoundException e)            {                    // TODO Auto-generated catch block                    e.printStackTrace();            }            catch(IOException e)            {                e.printStackTrace();            }}</code></pre><p>}</p><p>}</p><p>`</p><p>Please someone help me out.I have just started learning to work on android.</p>","566539","","265570","","2011-07-01 23:07:08","2012-11-08 13:33:52","screenshot in android","<android><opengl-es><screenshot>","1","1","1","",""
"4632501","1","4632617","","2011-01-08 05:20:45","7","10215","<p>I am having a database containing one table, i want to generate CSV file with values of this table.</p><p>Actually, I want to email this CSV file as an attachment. I know about sending file as an attachment in Email intent(AcTION_SEND), but i dont know the procedure of creating or the method by which i can create CSV formatted file.</p><p>Please give me suggestions or ideas.</p>","379693","","41713","","2011-10-04 13:46:52","2014-04-10 19:04:51","Android - Generate CSV file from table values","<java><android>","4","0","5","",""
"4632524","1","","","2011-01-08 05:28:25","7","18136","<p>I want to receive data from the serial port bluetooth device to android phone. But i don't know the UUID of that device how to find the UUID of that device?</p>","555910","","944657","","2012-11-05 08:29:22","2012-11-05 08:29:22","How to find the UUID of serial port Bluetooth device?","<android><bluetooth><uuid>","5","0","4","",""
"4632584","1","","","2011-01-08 05:48:07","1","609","<p>I have saved the java fine in the package android.media and I am allowed to create an instance of MediaMetadataRetriever class, but I am having problem with MediaMetadataRetriever.setDataSource() method. On using the path for this method, I get an error saying ""Source Not Found."" I am using eclipse IDE, can anyone please provide the solution?</p>","566947","","","","","2011-01-08 05:48:07","How to implement the MediaMetadataRetriever class in android","<android>","0","0","","",""
"4632608","1","4634179","","2011-01-08 05:54:38","5","3230","<p>Is it possible to detect touch events from within another application, specifically swipes?  I'd like to be able to detect if the user has swiped left or right (even with 2 fingers - but not required).  Perhaps there is a service or broadcast I can listen to.</p><p>or failing that, is there some API perhaps that I can poll say 10 times a second to get the touch state and I can compute the rest (why, I remember writing a mouse driver strobing the COM1 port with IN OUTs in 8086 assembler coded in a TSR on a XT...)!</p><p>Anyway, any help appreciated.  (I think it could be done by hijacking the primary Launcher and having a transparent click-through on-top activity, but that's seriously fraud with danger!)</p>","530047","","","","","2011-03-01 16:04:11","Android detecting the touch state from any application","<android><events><service><touch><broadcast>","2","2","4","",""
"4632707","1","","","2011-01-08 06:28:28","0","239","<p>now am trying tiny time tracker in android .. <a href=""http://tinytimetracker.sourceforge.net/php/"" rel=""nofollow"">http://tinytimetracker.sourceforge.net/php/</a> In the URL tiny time tracker code is available in java . now i need to convert that java to android.. can anybody help me pls.</p><p>Thank you,</p>","565106","","565106","","2011-01-08 11:23:41","2011-02-08 05:48:32","tiny time tracker in android","<android><widget><chronometer>","1","0","0","",""
"4632753","1","","","2011-01-08 06:40:58","1","343","<p>I am using yahoo local search in my android application. Everything works fine. I have a static sample query for yahoo local serach which is given for demo use.</p><pre><code>""http://local.yahooapis.com/LocalSearchService/V3/localSearch?appid=YahooDemo&amp;query=pizza&amp;zip=94306&amp;results=2""</code></pre><p>This query is searching Pizza shops with a postal code 94306 and maximum results are 2. I want to edit this query on runtime. For example if I write Mcdonalds in textbox the query should return maximum results of Mcdonalds. If i write coffee shop the query should return maximum results of coffee shops. I want to search Coffee shops, mcdonalds, grocery stores, hospitals and petrol filling stations.</p>","367121","","","","","2011-01-08 06:40:58","How to generate yahoo local search query in android?","<android><google-maps><yahoo-maps>","0","0","1","",""
"4632771","1","5030004","","2011-01-08 06:46:24","2","4944","<p>I have a simple ""Hello World"" style .air application.</p><p>How do I turn it into an .APK that can be run in the Android emulator?</p><p>I am using Adobe <strong>Flex Builder 3</strong> to create the .AIR file.</p>","247029","","773263","","2012-05-14 13:46:34","2012-05-14 13:46:34","Packaging Adobe AIR As .APK For Android","<android><flex><air><air-android>","4","0","1","",""
"4632849","1","4632868","","2011-01-08 07:09:36","0","400","<p>On stock android, what is that thing called when you click a contact's picture and it brings up a list of quick links?  this is also what you see when you long hold a icon in ADW Launcher.</p><p>More importantly though, i would like to know which png files in the folder <code>frameworks/base/core/res/res/drawable-hdpi</code> (from cm7 source, aka framework-res.apk) relate to that android view? (That is assuming they are in that folder, if not let me know).</p><p>I want to edit these but i cant for the life of me figure out which files relate to it. I have been searching around for a while and cant find anything on it.</p>","380527","","","","","2011-01-08 07:16:54","Android - What is that popup called when you click a contact's icon?","<android><view><png>","1","0","","",""
"4632890","1","4633061","","2011-01-08 07:24:32","0","7722","<p>I need to show menu at the time of button Click.But I am not able to display the menu . My code is below. Can anyone tell me what is wrong in my code ??? Thanks in Advance !!!</p><p>Code :</p><pre><code>import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.ContextMenu;import android.view.Menu;import android.view.View;import android.widget.Button;import android.widget.LinearLayout;public class DynamicMenu extends Activity {/** Called when the activity is first created. */private Context context;Button btnMenu;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    context = this;    LinearLayout llay = new LinearLayout(context);    btnMenu = new Button(context);    btnMenu.setText(""Show Menu"");    llay.addView(btnMenu);    setContentView(llay);    registerForContextMenu(btnMenu);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,        ContextMenu.ContextMenuInfo menuInfo) {    Menu m_menu = menu;    m_menu.add(0, 1, 0, ""Settings"");    m_menu.add(0, 2, 0, ""About"");    m_menu.add(0, 3, 0, ""Exit"");}}</code></pre>","548435","","548435","","2011-04-20 07:11:51","2011-09-28 19:28:17","Dynamic Menu in Android?","<android>","3","1","2","",""
"4633202","1","","","2011-01-08 09:03:37","0","549","<p>While trying to display a JPG from a URL I'm having an issue getting the image to appear in my ImageView. I'm able to open a URLConnection, pull the image down in an InputStream, decode that stream into Bitmap. I can even get values for the height and width of the bitmap. I set the bitmap to the ImageView and can still get a height for the Drawable. However, the image still does not appear in my application. Any ideas of what I could be missing? Thanks for any help.</p><pre><code>try{    URL imgURL = new URL(imgLocation);    URLConnection conn = imgURL.openConnection();    conn.connect();    InputStream is = conn.getInputStream();    BufferedInputStream bis = new BufferedInputStream(is, 25);    Bitmap bm = BitmapFactory.decodeStream(bis);    if(bm != null){        System.err.println(""Image Height: "" + bm.getHeight());        System.err.println(""Image Width: "" + bm.getWidth());    } else {        System.err.println(""bm is null!!!"");    }    img.setImageBitmap(bm);    System.err.println(""Drawable Height: "" + img.getDrawable().getIntrinsicHeight());    } catch (IOException e) {        // Print out the exception that occurred        e.printStackTrace();    }</code></pre>","413234","","","","","2011-01-08 11:15:21","Bitmap not appearing in ImageView","<android><bitmap><imageview>","1","0","","",""
"4633260","1","4633858","","2011-01-08 09:26:41","3","16431","<p>I just wanna display the contents of files from sdcard on emulator (as image files/video files/music files like that).</p><p>Below is my code.</p><pre><code>public class listfiles extends ListActivity { private ArrayList&lt;String&gt; item = null; private ArrayList&lt;String&gt; path = null; private String root=""/""; private TextView myPath;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.sub);        myPath = (TextView)findViewById(R.id.path);        getDir(root);    }    private void getDir(String dirPath)    {     myPath.setText(""Location: "" + dirPath);     item = new ArrayList&lt;String&gt;();     path = new ArrayList&lt;String&gt;();     File f = new File(dirPath);     File[] files = f.listFiles();     if(!dirPath.equals(root))     {      item.add(root);      path.add(root);      item.add(""../"");      path.add(f.getParent());     }     for(int i=0; i &lt; files.length; i++)     {       File file = files[i];       path.add(file.getPath());       if(file.isDirectory())        item.add(file.getName() + ""/"");       else        item.add(file.getName());     }     ArrayAdapter&lt;String&gt; fileList =      new ArrayAdapter&lt;String&gt;(this, R.layout.row, item);     setListAdapter(fileList);    } @Override protected void onListItemClick(ListView l, View v, int position, long id) {  File file = new File(path.get(position));  if (file.isDirectory())  {   if(file.canRead())    getDir(path.get(position));   else   {    new AlertDialog.Builder(this)    .setIcon(R.drawable.icon)    .setTitle(""["" + file.getName() + ""] folder can't be read!"")    .setPositiveButton(""OK"",       new DialogInterface.OnClickListener() {       @Override       public void onClick(DialogInterface dialog, int which) {        // TODO Auto-generated method stub       }      }).show();   }  }  else  {   new AlertDialog.Builder(this)    .setIcon(R.drawable.icon)    .setTitle(""["" + file.getName() + ""]"")    .setPositiveButton(""OK"",       new DialogInterface.OnClickListener() {       @Override       public void onClick(DialogInterface dialog, int which) {        // TODO Auto-generated method stub       }      }).show();  } }}</code></pre><p>In my output I got file path &amp; file name. But when i click the file, it won't show the contents. What should I do for that? Thanks</p><p>Finally i got it.My corrected code is shown below..</p><pre><code>public class SDCardActivity extends ListActivity { private List&lt;String&gt; item = null; private List&lt;String&gt; path = null; private String root=""/sdcard""; private TextView myPath;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);       // Intent intent=getIntent();        setContentView(R.layout.sub);        myPath = (TextView)findViewById(R.id.path);        getDir(root);    }    private void getDir(String dirPath)    {     myPath.setText(""Location: "" + dirPath);     item = new ArrayList&lt;String&gt;();     path = new ArrayList&lt;String&gt;();     File f = new File(dirPath);     File[] files = f.listFiles();     if(!dirPath.equals(root))     {      item.add(root);      path.add(root);      item.add(""../"");      path.add(f.getParent());     }     for(int i=0; i &lt; files.length; i++)     {       File file = files[i];       path.add(file.getPath());       if(file.isDirectory())        item.add(file.getName() + ""/"");       else        item.add(file.getName());     }     ArrayAdapter&lt;String&gt; fileList =      new ArrayAdapter&lt;String&gt;(this, R.layout.row, item);     setListAdapter(fileList);    } @Override protected void onListItemClick(ListView l, View v, int position, long id) {  File file = new File(path.get(position));  if (file.isDirectory())  {   if(file.canRead())    getDir(path.get(position));   else   {    new AlertDialog.Builder(this)    .setIcon(R.drawable.icon)    .setTitle(""["" + file.getName() + ""] folder can't be read!"")    .setPositiveButton(""OK"",       new DialogInterface.OnClickListener() {       public void onClick(DialogInterface dialog, int which){        // TODO Auto-generated method stub           dialog.dismiss();       }      }).show();   }  }  else  {      Intent intent = new Intent();      intent.setAction(Intent.ACTION_VIEW);      Uri uri = Uri.parse(""file://"" + file.getPath());      String fname=file.getName();      if(fname.endsWith("".jpeg"")||fname.endsWith(""png"")||fname.endsWith("".gif""))      {          intent.setDataAndType(uri, ""image/*"");          startActivity(intent);      }      else if(fname.endsWith("".mp4"")||fname.endsWith("".3gp""))      {          intent.setDataAndType(uri, ""video/*"");          startActivity(intent);      }      else if(fname.endsWith("".mp3""))      {          intent.setDataAndType(uri, ""audio/*"");          startActivity(intent);      }      else            try {              EditText tv = (EditText)findViewById(R.id.tn);              StringBuilder text = new StringBuilder();                BufferedReader br = new BufferedReader(new FileReader(file));                String line;                while ((line = br.readLine()) != null) {                    text.append(line);                    text.append('\n');                    //Set the text                    tv.setText(text);                }            }//try            catch (IOException e) {                //You'll need to add proper error handling here            }//catch  } }}</code></pre>","555948","","139010","","2011-02-22 20:30:25","2012-06-11 06:45:30","read data from sdcard in android","<android><file>","2","0","6","",""
"4633268","1","","","2011-01-08 09:28:09","2","1302","<p>In Android, is it possible to somehow display the SMSC address which was used for sending a given SMS to my phone? I'd like to write an app which lets me pick one of my stored SMS and then displays this SMSC address. Preferably this would happen as an extension to the ""message details"" dialogue box which can be invoked by long pressing an SMS.</p><p>Note: I do not mean the SMSC address of my phone's operator which is used for sending SMS from my phone to other phones.</p><p>I tried to find something in the now deprecated SMS content provider but either I did not look hard enough, or it's simply not stored after receiving the SMS.</p><p>Thanks for any tips!</p>","567888","","","","","2013-04-07 20:40:47","Displaying the SMSC address which was used for sending an SMS to my phone in Android","<android><service><sms><center><inbound>","2","1","","",""
"4633303","1","4634017","","2011-01-08 09:45:22","0","3588","<p>i'm new to android development and i'm playing around with json data. I managed to get the parsing to work. I want to show a ProgressDialog and i read that i need to use AsyncTask that. But for some reason i get a force close as soon as i put the same working code inside doInBackground() eventhough eclipse says everything is fine.</p><p>Here is the source code:</p><pre><code>public class HomeActivity extends Activity {  public class BackgroundAsyncTask extends AsyncTask&lt;Void, Integer, Void&gt; {      ProgressDialog dialog = new ProgressDialog (HomeActivity.this);      @Override      protected void onPreExecute() {        dialog.setMessage(""Loading...please wait"");        dialog.setIndeterminate(true);        dialog.setCancelable(false);        dialog.show();      }      protected void onPostExecute() {             dialog.dismiss();          }      @Override      protected Void doInBackground(Void... params) {                     try {                URL json = new URL(""http://www.corps-marchia.de/jsontest.php"");                URLConnection tc = json.openConnection();                BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));                String line;                while ((line = in.readLine()) != null) {                    JSONArray ja = new JSONArray(line);                    JSONObject jo = (JSONObject) ja.get(0);                    TextView txtView = (TextView)findViewById(R.id.TextView01);                    txtView.setText(jo.getString(""text""));                }            } catch (MalformedURLException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            } catch (JSONException e) {                e.printStackTrace();            }       return null;       }     }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new BackgroundAsyncTask().execute();    }}</code></pre><p>Here is the error log:</p><pre><code>01-08 12:33:48.225: ERROR/AndroidRuntime(815): FATAL EXCEPTION: AsyncTask #101-08 12:33:48.225: ERROR/AndroidRuntime(815): java.lang.RuntimeException: An error occured while executing doInBackground()01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.os.AsyncTask$3.done(AsyncTask.java:200)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.FutureTask.setException(FutureTask.java:125)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.lang.Thread.run(Thread.java:1019)01-08 12:33:48.225: ERROR/AndroidRuntime(815): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.ViewRoot.checkThread(ViewRoot.java:2932)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.ViewRoot.requestLayout(ViewRoot.java:629)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.View.requestLayout(View.java:8267)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.View.requestLayout(View.java:8267)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.View.requestLayout(View.java:8267)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.View.requestLayout(View.java:8267)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.view.View.requestLayout(View.java:8267)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.widget.TextView.checkForRelayout(TextView.java:5521)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.widget.TextView.setText(TextView.java:2724)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.widget.TextView.setText(TextView.java:2592)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.widget.TextView.setText(TextView.java:2567)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at net.ajzele.demo.andy1.HomeActivity$BackgroundAsyncTask.doInBackground(HomeActivity.java:52)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at net.ajzele.demo.andy1.HomeActivity$BackgroundAsyncTask.doInBackground(HomeActivity.java:1)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at android.os.AsyncTask$2.call(AsyncTask.java:185)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)01-08 12:33:48.225: ERROR/AndroidRuntime(815):     ... 4 more01-08 12:33:51.605: ERROR/WindowManager(815): Activity net.ajzele.demo.andy1.HomeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4051d0c0 that was originally added here01-08 12:33:51.605: ERROR/WindowManager(815): android.view.WindowLeaked: Activity net.ajzele.demo.andy1.HomeActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4051d0c0 that was originally added here01-08 12:33:51.605: ERROR/WindowManager(815):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:258)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.view.Window$LocalWindowManager.addView(Window.java:424)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.Dialog.show(Dialog.java:241)01-08 12:33:51.605: ERROR/WindowManager(815):     at net.ajzele.demo.andy1.HomeActivity$BackgroundAsyncTask.onPreExecute(HomeActivity.java:33)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.os.AsyncTask.execute(AsyncTask.java:391)01-08 12:33:51.605: ERROR/WindowManager(815):     at net.ajzele.demo.andy1.HomeActivity.onCreate(HomeActivity.java:72)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.os.Handler.dispatchMessage(Handler.java:99)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.os.Looper.loop(Looper.java:123)01-08 12:33:51.605: ERROR/WindowManager(815):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-08 12:33:51.605: ERROR/WindowManager(815):     at java.lang.reflect.Method.invokeNative(Native Method)01-08 12:33:51.605: ERROR/WindowManager(815):     at java.lang.reflect.Method.invoke(Method.java:507)01-08 12:33:51.605: ERROR/WindowManager(815):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-08 12:33:51.605: ERROR/WindowManager(815):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-08 12:33:51.605: ERROR/WindowManager(815):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Any hints? I hope you can help me out ive searched the net and didnt find any working solution...Thanks in advance</p>","563020","","","","","2011-01-08 13:11:30","Force close when trying to parse JSON with AsyncTask in the background","<android><json><android-asynctask>","2","0","2","",""
"4633315","1","4633327","","2011-01-08 09:49:30","0","1925","<p>I have an auto-complete drop down list, I want to make some action when I click on one item in the list.. is there any listener or event handler to to this ??</p>","508377","","","","","2013-08-03 03:41:52","how to add listener to auto complete drop down list in android?","<android>","2","0","","",""
"4633405","1","","","2011-01-08 10:22:28","2","1339","<p>How to put ProgressBar between screens in Android?</p>","567926","","914220","","2012-12-12 11:20:26","2012-12-12 11:20:26","Android.....progress bar","<android>","1","0","","",""
"4633435","1","4633873","","2011-01-08 10:29:28","1","576","<p>Here is what I am doing:</p><p>I'm building a webpage which I'm going to use in [an] android [app] for [the main] UI.</p><p>I want [to] interact with the android code while working the webpage. What I need is when I click a button on the webpage on an android phone a piece of android code should get executed. Normally we use direct buttons from android but in this app I need it that way. </p><p>Please drop in any suggestions.</p><p>Thank you</p>","438864","","6391","","2011-01-08 12:40:00","2011-01-08 12:40:00","How to interact with an android code using webpages?","<javascript><android><binding><webview>","1","0","","",""
"4633517","1","4633642","","2011-01-08 10:51:30","2","447","<p>When I am running my app on emulator it dont open and gives the following Error.</p><pre><code>[2011-01-08 16:16:56 - AudApp] ------------------------------[2011-01-08 16:16:56 - AudApp] Android Launch![2011-01-08 16:16:56 - AudApp] adb is running normally.[2011-01-08 16:16:56 - AudApp] Performing com.a1technology.AppingActivity activity launch[2011-01-08 16:17:00 - AudApp] Launching a new emulator with Virtual Device 'avd_2.3'[2011-01-08 16:17:00 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting</code></pre>","412168","","329637","","2011-01-08 11:01:42","2012-03-08 16:06:30","Emulator not opening in Android","<android><android-emulator>","2","2","","",""
"4633543","1","","","2011-01-08 11:02:13","9","15272","<p>I have two activities in the stack, in order to show them I use flag_activity_reorder_to_front. So far so good, the problem comes when I want to bring the activity with an animation using overridePendingTransition.</p><pre><code>Intent i = new Intent(ActivityA.this, ActivityB.class);i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); ActivityA.this.startActivity(i);overridePendingTransition(R.anim.transition_to_right, R.anim.transition_to_left);</code></pre><p>The transition is not shown, however, if the flag is not added to the intent (removing line 2) then there is no problem.</p><p>Is it possible to bring an activity to front with an animation?</p><p>Thanks a lot!</p>","567948","","","","","2011-12-13 12:27:40","overridePendingTransition does not work when flag_activity_reorder_to_front is used","<android><transition><flags>","5","0","3","",""
"4633700","1","","","2011-01-08 11:45:43","0","1032","<p>Need urgent help on desiging such a web app that will fetch records frm tomcat server(mysql) and restore/put data back to 'android' phone.</p><p>I need an urgent help coz am working on my graduation project.</p><p>Thanks,PrajaktaS.</p>","563042","","6391","","2011-01-08 12:31:12","2011-01-08 14:13:47","Web Application that fetches data from tomcat server and store it on android phone!","<android>","2","1","","",""
"4633725","1","","","2011-01-08 11:54:58","3","18478","<p>I want to completely disable the screen timeout.You can set a anti sleep in your application code, but it wont disable the auto sleep of Android that you can set from 15 sec to 30 min, also the programs that i downloaded from the market cant disable the 30 min auto screen sleep limit.</p><p>I want to run a AJAX webpage in the browser that has to be visible at all times, its connected to power, so power is no issue.</p>","537320","","6391","","2011-01-08 12:30:36","2013-01-04 06:44:50","Disable screen timeout Android phone/tablet","<android><sleep>","2","0","1","",""
"4633795","1","","","2011-01-08 12:15:11","2","1073","<p>I am making an app in android to get location name in google map.i have to get the particular location name when i tap in a pariticular location in my google map.i get error when i use my code , anyone can explain why it happens!!!</p><pre><code>package com.android.mapadress;import java.io.IOException;import java.util.List;import java.util.Locale;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;import android.app.Activity;import android.app.Service;import android.content.Context;import android.content.Intent;import android.graphics.Point;import android.location.Address;import android.location.Geocoder;import android.os.Bundle;import android.os.IBinder;import android.view.MotionEvent;import android.view.ViewGroup;import android.widget.LinearLayout;import android.widget.Toast;class MapOverlay extends com.google.android.maps.Overlay{public boolean onTouchEvent(MotionEvent event, MapView mapView) {       //---when user lifts his finger---    if (event.getAction() == 1) {                        GeoPoint p = mapView.getProjection().fromPixels(            (int) event.getX(),            (int) event.getY());            Toast.makeText(this,                 p.getLatitudeE6() / 1E6 + "","" +                 p.getLongitudeE6() /1E6 ,                 Toast.LENGTH_SHORT).show();    }                                return false;}@Overridepublic IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null;}}public class mapadress extends MapActivity  {    /** Called when the activity is first created. */    //@Override private MapOverlay overlay;    LinearLayout linearLayout; MapView mapView; MotionEvent event; //@Override protected boolean isRouteDisplayed() {      return false; }    public void onCreate(Bundle savedInstanceState) {     try     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mapView = (MapView) findViewById(R.id.mapview);     mapView.setBuiltInZoomControls(true);     overlay.onTouchEvent(event, mapView);     }     catch(Exception e)     {     }     }}</code></pre>","567994","","260990","","2011-01-08 12:20:10","2011-01-08 12:34:58","to get name of a location in google map by taping the location in android phone","<android>","1","0","","",""
"4633808","1","9620407","","2011-01-08 12:18:11","5","7995","<p>I have an Android application where I'm trying to send a picture to a server.  I did this using Base64 encoding and it worked quite well, but it took too much memory (and time) to encode the picture before sending it.</p><p>I'm trying to strip the Android application down to where it just simply sends the byte array and doesn't fiddle around with any kind of encoding scheme so it'll save as much memory and CPU cycles as possible.</p><p>This is what I would like the Android code to look like:</p><pre><code>public String sendPicture(byte[] picture, String address) {    try {        Socket clientSocket = new Socket(address, 8000);        OutputStream out = clientSocket.getOutputStream();        BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));        out.write(picture);        return in.readLine();    }    catch(IOException ioe) {        Log.v(""test"", ioe.getMessage());    }    return "" "";}</code></pre><p>The server is written in Java.  How do I write the server code so I can properly retrieve the exact same byte array?  My goal is to save as many CPU cycles on the Android as possible.</p><p>So far, all the methods I've tried resulted in corrupt data or a thrown exception.</p><p>Any help will be appreciated.</p>","489481","","","","","2012-06-12 15:00:25","Java/Android: Reading/writing a byte array over a socket","<java><android>","3","0","","",""
"4633815","1","","","2011-01-08 12:19:27","0","1932","<p>When I tap a tab, how do I make there to be three more tabs available to tap?</p><p>I'm new to Android, and I'm doing a simple project.</p>","567998","","63550","","2011-11-01 11:00:14","2011-11-01 11:24:01","How do I create a tab inside a tab in Android?","<android><tabs>","3","0","1","",""
"4633841","1","4634287","","2011-01-08 12:26:37","1","5915","<p>I'm using locationManager and ItemizedOverlay to draw My Location marker, the problem is when onLocationChanged is triggered I'm getting new marker drawed and not the last one moved to the new location, here is my onLocationChanged code :</p><pre><code>public void onLocationChanged(Location location) {  myOverlay object1 = new myOverlay(getResources().getDrawable(R.drawable.arrow),MyMap);  if(location!=null){   MyMap.invalidate();   GeoPoint MyPos = new GeoPoint(microdegrees(location.getLatitude()),microdegrees(location.getLongitude()));   MyController.animateTo(MyPos);   object1.addPoint(MyPos,""Ma position"",""Ma position"");   MyMap.getOverlays().add(object1);  } }</code></pre><p>Can you please help me solve this issue ?</p><p>Thanks a lot.</p><p>MapActivity :</p><pre><code>public class Main extends MapActivity implements LocationListener {  /** Called when the activity is first created. */  MapView MyMap;  MapController MyController;    @Override  public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      MyMap=(MapView)findViewById(R.id.MyGMap);      MyMap.setBuiltInZoomControls(true);      try {      getEventsFromAnXML(this);     } catch (XmlPullParserException e) {      e.printStackTrace();     } catch (IOException e) {      e.printStackTrace();     }     int j=0;     myOverlay object = new myOverlay(getResources().getDrawable(R.drawable.marker),MyMap);     while( j&lt;agencies.size()){         GeoPoint point = new GeoPoint(microdegrees(agencies.get(j).getLatitude()),microdegrees(agencies.get(j).getLongitude()));         String Tit;         String Des;         Tit=agencies.get(j).getTspTitle();         Des=agencies.get(j).getTspTitle() + ""\nAgence: "" + agencies.get(j).getTitle() +             ""\nTél: "" + agencies.get(j).getPhone();         object.addPoint(point,Tit,Des);         j=j+1;     }     MyMap.getOverlays().add(object);     MyController=MyMap.getController();     MyController.setZoom(12);     LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);     lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000L, 500.0f, this);  }  private int microdegrees(double value){      return (int)(value*1000000);  }  boolean na=false;  List&lt;Agency&gt; agencies = new ArrayList&lt;Agency&gt;();  Agency agency=new Agency();  int i=0;  String TempTspTitle;  String TempTspPhone;  Boolean TempTspEnabled;  private String getEventsFromAnXML(Activity activity)  throws XmlPullParserException, IOException  {   StringBuffer stringBuffer = new StringBuffer();   Resources res = activity.getResources();   XmlResourceParser xpp = res.getXml(R.xml.hotels);   xpp.next();   int eventType = xpp.getEventType();   while (eventType != XmlPullParser.END_DOCUMENT)   {    if(eventType == XmlPullParser.START_DOCUMENT)    {     stringBuffer.append(""--- Start XML ---"");    }    else if(eventType == XmlPullParser.START_TAG)    {        if (xpp.getName().equals(""DataBase"")){            String name=xpp.getAttributeValue(null, ""name"");            agency.setTspTitle(name);            TempTspTitle=name;            na=true;        }        if (xpp.getName().equals(""DataBaseEnabled"")){            xpp.next();            agency.setTspEnabled(Boolean.parseBoolean(xpp.getText()));            TempTspEnabled=Boolean.parseBoolean(xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Title"")){            xpp.next();            agency.setTitle(xpp.getText());            na=false;            xpp.nextTag();        }        if (xpp.getName().equals(""Address"")){            xpp.next();            agency.setAddress(xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Phone"") &amp;&amp; na==true){            xpp.next();            agency.setTspPhone(xpp.getText());            TempTspPhone=xpp.getText();            xpp.nextTag();        }else{            if (xpp.getName().equals(""Phone"") &amp;&amp; na==false){                xpp.next();                agency.setPhone(xpp.getText());                xpp.nextTag();            }        }        if (xpp.getName().equals(""Fax"")){            xpp.next();            agency.setFax(xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""e-Mail"")){            xpp.next();            agency.setMail(xpp.getText());            xpp.nextTag();        }        if (xpp.getName().equals(""Latitude"")){            xpp.next();            agency.setLatitude(Double.parseDouble(xpp.getText()));            xpp.nextTag();        }        if (xpp.getName().equals(""Longitude"")){            xpp.next();            agency.setLongitude(Double.parseDouble(xpp.getText()));        }    }    else if(eventType == XmlPullParser.END_TAG)    {        if (xpp.getName().equals(""DataBase"") ){            agency = new Agency();        }else if (xpp.getName().equals(""Agency"")){            agencies.add(i,agency);            i=i+1;            agency = new Agency();            agency.setTspTitle(TempTspTitle);            agency.setTspPhone(TempTspPhone);            agency.setTspEnabled(TempTspEnabled);        }    }    eventType = xpp.next();   }   stringBuffer.append(""\n"" + ""Size: "" + agencies.size());   return stringBuffer.toString();  }  @Override    protected boolean isRouteDisplayed() {        return false;    }    public void onLocationChanged(Location location) {        myOverlay object1 = new myOverlay(getResources().getDrawable(R.drawable.arrow),MyMap);        if(location!=null){            MyMap.getOverlays().remove(object1);            MyMap.invalidate();            GeoPoint MyPos = new GeoPoint(microdegrees(location.getLatitude()),microdegrees(location.getLongitude()));            MyController.animateTo(MyPos);            object1.addPoint(MyPos,""Ma position"",""Ma position"");            MyMap.getOverlays().add(object1);        }    }    public void onProviderDisabled(String provider) {        // TODO Auto-generated method stub    }    public void onProviderEnabled(String provider) {        // TODO Auto-generated method stub    }    public void onStatusChanged(String provider, int status, Bundle extras) {        // TODO Auto-generated method stub    }</code></pre><p>and myOverlay Class :</p><pre><code>public class myOverlay extends ItemizedOverlay&lt;OverlayItem&gt;{    List&lt;OverlayItem&gt; points= new ArrayList&lt;OverlayItem&gt;();    private Drawable marker=null;      private Context c;    public myOverlay(Drawable marker, MapView mapView) {        super(marker);        this.marker=marker;        c=mapView.getContext();    }    @Override    protected OverlayItem createItem(int i) {        return (points.get(i));    }    public void draw(Canvas canvas,MapView mapView, boolean shadow){        super.draw(canvas, mapView, shadow);        boundCenterBottom(marker);    }    @Override    public int size() {        return points.size();    }    public void addPoint(GeoPoint point, String Titre, String Desc){        this.points.add(new OverlayItem(point,Titre,Desc));        populate();    }    public void removePoint(){        this.points.clear();        populate();    }    @Override    protected boolean onTap(int i){        Toast.makeText(c, points.get(i).getSnippet(), Toast.LENGTH_SHORT).show();        return (true);    }  }          }</code></pre>","552264","","552264","","2011-01-08 14:08:21","2011-01-08 14:22:14","Android MapView can't remove marker","<android><android-mapview><marker>","3","0","1","",""
"4633896","1","","","2011-01-08 12:41:31","2","3240","<p>I have a problem with an Open GL ES 2 fragment shader and was wondering if anybody could help me.</p><p>I'm using the shader to draw metaballs on the screen.  It's relatively simple and the code is as follows:</p><pre><code>private static final String mFragmentShader = ""precision mediump float;\n""                                              + ""uniform vec2 balls[""                                              + NUMBER_OF_BALLS                                              + ""];\n""                                              + ""float sqr(highp float x) { return x*x; }\n""                                              + ""void main() {\n""                                              + ""  vec4 pixelColor = vec4(0.0, 0.0, 0.0, 0.0);\n""                                              + ""  vec4 color = vec4(0.0, 0.5, 1.0, 1.0);\n""                                              + ""  for (int i=0; i&lt;""                                              + NUMBER_OF_BALLS                                              + ""; ++i) {\n""                                              + ""    vec2 dist = balls[i] - gl_FragCoord.xy;\n""                                              + ""    float val = 100.0 / (sqr(dist.x) + sqr(dist.y));\n""                                              + ""    pixelColor += color * val;\n""                                              + ""  }\n""                                              + ""  highp float a = smoothstep(0.9, 1.0, pixelColor.a);\n""                                              + ""  gl_FragColor = vec4(pixelColor.rgb * a, 1.0);\n""                                              + ""}\n"";</code></pre><p>The shader compiles fine and works well when NUMBER_OF_BALLS is less than 15.  Unfortunately when number of balls is greater than 15, it renders as if the locations of all the balls are at position (0,0) (see <a href=""http://www.suzannemartintutoring.co.uk/images/broken.png"" rel=""nofollow"">here</a>).  I've checked the input to the shader and it is definitely right so there must be a problem with the shader itself.  Furthermore if I change the precision from mediump to highp then I can up the number of balls to 20 before the rendering becomes a problem.</p><p>Can anyone tell me what I am doing wrong? </p><p>Edit:  Here is the complete code just in case the problem is not wirth the fragment shader itself.</p><pre><code>       private static final String mFragmentShader = ""precision mediump float;\n""                                              + ""uniform vec2 balls[""                                              + NUMBER_OF_BALLS                                              + ""];\n""                                              + ""float sqr(highp float x) { return x*x; }\n""                                              + ""void main() {\n""                                              + ""  vec4 pixelColor = vec4(0.0, 0.0, 0.0, 0.0);\n""                                              + ""  vec4 color = vec4(0.0, 0.5, 1.0, 1.0);\n""                                              + ""  for (int i=0; i&lt;""                                              + NUMBER_OF_BALLS                                              + ""; ++i) {\n""                                              + ""    vec2 dist = balls[i] - gl_FragCoord.xy;\n""                                              + ""    float val = 100.0 / (sqr(dist.x) + sqr(dist.y));\n""                                              + ""    pixelColor += color * val;\n""                                              + ""  }\n""                                              + ""  highp float a = smoothstep(0.9, 1.0, pixelColor.a);\n""                                              + ""  gl_FragColor = vec4(pixelColor.rgb * a, 1.0);\n""                                              + ""}\n"";private static final String mVertexShader = ""attribute vec4 vPosition;\n"" + ""void main() {\n""                                            + ""  gl_Position = vPosition;\n""                                            + ""}\n"";int gProgram;int gvPositionHandle;private float[][] balls = new float[NUMBER_OF_BALLS][2];int[] lBalls = new int[NUMBER_OF_BALLS];private static final int FLOAT_SIZE_BYTES = 4;private final float[] mQuadVerticesData = { 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, };private FloatBuffer mQuadVertices;public MetaballRenderer() {    mQuadVertices = ByteBuffer.allocateDirect(mQuadVerticesData.length * FLOAT_SIZE_BYTES)                              .order(ByteOrder.nativeOrder())                              .asFloatBuffer();    mQuadVertices.put(mQuadVerticesData).position(0);}private int loadShader(int shaderType, String source) {    int shader = GLES20.glCreateShader(shaderType);    if (shader != 0) {        GLES20.glShaderSource(shader, source);        GLES20.glCompileShader(shader);        int[] compiled = new int[1];        GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);        if (compiled[0] == 0) {            Log.e(TAG, ""Could not compile shader "" + shaderType + "":"");            Log.e(TAG, GLES20.glGetShaderInfoLog(shader));            GLES20.glDeleteShader(shader);            shader = 0;        }    }    return shader;}private int createProgram(String vertexSource, String fragmentSource) {    int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);    if (vertexShader == 0) {        return 0;    }    int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);    if (pixelShader == 0) {        return 0;    }    int program = GLES20.glCreateProgram();    if (program != 0) {        GLES20.glAttachShader(program, vertexShader);        checkGlError(""glAttachShader"");        GLES20.glAttachShader(program, pixelShader);        checkGlError(""glAttachShader"");        GLES20.glLinkProgram(program);        int[] linkStatus = new int[1];        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);        if (linkStatus[0] != GLES20.GL_TRUE) {            Log.e(TAG, ""Could not link program: "");            Log.e(TAG, GLES20.glGetProgramInfoLog(program));            GLES20.glDeleteProgram(program);            program = 0;        }    }    return program;}private void init_balls() {    for (int i = 0; i &lt; NUMBER_OF_BALLS; ++i) {        balls[i][0] = 200 + rand.nextInt(50);        balls[i][1] = 200 + rand.nextInt(50);    }}private void checkGlError(String op) {    int error;    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {        Log.e(TAG, op + "": glError "" + error);        throw new RuntimeException(op + "": glError "" + error);    }}@Overridepublic void onDrawFrame(GL10 arg0) {    GLES20.glUseProgram(gProgram);    checkGlError(""glUseProgram"");    for (int i = 0; i &lt; NUMBER_OF_BALLS; ++i) {        GLES20.glUniform2fv(i, 1, balls[i], 0);        checkGlError(""glUniform2fv"");    }    GLES20.glVertexAttribPointer(gvPositionHandle, 2, GLES20.GL_FLOAT, false, 0, mQuadVertices);    checkGlError(""glVertexAttribPointer"");    GLES20.glEnableVertexAttribArray(gvPositionHandle);    checkGlError(""glEnableVertexAttribArray"");    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_FAN, 0, 4);    checkGlError(""glDrawArrays"");    GLES20.glUseProgram(0);    checkGlError(""glUseProgram"");}@Overridepublic void onSurfaceChanged(GL10 glUnused, int width, int height) {    // Ignore the passed-in GL10 interface, and use the GLES20    // class's static methods instead.    gProgram = createProgram(mVertexShader, mFragmentShader);    if (gProgram == 0) {        return;    }    gvPositionHandle = GLES20.glGetAttribLocation(gProgram, ""vPosition"");    checkGlError(""glGetAttribLocation"");    init_balls();    for (int i = 0; i &lt; NUMBER_OF_BALLS; ++i) {        lBalls[i] = GLES20.glGetUniformLocation(gProgram, ""balls["" + i + ""]"");        checkGlError(""glGetUniformLocation"");    }    GLES20.glViewport(0, 0, width, height);    checkGlError(""glViewport"");}@Overridepublic void onSurfaceCreated(GL10 arg0, EGLConfig arg1) {}</code></pre><p>}</p>","568011","","568011","","2011-01-08 17:14:46","2011-05-05 09:17:00","Android OPEN GL ES 2 Fragment Shaders","<android><opengl-es>","2","3","2","",""
"4633988","1","4749042","","2011-01-08 13:01:15","5","4225","<p>How do can you generate a bitmap from HTML in Android?</p><p>Can the <code>WebView</code> be used for this or is there a better approach (like maybe using the <code>WebView</code> rendering engine directly)? How?</p><p>I would like to implement the following method...</p><pre><code>public Bitmap toBitmap(Context context, String html, Rect rect);</code></pre><p>...where <code>html</code> is the html to render and <code>rect</code> is the frame of the desired bitmap.</p>","143378","","143378","","2011-01-09 16:59:45","2014-01-15 08:26:14","Generate bitmap from HTML in Android","<android><html><bitmap><webview>","4","2","8","",""
"4634052","1","4634067","","2011-01-08 13:20:01","4","9326","<p>I need help with sending http get request. Like this:</p><pre><code>URL connectURL;connectURL = new URL(address);HttpURLConnection conn = (HttpURLConnection)connectURL.openConnection(); // do some setupconn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); conn.setRequestMethod(""GET""); // connect and flush the request outconn.connect();conn.getOutputStream().flush();// now fetch the resultsString response = getResponse(conn);et.setText(response);</code></pre><p>I searched the web but any method I try, the code fails at <code>'conn.connect();'</code>. Any clues?</p>","568021","","","","","2013-03-05 17:28:31","Http get request in Android","<android><http><request>","2","1","1","",""
"4634053","1","4634087","","2011-01-08 13:20:06","0","3951","<p>I am developing one GPS Application. Which will send the location data to server for every one hour.</p><p>In this I am using following code:</p><pre><code>location.getLatitude();location.getLongitude();location.getTime();</code></pre><p>with this code I am getting Latitude and Longitude correctly and Time also, but I am getting some 13 digits number instead of the time. I done some research on that, I found that is an seconds for of the current time.</p><p>so now I need to convert that 13 digit number in to the specific format.</p>","546107","","139010","","2011-01-08 13:38:55","2012-09-27 09:20:59","Using the GPS (LocationManager) how To get the current Time?","<java><android>","2","0","","",""
"4634081","1","","","2011-01-08 13:29:36","0","703","<p>I am developing the typical RSS application. In the method onCreate define the layout to paint the screen and in the method onResume do a query to a URL to extract the data. Should paint the screen and then check the URL, right? because I do not paint the screen until the request to the URL has been answered.</p><p>How do I get paint the screen and before refer to the URL?Thanks a lot.</p>","567984","","","","","2011-01-08 13:53:02","Problems with onResume()","<android>","1","0","","",""
"4634172","1","","","2011-01-08 13:52:24","7","8311","<p>I need to scale an image before creating it and I want to do it only if it exceeds 1024KB (for example).</p><p>By doing the following I can scale the image but I only need to scale the ones that are bigger than the given size.</p><pre><code>Bitmap bmImg = null;InputStream is = url.openStream();BitmapFactory.Options opts = new BitmapFactory.Options();opts.inSampleSize = 10;bmImg = BitmapFactory.decodeStream(is,null,opts);</code></pre><p>How can I get the size of the Bitmap? (I'm happy knowing the amount of bytes, not the size after decompressing).</p><p><strong>Edit:</strong></p><p>I'm trying this:</p><pre><code>BitmapFactory.Options opts = new BitmapFactory.Options();opts.inJustDecodeBounds = true;Bitmap bmImg=BitmapFactory.decodeStream(is,null,opts);Log.e(""optwidth"",opts.outWidth+"""");Bitmap bmImg1 = BitmapFactory.decodeStream(is);</code></pre><p>The first time I use the InputStream (is) to decode it with the ""inJustDecodeBounds"" works fine and I can get the Bitmap dimensions.The problem is that the second time I use it to actually decode the image, no image is shown.</p><p>What am I doing wrong? </p>","564468","","564468","","2011-01-08 22:12:55","2012-11-19 12:54:29","How to know a Bitmap size from InputStream before creating the Bitmap?","<android>","8","0","1","",""
"4634206","1","4635071","","2011-01-08 14:03:16","1","1203","<p>I'm planning to cache some JSON response strings, and I also know when they will expire (app is communicating with my web service). I want to store key-value pairs (key=URL, value={json content+expire date}) somewhere, and I think I have these options:</p><ul><li>store in cache folder retrieved by getCacheDir() - documentation says <strong>you should always have a reasonable maximum, such as 1 MB, for the amount of space you consume with cache files</strong></li><li>save on a folder in SD Card (what folder? /sdcard/.temp ?) - how much is reasonable here 4 MB? 16 MB</li><li>store in SQLite database - here I assume that 1 MB limit for internal storage is OK too, and what size is OK for SD Card?</li></ul><p>Or should I put a combobox somewhere in app Preferences where the user will be able to choose cache location and size?</p><p><a href=""http://stackoverflow.com/questions/1547103/android-and-data-storage-space"">related question</a></p>","72746","","","","","2011-01-08 17:14:40","How much JSON should I cache in Android app?","<android><caching>","1","0","2","",""
"4634217","1","","","2011-01-08 14:07:53","1","387","<p>I'm creating a game, and I have a few audio clips in the game. I'm using audio pool and I'm only using 2 audio clips. They are both mp3 format, 1 is 700kb and the other is 800 bytes. </p><p>I'm trying to play the 700kb audio clip when the game is first loaded. It's a background sound that will loop forever as long as the app is open. However everything I've tried fails. The only way I was able to get it to work is to start a thread on startup and have the thread sleep for like 15 seconds. After that it calls the start audio and it plays, but if the thread is destroyed it will kill the sound with it.</p><p>I'm assuming the audio is buffering maybe and that's why it doesn't play at start? Also do you have to make all audio calls from a thread?</p>","562537","","","","","2011-01-08 16:35:36","Start audio as soon as the app is loaded Android App","<android><audio><soundpool>","1","1","1","",""
"4634313","1","4634515","","2011-01-08 14:27:48","2","1003","<p>I want to send commands to (and receive output from) the Android shell (BusyBox) from a standard Android App. How would I go about doing this? 1 hour of googling yielded no result. </p><p>Help very appreciated.</p><p>Regards,Svante</p>","355942","","","","","2011-06-01 22:45:23","How to interface with shell (BusyBox) in Android App","<android><shell><busybox>","1","0","3","",""
"4634342","1","4634828","","2011-01-08 14:33:35","0","1900","<p>I am starting to develop apps for Android. As you know, i need to download Android SDK to my computer, but i cannot because developer.android.com is not being opened. Is there another way to download this SDK? Thanks so much.</p>","568086","","","","","2011-04-01 19:04:56","Downloading Android SDK","<android><sdk>","3","1","","",""
"4634399","1","4649612","","2011-01-08 14:47:34","2","701","<p>I have an Android App and I would like to start putting non-intrusive advert into the app. However, I have the benefit of knowing exactly what products I would like to put in these adverts (which will basically be amazon ""similar products"" type things and a few other suppliers). Is there any ad-engine out there that will allow me to do this? The ones I see already just put what <em>they</em> think are suitable.</p><p>I have scoured and I can't find an example of this... Any ideas? Should I just bite the bullet and write my own classes to do this ?</p>","151153","","319618","","2011-01-08 14:49:16","2013-06-09 20:19:59","How to create your own advert engine for an Android App?","<android><advertising>","1","0","","",""
"4634502","1","","","2011-01-08 15:10:12","0","569","<p>Well basically my question is right in the title: why does my game use 100% cpu and the LunarLander example does not?</p><p>My game is currently almost identical to the LunarLander example in function, with a separate thread for the game loop, updating physics/events in a while() loop and drawing to the screen continuously.</p><p>However when I run LunarLander and enable the debug tools, it shows about 50% cpu usage (the emulator uses about 25% on my dual-core PC). My own game uses 100% of the cpu (and the emulator 50% on my pc).</p><p>I don't necessarily want or need to reduce the cpu load and increase the performance of my game (although it runs a bit sluggish on the emulator and on a slower phone), but I just really don't understand why the LunarLander example doesn't use 100%? It basically has a while(true) loop in which it updates the physics and draws to the screen constantly. Why does that not reach 100%?</p><p>Also my game is quite similar: I update my game state in a method and then draw everything to the screen. First a background image, then a few other images on it (the LunarLander example uses Drawables while I use Bitmap, because I don't have to transform them and they're supposed to be faster). When I don't interact with the game, nothing even really happens, and interaction is done through events, not even in the main loop.</p><p>Any ideas? :-)</p>","504451","","","","","2011-01-08 18:20:36","Why does my game use 100% CPU and LunarLander doesn't?","<android><performance>","1","3","1","",""
"4634545","1","","","2011-01-08 15:22:43","1","1069","<p>This question is related to android contacts &amp; accounts.   How do I make a copy of contacts from one account into another account?    For sample, the contacts in account A is person_a, person_b, person_c, person_d; but there are none in account B. How to make copy of person_a, person_b, person_c, person_d in account B. Contacts in account A are not deleted.   Thanks.</p><p>BRShawn</p>","557911","","319618","","2011-01-08 15:27:13","2013-05-03 05:10:36","How to make copy of contacts from one account into another account?","<android><copy><contact><account>","1","2","","",""
"4634564","1","","","2011-01-08 15:25:41","2","1870","<p>I have made a class:</p><pre><code>package com.test;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.os.PowerManager;public class DoNotDimScreen extends Activity {private PowerManager.WakeLock wl;@Overrideprotected void onCreate(Bundle savedInstanceState) {PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, ""DoNotDimScreen"");}@Overrideprotected void onPause() {super.onPause();wl.release();}@Overrideprotected void onResume() {super.onResume();wl.acquire();}}</code></pre><p>That i want to use in my main class to turn the screen on and off at certain hours of the day, so ve tried the following (in my main class):</p><pre><code>DoNotDimScreen dm = new DoNotDimScreen(); if (hourOfDay == 5)   dm.onResume();    else     dm.onPause();</code></pre><p>But i get a nullpointerexception. What am i doing wrong? Thanks</p>","557703","","","","","2012-06-01 08:16:56","Android powermanager / wakelock problem","<android><screen>","3","0","0","",""
"4634633","1","4779120","","2011-01-08 15:39:36","11","2554","<p>My app performs some backgound data collection and I'm adding support for the user network preferences, such as performing background updates and data roaming.  I have the following checks already:</p><pre><code>ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);if(cm.getBackgroundDataSetting()) {...NetworkInfo networkInfo = cm.getActiveNetworkInfo();if (networkInfo != null &amp;&amp; networkInfo.isAvailable() &amp;&amp; networkInfo.isConnected()) {</code></pre><p>with the required entries in the manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""&gt;&lt;/uses-permission&gt;</code></pre><p>This all appears to be working fine, but I was wondering if I should be checking anything else?  I was worried about checking for data roaming but the <a href=""http://developer.android.com/reference/android/net/NetworkInfo.html#isAvailable%28%29"">docs</a> state that <code>networkInfo.isAvailable()</code> checks this for me.  So are there any other checks I need to implement for network settings?  Anything else in this area I should be aware of?</p>","512958","","","","","2011-01-27 06:43:00","How to respect network use settings in Android","<android>","3","3","11","",""
"4634647","1","","","2011-01-08 15:44:00","0","4118","<p>I try to get the effect click background color for linear layout. I've set clickable to linear layout. and from the code also I've put the click listener the setBackgroundResource.</p><p>Here it 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;LinearLayout     android:id=""@+id/llinsertmem""    android:clickable=""true""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:layout_marginBottom=""50px""&gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:textSize=""20sp""        android:text=""PUSH it""        /&gt;   &lt;/LinearLayout&gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>and the java code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);        LinearLayout linearInsertMem = (LinearLayout)findViewById(R.id.llinsertmem);        linearInsertMem.setOnClickListener(new View.OnClickListener() {                     @Override            public void onClick(View v) {                v.setBackgroundResource(android.R.drawable.list_selector_background);                Toast.makeText(testdoank.this, ""succeded"", Toast.LENGTH_SHORT)                    .show();            }        });}</code></pre><p>When first time click the clickable linearlayout, the toast text is displayed but the background color click effect doesn't. The flash background click color is only work from the second click.</p><p>any idea what the problem is?</p>","436498","","","","","2011-03-19 09:14:56","first click on linearlayout doesn flash background click color, it just flash for second and next click","<android>","3","0","","",""
"4634688","1","4634907","","2011-01-08 15:53:24","1","1233","<p>The limitation of an APK's size on the Android Market is now 50mb. However I'm doing an application which is really bigger. </p><p>The size of my app is due to videos. However even if I don't now if I'll make a free or paid app, I don't want anyone to be able to copy/re-use my videos. So I can't upload my videos on Internet and just download them from my app to copy them to the phone or sd card. In this case everyone would have acces to the file with all the videos.</p><p>Can we ask Google to accept a bigger app (with extra-cost if needed) ? Is there other solutions ?</p>","400695","","","","","2011-01-14 18:28:35","APK bigger than 50 MB","<android><google-play>","3","2","0","",""
"4634744","1","7458256","","2011-01-08 16:05:16","0","1566","<p>I am building a simple application based off of the Google provided Note pad app.  One of my first steps is converting the app to use XML menus, where possible.  In the main activity, the notes list, I am using MenuInflater to show the default 'Compose' menu option:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    // menu initialization, use the baseline menu from XML    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.noteslist, menu);    // generate any additional actions that can be performed on the    // overall list.  In a normal install, there are no additional    // actions found here, but this allows other applications to extend    // our menu with their own actions.    Intent intent = new Intent(null, getIntent().getData());    intent.addCategory(Intent.CATEGORY_ALTERNATIVE);    menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0, new ComponentName(this, NotesList.class), null, intent, 0, null);    return true;}</code></pre><p>With noteslist.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/compose_note""      android:icon=""@drawable/ic_menu_compose""      android:title=""@string/menu_compose""      android:alphabeticShortcut=""c""      android:numericShortcut=""3"" /&gt;&lt;/menu&gt;</code></pre><p>Everything works fine.  Now, per the example (and modified as the example tries to add intent options when there are no items selected on the list as well), I want to add some additional options if there are items in the list, and one of them is selected:</p><pre><code>@Overridepublic boolean onPrepareOptionsMenu(Menu menu) {    super.onPrepareOptionsMenu(menu);    // determine if we have any items in the list via the ListAdapter    final boolean haveItems = (getListAdapter().getCount() &gt; 0);    // do we have items?    if (haveItems) {        // there are items, check if any are selected        //Toast.makeText(getApplicationContext(), ""position: "" + getSelectedItemPosition(), Toast.LENGTH_SHORT).show();        if (getSelectedItemPosition() &gt;= 0) {            // an item is selected, add the intents for one of our list items to the menu            Uri uri = ContentUris.withAppendedId(getIntent().getData(), getSelectedItemId());            // build menu on the fly... always starts with the EDIT action            Intent[] specifics = new Intent[1];            specifics[0] = new Intent(Intent.ACTION_EDIT, uri);            MenuItem[] items = new MenuItem[1];            // now add additional CATEGORY_ALTERNATIVE intent-based actions, (see the manifest)            Intent intent = new Intent(null, uri);            intent.addCategory(Intent.CATEGORY_ALTERNATIVE);            menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0, null, specifics, intent, 0, items);            // finally, add a shortcut to the edit menu item            if (items[0] != null) {                items[0].setShortcut('1', 'e');            }        }    } else {        menu.removeGroup(Menu.CATEGORY_ALTERNATIVE);    }    return true;}</code></pre><p>Finally, the referenced AndroidManifest.xml, unchanged from the default for the demo app:</p><p><a href=""http://developer.android.com/resources/samples/NotePad/AndroidManifest.html"" rel=""nofollow"">http://developer.android.com/resources/samples/NotePad/AndroidManifest.html</a></p><p>So, I have two questions:</p><p>1) The resulting menus, Edit Note and Edit Title, generated by onPrepareOptionsMenu() when an item is selected, use the default icon and have no shortcuts assigned.  I can set the intent-filter to have a different icon via android:icon="""", but no such luck with assigning alphabetic and numeric shortcuts... I'd like to specify these, and was hoping that there might be a way to define these menu items in XML, and when they are to be brought in by the app via being identified by the intent-filters, also pull the XML and inflate/import it somehow.  Any suggestions or pointers?</p><p>2) In onCreateOptionsMenu(), why is the addIntentOptions() call with CATEGORY_ALTERNATIVE NOT adding the activities with intent-filter set to category.ALTERNATIVE to the menu (not adding is correct behavior in this case, just trying to get my head around how the virtually identical calls to addIntentOptions() in onCreateOptionsMenu() and onPrepareOptionsMenu() result in different menus).</p>","357801","","","","","2011-09-17 22:29:22","Customize Menu Options When Using menu.addIntentOptions()","<android><menu><android-intent><notepad><options-menu>","1","6","1","",""
"4634774","1","4634858","","2011-01-08 16:11:11","16","40001","<p>On a <a href=""http://stackoverflow.com/questions/4615693/android-file-copy"">separate thread</a> I demonstrated my ignorance of memory types by asking about the best way to copy a file into ""internal memory"" and was advised that this was not a good idea and that it would be better to read the file into ""RAM"". I am now trying to understand how these two types of memory are related and how they can be used.</p><p>I understand that ""internal memory is perceived to be the flash that is used to store APKs, ROM images, etc.""</p><p>The specification for my HTC Hero says that there is ""ROM: 512MB, RAM: 288MB"" with no indication of how the RAM is subdivided.</p><p>On the phone the ""Settings""->""SD &amp; phone storage"" page simply refers to ""SD card"" and ""Internal phone storage"" and for the latter just shows one amount for ""Available space"".</p><p>The Android Reference for <a href=""http://developer.android.com/guide/topics/data/data-storage.html"">Data Storage</a> mentions ""Internal Storage"". This is a place where ""you can save files"". The page also mentions SQLite database files which I think can be stored in the ""Internal storage"". However, the page doesn't seem to offer any explanation of the sub-division of RAM between Internal Storage and another (presumably more dynamic) type.</p><p>Is there some kind of dynamic division of the total RAM (288MB on the Hero) into two sub-divisions which are usable in different ways? If so, where in the Android documentation is this explained?</p>","250845","","","","","2014-02-17 14:24:42","Android memory types (RAM v Internal Memory)","<android><memory><storage><ram>","1","0","6","",""
"4634796","1","","","2011-01-08 16:13:58","2","7486","<p>I have spent some days trying to solve a problem I have with ListViews on Android. I would like to implement a single selection list box using a ListView. So, I would like to have only one row with a predefined light background color and the rest with another preselected color. The problem I have is that when I click over a specific row is another row which is highlighted and not the one I pressed. I added several messages to Log what is happening but all seems to work fine. Here is my code:</p><pre><code>public class TryListViewActivity extends Activity {    protected static final int NO_SELECTED_COLOR = 0xFF191919;    protected static final int SELECTED_COLOR = 0xFF3366CC;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ListView listView = new ListView(this);        ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();        list.add(""Option 1"");        list.add(""Option 2"");        list.add(""Option 3"");        list.add(""Option 4"");        list.add(""Option 5"");        list.add(""Option 6"");        list.add(""Option 7"");        list.add(""Option 8"");        list.add(""Option 9"");        list.add(""Option 10"");        list.add(""Option 11"");        list.add(""Option 12"");        list.add(""Option 13"");        list.add(""Option 14"");        list.add(""Option 15"");        ArrayAdapter&lt;String&gt; listAdapter = new ArrayAdapter&lt;String&gt;(            this,            R.layout.list_box_entry,            list        );        listView.setAdapter(listAdapter);        listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);        // Set the listener        listView.setOnItemClickListener(            new AdapterView.OnItemClickListener() {                public void onItemClick(AdapterView&lt;?&gt; parent, View view,                    int position, long id) {                    Log.i(                        ""Log"",                        ""[SingleSelectionListBox] Item clicked: position=""                        + position + "";id="" + id                    );                    // First, set all rows to be unselected                    int counter  = parent.getCount();                    Log.i(                        ""Log"",                        ""[SingleSelectionListBox] ""                        + counter + "" items found inside the parent""                    );                    int children = parent.getChildCount();                    Log.i(                        ""Log"",                        ""[SingleSelectionListBox] ""                        + children + "" views found inside the parent""                    );                    for(int i=0;i&lt;children;i++) {                        Log.i(                            ""Log"",                            ""[SingleSelectionListBox] Child ""                            + i + "" has message ""                            + ((TextView)parent.getChildAt(i)).getText()                        );                    }                    // Too inefficient but for now is OK                    for(int i=0;i&lt;children;i++)                        parent.getChildAt(i)                            .setBackgroundColor(NO_SELECTED_COLOR);                    Log.i(""Log"",                        ""[SingleSelectionListBox] First visible position: ""                        + parent.getFirstVisiblePosition()                    );                    // Set the background color                    TextView textView = (TextView)(parent.getChildAt(                        position-parent.getFirstVisiblePosition()));                    textView.setBackgroundColor(SELECTED_COLOR);                    Log.i(                        ""Log"",                        ""[SingleSelectionListBox] Text inside the ""                        + "" View changing the color "" + textView.getText()                    );                }            }        );        setContentView(listView);    }}</code></pre><p>Inside the resources (res/layout) I inserted a file called list_text_entry.xml with the following content</p><pre class=""lang-xml prettyprint-override""><code>&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:gravity=""center""  android:textColor=""#FFFFFF"" android:padding=""10dp"" android:textSize=""16sp""&gt;&lt;/TextView&gt;</code></pre><p>For example, If I click over the ""Option 11"" entry when the listView has been previously scrolled down until the first row I see is ""Option 4"", the ""Option 7"" row appears as selected being the only one carrying a blue color in the background. Can someone explain what happens here to me? I post below the messages I got throw the Log.</p><pre class=""lang-none prettyprint-override""><code>[SingleSelectionListBox] Item clicked: position=10;id=10[SingleSelectionListBox] 15 items found inside the parent[SingleSelectionListBox] 11 views found inside the parent[SingleSelectionListBox] Child 0 has message Option 4[SingleSelectionListBox] Child 1 has message Option 5[SingleSelectionListBox] Child 2 has message Option 6[SingleSelectionListBox] Child 3 has message Option 7[SingleSelectionListBox] Child 4 has message Option 8[SingleSelectionListBox] Child 5 has message Option 9[SingleSelectionListBox] Child 6 has message Option 10[SingleSelectionListBox] Child 7 has message Option 11[SingleSelectionListBox] Child 8 has message Option 12[SingleSelectionListBox] Child 9 has message Option 13[SingleSelectionListBox] Child 10 has message Option 14[SingleSelectionListBox] First visible position: 3[SingleSelectionListBox] Text inside the View changing the color Option 11</code></pre><p>As I can guess all children inside the ViewGroup as ordered from top to bottom and even when I do this in the code:</p><pre><code>TextView textView = (TextView)(parent.getChildAt(    position-parent.getFirstVisiblePosition()));textView.setBackgroundColor(SELECTED_COLOR);</code></pre><p>Appears the message <code>Option 11</code> but is really the <code>option 7</code> selected. Is this a bug from Android?</p>","568146","","344480","","2012-06-17 09:29:15","2013-06-27 13:49:58","How can I change the background color for an specific row properly in a ListView? (Android)","<android><listview><background-color>","4","1","2","",""
"4634915","1","","","2011-01-08 16:42:23","1","2463","<p>I'm trying to launch a new activity from my main activity, but I just get error codes all the time.</p><p>Heres my main activity;</p><pre><code>   package com.gunstats;import android.app.Activity;import android.content.Intent;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.widget.Button;public class gunstats extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         final MediaPlayer mp = MediaPlayer.create(this, R.raw.deagle);        Button button3 = (Button)this.findViewById(R.id.button3);        button3.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mp.start();            }        });        final MediaPlayer mp2 = MediaPlayer.create(this, R.raw.ak47);        Button button2 = (Button)this.findViewById(R.id.button2);        button2.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mp2.start();            }        });        final MediaPlayer mp3 = MediaPlayer.create(this, R.raw.m40a3);        Button button1 = (Button)this.findViewById(R.id.button1);        button1.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mp3.start();            }        });        Button button4 = (Button)findViewById(R.id.button4);                button4.setOnClickListener(new Button.OnClickListener() {                    public void onClick(View v) {                        Intent intent = new Intent(gunstats.this,                                more.class);                                                 startActivity(intent);                                            }                                        });    }}</code></pre><p>and the activity that is being called from my main class;</p><pre><code>package com.gunstats;import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.widget.Button;public class more extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         final MediaPlayer mp = MediaPlayer.create(this, R.raw.deagle);        Button buttonm1 = (Button)this.findViewById(R.id.buttonm1);        buttonm1.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                mp.start();            }        });    }}</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.gunstats""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".gunstats""                  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="".more""/&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;/manifest&gt; </code></pre><p>Logcat:</p><pre><code>01-08 17:37:47.658: ERROR/AndroidRuntime(276): Uncaught handler: thread main exiting due to uncaught exception01-08 17:37:47.728: ERROR/AndroidRuntime(276): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gunstats/com.gunstats.more}: java.lang.NullPointerException01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.os.Handler.dispatchMessage(Handler.java:99)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.os.Looper.loop(Looper.java:123)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.main(ActivityThread.java:4203)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invokeNative(Native Method)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invoke(Method.java:521)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at dalvik.system.NativeStart.main(Native Method)01-08 17:37:47.728: ERROR/AndroidRuntime(276): Caused by: java.lang.NullPointerException01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at com.gunstats.more.onCreate(more.java:23)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)01-08 17:37:47.728: ERROR/AndroidRuntime(276):     ... 11 more</code></pre><p>The error is pointing to my 23 line in the 'more' class.</p><p>my 23 line is;buttonm1.setOnClickListener(new View.OnClickListener() {</p><p>Whats wrong?</p>","567231","","6391","","2011-01-08 19:35:39","2011-01-08 19:35:39","Force close when starting new activity","<android>","2","0","","",""
"4634936","1","4787865","","2011-01-08 16:48:07","2","4180","<p>So I'm dipping my toes into this area for the first time - i followed instructions to install the android SDK and eclipse plug in. I created a blank new android project and I get the following build errors:</p><pre><code>[2011-01-08 16:34:55 - xxx]: Dxno classfiles specified[2011-01-08 16:34:55 - xxx] Conversion to Dalvik format failed with error 1</code></pre><p>I've googled the problem and tried to clean and rebuild, or hitting F5 on the project in the explorer but the issue remains. I've verified the build paths and the libraries to make sure only Android 2.3 is there but still get this issue. </p><p>I have also tried to load a sample project and I get the same error.</p><p>Any ideas?</p>","94279","","","","","2012-02-29 06:00:21","Android Development - Conversion to Dalvik format failed with error 1","<android>","5","0","","",""
"4634985","1","","","2011-01-08 16:59:31","2","1539","<p>I have an application that works fine, except when it is in the background for a long time and is brought back to the foreground. I am wondering if this has anything to do with the flag alwaysRetainTaskState, when the system has cleared my activity stack. I would like to test it, but I don't want to sit around for 30 minutes every time. Is there any way to trigger the normal system behavior some other way?</p><p>Update:If I set the flag android:clearTaskOnLaunch, is it going to do the same thing as alwaysRetainTaskState when I relaunch the app?</p>","3610","","3610","","2011-01-08 17:11:13","2013-03-25 05:44:34","How to test android:alwaysRetainTaskState","<android>","2","0","","",""
"4635022","1","4696502","","2011-01-08 17:05:17","0","491","<p>I have a basic ListActivity that supports context menus via onCreateContextMenu() and onContextItemSelected().  If either of these methods fail and the context menu is not generated, the current default functionality seems to be to fire off onListItemClick().  TO me, if a user intentionally holds down their finger to get to the context menu, only to then have the item open, is very confusing and could lead them to simply abandoning this gesture in your app if it happens.</p><p>What I'd like to do is on failure fire off a Toast with a helpful message, then cancel the onListItemClick so that the list item doesn't open.  I have the Toast working, but trying to figure out if it's possible to cancel the click action from inside on of onCreateContextMenu() or onContextItemSelected() where the error will occur.</p><p>Thanks!</p>","357801","","","","","2011-01-14 22:07:01","Cancel onListItemClick() if onCreateContextMenu() Fails","<android><listactivity>","1","2","","",""
"4635030","1","4716189","","2011-01-08 17:07:11","0","4876","<p>The program gets a cursor and loops through it with <code>while(cursor.moveToNext())</code> in several different places but one in particular is constantly giving this exception:</p><pre><code>01-08 09:00:06.168: ERROR/AndroidRuntime(13434): Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O error01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:296)01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:269)01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171)01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at android.database.AbstractCursor.moveToNext(AbstractCursor.java:256)01-08 09:00:06.168: ERROR/AndroidRuntime(13434):     at ... [my code]</code></pre><p>Watching it in the debug, it gets to the <code>while(cursor.moveToNext())</code> line and then pauses for a couple seconds before throwing this error.</p><p>What are possible issues that would throw this error?</p><p><strong>Additional info</strong></p><p>If I try to call <code>cursor.getCount()</code> it also crashes with the same exception.</p><p>The issue was only affecting one table in the database.  I took the database file off the phone and opened it on my computer and it seemed fine.  I was able to run the same query on it that was causing the problem and it worked just fine.</p><p>I then completely removed the app from the phone and reinstalled it fresh and the problem seems to have gone away.  So on one hand it looked like a corrupted table and on the other it didn't...</p><p><strong>Update</strong></p><p>This error is happening again to the same table. After reinstalling the app on the device the problem went away for a while.  I'll see if I can track down when it starts.</p>","445348","","445348","","2011-01-17 03:04:54","2013-05-23 09:27:19","SQLiteDiskIOException: disk I/O error happening on Cursor.moveToNext()","<android><sqlite>","3","3","","",""
"4635042","1","","","2011-01-08 17:09:59","9","2532","<p>I am finding alot of users for some reason are not upgrading my application when new versions come out.Is there a way for my application to query the Marketplace application and then notify the user if a newer version is available ?</p>","507991","","","","","2012-01-14 11:54:10","Android: Notify user of a newer version","<android><updates>","3","3","","",""
"4635212","1","4635497","","2011-01-08 17:38:51","0","568","<p>Is it possible to use the VideoVideo with the ListView as an item. Has anyone done this? Are there any issues I should be aware of?</p>","553462","","","","","2012-08-03 03:00:19","VideoView in ListView","<java><android>","2","0","","",""
"4635233","1","4638409","","2011-01-08 17:44:09","0","104","<p>I have a a database with more than 6000 entries. I am using this example <a href=""http://eshyu.wordpress.com/2010/08/15/cursoradapter-with-alphabet-indexed-section-headers/"" rel=""nofollow"">http://eshyu.wordpress.com/2010/08/15/cursoradapter-with-alphabet-indexed-section-headers/</a> to display the contents. But now the activity isn't able to handle it. I get a ANR dialog every time. How do I efficiently handle this circumstance?</p>","421372","","","","","2011-01-09 08:56:30","Managing 6000+ contacts from a database","<android><optimization><listview><cursor><custom-view>","1","2","1","",""
"4635240","1","4636303","","2011-01-08 17:45:04","0","538","<p>Hy!!</p><p>I have a problem with the progressdialog.</p><p>My used code:</p><pre><code>package com.android.skiptvad;import java.io.InputStreamReader;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;import java.util.ArrayList;import java.util.List;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.HttpGet;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import org.apache.http.protocol.HTTP;import org.apache.http.util.EntityUtils;import org.json.JSONException;import org.json.JSONObject;import android.app.Activity;import android.app.Dialog;import android.app.ProgressDialog;import android.graphics.LightingColorFilter;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.view.Window;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;import com.android.skiptvad.*;public class Login extends Activity {    /** Called when the activity is first created. */    TextView tvuser;    String sessionid;    ProgressDialog pd = null;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.login);        tvuser = (TextView) findViewById(R.id.tvuser);        TextView tvpw = (TextView) findViewById(R.id.tvpw);        final EditText etuser = (EditText) findViewById(R.id.etuser);        final EditText etpw = (EditText) findViewById(R.id.etpw);        Button btlogin = (Button)findViewById(R.id.btlogin);        btlogin.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                if (etuser.getText() != null &amp;&amp; etpw.getText()!= null)                {                    runOnUiThread(new Runnable() {                        @Override                        public void run() {                            pd = ProgressDialog.show(Login.this,"""",""Loading. Please wait..."", true);                             pd.show();                             Thread t = new Thread() {                                  public void run(){                                      download(etuser.getText().toString(), md5(etpw.getText().toString()));                                      pd.dismiss();                                    }                                  };                                  t.run();                        }                    });                }            }        });    }    public void download (final String user, final String pw)    {            try{                            HttpClient client = new DefaultHttpClient();                              String postURL = ""link_deleted"";                            HttpPost post = new HttpPost(postURL);                                 List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                                params.add(new BasicNameValuePair(""username"", user));                                params.add(new BasicNameValuePair(""password"", pw));                                UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);                                post.setEntity(ent);                                HttpResponse responsePOST = client.execute(post);                                  HttpEntity resEntity = responsePOST.getEntity();                                final JSONObject jObject = new JSONObject(EntityUtils.toString(resEntity));                                JSONObject menuObject = jObject.getJSONObject(""responseData"");                                if (jObject.getInt(""responseStatus"")== 200 &amp;&amp; jObject.get(""responseDetails"")!= null)                                {                                    sessionid = menuObject.getString(""session_id"");                                    finish();                                }                                else                                {                                    //dismissDialog(DIALOG_LOADING);                                     if (jObject.getInt(""responseStatus"")== 500)                                     {                                         throw new Exception(""Server Error"");                                     }                                     else if (jObject.getInt(""responseStatus"")== 400)                                     {                                         throw new Exception(""Wrong User/Password"");                                     }                                     else                                     {                                         throw new Exception();                                     }                                }                              //pd.dismiss();                         } catch (Exception e) {                            //dismissDialog(DIALOG_LOADING);                             Toast toast ;                                toast =     Toast.makeText(getApplicationContext(), e.getMessage(), 500);                            toast.show();                        }    }    private String md5(String in) {        MessageDigest digest;        try {            digest = MessageDigest.getInstance(""MD5"");            digest.reset();                    digest.update(in.getBytes());            byte[] a = digest.digest();            int len = a.length;            StringBuilder sb = new StringBuilder(len &lt;&lt; 1);            for (int i = 0; i &lt; len; i++) {                sb.append(Character.forDigit((a[i] &amp; 0xf0) &gt;&gt; 4, 16));                sb.append(Character.forDigit(a[i] &amp; 0x0f, 16));            }            return sb.toString();        } catch (NoSuchAlgorithmException e) { e.printStackTrace(); }        return null;    }}</code></pre><p>No error occurs in the Dalvik Debug Monitor.</p><p>Please help</p>","547995","","1053","","2011-01-08 21:58:11","2011-01-08 21:58:11","ProgressDialog is invisible","<android>","1","0","","",""
"4635353","1","4702831","","2011-01-08 18:13:12","4","3889","<p>Does anyone know why my application still receives the ACTION_BOOT_COMPLETED broadcast even when my app doesn't have the permission <code>android.permission.RECEIVE_BOOT_COMPLETED</code> in the manifest file? I thought it was required but a few tutorials I used also didn't have it. A few did. I use my phone running CyanogenMod for testing but I doubt that matters. LogCat shows my ""Notified of boot"" log upon each boot. See below for code used.</p><p>AndroidManifest.xml</p><pre><code>  &lt;receiver android:name=""AlarmReceiver""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;    &lt;category android:name=""android.intent.category.HOME"" /&gt;   &lt;/intent-filter&gt;  &lt;/receiver&gt;</code></pre><p>AlarmReceiver class</p><pre><code>  public class AlarmReceiver extends BroadcastReceiver {  private static final String TAG = ""MyProgram"";  @Override  public void onReceive(Context context, Intent intent) {   try {          if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {     Log.d(TAG, ""Notified of boot"");           }          Intent newIntent = new Intent(context, MyService.class);          context.startService(newIntent);    } catch (Exception e) {     Log.d(TAG, ""An alarm was received but there was an error"");     e.printStackTrace();     }    }  }</code></pre><p>I revisited this on the emulator and successfully reproduced the ""problem"" on Android 2.1, 2.2 and 2.3. I get an ANR (as expected) since the emulator doesn't have the database my app queries. When I remove all declared uses-permissions from the manifest, I get the expected permission denial errors when trying to use my app. However, I still receive the ACTION_BOOT_COMPLETED intent broadcasted upon boot. Any suggestions?</p>","558929","","558929","","2011-01-09 19:37:22","2012-04-25 04:24:06","Is android.permission.RECEIVE_BOOT_COMPLETED not required?","<android><broadcastreceiver><boot>","1","6","2","",""
"4635369","1","","","2011-01-08 18:15:35","2","824","<p>Good evening, programmers. I have a problem. Please help me to solve it.I am writing an android application. I can't create custom dialogs. I have errors or my application looks very awfully. I have some dialogs in my application. Here is of a part of my programm:</p><p>The view is very terrible, isn't it? <strong>I want that one of the layouts to be in the dialog</strong> but it appears in the main activity. Why?</p><p><strong>dialogtable.xml</strong></p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/LinearLayout01"" android:orientation=""vertical"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" &gt;  &lt;LinearLayout   android:id=""@+id/LinearLayout02""   android:orientation=""horizontal""   android:layout_height=""fill_parent""   android:layout_width=""fill_parent""   &gt;   &lt;TextView    android:id=""@+id/textRows""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""left""    android:text=""Amount of rows ""/&gt;   &lt;TextView    android:id=""@+id/textColumns""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""right""    android:text=""Amount of columns""/&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout    android:id=""@+id/LinearLayout03""   android:orientation=""horizontal""   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""   &gt;   &lt;EditText    android:id=""@+id/EditText01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:inputType=""number""    android:gravity=""right""/&gt;   &lt;EditText    android:id=""@+id/EditText02""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""right""/&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout    android:id=""@+id/LinearLayout04""   android:orientation=""vertical""   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""   &gt;  &lt;TextView    android:id=""@+id/textBorder""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""right""    android:text=""Width of border""/&gt;  &lt;EditText    android:id=""@+id/EditText03""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""right""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The code from MainActivity</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);    View layout = inflater.inflate(R.layout.dialogtable, (ViewGroup)findViewById(R.id.LinearLayout01));    AlertDialog.Builder alert = null;    alert = new AlertDialog.Builder(this);    alert.setView(layout);    alert.setTitle(""Create table"");    alert.setCancelable(false);    alert.setNegativeButton(""Cancel"",new DialogInterface.OnClickListener() {        @Override            public void onClick(DialogInterface dialog, int which) {            dialog.cancel();        }    });    alert.setPositiveButton(""OK"",new DialogInterface.OnClickListener() {        @Override            public void onClick(DialogInterface dialog, int which) {            Editable rows = fieldForRows.getText();            Editable columns = fieldForColumns.getText();            Editable border = fieldForWidthOfBroder.getText();            TableAction tableAction = new TableAction(MainActivity.this.visualPane);            tableAction.insertTable(rows, columns, border);        }    });    Dialog dialog = null;    dialog = new Dialog(this);    switch (id) {    case IDD_CUSTOM_INSERT_TABLE:        dialog.setTitle(""Insert table"");        dialog.setContentView(R.layout.dialogtable);        return dialog;    case IDD_CUSTOM_INSERT_IMAGE:        dialog.setTitle(""Insert image"");        return dialog;    default:        return alert.create();    }}</code></pre><p>The appearance of the application before calling showDialog():</p><p><a href=""http://s015.radikal.ru/i330/1101/d0/f7cc38852dc6.jpg"" rel=""nofollow"">http://s015.radikal.ru/i330/1101/d0/f7cc38852dc6.jpg</a></p><p>The appearance of the application after calling showDialog():</p><p><a href=""http://s003.radikal.ru/i201/1101/f0/d1ebc436427f.jpg"" rel=""nofollow"">http://s003.radikal.ru/i201/1101/f0/d1ebc436427f.jpg</a></p><p>Why it looks so terrible? What is wrong?</p>","565447","","71034","","2011-01-08 19:39:01","2011-01-08 19:39:01","How to create and show dialog in the android application?","<android>","1","0","0","",""
"4635448","1","","","2011-01-08 18:27:15","8","33804","<p>Need some help by retrieving *.apk file name from Android device programmaticaly ? Could any body provide some Android methods doing that or even shell commands run under Android to get the file location , if I know just a part from file name ?</p><p>Also if there is a way how to find out where the *.apk file went after downloading from Market or outside Market ? </p><p>Thank you in advance.</p>","568225","","","","","2013-12-09 03:41:41","How to get the file *.apk location in Android device","<android>","6","3","5","",""
"4635519","1","4635554","","2011-01-08 18:45:11","0","589","<p>I'm developing an Android 2.2 application.</p><p>I want to know which activity method is ran when user press back key.</p><p>I have found this: <em>""When the user presses the BACK key, the current activity is popped from the stack, and the previous one resumes as the running activity. ""</em></p><p>But it doesn't tell what method is ran.</p><p>Thanks.</p>","68571","","68571","","2011-01-08 19:19:26","2011-01-08 19:19:26","Method ran when user press Back key on Android","<android><activity>","2","0","","",""
"4635540","1","4676265","","2011-01-08 18:49:47","1","489","<p>I have an application that allows the user to send a picture.  This picture can be sent via a number of different ways, like g-mail, facebook, flickr, and the one I am interested in, text messaging.  When the following code is run, a dialog box pops up with a number of these options available.</p><pre><code>       Uri uri = Uri.fromFile(new File(externalDirectory + FILE_DIRECTORY + fileName));              Intent intent = new Intent(Intent.ACTION_SEND);         intent.putExtra(Intent.EXTRA_STREAM, uri);        intent.setType(""image/png"");         startActivity(intent);</code></pre><p>On my Droid X, the text messaging option is shown, and this code adds the picture to the MMS perfectly.</p><p>On the emulator, text messaging is chosen automatically (since there are no other options) and once again it works great.</p><p>On my Droid Incredible, there is no text messaging option.  However, I can manually bring up the built-in text messaging utility, add the picture and then send it.  I also downloaded an SMS/MMS app from the market, and afterward the option to use this 3rd party program to send the picture was available from the list.</p><p>So, why isn't text messaging an available option on the Droid Incredible?  What do I need to do to make it an option, and how do I evaluate this problem (OR UNKNOWN PROBLEMS) with phone types I have no access to?</p>","432209","","","","","2011-01-13 02:37:03","Dealing with differences between phones when Application uses Intent.ACTION_SEND","<java><android><sms><mms>","2","0","","",""
"4635567","1","","","2011-01-08 18:55:47","0","1231","<p>i have alt.xml and main.xml, alt.xml has a edittext and a button, main.xml has a webview, whenever i try to load a page with the webview it just loads a blank page. i'll post my code below, thanks in advance.</p><pre><code>package com.tyran.webviewer;import android.app.Activity;import android.os.Bundle;import android.text.Editable;import android.view.View;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Button;import android.widget.EditText;public class WebViewer extends Activity {WebView browser;@Overridepublic void onCreate(Bundle icicle) {super.onCreate(icicle);setContentView(R.layout.alt);}public void selfDestruct(View view) {loadTime();}void loadTime() {    setContentView(R.layout.main);    browser=(WebView)findViewById(R.id.webview);    browser.setWebViewClient(new Callback());    browser.getSettings().setJavaScriptEnabled(true);    final EditText edittext = (EditText) findViewById(R.id.edittext);    Editable text = edittext.getText();    String Tekst = text.toString();browser.loadUrl(Tekst);}private class Callback extends WebViewClient {public boolean shouldOverrideUrlLoading(WebView view, String url) {loadTime();return(true);}}{}}</code></pre>","553642","","","","","2014-04-14 08:30:30","Webview shows a blank screen instead of the webpage","<android><webview>","1","2","2","",""
"4635575","1","4635605","","2011-01-08 18:57:31","0","4464","<p>Hy!</p><p>I have a Json Object:</p><pre><code>                            HttpResponse responsePOST = client.execute(post);                              HttpEntity resEntity = responsePOST.getEntity();                            final JSONObject jObject = new JSONObject(EntityUtils.toString(resEntity));                            Log.e(""test"", jObject.toString());</code></pre><p>Log:</p><pre><code>{""responseData"":null,""responseStatus"":200,""responseDetails"":null}</code></pre><p>Code: </p><pre><code>Log.e(""test"", String.valueOf(jObject.getInt(""responseStatus"")))`;</code></pre><p>Log:</p><pre><code>200</code></pre><p>Get Int from Json:</p><pre><code>                                    if (jObject.getInt(""responseStatus"")== 200)                                {                                    Toast toast ;                                    toast =     Toast.makeText(getApplicationContext(), ""OK"", 500);                                toast.show();                                    finish();                                } else                                {                                    Log.e(""else"", ""else"");                                    //dismissDialog(DIALOG_LOADING);                                     if (jObject.getInt(""responseStatus"")== 500)                                     {                                         throw new Exception(""Server Error"");                                     }                                     else if (jObject.getInt(""responseStatus"")== 400)                                     {                                         throw new Exception(""Wrong User/Password"");                                     }                                     else                                     {                                         throw new Exception();                                     }                                }                              //pd.dismiss();                         } catch (Exception e) {                            Log.e(""catch"", ""catch"");                             Toast toast ;                                toast =     Toast.makeText(getApplicationContext(), e.getMessage(), 500);                            toast.show();                        }</code></pre><p>Log:</p><pre><code> catch Value null at responseData of type org.json.JSONObject$1 cannot be converted to JSONObject</code></pre><p>The log says that the responeStatus is 200, but the toast and the finish was not executed</p><p>Please help</p><p>full code:</p><pre><code>package com.android.skiptvad;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;import java.util.ArrayList;import java.util.List;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.apache.http.protocol.HTTP;import org.apache.http.util.EntityUtils;import org.json.JSONObject;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class Registerusr extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.regusr);        Button bt = (Button)findViewById(R.id.reguserreq);        final EditText user = (EditText)findViewById(R.id.reguseruser);        final EditText pw = (EditText)findViewById(R.id.reguserpw);        final EditText email  = (EditText)findViewById(R.id.requseremail);        bt.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                if (user.getText() != null &amp;&amp; pw.getText()!= null &amp;&amp; email.getText()!= null)                {                    download(user.getText().toString(), md5(pw.getText().toString()), email.getText().toString());                }            }        });    }    public void download (final String usr, final String pw, final String email)    {            try{                            HttpClient client = new DefaultHttpClient();                              String postURL = ""http://surfkid.redio.de/register"";                            HttpPost post = new HttpPost(postURL);                                 List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                                params.add(new BasicNameValuePair(""username"", usr));                                params.add(new BasicNameValuePair(""password"", pw));                              params.add(new BasicNameValuePair(""email"", email));                            params.add(new BasicNameValuePair(""country_id"", ""1""));                                UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8);                                post.setEntity(ent);                                HttpResponse responsePOST = client.execute(post);                                  HttpEntity resEntity = responsePOST.getEntity();                                final JSONObject jObject = new JSONObject(EntityUtils.toString(resEntity));                                Log.e(""test"", jObject.toString());                                Log.e(""test"", String.valueOf(jObject.getInt(""responseStatus"")));                                //JSONObject menuObject = jObject.getJSONObject(""responseData"");                                if (jObject.getInt(""responseStatus"")== 200)                                {                                    finish();                                }                                else                                {                                    Log.e(""else"", ""else"");                                    //dismissDialog(DIALOG_LOADING);                                     if (jObject.getInt(""responseStatus"")== 500)                                     {                                         throw new Exception(""Server Error"");                                     }                                     else if (jObject.getInt(""responseStatus"")== 400)                                     {                                         throw new Exception(""Wrong User/Password"");                                     }                                     else                                     {                                         throw new Exception();                                     }                                }                              //pd.dismiss();                         } catch (Exception e) {                            Log.e(""catch"", ""catch"");                             Toast toast ;                                toast =     Toast.makeText(getApplicationContext(), e.getMessage(), 500);                            toast.show();                            Log.e(""catch"", e.getMessage());                        }    }    private String md5(String in) {        MessageDigest digest;        try {            digest = MessageDigest.getInstance(""MD5"");            digest.reset();                    digest.update(in.getBytes());            byte[] a = digest.digest();            int len = a.length;            StringBuilder sb = new StringBuilder(len &lt;&lt; 1);            for (int i = 0; i &lt; len; i++) {                sb.append(Character.forDigit((a[i] &amp; 0xf0) &gt;&gt; 4, 16));                sb.append(Character.forDigit(a[i] &amp; 0x0f, 16));            }            return sb.toString();        } catch (NoSuchAlgorithmException e) { e.printStackTrace(); }        return null;    }}</code></pre>","547995","","547995","","2011-01-08 20:24:57","2011-05-20 01:04:17","JSON Object get problem","<android>","3","1","1","",""
"4635667","1","","","2011-01-08 19:19:30","3","2685","<p>I'm stepping through the android Searchable Dictionary example, and I can't find the place where it actually loads the words into the sqlite db.  I would think it happens in the onCreate method of DictionaryDatabase.java, but this never seems to be called.  And yet the app works!</p><p>Also, I couldn't get it to work at all until I commented out lines 41-42 of strings.xml, which was giving me this error:</p><p>Description Resource Path Location Typeerror: Found tag  where  is expected strings.xml /SearchableDictionary/res/values line 41 Android AAPT Problem</p><p>TIA,Joel</p><p>Ha!  So it looks like onCreate is only called when the db is first created, as it was the first time I ran the app.  I deleted the db manually and it was recreated next time I ran the app:</p><p>from within adb shell:rm /data/data/com.example.android.searchabledict/databases/dictionary</p><p>I still don't know why the strings.xml file causes an error, but I'm moving on :)</p>","568259","","568259","","2011-01-08 20:18:05","2011-06-16 19:10:15","Android Searchable Dictionary word loading question","<android><sample>","1","0","","",""
"4635707","1","","","2011-01-08 19:29:29","0","861","<p>I'm trying to make an android game with opengl</p><p>I managed to set up the glOrthof view alongside the regular 3D perspective. However I'm having trouble coming up with a way to draw to the gui. I'm thinking of having one Bitmap that will be the screen, and then draw whatever I want to it with a Canvas.</p><p>I can turn the screen bitmap into a texture and map it onto a mesh which I can then render normally with the orthographic perspective.</p><p>Only problem is that I would most likely need the screen to be updated every frame, and to do that I would have to create a brand new texture whenever I want to update it. And I would imagine that to be horrendously slow.</p><p>So, how could I make a gui for my game? I have the orthographic perspective set up already alongside with my 3d perspective. The method I described above doesn't seem like it would work. Can you give me some suggestions or explain to me how I would go about doing it?</p>","482085","","","","","2011-01-25 21:21:40","2d hud layer in android and opengl es","<android><gui><opengl-es><canvas><orthographic>","1","0","","",""
"4635784","1","","","2011-01-08 19:49:24","0","6206","<p>Hi I would like to add more images in my list view as this code below only displays image 1 and 2 continuously in each row. What I want to do is display a different image for each different row. Here is mycode below;</p><p>Thanks for any help. I am not good at java please change the code where necessary and I can then refer to it.</p><p>public class starters extends ListActivity{    private static class EfficientAdapter extends BaseAdapter {        private LayoutInflater mInflater;        private Bitmap mIcon1;        private Bitmap mIcon2;        private Bitmap mIcon3;        private Bitmap mIcon4;        private Bitmap mIcon5;        private Bitmap mIcon6;        private Bitmap mIcon7;        private Bitmap mIcon8;        private Bitmap mIcon9;        private Bitmap mIcon10;</p><pre><code>    public EfficientAdapter(Context context) {        // Cache the LayoutInflate to avoid asking for a new one each time.        mInflater = LayoutInflater.from(context);        // Icons bound to the rows.        mIcon1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters1);        mIcon2 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters2);        mIcon3 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters3);        mIcon4 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters4);        mIcon5 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters5);        mIcon6 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters6);        mIcon7 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters7);        mIcon8 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters8);        mIcon9 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters9);        mIcon10 = BitmapFactory.decodeResource(context.getResources(), R.drawable.starters10);    }    public int getCount() {        return DATA.length;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        // A ViewHolder keeps references to children views to avoid unneccessary calls        // to findViewById() on each row.        ViewHolder holder;        // When convertView is not null, we can reuse it directly, there is no need        // to reinflate it. We only inflate a new View when the convertView supplied        // by ListView is null.        if (convertView == null) {            convertView = mInflater.inflate(R.layout.starters, null);            // Creates a ViewHolder and store references to the two children views            // we want to bind data to.            holder = new ViewHolder();            holder.text = (TextView) convertView.findViewById(R.id.text01);            holder.text = (TextView) convertView.findViewById(R.id.secondLine);            holder.icon = (ImageView) convertView.findViewById(R.id.icon01);            convertView.setTag(holder);        } else {            // Get the ViewHolder back to get fast access to the TextView            // and the ImageView.            holder = (ViewHolder) convertView.getTag();        }        // Bind the data efficiently with the holder.        holder.text.setText(DATA[position]);       holder.icon.setImageBitmap((position &amp; 1) ==1 ? mIcon1 : mIcon2);         return convertView;    }    static class ViewHolder {        TextView text;        ImageView icon;    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new EfficientAdapter(this));}private static final String[] DATA = {    ""Original nachos"", ""Toasted chicken and cheese quesadillas"", ""Chicken, lime and coriander nachos"",    ""Spicy bean and cheese quesadillas"", ""Tuna and corn quesadillas"", ""Cheesy bean and sweetcorn nachos"", ""Crispy chicken, avocado and lime salad"", ""Beef and baby corn tostada"",    ""Spicy mexican rice with chicken and prawns"", ""Chilli potato boats""};</code></pre><p>}</p>","566317","","","","","2013-03-25 07:27:07","add an image in listview","<android><android-layout><android-listview>","1","0","","",""
"4635818","1","4635975","","2011-01-08 19:55:08","0","743","<p>I know for a fact that most Blackberry Handsets is Java enabled and supports J2ME development but i haven't found any useful information on the same topic regarding IPHone, Androids etc..</p><p>any help much appreciated.</p>","483547","","","","","2012-12-26 21:01:33","Possible to develop J2ME applications on IPhone, Android (HTCs..), Samsungs etc?","<iphone><android><java-me><software-engineering>","3","0","","2012-12-27 08:29:01",""
"4635918","1","4636206","","2011-01-08 20:17:34","1","221","<pre><code>package com.parseador.prueba;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.EditText;public class main extends Activity {    /** Called when the activity is first created. */    //private Button botonParsear;    private EditText link; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        //Button botonParsear = (Button) findViewById(R.id.BotonParsear);         //EditText link = (EditText) findViewById(R.id.Link);    }    public void onParsearClick(View botonParsear) {     link.setText(""Siii"");    }}</code></pre><p>Hello.</p><p>Ive a problem when i run this code. It keeps FCing. Have tried changing whats on comments, but theres no way to make the button work.</p><p>I would appreciate if you could tell me what am i doing wrong.</p><p>Thanks in advance.</p><p>Ps: The xml file does have the method on the button. This is its code (on strong the call):</p><pre><code>android:layout_height=""wrap_content"" android:text=""@string/parse"" android:textSize=""20sp"" android:layout_width=""wrap_content"" android:layout_gravity=""center"" <strong>android:onClick=""onParsearClick""</strong> android:id=""@+id/BotonParsear""</code></pre>","568288","","","","","2011-01-08 21:19:52","Android: Noob problem with a button","<android><button>","2","2","","",""
"4635978","1","","","2011-01-08 20:31:26","8","1285","<p>I would like to create a sidebar like the one in dolphin browser or firefox for android.</p><p>I have a listview that is my main screen, when I swype to right I wish to move the listview to right and make appear a new view on the left.</p><p>Like <a href=""http://bestmobileapp.org/wp-content/uploads/2010/07/Dolphin-Browser-HD-Android.jpg"">this</a></p><p>Thanks</p><p>PS : I'm a french guy sorry for the english :-)</p>","568303","","","","","2012-04-06 11:32:42","Make a side bar like Dolphin browser or Firefox in android","<android><android-widget>","3","0","2","",""
"4636009","1","","","2011-01-08 20:38:14","0","4015","<p>I'm trying to copy a file to an android device using Wifi. For what i cant tell the creation of the file works, but i can't find it anywhere...</p><p>I've try to use the DDMS on Eclipse, but there's nothing on the Data folder... for what i read on other topics, the file should be located on the data folder of the App.. but there's no folder anywhere...</p><p>This is the code</p><pre><code>package com.ejemplo.cliente;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.net.Socket;import java.net.UnknownHostException;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import android.widget.Toast; public class ClienteSocket extends Activity { Socket socket; String IP = ""192.168.1.101""; Integer Puerto = 4444; TextView Mensaje;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Mensaje = (TextView)findViewById(R.id.Mensaje);    try {         socket = new Socket(IP,Puerto);         Mensaje.setText(""Conectado"");         InputStream input = socket.getInputStream();         BufferedReader inReader = new BufferedReader(new                  InputStreamReader(socket.getInputStream()));        BufferedWriter outReader = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));        String filename = inReader.readLine();      if ( !filename.equals("""") ){          outReader.write(""READY\n"");          outReader.flush();          Mensaje.setText(""Request Acepted"");                FileOutputStream wr = openFileOutput(filename,MODE_WORLD_READABLE);                OutputStreamWriter osw = new OutputStreamWriter(wr);           byte[] buffer = new byte[socket.getReceiveBufferSize()];          int bytesReceived = 0;          while((bytesReceived = input.read(buffer))&gt;0)          {             osw.write(bytesReceived);             Toast.makeText(this, ""Transfering"", Toast.LENGTH_SHORT).show();          }          osw.flush();          osw.close();          Mensaje.setText(""File Received"");      }    } catch (UnknownHostException e) {      Mensaje.setText(""error 1"" + e.getMessage());    } catch (IOException e) {      Mensaje.setText(""error 2"" + e.getMessage());   }   }}</code></pre>","611363","","","","","2014-04-15 17:50:25","Path to a file using openFileOutput","<java><android><file>","2","0","","",""
"4636056","1","","","2011-01-08 20:47:40","0","1665","<p>I am new to android development. So far I could help myself in all matters by reading threads here on stackoverflow. Now I am stuck and need someones help. Unfortunately I am not allowed to post an image of a screenshot because I am a new mamber, so I try to descripe it. </p><p>I have a Samsung Galasy S and the clock app that ships with it has an button called ""+ Create alarm"". I want to create a similar button for my app. I've been experimenting with ImageButton. I do know how to get that ""+""-Icon onto an ImageButton, but only centered and without text. I guess this is a custom button. Does anyone know how to do this? Can I do it in xml or do I need to extend the view-class and make it my own view?</p>","568306","","","","","2011-01-08 22:14:10","Android ImageButton / Custom-Button?","<android><button><imagebutton>","2","0","","",""
"4636117","1","","","2011-01-08 21:00:46","0","542","<p>the data storage doesn't seem to work in my case.I read a lot in forums but couldn't find any answer to it.So here goes my issue:</p><p>I have an Activity called MainActivity that starts a second Activitynamed VertragHinzufuegen. This class allows entering some user data andconfirm them with a button. The button has an onClickListenerwith which I want to save all data in SQL. But these data don't appear in my list :(</p><p><strong>MainActivity.java</strong></p><pre><code>private void createAgreement() {     Intent i = new Intent(this, VertragHinzufuegen.class);     startActivityForResult(i, ACTIVITY_CREATE);    }@Override    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {        super.onActivityResult(requestCode, resultCode, intent);    }</code></pre><p><strong>VertragHinzufuegen.java</strong></p><pre><code>mConfirmButton.setOnClickListener(new View.OnClickListener() {         public void onClick(View view) {          Log.d(TAG, ""mConfirmButton clicked"");          // Progress circle for loading          ProgressDialog pdialog = ProgressDialog.show(VertragHinzufuegen.this, """", ""Lade. Bitte warten..."", true);          pdialog.show();          // TODO:          // Here happens the magic of data storage :)                    mDbHelper.addAgreement(""Testcontract"",""null"",""null"",""null"",""null"");          // Send callback             setResult(RESULT_OK);             finish();         }        });</code></pre><hr><p><strong>UPDATE:</strong></p><p>Well, that is the point.</p><p>Besides the MainActivity class and the VertragHinzufuegen classthere exists the class VertraegeListe. The MainActivity containsa TabHost which includes VertraegeListe as intent.And the population of the list is in the class VertraegeListe,so I canÄt call the population method in MainActivity.</p><p><strong>VertraegeListe.java</strong></p><pre><code>private void fillData() {        // Build adapter with agreement entries; Populate the agreement list        Cursor cursor = mDbHelper.getAllAgreements();        String[] fields = new String[] {                mDbHelper.KEY_AGREEMENTNAME        };        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.vertraege_datensatz, cursor,                fields, new int[] {R.id.agreementEntryText});        mAgreementList.setAdapter(adapter);    }</code></pre><p>MainActivity -includes-> VertraegeListe -includes-> fillData()</p><p>Any idea?</p><hr><p><strong>UPDATE 2:</strong></p><p>How do I have to redefine my originally rawQuery??? I don't get it:</p><p><strong>VertraegeDBAdapter.java</strong></p><p><pre><code>// Get all data from the table vertraege public Cursor getAllAgreements() {  // Entity attributes  String attributes = ""t1._id,""
        + ""t1._idvertragspartner,""
        + ""t1._idvertragsart,""
        + ""t1.kundennummer,""
        + ""t1.vertragsname,""
        + ""t1.startdatum,""
        + ""t1.enddatum,""
        + ""t1.kuendigungsfristdatum,""
        + ""t1.kuendigungserinnerung,""
        + ""t2._id,""
        + ""t2.vertragspartnername,""
        + ""t2.vertragspartnerkontaktperson,""
           + ""t2.anschrift,""
           + ""t2.postleitzahl,""
           + ""t2.ort,""
           + ""t2.email,""
           + ""t2.festnetznummer,""
           + ""t2.faxnummer,""
           + ""t2.url,""
           + ""t3._id,""
           + ""t3.vertragsartname"";</p><p>// Entities  String tables = DATABASE_TABLE_AGREEMENTS+"" t1, ""        + DATABASE_TABLE_AGREEMENTPARTNER+"" t2, ""        + DATABASE_TABLE_AGREEMENTTYPES+"" t3"";</p><p>// Where clause  String whereclause = ""t2._id = t1._idvertragspartner AND t3._id = t1._idvertragsart"";</p><p>// The entire structured query language statement  String sqlstatement = ""SELECT ""+attributes+"" FROM ""+tables+"" WHERE ""+whereclause; </p><p>// rawQuery(String sql, String selectionArgs)  return mDb.rawQuery(sqlstatement, null); }</pre></code></p><p>The refreshing method I have rewritten as follows:</p><p><strong>VertraegeListe.java</strong></p><pre><code>/**     * Get agreements from database and project records on list     */    private void fillData() {         // Get all of the rows from the database and create the item list        Cursor mAgreementsCursor = mDbHelper.getAllAgreements();        startManagingCursor(mAgreementsCursor);        // Create an array to specify the fields we want to display in the list (only TITLE)        String[] from = new String[]{mDbHelper.KEY_AGREEMENTNAME};        // and an array of the fields we want to bind those fields to (in this case just agreementEntryText)        int[] to = new int[]{R.id.agreementEntryText};        // Now create a simple cursor adapter and set it to display        SimpleCursorAdapter agreementsAdapter =                 new SimpleCursorAdapter(this, R.layout.vertraege_datensatz, mAgreementsCursor, from, to);        mAgreementList.setAdapter(agreementsAdapter);    }</code></pre>","568322","","507519","","2011-12-17 19:53:19","2011-12-17 19:53:19","Android: startActivityForResult to go in second acitivity and save data in sqlite","<android>","1","0","","",""
"4636141","1","4636181","","2011-01-08 21:06:30","20","11126","<p>I am currently developing an android app. I need to do something when the app is launched if it is the first time it is launched, i.e. the code only runs once the first time the program is launched.</p><p>Thanks</p>","499448","","","","","2014-02-12 13:30:57","Determine if android app is the first time used","<android>","9","0","5","",""
"4636201","1","4636219","","2011-01-08 21:18:38","2","97","<p>I have written some code that used strings to represent time such as ""0620"", but after careful thought I realised these could be parsed into shorts for comparison performance and storage gains.</p><p>In a unit test, I have a short written as 0620 being compared against a return value of 620, expecting this to work. However, the test <strong>0620 equals 620</strong> (both are shorts) fails.</p><p>The error message says 0620 was interrupted as 400 (and 400 != 620 explaining the failure). Removing the lead 0 fixes the problem, but I wanted to know, what's going on with this?</p><p><em><strong>This doesn't work</em></strong></p><pre><code>assertEquals(""Time Failed"", 0620, st.GetTime());</code></pre><p><em><strong>This Works</em></strong></p><pre><code>assertEquals(""Time Failed"", 620, st.GetTime());</code></pre>","243203","","139063","","2011-02-06 12:59:39","2011-02-06 12:59:39","Shorts in Android and Java","<java><android><short>","2","0","","",""
"4636239","1","","","2011-01-08 21:25:28","0","281","<p>What is the easiest way to use a custom sync adapter with the google spreadsheet for an android device. Can it be done by using the using the SampleSyncAdapter from google as a base. Im developing an app where the user can upload data google spreadsheet. So can it be done?</p>","568336","","","","","2012-05-10 00:53:54","syncadapter google spreadsheet - Android","<android>","2","1","","",""
"4636268","1","5203524","","2011-01-08 21:32:10","3","5174","<p>I'm probably trying to ask too much at once here, but any saintly, patient, Android guru who can help me even a little bit is probably going to save my project from failure.</p><p>I'm working on a dress-up-doll app, where the user can drag items from a ""clothing inventory"" view over to a ""doll"", in another view.</p><p>Firstly, I can't figure out how to have the doll and the inventory in separate views and still be able to drag bitmaps between the two. (the drawing and dragging of bitmaps is not a problem in itself). </p><p>All I've been able to get working so far, is to use one extended SurfaceView, which I add programatically to my layout and use a thread to draw to its Canvas.  On one side of the Canvas I draw bitmpas that make up the doll.  On the other, I draw bitmaps that make up the inventory.  It works fine like that, but I need to be able to split it into two views, as a) the height of the doll view needs to be greater than the height of the inventory view, and b) I want to re-use the two views elsewhere, on their own, in different activities.</p><p>So, at last, my question is: How can I share bitmaps between the Canvases of two surface views?  Or, can I have a Canvas that covers the whole screen with other views (Buttons TextView, etc) placed on top of it?  Or, is there some other entirely more logical way of doing what I'm attempting that has passed me by?  If I've got two SurfaceViews, each with a Canvas being controlled by a thread, how would I handle the fact that the bitmap I'm dragging could be partially ""inside"" both Canvases' areas at once? (I really just want one screen-sized Canvas, don't I?)</p><p>The progamatically added SurfaceView, let's call it DollView is added to an otherwise empty, nested RelativeLayout as per the Layout XML below.  I've gone on to continually fudge things by adding Buttons to the layout XML that, somehow, DO appear on top of the DollView, and aren't affected by the continual drawing and re-drawing of the DollView's Canvas.  When I drag a clothing item or doll piece's bitmap around, it passes underneath these Buttons...<em>and</em> if I drag a bitmap outside of the specified width of the DollView's parent RelativeLayout I can still ""keep hold"" of it, and bring it back into view, but, it isn't drawn onto the screen.  Totally stumped by that, too altough it's the least of my problems right now.</p><p>I can show anyone who's interested in this insanity as much code as they'd like to see.  Thanks for bearing with me. I hope reading it doesn't hurt your head as much as trying to explain it has hurt mine! :)</p><p>Here's the activity's layout, which is set as the content view in the OnCreate:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code> &lt;TextView android:id=""@+id/header_text""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""    android:layout_alignParentTop=""true""    android:layout_alignParentLeft=""true""    android:text=""Header text..."" /&gt;&lt;!-- The extended SufaceView (DollView) is programatically added to this RelativeLayout --&gt;&lt;RelativeLayout android:id=""@+id/doll_layout""    android:layout_width=""350dip""    android:layout_height=""wrap_content""    android:layout_below=""@+id/header_text""    android:layout_alignParentLeft=""true"" /&gt;&lt;TextView android:id=""@+id/stats""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""center""    android:layout_below=""@+id/header_text""    android:layout_toRightOf=""@+id/doll_layout""    android:layout_alignParentRight=""true""    android:text=""Stats text..."" /&gt;     &lt;TableLayout android=""@+id/stats_table""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_below=""@+id/stats""    android:layout_toRightOf=""@+id/doll_layout""    android:layout_alignParentRight=""true""&gt;&lt;TableRow&gt;&lt;TextView android:id=""@+id/stat_one""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""left""    android:text=""stat one..."" /&gt;&lt;TextView android:id=""@+id/stat_one_score""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""center""    android:text=""0"" /&gt;&lt;TextView android:id=""@+id/stat_one_mod""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""left""    android:text="" "" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt;&lt;TextView android:id=""@+id/stat_two""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""left""    android:text=""stat two..."" /&gt;&lt;TextView android:id=""@+id/stat_two_score""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""center""    android:text=""0"" /&gt; &lt;TextView android:id=""@+id/stat_two_mod""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:gravity=""left""    android:text="" "" /&gt;&lt;/TableRow&gt;&lt;TableRow&gt;&lt;Button android:id=""@+id/stats_btn""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""stats"" /&gt;&lt;Button android:id=""@+id/info_btn""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""info"" /&gt;&lt;Button android:id=""@+id/help_btn""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""help"" /&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;!-- A ""dragged"" bitmap from the DollView passes underneath this TextView.  Why? --&gt;&lt;TextView android:id=""@+id/doll_name""    android:textSize=""16sp""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@+id/header_text""    android:layout_alignParentLeft=""true""    android:text="""" /&gt;&lt;!-- dragged bitmaps pass under all of these buttons too, apart from the last three     nav buttons, as they're outside the DollView's width.      How would I make the dragged bitmaps pass OVER these objects, instead? --&gt; &lt;Button android:id=""@+id/nav_btn1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_toLeftOf=""@+id/nav_btn2""    android:text=""nav1"" /&gt;&lt;Button android:id=""@+id/next_btn""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_above=""@+id/nav_btn1""    android:layout_centerHorizontal=""true""    android:text=""Next"" /&gt;&lt;Button android:id=""@+id/prev_btn""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_above=""@+id/nav_btn1""            android:layout_toLeftOf=""@+id/next_btn""    android:text=""Previous"" /&gt;&lt;Button android:id=""@+id/nav_btn2""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_toLeftOf=""@+id/nav_btn3""    android:text=""nav2"" /&gt;&lt;Button android:id=""@+id/nav_btn3""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_toLeftOf=""@+id/nav_btn4""    android:text=""nav3"" /&gt;      &lt;Button android:id=""@+id/nav_btn4""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_toLeftOf=""@+id/nav_btn5""    android:text=""nav4"" /&gt;&lt;Button android:id=""@+id/nav_btn5""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_toLeftOf=""@+id/nav_btn6""    android:text=""nav5"" /&gt;&lt;Button android:id=""@+id/nav_btn6""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""    android:text=""nav6"" /&gt;</code></pre><p></p>","442912","","","","","2011-03-05 11:27:53","Android - A Layout, Surface View and Canvas Conundrum","<android><layout><canvas><surfaceview>","3","1","3","",""
"4636270","1","4636538","","2011-01-08 21:32:47","3","10170","<p>I'm doing some AsyncTask work after user clicks an item in my ListView. I'd like to disable the item so it can't be clicked twice. I've simplified the click listener to contain only this method, but it still doesn't do anything for me, the view looks the same and it lets itself be happily clicked again, much to my annoyance.</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View clickedView,  int position, long id) {  item = (Episode) parent.getItemAtPosition(position);  clickedView.setClickable(false);  clickedView.setEnabled(false);  clickedView.invalidate();</code></pre><p>}</p><p>My View for each row is a custom LinearLayout with two TextViews.</p>","72746","","","","","2012-04-05 11:02:54","Android ListView child View setEnabled() and setClickable() do nothing","<android><listview>","4","1","","",""
"4636412","1","","","2011-01-08 22:07:01","0","1320","<p>Hallo All,</p><p>I have a ListView, which kontains a RadioGroup and a Button in each row. The ListView works well. Now i want to add a header to the ListView, to get the effect like the address book. I fund a Java Class from the Internet, which looks like this:</p><pre><code>package com.aiquan.android.wljs_ncre3_free;import java.util.LinkedHashMap;import java.util.Map;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.Adapter;import android.widget.ArrayAdapter;import android.widget.BaseAdapter;public class SeparatedListAdapter extends BaseAdapter { public final Map&lt;String, Adapter&gt; sections = new LinkedHashMap&lt;String, Adapter&gt;(); public final ArrayAdapter&lt;String&gt; headers; public final static int TYPE_SECTION_HEADER = 0; public SeparatedListAdapter(Context context) {  headers = new ArrayAdapter&lt;String&gt;(context, R.layout.list_header); } public void addSection(String sectionHeader, Adapter sectionAdapter) {  this.headers.add(sectionHeader);  this.sections.put(sectionHeader, sectionAdapter); } public Object getItem(int position) {  for (Object section : this.sections.keySet()) {   Adapter adapter = sections.get(section);   int size = adapter.getCount() + 1;   // check if position inside this section   if (position == 0)    return section;   if (position &lt; size)    return adapter.getItem(position - 1);   // otherwise jump into next section   position -= size;  }  return null; } public int getCount() {  // total together all sections, plus one for each section header  int total = 0;  for (Adapter adapter : this.sections.values())   total += adapter.getCount() + 1;  return total; } public int getViewTypeCount() {  // assume that headers count as one, then total all sections  int total = 1;  for (Adapter adapter : this.sections.values())   total += adapter.getViewTypeCount();  return total; } public int getItemViewType(int position) {  int type = 1;  for (Object section : this.sections.keySet()) {   Adapter adapter = sections.get(section);   int size = adapter.getCount() + 1;   // check if position inside this section   if (position == 0)    return TYPE_SECTION_HEADER;   if (position &lt; size)    return type + adapter.getItemViewType(position - 1);   // otherwise jump into next section   position -= size;   type += adapter.getViewTypeCount();  }  return -1; } public boolean areAllItemsSelectable() {  return false; } public boolean isEnabled(int position) {  return (getItemViewType(position) != TYPE_SECTION_HEADER); }// @Override public View getView(int position, View convertView, ViewGroup parent) {  int sectionnum = 0;  for (Object section : this.sections.keySet()) {   Adapter adapter = sections.get(section);   int size = adapter.getCount() + 1;   // check if position inside this section   if (position == 0)    return headers.getView(sectionnum, convertView, parent);   if (position &lt; size)    return adapter.getView(position - 1, convertView, parent);   // otherwise jump into next section   position -= size;   sectionnum++;  }  return null; }    // @Override public long getItemId(int position) {  return position; }    }</code></pre><p>I try to use this class (without any change) to solve my problem. But i got a very strange effect: the part with RadioGroup and Buttons are not displayed, but the part with Strings are displayed correctly! And i got no error messages from Eclipse. Here is my code:</p><pre><code>   SeparatedListAdapter adapter = new SeparatedListAdapter(this);     adapter.addSection(""Header 1"", new ArrayAdapter&lt;String&gt;(this,              R.layout.list_item, new String[] { ""First item"", ""Item two"" }));     adapter.addSection(""Header 2"", new ExerciseAdapter(this,              R.layout.sc_for_exam, n_exercises));    adapter.addSection(""Header 3"", new ArrayAdapter&lt;String&gt;(this,              R.layout.list_item, new String[] { ""lala"", ""lolo"" }));   setListAdapter(adapter);</code></pre><p>n_exercises ist an ArrayList, which contains the List Items(each list item contains a RadioGroup and a Button). ExerciseAdapter extends from ArrayAdapter. </p><p>Now i got this effect:<img src=""http://i.stack.imgur.com/X66hP.png"" alt=""alt text""></p><p>Does anybody know what is wrong and how i can solve this problem? Thank you very much!!</p><p>Here is the code of ExerciseAdapter. They are in the same class like the code above.</p><pre><code>private class ExerciseAdapter extends ArrayAdapter&lt;Exercise_SC&gt; {    public ExerciseAdapter(Context context, int textViewResourceId,            ArrayList&lt;Exercise_SC&gt; exes) {        super(context, textViewResourceId, exes);    }    public View getView(final int position, View convertView,            ViewGroup parent) {        View row = convertView;        SC_ViewWrapper wrapper;        RadioGroup rg;        if (row == null) {            LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);            if (ChooseMode_Act.modeInfo.equalsIgnoreCase(""Training"")) {                row = vi.inflate(R.layout.sc_for_training, parent, false);            } else {                row = vi.inflate(R.layout.sc_for_exam, parent, false);            }            wrapper = new SC_ViewWrapper(row);            row.setTag(wrapper);            rg = wrapper.getRadioGroup();            RadioGroup.OnCheckedChangeListener l = new RadioGroup.OnCheckedChangeListener() {                // @Override                public void onCheckedChanged(RadioGroup group, int checkedId) {                    Integer myPosition = (Integer) group.getTag();                    Exercise_SC eRow = getExerciseRow(myPosition);                    eRow.setCheckedRB(checkedId);                    switch (checkedId) {                    case R.id.RB_A:                        n_exercises.get(myPosition).setCustomerAnswer(""A"");                        break;                    case R.id.RB_B:                        n_exercises.get(myPosition).setCustomerAnswer(""B"");                        break;                    case R.id.RB_C:                        n_exercises.get(myPosition).setCustomerAnswer(""C"");                        break;                    case R.id.RB_D:                        n_exercises.get(myPosition).setCustomerAnswer(""D"");                        break;                    default:                        n_exercises.get(myPosition).setCustomerAnswer("""");                    }                }            };            rg.setOnCheckedChangeListener(l);        } else {            wrapper = (SC_ViewWrapper) row.getTag();            rg = wrapper.getRadioGroup();        }        Exercise_SC myExe = getExerciseRow(position);        int size = ChooseMode_Act.size;        wrapper.getTi().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getTVExer().setText(myExe.getExerciseText());        wrapper.getTVExer().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getA().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getTVA().setText(myExe.getAnswerA());        wrapper.getTVA().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getB().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getTVB().setText(myExe.getAnswerB());        wrapper.getTVB().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getC().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getTVC().setText(myExe.getAnswerC());        wrapper.getTVC().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getD().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getTVD().setText(myExe.getAnswerD());        wrapper.getTVD().setTextSize(TypedValue.COMPLEX_UNIT_DIP, size);        wrapper.getImageView().setImageResource(myExe.getImageSrc());        if (ChooseMode_Act.modeInfo.equalsIgnoreCase(""Training"")) {            wrapper.getButton().setOnClickListener(new OnClickListener() {                // @Override                public void onClick(View v) {                    Toast toast = Toast.makeText(                            getApplicationContext(),                            ""?-""                                    + (position + 1)                                    + "": ""                                    + n_exercises.get(position)                                            .getCorrectAnswer(),                            Toast.LENGTH_SHORT);                    toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);                    toast.show();                }            });        }        rg.setTag(new Integer(position));        rg.check(myExe.getCheckedRB());        return row;    }}</code></pre>","353857","","353857","","2011-01-08 23:13:11","2012-10-26 22:05:13","Android: SeperatedList (How to get address book effect?)","<android><listview><addressbook>","2","2","","",""
"4636474","1","4636505","","2011-01-08 22:19:23","3","2302","<p>i'm building an Android app on which i have to represent data in a Table-like format.So i'm using TableLayout; the problem is that i have to draw a rotated string like in the following raw example:</p><p><img src=""http://i.stack.imgur.com/l969b.jpg"" alt=""alt text""></p><p>How can i create my layout to be able to show the '2011' rotated?</p><p>Thanks in advance and greetings !c.</p>","339500","","339500","","2011-01-08 22:26:36","2011-01-08 22:26:36","Layout problem with Android: rotated TextView","<android><textview>","1","0","1","",""
"4636537","1","4636775","","2011-01-08 22:32:19","0","298","<p>In my application I have a sqlite database that looks like this:</p><pre><code>CREATE TABLE notes (_id integer primary key,                     content text);CREATE TABLE tags (_id integer primary key,                   name text,                   noteid integer,                   foreign key(noteid) references notes(_id));</code></pre><p>I'm storing text that can have some tags associated with it. Now I want to show this text and the tags in a <code>ListView</code>. However I can't figure out how to do this with a <code>SimpleCursorAdapter</code>. Is it even possible? My data might look like this:</p><pre><code>sqlite&gt; select * from notes;1|foo bar bazsqlite&gt; select * from tags;1|x|12|y|1</code></pre><p>The query to get all notes and the data it returns looks like this:</p><pre><code>sqlite&gt; select notes._id, notes.content, tags.name from notes, tags where notes._id = tags.noteid;1|foo bar baz|x1|foo bar baz|y</code></pre><p>Now, if I want to bind this data to the <code>ListView</code> in some way, how to do it? I would be happy if each row int the <code>ListView</code> contained two lines, one line with the content and one line with all the tags. Am I correct in guessing that the SimpleCursorAdapter won't help me here? What should I do instead?</p>","3414","","","","","2011-01-08 23:30:54","Displaying data in a ListView when each object is located on more than one row in a Cursor","<android><listview><cursor>","1","0","","",""
"4636647","1","4636669","","2011-01-08 22:58:21","2","1055","<p>What is the difference or significance of putting $ sign before any variable or parameter..</p><p>e.g. </p><p>Suppose here is my class...</p><pre><code> public class Vector3 {      public Vector3(float x, float y, float z){           //...          //... my ctor code          //...      } }</code></pre><p>and what will be the difference between these two declarations...</p><p><strong>Declaration 1</strong></p><pre><code> Vector3 $vec = new Vector3(1f,1f,1f);</code></pre><p><strong>Declaration 2</strong></p><pre><code> Vector3 vec = new Vector3(1f,1f,1f);</code></pre><p>If you can notice $ sign before ""vec"" in Declaration 1 and Declaration 2.</p><p>Any clues?</p><p>Also, declaring the same constructor as below,</p><pre><code>public class Vector3 {    public Vector3(float $x, float $y, float $z){    //...    //... my ctor code    //...    }}</code></pre><p>What is difference between above constructor and the initial constructor ?</p><p>Thanks...</p><p>Edit: Thanks to all your responses, I did this with different combinations and there is no major significance :) I appreciate all your answers.</p>","240086","","240086","","2011-01-08 23:56:18","2011-01-08 23:57:14","What is significance of putting ""$"" sign before a parameter in Java / Android?","<java><android>","5","4","","",""
"4636679","1","4636870","","2011-01-08 23:05:26","4","25424","<p>I've written a ListActivity that has a custom list adapter.  The list is being updated from a ContentProvider when onCreate is run.  I also have a service that gets started when I run the app and it first updates the ContentProvider, then sends a Broadcast that the content has been updated.<br>  My ListActivity recieves the broadcast and tries to update my ListView.  My problem is, I'm getting intermittent errors about the ListView adapter data changing without the ListView being notified.  I call the notifyDataSetChanged() method on my list adapter right after I update it.  What it seems like is happening is the list is still in the process of being updated after first call in onCreate when it recieves the broadcast from the service to update, so it tries to update my ListView before it's finished updating from it's first run.  Does this make sense?  Here is some of my code.</p><p>NOTE: The service is working properly, it gets new data and updates my ContentProvider, and I do get the broadcast in my activity when it is updated.</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ctx = this;    getPrefs();    setContentView(R.layout.main);    // Setup preference listener    preferences = PreferenceManager.getDefaultSharedPreferences(this);    preferences.registerOnSharedPreferenceChangeListener(listener);    // Setup report list adapter    ListView nzbLv = (ListView) findViewById(R.id.report_list);    nzbla = new NZBReportListAdaptor(ctx);    getReports();    nzbla.setListItems(report_list);                nzbLv.setAdapter(nzbla);            // Broadcast receiver to get notification from NZBService to update ReportList    registerReceiver(receiver,            new IntentFilter(NZBService.BROADCAST_ACTION));    startService(new Intent(ctx, NZBService.class));</code></pre><p>}</p><pre><code>@Overridepublic void onResume() {    super.onResume();    timerHandler.resume();      new updateSabQueue().execute();    //updateList();}@Overridepublic void onPause() {    super.onPause();    timerHandler.pause();    unregisterReceiver(receiver);}private BroadcastReceiver receiver = new BroadcastReceiver() {    public void onReceive(Context context, Intent intent) {        Toast.makeText(ctx, ""NZBService broadcast recieved"", Toast.LENGTH_SHORT).show();        updateReportList();    }};private void updateReportList() {    new updateReportList().execute();}private class updateReportList extends AsyncTask&lt;Void, Void, Boolean&gt; {    /* (non-Javadoc)     * @see android.os.AsyncTask#onPreExecute()     * Show progress dialog     */    protected void onPreExecute() {    }    /* (non-Javadoc)     * @see android.os.AsyncTask#doInBackground(Params[])     * Get new articles from the internet     */    protected Boolean doInBackground(Void...unused) {        getReports();        return true;    }    /**     * On post execute.     * Close the progress dialog     */    @Override    protected void onPostExecute(Boolean updated) {        if (updated) {            Log.d(TAG, ""NZB report list adapter updated"");            synchronized(this) {                nzbla.setListItems(report_list);                        }            Log.d(TAG, ""NZB report list notified of change"");            nzbla.notifyDataSetChanged();                                   }    }}</code></pre><p>Now that this question is answered, I will post my updated code in an effort to help others who might come across it.</p><pre><code>@Override  public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  ctx = this;    getPrefs();setContentView(R.layout.main);    // Setup preference listener    preferences = PreferenceManager.getDefaultSharedPreferences(this);    preferences.registerOnSharedPreferenceChangeListener(listener);    // Setup report list adapter    ListView nzbLv = (ListView) findViewById(R.id.report_list);    nzbla = new NZBReportListAdaptor(ctx);    report_list.addAll(getReports());    nzbla.setListItems(report_list);                nzbLv.setAdapter(nzbla);            // Broadcast receiver to get notification from NZBService to update ReportList    registerReceiver(receiver,            new IntentFilter(NZBService.BROADCAST_ACTION));    startService(new Intent(ctx, NZBService.class));</code></pre><p>}</p><pre><code>private class updateReportList extends AsyncTask&lt;Void, Void, ArrayList&lt;Report&gt;&gt; {    /* (non-Javadoc)     * @see android.os.AsyncTask#onPreExecute()     * Show progress dialog     */    protected void onPreExecute() {    }    /* (non-Javadoc)     * @see android.os.AsyncTask#doInBackground(Params[])     * Get new articles from the internet     */    protected ArrayList&lt;Report&gt; doInBackground(Void...unused) {        return getReports();    }    /**     * On post execute.     * Close the progress dialog     */    @Override    protected void onPostExecute(ArrayList&lt;Report&gt; updated) {        nzbla.setListItems(updated);                    nzbla.notifyDataSetChanged();                               }}private ArrayList&lt;Report&gt; getReports() {    ArrayList&lt;Report&gt; reports = new ArrayList&lt;Report&gt;();    ContentResolver r = getContentResolver();    Cursor c = r.query(NZBReportProvider.CONTENT_URI, null, null, null, NZBReportProvider.ARTICLE_KEY_ROWID + "" DESC"");    startManagingCursor(c);    Log.d(TAG, ""NZBReport cursor.getCount="" + c.getCount());    int title = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_TITLE);    int desc = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_DESCRIPTION);    int cat = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_CAT);    int size = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_SIZE);    int link = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_LINK);    int catid = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_CATID);    int date = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_DATE_ADDED);    int group = c.getColumnIndex(NZBReportProvider.ARTICLE_KEY_GROUP);    if (c.getCount() &gt; 0) {        c.moveToFirst();        do {            URL url = null;            try {                url = new URL(c.getString(link));            } catch (MalformedURLException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            reports.add(new Report(c.getString(title), url, c.getString(desc), c.getString(cat), c.getString(date), c.getString(size), c.getInt(catid), c.getString(group)));                       } while (c.moveToNext());                       }    return reports;}</code></pre>","326430","","326430","","2011-01-09 03:45:58","2013-06-21 13:49:23","ListView adapter data change without ListView being notified","<android><listview><data><adapter><notify>","2","0","4","",""
"4636751","1","","","2011-01-08 23:24:39","0","110","<p>I am currently developing an application on android. </p><p>I would like a class which creates the database and tables in a separated from the Activity screen. </p><pre><code>public void createDatabase()    {        try        {            SQLiteDatabase myDB;            myDB = this.openOrCreateDatabase(""PasswordManager"", Context.MODE_PRIVATE, null);            myDB.execSQL(""CREATE TABLE IF NOT EXISTS `users` (`use_userID` int(11) NOT NULL, `use_username` varchar(25) DEFAULT NULL,"" +                    ""`use_usePassword` char(1) DEFAULT NULL, `use_password` varchar(150) DEFAULT NULL, PRIMARY KEY (`use_userID`))"");            myDB.execSQL(""CREATE TABLE IF NOT EXISTS `password` (`pas_loginID` int(11) NOT NULL, `pas_userID` int(11) DEFAULT NULL,"" +                    ""`pas_company` varchar(50) NOT NULL, `pas_companyURL` varchar(250) DEFAULT NULL, `pas_username` "" +                    ""varchar(150) NOT NULL, `pas_password` varchar(150) NOT NULL, `pas_type` varchar(50) NOT NULL, "" +                    ""PRIMARY KEY (`pas_loginID`))"");        }        catch (SQLiteException sqlEx)        {            Log.d(""Database Error"", sqlEx.toString());        }        catch (Exception ex)        {            Log.d(""General Error"", ex.toString());        }    }</code></pre><p>The class isn't activity i.e. it is not showing a screen, it is just going to do certain methods which will need to happen regularly so I haven't got to repeat code. How can I do this. It keeps on coming up with a Null Pointer Exception</p>","499448","","","","","2011-01-09 01:00:06","Running a method in a class which does not extend an activity on android","<android>","1","0","","",""
"4636754","1","","","2011-01-08 23:24:55","0","975","<p>For my listview in android, I am using a custom baseadapter which creates the date separated headers between the items of the list. FastSctoll is enabled on the listview and this adapter also implements SectionIndexer to display short dates (e.g Feb 14) as indexes when doing scrolling using thumb-scroller. It works fine, except that transparent background behind these displayed indexes does not fully cover the short dates. It ends up <a href=""http://img52.imageshack.us/img52/2741/extendeddate.png"" rel=""nofollow"">looking like this</a>.</p><p>Can the font of the displayed index be made smaller or the background stretched to make the date fully appear within the background image??</p>","553267","","","","","2014-01-13 21:39:06","Custom SectionIndexer for android listivew. The displayed index does not fit into the transparent background!","<android><listview>","2","0","","",""
"4636767","1","4696178","","2011-01-08 23:28:50","11","4891","<p>Hallo,</p><p>I am writing a widget, but am unsure what size bitmap to use as a background for each screen resolution/density.</p><p>According to the <a href=""http://developer.android.com/guide/topics/appwidgets/index.html#MetaData"">Android Developer App Widgets</a> tutorial:</p><pre><code>To find your minimum width and height in density-independent pixels (dp), use this formula:(number of cells * 74) - 2Following this formula, you should use 72 dp for a height of one cell, 294 dp and for a width of four cells</code></pre><p>So if my widget is 72dp x 294dp, what size bitmaps do I need for my ldpi, mdpi and hdpi drawables?</p><p>Also, will I need any particular supports-screens settings in my manifest?</p><p>TIA,</p><p>-Frink</p><p>Update:I've made some checkerboard patterns in various sizes and colours for each drawable- folder and tried them out. Is this density thing a bit of a red herring?</p><p>I've just done a screen-grab of my emulator running as HVGA, medium density, 320x480. The size taken up by my widget is 320x100, so I create a 320x100 bitmap in the mdpi folder as a background for my widget it looks perfect both on my emulator and LG GT540.</p><p>And for an emulator running as WVGA854, high density, 480x854. The size of my widget is 480x150. Creating a background this size and placing it in the hdpi folder displays correctly on this emulator. I have no hardware to test this on tho :-(</p><p>Update2:I think I can explain my problem better now :-)</p><p>If I have three devices:</p><pre><code>Device1, resolution 320x480, density ldpiDevice2, resolution 320x480, density mdpiDevice3, resolution 400x854, density mdpi</code></pre><p>The physical size of the screens would probably all be different, but I don't think the actual sizes matter</p><p>I've worked out that Device1 and Device2 will need a background of 320x100, whereas Device3 will need 400x150So what size background goes into the mdpi folder to display properly on Device2 and Device3?</p>","131209","","131209","","2011-01-18 12:28:10","2011-01-21 16:40:41","Android Widget Bitmap Sizes","<android><bitmap><android-widget><android-layout><android-manifest>","2","4","6","",""
"4636791","1","4636835","","2011-01-08 23:35:15","0","941","<p>I've been trying to make a game, and I'm getting the background music to work right now. The files are simply too large to fit in the res/raw directory and compile into an apk, so I'm  downloading them from online. This is a good solution; it doesn't use up any space on the phone and it plays smoothly, just that it won't work if the phone can't connect to the internet when the app is running. A better solution would be to download the music when the app starts for the first time, but I can't find the documentation on how to do this.</p><p>Any help would be appreciated.</p>","498680","","","","","2011-01-08 23:44:27","Downloading resource files in Android","<android><file><background><music><downloading>","1","0","","",""
"4636794","1","","","2011-01-08 23:35:48","0","604","<p>I have Huawei u8100 device running android 2.1. After installing android sdk on Win7 x32 everything seems to work fine. But when I try to run C:\android>adb devicesList of devices attached?       device</p><p>Once I disconnect device it disappears from the list of attached device so it looks like there is no problem with communication to my phone. I can install/uninstall apps using adb.So why do I see exclamation sign instead of a serial number?</p><p>Thanks,Eugene </p>","568419","","","","","2011-04-21 02:32:43","Strange output of adb devices","<android><adb>","1","0","","",""
"4636797","1","4637084","","2011-01-08 23:36:19","7","3459","<p><em>Should you get data via a cursor and fill in the data on the screen, such as setting the window title, in <code>onStart()</code> or <code>onResume()</code>?</em></p><p><code>onStart()</code> would seem the logical place because after <code>onStart()</code> the Activity can already be <strong>displayed</strong>, albeit in the background. Notably I was having a problem with a <strong>managed dialog</strong> that made me rethink this. If the user rotates the screen while the dialog is still open, <code>onCreateDialog()</code> and <code>onPrepareDialog()</code> are called <strong>between</strong> <code>onStart()</code> and <code>onResume()</code>. If the dialog needs to be based on the data you need to have the data before <code>onResume()</code>.</p><p>If I'm correct about <code>onStart()</code> then why does the <strong>Notepad example</strong> give a bad example by doing it in <code>onResume()</code>? See <a href=""http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html"">http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.html</a> NoteEditor.java line 176 (<code>title = mCursor.getString...</code>).</p><p>Also, what if my Activity launches another Actvity/Dialog that changes the data my cursor is tracking. Even in the simplest case, does that mean that I have to manually <strong>update</strong> my previous screen (a listener for a dialog in the main activity), or alternatively that I have to register a ContentObserver, since I'm no longer updating the data in onResume() (though I could update it twice of course)?</p><p>I know it's a basic question but the dialog only recently, to my surprise, made me realize this.</p>","458813","","","","","2011-01-09 00:54:29","Android lifecycle: Fill in data in activity in onStart() or onResume()?","<android><dialog><lifecycle><onresume><onstart>","2","0","","",""
"4636798","1","","","2011-01-08 23:36:31","4","523","<p>The AdWhirl instructions are <strong>extremely</strong> crappy. All I want to know is how to set up the layout XML and get the source code into the Java of my application.</p><p>Can someone please give me an example for, let's say, a simple application with just buttons and text and pictures with the AdWhirl ads on the page?</p>","424421","","496830","","2011-11-10 13:21:11","2012-10-20 07:54:26","How can I set up AdWhirl in the Android SDK?","<android><adwhirl>","1","1","1","",""
"4636901","1","6788179","","2011-01-09 00:02:28","9","1493","<p>I haven't tested this on any other devices but on a 2.1 device, in a WebView with the zoom controls turned on, a toast message sometimes comes up that says something like ""Tip: double tap to zoom in and out"".  I don't know where it is coming from as nothing in my code asked for it to appear. Is there any way to disable this?</p><p>I don't know how to reproduce it but it seems to happen more often when the app is freshly installed.</p>","445348","","445348","","2011-01-10 19:36:27","2011-07-22 09:38:00","How disable the tip toast message that sometimes appears with the zoom controls in a WebView?","<android><webview><zoom>","2","0","5","",""
"4636947","1","4636959","","2011-01-09 00:17:16","0","3095","<p>I implement <em>TextWatcher</em> in the <em>Activity</em>:</p><pre><code>public class Coordinate extends Activity implements TextWatcher {/** Called when the activity is first created. */......</code></pre><p>Then</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ........</code></pre><p>Part of my problem is that having more than one TextChangedListener causes the app to FC</p><pre><code>txtDdLatDeg.addTextChangedListener(this);txtDMmLatDeg.addTextChangedListener(this);txtDMSLatDeg.addTextChangedListener(this);</code></pre><p>Then</p><pre><code>@Overridepublic void afterTextChanged(Editable s) {    String c = s.toString(); // read Content    // stuff to do later    ((EditText)findViewById(R.id.txtDMSLatDeg)).setText(c);    ((EditText)findViewById(R.id.txtDdLatDeg)).setText(c);    return;} // End of TextChanged method</code></pre><p>I need to be able to update one <em>EditText</em> and have the other two update on the fly.<br>I can only seem to make it works when only one <em>EditText</em> has the <code>addChangeListener</code>.<br>I also cannot seem to implement a seperate <code>afterTextChanged</code> method for the individual <em>EditText</em> fields.</p>","564884","","390177","","2012-05-26 21:10:37","2014-04-15 06:36:30","Implementing multiple TextWatchers on the same Activity","<android><listener><edittext><textwatcher>","2","0","","",""
"4636960","1","4637211","","2011-01-09 00:21:32","1","3042","<p>I'm looking for a library to access Gmail which can handle attachments.  Can someone point me towards this please?</p><p>Thanks</p>","568445","","","","","2012-06-08 11:40:18","Gmail (or POP3) library for Android development","<android><gmail><pop3><pop>","2","1","1","",""
"4636966","1","4637008","","2011-01-09 00:22:24","1","1087","<p>I wonder if there is an easy way to see the SQL generated by the <code>SQLiteQueryBuilder</code> class in Android? I want to use this for debugging purposes.</p><p>I looked around and searched but couldn't find anything. Either it's not easy or it's super obvious.</p>","380567","","844882","","2012-03-22 23:36:33","2012-03-22 23:36:33","How to view generated SQL Statements for Android/SQLite","<android><database><debugging><sqlite3>","1","0","","",""
"4637115","1","4637145","","2011-01-09 01:02:33","1","394","<p>Just getting my hands around intent filters, and I've noticed a rather hit and miss approach to labeling intent-filters using android:label in both sample code and other online sources, yet haven't been able to find a definitive explanation for the purpose of labeling.</p><p>Can anyone point me in the right direction?</p><p>Thanks,</p><p>Paul</p>","357801","","","","","2011-01-09 01:09:30","Why Label Intent Filters?","<android><intentfilter>","1","1","","",""
"4637140","1","4637178","","2011-01-09 01:08:18","2","1630","<p>I have the following native routine:</p><pre><code>void sendMessage(const char* text){    JNIEnv* env;    if(!_jvm)        return;    _jvm-&gt;AttachCurrentThread(&amp;env, NULL);    if(!_nativesCls)        _nativesCls = env-&gt;FindClass(""com/foo/BaseLib"");    if(_nativesCls == 0)            return;    jstring message = env-&gt;NewStringUTF(text);    if(!_sendStr)        _sendStr = env-&gt;GetStaticMethodID(_nativesCls, ""onMessage"", ""(Ljava/lang/String;)V"");    if(_sendStr)        env-&gt;CallStaticVoidMethod(_nativesCls, _sendStr, message);    //env-&gt;ReleaseStringUTFChars(message, text); // &lt;----- * NOT WORKING}</code></pre><p>If I run this as is, it works fine up until memory fills up and I receive:</p><blockquote>  <p>ReferenceTable overflow (max=512)</p></blockquote><p>I thought adding the commented line above would fix the issue but it just causes the app to bomb out at that point.</p><p>Any suggestions?</p>","38258","","38258","","2011-01-09 01:19:31","2013-10-30 07:43:15","How to Release jstring that is sent from Native Code back to Java?","<c++><android><memory-management><jni><android-ndk>","1","0","1","",""
"4637166","1","4638356","","2011-01-09 01:18:57","0","81","<p>I'm working on a couple of apps at the moment while I try to learn my way around the Android SDK. I had a bit of trouble recently with my layouts where I was defining, for example, an EditText element as such...</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;EditText       android:id=""@+id/price_per_pack""      android:layout_width=""100dip""      android:layout_height=""wrap_content""      android:layout_alignParentRight=""true""/&gt;  &lt;TextView       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:layout_toLeftOf=""@id/price_per_pack""      android:layout_alignParentLeft=""true""      android:textSize=""12pt""      android:text=""Price Per Pack""/&gt;   &lt;/LinearLayout&gt;</code></pre><p>The application was compiling correctly, however when I attempted to start the activity which utilizes this layout nothing would happen. Through a process of elimination I identified the id attribute as the troublesome one and while playing about I discovered that changing  </p><pre><code>android:id=""@+id/price_per_pack""</code></pre><p>to </p><pre><code>android:id=""@+android:id/price_per_pack""</code></pre><p>solved my problem and the application behaved as expected. My initial attempt at declaring the id attribute was based upon examples in the SDK documentation so I'm wondering if somebody could explain to me why I needed to make the above change to get it working?</p><p>I'm sure that it won't make any difference but I'm developing using the android-mode.el emacs plugin and have a completely up-to-date copy of the SDK.</p><p>Thanks in advance.</p>","127249","","","","","2011-01-09 08:38:29","Non-urgent Android layout id attribute quirk","<android>","1","3","","",""
"4637185","1","","","2011-01-09 01:27:39","3","1300","<p>I am working on an app and need to add a textbox to the View when a button is selected.  How can I do that or add any object dynamically.  What class do I use or what method do I need to call? Thanks.</p>","531479","","","","","2011-01-09 01:37:45","Dynamically adding textbox in android","<java><android><android-layout>","2","0","","",""
"4637188","1","","","2011-01-09 01:29:30","1","465","<p>Hey all, I've setup a tab layout so that each tab is a custom bitmap of mine.  This is the main java file:</p><pre><code>public class HelloTabWidget1 extends TabActivity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Resources res = getResources();    TabHost tabHost = getTabHost();    TabHost.TabSpec spec;    Intent intent;    intent = new Intent().setClass(this, ArtistsActivity.class);           ImageView imgView1 = new ImageView(this);    BitmapDrawable bmd1 = new BitmapDrawable();    bmd1 = (BitmapDrawable) res.getDrawable(R.drawable.blue);    imgView1.setImageDrawable(bmd1); spec = tabHost.newTabSpec(""firsttab"").setIndicator(imgView1) .setContent(intent); tabHost.addTab(spec);    intent = new Intent().setClass(this, AlbumsActivity.class);           ImageView imgView2 = new ImageView(this);    BitmapDrawable bmd2 = new BitmapDrawable();        bmd2 = (BitmapDrawable) res.getDrawable(R.drawable.pink);        imgView2.setImageDrawable(bmd2);        spec = tabHost.newTabSpec(""secondtab"").setIndicator(imgView2)        .setContent(intent);        tabHost.addTab(spec);    intent = new Intent().setClass(this, SongsActivity.class);           ImageView imgView3 = new ImageView(this);        BitmapDrawable bmd3 = new BitmapDrawable();            bmd3 = (BitmapDrawable) res.getDrawable(R.drawable.purple);            imgView3.setImageDrawable(bmd3);            spec = tabHost.newTabSpec(""thirdtab"").setIndicator(imgView3)            .setContent(intent);            tabHost.addTab(spec);            intent = new Intent().setClass(this, Forthtab.class);                   ImageView imgView4 = new ImageView(this);                BitmapDrawable bmd4 = new BitmapDrawable();                    bmd4 = (BitmapDrawable) res.getDrawable(R.drawable.red);                    imgView4.setImageDrawable(bmd4);                    spec = tabHost.newTabSpec(""forthtab"").setIndicator(imgView4)                    .setContent(intent);                    tabHost.addTab(spec);    tabHost.setCurrentTab(0);}</code></pre><p>}</p><p>I'm able to get any bitmap I want as a tab, the problem is my original bitmaps were too small to see, once I increased them in size the tabs end up in the middle of the screen with a huge blank black space above it. When I click a black space it changes tabs accordingly.  Is there a way to position it back to the very top and make each bitmap fill a tab?</p>","560983","","","","","2011-01-09 03:31:36","Put bitmap tab in any position","<android><tabs><bitmap><position><fill>","1","0","","",""
"4637220","1","","","2011-01-09 01:40:57","4","2926","<p>It used to be that if you clicked on an appropriate embed tag on a web page in the Android browser, it would launch the youtube app.  Now that the browser has its own youtube plugin, it seems to run that instead.  </p><p>How can I get the old behavior?  </p><p>Youtube's web pages still have the old behavior, but I can't understand their javascript.</p><p>Thanks,</p><p>Dawg</p>","568480","","","","","2014-02-08 14:11:18","Launch youtube app from Android browser","<android><browser><youtube>","1","0","2","",""
"4637233","1","4637266","","2011-01-09 01:46:51","11","11234","<p><br>Does anyone know how to set/change the <code>android:layout_span=""""</code> of an EditText in Android at runtime. I already have the EditText defined in my XML file.</p><pre><code>&lt;TableRow android:paddingTop=""20dip"" android:gravity=""center_horizontal""&gt;  &lt;EditText android:layout_width=""150dip"" android:text="""" android:layout_height=""40dip"" android:id=""@+id/p"" android:layout_span=""2""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;</code></pre>","193562","","6391","","2011-01-09 01:58:45","2012-03-06 12:18:32","How to set layout_span through code","<android><tablelayout><tablerow><layoutparams>","1","0","1","",""
"4637241","1","","","2011-01-09 01:48:58","1","540","<p>I am using a keylistener to get key taps.  The problem is that once you tap the delete key, the next key tap is not registering.  The key tap after that keeps working.  If I tap 2 deletes in a row, they work, just no other keys.  They just disappear.</p><p>I put in a log test before the ""if (keycode"" section and it shows nothing after the first delete is pressed, unless it is another delete.</p><p>I am using the following code (Thanks Shawn).:</p><pre><code>itemPrice.setKeyListener(new CalculatorKeyListener());itemPrice.setRawInputType(Configuration.KEYBOARD_12KEY);class CalculatorKeyListener extends NumberKeyListener {    public int getInputType() { return InputType.TYPE_CLASS_NUMBER;    }    @Override    public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event)    { if (keyCode &gt;= KeyEvent.KEYCODE_0 &amp;&amp; keyCode &lt;= KeyEvent.KEYCODE_9) {     digitPressed(keyCode - KeyEvent.KEYCODE_0); } else if (keyCode == KeyEvent.KEYCODE_DEL) {                                              deletePressed(); } return true;    }    @Override    protected char[] getAcceptedChars() { return new char[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };    }}</code></pre><p>With this problem the keylistener provides no value to me.  There must be something that I am missing.</p><p>Thanks,</p>","411203","","","","","2011-01-09 01:48:58","android keylistener losing key taps","<android><keylistener>","0","3","","",""
"4637298","1","","","2011-01-09 02:12:41","2","1765","<p>I'm trying to run this opencv sample for android from here.<a href=""http://code.google.com/p/android-opencv/"" rel=""nofollow"">http://code.google.com/p/android-opencv/</a></p><p>I've followed the instructions very closely and successfully built opencv and then CVCamera from the samples. I then setup opencv as an android library project and referenced it from CVCamera.</p><p>When I install the app on to the emulator and run it, I don't get any errors. The app focuses and immediately loses focus and seems to terminate. Here are the DDMS messages. Any idea why it might not be working?</p><pre><code>01-09 07:36:32.503: INFO/ActivityManager(53): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.theveganrobot.cvcamera/.CVCamera }01-09 07:36:32.593: INFO/ActivityManager(53): Start proc com.theveganrobot.cvcamera for activity com.theveganrobot.cvcamera/.CVCamera: pid=230 uid=10024 gids={1006, 1015}01-09 07:36:32.913: DEBUG/ddm-heap(230): Got feature list request01-09 07:36:32.983: INFO/WindowManager(53): Setting rotation to 1, animFlags=001-09 07:36:33.073: INFO/ActivityManager(53): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=2 layout=18}01-09 07:36:33.363: DEBUG/dalvikvm(230): Trying to load lib /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so 0x43d0bb6801-09 07:36:33.493: INFO/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***01-09 07:36:33.503: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys'01-09 07:36:33.503: INFO/DEBUG(28): pid: 230, tid: 230  &gt;&gt;&gt; com.theveganrobot.cvcamera &lt;&lt;&lt;01-09 07:36:33.503: INFO/DEBUG(28): signal 4 (SIGILL), fault addr 80d763a401-09 07:36:33.503: INFO/DEBUG(28):  r0 00000000  r1 80e0cbb8  r2 80ca9199  r3 80cb183901-09 07:36:33.503: INFO/DEBUG(28):  r4 000efdf0  r5 80e6fa24  r6 00000004  r7 0000000001-09 07:36:33.503: INFO/DEBUG(28):  r8 ad00f380  r9 0000bd00  10 4104bbe8  fp 0000000001-09 07:36:33.503: INFO/DEBUG(28):  ip 80e66208  sp becb4600  lr 80ca94c7  pc 80d763a4  cpsr 6000003001-09 07:36:33.603: INFO/DEBUG(28):          #00  pc 001763a4  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.603: INFO/DEBUG(28):          #01  pc 000a94c2  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.613: INFO/DEBUG(28):          #02  pc b00001fc  /system/bin/linker01-09 07:36:33.613: INFO/DEBUG(28):          #03  pc b00002bc  /system/bin/linker01-09 07:36:33.613: INFO/DEBUG(28):          #04  pc b00018a4  /system/bin/linker01-09 07:36:33.624: INFO/DEBUG(28):          #05  pc b0001b70  /system/bin/linker01-09 07:36:33.624: INFO/DEBUG(28):          #06  pc b0001552  /system/bin/linker01-09 07:36:33.624: INFO/DEBUG(28):          #07  pc b0001cbc  /system/bin/linker01-09 07:36:33.624: INFO/DEBUG(28):          #08  pc 0003cdfc  /system/lib/libdvm.so01-09 07:36:33.624: INFO/DEBUG(28):          #09  pc 0005416a  /system/lib/libdvm.so01-09 07:36:33.634: INFO/DEBUG(28):          #10  pc 00013f58  /system/lib/libdvm.so01-09 07:36:33.644: INFO/DEBUG(28):          #11  pc 00019888  /system/lib/libdvm.so01-09 07:36:33.644: INFO/DEBUG(28):          #12  pc 00018d5c  /system/lib/libdvm.so01-09 07:36:33.644: INFO/DEBUG(28):          #13  pc 0004d6d0  /system/lib/libdvm.so01-09 07:36:33.644: INFO/DEBUG(28):          #14  pc 0004d702  /system/lib/libdvm.so01-09 07:36:33.654: INFO/DEBUG(28):          #15  pc 00058232  /system/lib/libdvm.so01-09 07:36:33.654: INFO/DEBUG(28):          #16  pc 00059ab4  /system/lib/libdvm.so01-09 07:36:33.664: INFO/DEBUG(28):          #17  pc 00010fe8  /system/lib/libdvm.so01-09 07:36:33.674: INFO/DEBUG(28):          #18  pc 00019888  /system/lib/libdvm.so01-09 07:36:33.674: INFO/DEBUG(28):          #19  pc 00018d5c  /system/lib/libdvm.so01-09 07:36:33.683: INFO/DEBUG(28):          #20  pc 0004d6d0  /system/lib/libdvm.so01-09 07:36:33.683: INFO/DEBUG(28):          #21  pc 0004d702  /system/lib/libdvm.so01-09 07:36:33.683: INFO/DEBUG(28):          #22  pc 00053ce4  /system/lib/libdvm.so01-09 07:36:33.694: INFO/DEBUG(28):          #23  pc 00013f58  /system/lib/libdvm.so01-09 07:36:33.694: INFO/DEBUG(28):          #24  pc 00019888  /system/lib/libdvm.so01-09 07:36:33.703: INFO/DEBUG(28):          #25  pc 00018d5c  /system/lib/libdvm.so01-09 07:36:33.703: INFO/DEBUG(28):          #26  pc 0004d3bc  /system/lib/libdvm.so01-09 07:36:33.703: INFO/DEBUG(28):          #27  pc 00054e74  /system/lib/libdvm.so01-09 07:36:33.703: INFO/DEBUG(28):          #28  pc 00013f58  /system/lib/libdvm.so01-09 07:36:33.703: INFO/DEBUG(28):          #29  pc 00019888  /system/lib/libdvm.so01-09 07:36:33.714: INFO/DEBUG(28):          #30  pc 00018d5c  /system/lib/libdvm.so01-09 07:36:33.734: INFO/DEBUG(28):          #31  pc 0004d6d0  /system/lib/libdvm.so01-09 07:36:33.734: INFO/DEBUG(28): code around pc:01-09 07:36:33.734: INFO/DEBUG(28): 80d76394 b08bb530 46054c10 20009306 bf009b10 01-09 07:36:33.734: INFO/DEBUG(28): 80d763a4 0c00f20f 44649000 f04f9003 93090c28 01-09 07:36:33.734: INFO/DEBUG(28): 80d763b4 90029b0e f8cd4668 9307c004 91049b0f 01-09 07:36:33.734: INFO/DEBUG(28): code around lr:01-09 07:36:33.734: INFO/DEBUG(28): 80ca94b4 480f1861 58e318a2 90021820 f0cc4628 01-09 07:36:33.734: INFO/DEBUG(28): 80ca94c4 4b0cff67 58e14628 58e24b0b ec24f7b1 01-09 07:36:33.734: INFO/DEBUG(28): 80ca94d4 bd30b005 001bccfc ffe445c1 00000264 01-09 07:36:33.744: INFO/DEBUG(28): stack:01-09 07:36:33.744: INFO/DEBUG(28):     becb45c0  b000fd00  /system/bin/linker01-09 07:36:33.744: INFO/DEBUG(28):     becb45c4  80e660c0  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.744: INFO/DEBUG(28):     becb45c8  00000000  01-09 07:36:33.780: INFO/DEBUG(28):     becb45cc  b0000559  /system/bin/linker01-09 07:36:33.784: INFO/DEBUG(28):     becb45d0  0000001b  01-09 07:36:33.784: INFO/DEBUG(28):     becb45d4  aca01df2  /system/lib/libGLESv2.so01-09 07:36:33.784: INFO/DEBUG(28):     becb45d8  b00163f8  01-09 07:36:33.784: INFO/DEBUG(28):     becb45dc  b00032e8  /system/bin/linker01-09 07:36:33.784: INFO/DEBUG(28):     becb45e0  b00129d8  01-09 07:36:33.784: INFO/DEBUG(28):     becb45e4  becb45fc  [stack]01-09 07:36:33.784: INFO/DEBUG(28):     becb45e8  80c3b080  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.784: INFO/DEBUG(28):     becb45ec  b000fac4  /system/bin/linker01-09 07:36:33.794: INFO/DEBUG(28):     becb45f0  afe42c7c  01-09 07:36:33.794: INFO/DEBUG(28):     becb45f4  afe0f3b0  /system/lib/libc.so01-09 07:36:33.794: INFO/DEBUG(28):     becb45f8  df002777  01-09 07:36:33.794: INFO/DEBUG(28):     becb45fc  e3a070ad  01-09 07:36:33.794: INFO/DEBUG(28): #00 becb4600  00000000  01-09 07:36:33.794: INFO/DEBUG(28):     becb4604  afe0f2c0  /system/lib/libc.so01-09 07:36:33.794: INFO/DEBUG(28):     becb4608  00000000  01-09 07:36:33.794: INFO/DEBUG(28):     becb460c  00000001  01-09 07:36:33.794: INFO/DEBUG(28):     becb4610  00001000  01-09 07:36:33.804: INFO/DEBUG(28):     becb4614  80c5bbdc  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4618  80caa5a1  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb461c  afe23043  /system/lib/libc.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4620  00000000  01-09 07:36:33.804: INFO/DEBUG(28):     becb4624  afe179a5  /system/lib/libc.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4628  00000000  01-09 07:36:33.804: INFO/DEBUG(28):     becb462c  80e66198  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4630  80e6fa24  01-09 07:36:33.804: INFO/DEBUG(28):     becb4634  80ca94c7  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28): #01 becb4638  80caa759  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb463c  80ca91bd  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4640  80cb1839  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4644  80e63bf8  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4648  00000004  01-09 07:36:33.804: INFO/DEBUG(28):     becb464c  80e63bfc  /data/data/com.theveganrobot.cvcamera/lib/libandroid-opencv.so01-09 07:36:33.804: INFO/DEBUG(28):     becb4650  00000003  01-09 07:36:33.804: INFO/DEBUG(28):     becb4654  b00001ff  /system/bin/linker01-09 07:36:34.454: DEBUG/Zygote(30): Process 230 terminated by signal (4)01-09 07:36:34.454: INFO/ActivityManager(53): Process com.theveganrobot.cvcamera (pid 230) has died.01-09 07:36:34.514: INFO/ARMAssembler(53): generated scanline__00000077:03010104_00000004_00000000 [ 22 ipp] (41 ins) at [0x48c470:0x48c514] in 13459425 ns01-09 07:36:34.644: DEBUG/dalvikvm(53): GC freed 4974 objects / 263544 bytes in 145ms01-09 07:36:34.654: INFO/WindowManager(53): Setting rotation to 0, animFlags=001-09 07:36:34.704: INFO/ActivityManager(53): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18}01-09 07:36:34.814: INFO/UsageStats(53): Unexpected resume of com.android.launcher while already resumed in com.theveganrobot.cvcamera01-09 07:36:34.894: WARN/InputManagerService(53): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43cb43c801-09 07:36:37.094: DEBUG/dalvikvm(53): GC freed 1944 objects / 103176 bytes in 78ms</code></pre>","219579","","219579","","2011-01-10 02:42:01","2011-04-07 10:32:12","help running opencv on android","<android><opencv><jni><android-ndk>","2","0","","",""
"4637309","1","4639846","","2011-01-09 02:19:02","2","771","<p>I create a SQLiteDatabase instance and call getReadableDatabase() or getWritableDatabase() and manipulate data that way but I never close the database via db.close(). Is it bad to not close it? I tried adding db.close() to my onStop() or onDestroy() methods but it just force closes.</p>","507007","","","","","2011-07-05 10:57:57","Android sqlite leaving connection open","<java><android><database><sqlite><data>","3","0","","",""
"4637379","1","4637450","","2011-01-09 02:46:19","2","6469","<p>I am trying to have an <code>EditText</code> widget next to a <code>Button</code>, also with a <code>TextView</code> underneath. The <code>EditText</code> should resize and fill the screen accordingly, while the Button's width should always be only what it needs to be (I did this by setting the width to <code>wrap_content</code>).</p><p>The layout I am trying to accomplish should <strong>not</strong> be relative. Below is the code I have so far (some of which was found here on StackOverflow). Removing the TextView gives the desired appearance for the EditText and Button, but when the TextView is added, the view goes pretty awry. </p><p>Any insight would 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:layout_height=""wrap_content""                 android:orientation=""horizontal""                android:layout_width=""fill_parent""  &gt;    &lt;EditText android:text=""@+id/EditText01""               android:id=""@+id/EditText01""              android:layout_height=""wrap_content""               android:layout_weight=""1""              android:layout_width=""fill_parent""    /&gt;    &lt;Button android:text=""@+id/Button01""             android:id=""@+id/Button01""            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=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre>","568508","","132735","","2012-08-25 08:33:36","2012-08-25 08:33:36","EditText and Button on the same line with TextView underneath?","<android><android-layout>","1","3","","",""
"4637513","1","","","2011-01-09 03:27:07","13","4537","<p>What is an average ""active installs"" for an application listed on the Android Market place?</p>","289348","","","","","2011-06-08 14:18:13","Is a 45% Active installs on android market place ""high/low/don't know"" for application?","<android>","4","0","1","2011-06-09 13:51:20",""
"4637632","1","","","2011-01-09 04:06:09","0","867","<p>In the case of normal ListView, if user touch one of items in ListView.touched item blink one time. I want that it doesn't blink.</p><h2>How to configure ListView like above?</h2><p>I've figured out myself. If we set color or textColor attribute, this problem resovled.</p>","527398","","527398","","2011-01-09 23:59:06","2013-08-15 12:28:12","How to make not to blink when item in ListView is touched","<android><android-listview>","2","0","","",""
"4637691","1","4637761","","2011-01-09 04:30:22","3","595","<p>I have an app on the market. However, I noticed that I made a bug, which was that I did not sign the maps api key with the key md5 key that i signed the published app. Therefore, should I upgrade the app, or unpublish and republish it back?</p>","522559","","","","","2011-01-09 04:55:48","android market: upgrade or unpublish?","<android><maps><google-play><api-key>","1","0","","",""
"4637693","1","","","2011-01-09 04:30:39","3","468","<p>I have a <code>preferences.xml</code> file with some checkbox preferences, a custom time picker preference, and a custom <code>SeekBar</code> preference.  Everything works fine in my 2.2 emulator.  I've tried running it in a 1.6 emulator and every time I adjust one of the sliders(<code>SeekBar</code> preferences), or change another preference, the <code>SeekBar</code> preferences change positions.  Its like they just shuffle around.  Anybody know how I can stop this?This keeps me from having groupings because they are always changing positions.</p><p>I have this for my preference activity:</p><pre><code>public class MySettings extends PreferenceActivity {        @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preferences);    }   }</code></pre><p>This for my slider:</p><pre><code>public class PreferenceSlider extends Preference implements OnSeekBarChangeListener{      public static int maximum    = 100;     public static int interval   = 1;      private float oldValue = 50;     private TextView monitorBox;       private float beforeTouch = 50;    public PreferenceSlider(Context context)     {          super(context);     }      public PreferenceSlider(Context context, AttributeSet attrs)     {          super(context, attrs);     }      public PreferenceSlider(Context context, AttributeSet attrs, int defStyle)     {          super(context, attrs, defStyle);     }        @Override     protected View onCreateView(ViewGroup parent)    {             LinearLayout layout = new LinearLayout(getContext());              LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);           params1.gravity = Gravity.LEFT;           params1.weight  = 1.0f;                 LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);           params2.gravity = Gravity.LEFT;           LinearLayout.LayoutParams params3 = new LinearLayout.LayoutParams(30, LinearLayout.LayoutParams.WRAP_CONTENT);           params3.gravity = Gravity.LEFT;         layout.setPadding(15, 5, 10, 5);           layout.setOrientation(LinearLayout.VERTICAL);              TextView view = new TextView(getContext());           view.setText(getTitle());           view.setTextSize(18);           view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);           view.setGravity(Gravity.LEFT);           view.setLayoutParams(params1);               SeekBar bar = new SeekBar(getContext());           bar.setMax(maximum);           bar.setProgress((int)this.oldValue);          //bar.        //bar.setLayoutParams(params2);           bar.setOnSeekBarChangeListener(this);              this.monitorBox = new TextView(getContext());           this.monitorBox.setTextSize(12);           this.monitorBox.setTypeface(Typeface.MONOSPACE, Typeface.ITALIC);           this.monitorBox.setLayoutParams(params3);           this.monitorBox.setPadding(2, 5, 0, 0);           this.monitorBox.setText(bar.getProgress()+"""");                 layout.addView(view);           layout.addView(bar);           layout.addView(this.monitorBox);           layout.setId(android.R.id.widget_frame);                 return layout;      }      @Override     public void onProgressChanged(SeekBar seekBar, int progress,boolean fromTouch)     {              progress = Math.round(((float)progress)/interval)*interval;              if(!callChangeListener(progress)){            seekBar.setProgress((int)this.oldValue);                 return;     }                seekBar.setProgress(progress);            this.oldValue = progress;            this.monitorBox.setText(progress+"""");            updatePreference(progress);              //notifyChanged();     }     @Override     public void onStartTrackingTouch(SeekBar seekBar)     {         beforeTouch = seekBar.getProgress();    }    @Override     public void onStopTrackingTouch(SeekBar seekBar)     {         if(beforeTouch != seekBar.getProgress())        {            notifyChanged();        }    }      @Override      protected Object onGetDefaultValue(TypedArray ta,int index)    {            int dValue = (int)ta.getInt(index,50);               return validateValue(dValue);     }         @Override        protected void onSetInitialValue(boolean restoreValue, Object defaultValue)     {                  int temp = restoreValue ? getPersistedInt(50) : (Integer)defaultValue;        if(!restoreValue)                    persistInt(temp);                   this.oldValue = temp;        }          private int validateValue(int value)    {                   if(value &gt; maximum)                 value = maximum;            else if(value &lt; 0)                 value = 0;            else if(value % interval != 0)                 value = Math.round(((float)value)/interval)*interval;                       return value;          }             private void updatePreference(int newValue)    {            SharedPreferences.Editor editor =  getEditor();          editor.putInt(getKey(), newValue);          editor.commit(); }     }</code></pre><p>Then the <code>preferences.xml</code> is like this:</p><pre><code>&lt;com.myprogram.PreferenceSlider                      android:key=""ringerVolume""                  android:defaultValue=""50""                    android:title=""Ringer Volume""/&gt;&lt;com.myprogram.PreferenceSlider                      android:key=""notificationVolume""                    android:defaultValue=""50""                    android:title=""Notification Volume""/&gt;</code></pre>","568551","","693959","","2013-12-10 21:11:13","2013-12-10 21:11:13","Android why is preference changing positions automatically?","<android><android-emulator>","1","3","1","",""
"4637731","1","4638830","","2011-01-09 04:46:53","0","544","<p>I am trying to write an android app that acquires a GPS signal at a fix time interval, for example every 1 minute. Since the requestLocationUpdate function does not exactly implement that, I tried to use task to accomplished it.</p><pre><code>public class getGPS extends TimerTask{     public void run(){        System.out.println(""Running a GPS task"");        locHandler = new locationUpdateHandler();            myManager.requestLocationUpdates(provider, 60000, 0, locHandler);     } }public void LoadCoords(){     Timer timer = new Timer();     timer.scheduleAtFixedRate(new getGPS(), 0, 60000);}</code></pre><p>However, from what I've seen, requestLocationUpdates would run fine if I put it inside LoadCoords(), but would not run if I put it inside the TimerTask (ie no green icon on the task bar to show that GPS is looking for a fix). </p><p>Can anyone please suggest an alternative approach or pseudo-code, or correct my mistake if there is one ? Thank you in advance.</p>","568553","","","","","2011-01-09 11:12:14","GPS can't run inside TimerTask","<android><gps><scheduled-tasks>","1","0","","",""
"4637752","1","4637770","","2011-01-09 04:51:58","1","575","<p>I'm trying to get a physical url of an image file after getting media store path (e.g. external/images/media/412). Is it possible to achieve that?</p>","372107","","","","","2011-01-09 05:01:46","Getting physical path from content resolver","<java><android>","1","0","","",""
"4637780","1","4637832","","2011-01-09 05:04:58","20","16830","<p>In Android project's strings.xml file i have following html text</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string name=""myHeadStr""&gt;&lt;b&gt;&lt;u&gt;bold, underline &lt;/u&gt;&lt;/b&gt;&lt;/string&gt;...&lt;/resources&gt;</code></pre><p>When i read this into getString(R.string.myHeadStr) it gives only text ""bold, underline"" it forgets the html tags  and  ....</p><p>how to read complete string with html tags from string.xml</p>","216431","","244296","","2011-01-09 05:06:01","2012-05-31 11:54:56","android string.xml reading html tags problem","<android><string>","2","0","5","",""
"4637821","1","5096673","","2011-01-09 05:19:11","15","9477","<p>How can I code in Android such that my app can analyze an incoming SMS and perhaps block it or do something(maybe move to a different SMS folder) BEFORE the SMS actually raises a notification telling the user of a new SMS? I would target Android 2.1 and above.</p><p>I would want to analyse incoming SMS for user specified spam words, and if found would want to delete/mark as read/move the message to a different folder.</p>","341791","","341791","","2011-01-10 04:38:48","2012-10-26 05:45:38","How to analyze incoming SMS on Android?","<android><sms>","3","0","10","",""
"4637853","1","4637933","","2011-01-09 05:35:10","1","4893","<p>So the back story is this:I can install perfectly fine and run the program on the emulator, but the second I try and install it on my device i get this:</p><pre><code>[2011-01-08 21:29:36 - girboardpro] Android Launch![2011-01-08 21:29:36 - girboardpro] adb is running normally.[2011-01-08 21:29:36 - girboardpro] Performing com.laytproducts.girboardpro.mainAct activity launch[2011-01-08 21:29:38 - girboardpro] Uploading girboardpro.apk onto device 'I8975c9b90dc'[2011-01-08 21:29:46 - girboardpro] Failed to install girboardpro.apk on device 'I8975c9b90dc': timeout[2011-01-08 21:29:46 - girboardpro] Launch canceled!</code></pre><p>I have NO idea why.Nothing pops up on my LogCat, nothing happens on the device...</p><p>Hopefully someone can help :)</p><p>Thanks,</p><p>Brandon</p>","558961","","","","","2014-04-07 03:10:34","Android App not Installing onto Device","<android><upload><install><emulator><devices>","4","0","","",""
"4637963","1","4638039","","2011-01-09 06:22:07","1","607","<p>I have two activities: one displays an image and a button, the other displays a photo gallery. I want to be able to select any of the images in the gallery and then display them on the first activity in place of the default image.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.gallery);    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) {            Toast.makeText(PhotoGallery.this, ""Position: "" + id, Toast.LENGTH_SHORT).show();            Intent intent=new Intent();               intent.putExtra(""PictureID"", position);            setResult(RESULT_OK, intent);            finish();        }    });}</code></pre><p>Am I even close here? I'm not quite sure what to do with any string or int I would attach to the Intent -- can I attach the object itself? I'd much rather pass back at minimum the string name of the resource (image), but the only thing I can seem to figure out right now is how to pass back the position of the picture ... not a great solution. I can clarify more if necessary -- thanks.</p><p><strong>EDIT:</strong> </p><p>For anyone who comes across this in the future, here's the result of my app. Simple, but works!<a href=""http://www.youtube.com/watch?v=WJjEvwy8yDc"" rel=""nofollow"">http://www.youtube.com/watch?v=WJjEvwy8yDc</a> </p>","387064","","387064","","2011-01-11 07:23:01","2011-01-11 07:23:01","Relatively simple task: How do I pass back the selected item from one activity to another?","<android>","1","2","","",""
"4638116","1","","","2011-01-09 07:15:55","0","557","<p>I'm trying to keep track of home key button hit and touch event in thearea of interest pressed within some fixed window of time.For that I'm usingpublic static int COUNTER_HOME =0 in View.java under frameworks/base/core/java/android/view/</p><p>I then increment the variable in WindowManagerService.java underframeworks/base/services/java/com/android/server/View.COUNTER_HOME++when i acess the variable upon touch event in ViewGroup.java which isa subclass of View under frameworks/base/core/java/android/viewI see the COUNTER to be 0,WHy is that, is the class ViewGroup reloaded everytime the controltransfers from WindowManagerService, I dont understand it or there issomething I'm missing?</p><p>Appreciate your help</p>","568621","","","","","2011-01-09 07:41:06","android: public static variables being reset across same package in different classes in the framework","<android><variables><frameworks><static>","1","1","","",""
"4638144","1","4639234","","2011-01-09 07:24:36","3","1880","<p>My question is similar to this one: <a href=""http://stackoverflow.com/questions/4279655/listview-disabling-clicking-focus"">ListView: disabling clicking/focus</a></p><p>However, I don't want to disable the default onClick, just the long click. I've registered my ListView for context menu creation, and I want to disable it for a header element (or at least change its behavior). How would I go about this?</p><p>Thanks!</p>","210920","","","","","2011-01-09 13:05:35","Disable Long Click for Headers (or Footers) in a ListView","<android><listview><onlongclicklistener>","2","0","","",""
"4638403","1","","","2011-01-09 08:55:02","0","532","<p>I was wondering if it's possible to read emails and SMS from an android application I'm developing.Or even have the chance to add a new menu button to the default mail app in order to pass that particular mail text to my background application that can use it to perform some syntax analysis.</p><p>Thanks in advance</p>","551499","","","","","2011-01-09 10:15:35","Read mail and SMS from my application","<android>","1","0","","",""
"4638478","1","4638658","","2011-01-09 09:19:51","4","5145","<p><strong>I am trying to get a video stream from point A (2.1 android phone) to point B (my server) in real time. How would I do it?</strong>  Detailed below are my attempts (a little long, but concise!)</p><hr><p>The goal is to get an hour long video recorded with the phone to the server without pausing/stopping the stream. a delay of up to several minutes isn't a problem. I've tried three approaches</p><ol><li>thread a FileInputStream that reads from theFileDescriptor of the videodestination</li><li>call MediaRecoder.setOutputFile onthe FD of a 'sender' socket. thissocket connects to aLocalSocketServer, whose destinationis a 'receiver' socket.</li><li>open a socket to my server andgiving setOutputFile its FD</li></ol><p>unfortunately both attempts have failed.</p><ol><li>Only registers 24 bytes whenever icall FileInputStream.available(),and the actual number of bytes onlyafter i call Recorder.stop()</li><li><p>gives me this beautifully uselessstacktrace</p><p>ERROR/AndroidRuntime(18532): Caused by: java.lang.RuntimeException: start failed.ERROR/AndroidRuntime(18532):  at android.media.MediaRecorder.start(Native Method)ERROR/AndroidRuntime(18532):  at com.example.demovideo.DemoVideo.initializeCamera(...)...</p></li><li><p>same error 2</p></li></ol><p>code snippets (parts omitted)</p><p>1)</p><pre><code>fileOut = new FileOutputStream(pathToFile);...recorder.setOutputFile(fileOut.getFD());recorder.prepare()recorder.start()// in an Async ThreadfileIn = FileInputStream(fileOut.getFD);while (recording) {       fos.flush();    Log.w(""---"", ""bytesAvailable: "" + fileIn.available()); //always returns 24    Thread.sleep(1000);}</code></pre><p>2)</p><pre><code>// in a Threadserver = new LocalServerSocket(SOCKET_ADDRESS);    while (true){        receiver = server.accept();        if (receiver != null){        InputStream input = receiver.getInputStream();            ... // processing would go here    }   }sender = new LocalSocket();sender.connect(new LocalSocketAddress(SOCKET_ADDRESS));recorder.setOutputFile(sender.getFileDescriptor());...recorder.prepare();recorder.start(); // &lt;- error</code></pre><ol><li>properly saves an uncorrupted videoto sd</li><li>works if I usesetOutputFile(pathToFile) instead.the sockets also work when i run<code>sender.getOutputStream().write(message.getBytes());</code></li></ol>","426957","","1102056","","2012-05-08 09:50:13","2012-05-08 09:50:13","stream a MediaRecorder file while recording","<java><android><streaming><video-streaming><mediarecorder>","1","3","0","",""
"4638550","1","","","2011-01-09 09:43:39","0","184","<p>A child view had joined the main view. I don't want it to be so. Look at the screenshot. But I want that the dialog has appeared and it disappeared, and the view of the dialog didn't join itself to main view. After I called dialog, the view of the it joined every time and it looked like this: </p><p>_http://s014.radikal.ru/i329/1101/cc/4ce75c9e8ae2.jpg</p><p>_http://i075.radikal.ru/1101/00/f1b132b07e25.jpg</p><p>But the normal view must look like this:</p><p>_http://i016.radikal.ru/1101/64/0b2a4718cd0e.jpg</p><p>Why it happens?</p><p>dialogtable.xml</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView        android:id=""@+id/label""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Type here:""/&gt;    &lt;EditText        android:id=""@+id/entry""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:background=""@android:drawable/editbox_background""        android:layout_below=""@id/label""/&gt;    &lt;Button        android:id=""@+id/ok""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_below=""@id/entry""        android:layout_alignParentRight=""true""        android:layout_marginLeft=""10dip""        android:text=""OK"" /&gt;    &lt;Button        android:id=""@+id/cancel""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@id/ok""        android:layout_alignTop=""@id/ok""        android:text=""Cancel"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The code from MainActivity</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);    View layout = inflater.inflate(R.layout.dialogtable, (ViewGroup)findViewById(R.id.LinearLayout01));    AlertDialog.Builder alert = null;    alert = new AlertDialog.Builder(this);    alert.setView(layout);    alert.setTitle(""Create table"");    alert.setCancelable(false);    alert.setNegativeButton(""Cancel"",new DialogInterface.OnClickListener() {        @Override            public void onClick(DialogInterface dialog, int which) {            dialog.cancel();        }    });    alert.setPositiveButton(""OK"",new DialogInterface.OnClickListener() {        @Override            public void onClick(DialogInterface dialog, int which) {            Editable rows = fieldForRows.getText();            Editable columns = fieldForColumns.getText();            Editable border = fieldForWidthOfBroder.getText();            TableAction tableAction = new TableAction(MainActivity.this.visualPane);            tableAction.insertTable(rows, columns, border);        }    });    Dialog dialog = null;    dialog = new Dialog(this);    switch (id) {    case IDD_CUSTOM_INSERT_TABLE:        dialog.setTitle(""Insert table"");        dialog.setContentView(R.layout.dialogtable);        return dialog;    case IDD_CUSTOM_INSERT_IMAGE:        dialog.setTitle(""Insert image"");        return dialog;    default:        return alert.create();    }}</code></pre>","565447","","565447","","2011-01-09 10:55:53","2011-01-09 10:55:53","Child view adds itself to another view every time when I show dialog","<android>","0","3","","",""
"4638682","1","","","2011-01-09 10:27:01","1","736","<p>I'm trying to write a metaballrenderer for Android.  I have had some success using the OpenGL ES 2.0 API, but would really like to use Openg GL 1.0 as this is better supported.  Does anyone know of a technique I can use for rendering many Metaballs using just 1.0 calls?  My 2.0 implementation uses pixel shaders which are obviously not available.</p>","568011","","44729","","2012-06-05 19:36:33","2012-06-05 19:36:33","Efficient Rendering Of Metaballs Using OpenGL ES 1.0","<android><opengl-es>","1","1","","",""
"4638775","1","4639026","","2011-01-09 10:57:14","1","2201","<p>I have preferences.xml which is used in my extension of PreferencesActivity. </p><p>I have another preference in the xml that I would like to use to clear the cache of a webview. </p><p>It has a key though I can't work out how to fire webview.clearCache by pressing the entry in my preferences...</p><p>In a nutshell, I'd like to run the webview.clearCache() command from a my preferences screen like one can from an options menu item.</p><p>OK so I think I have to use something like setOnPreferenceClickListener with onPreferenceClick, but how?</p>","496625","","496625","","2011-01-09 11:39:16","2011-02-14 23:27:20","webview.clearCache from PreferenceActivity","<android><caching><activity><webview><preferences>","2","0","1","",""
"4638777","1","4639575","","2011-01-09 10:57:19","1","1152","<p>I am trying to create a list with a custom List item cell in a completely programatic way (without using any xml). I am running into below error. After several hours of searching on the web, I am writing this as my first question on Stack Overflow.</p><p>Appreciate your inputs on this &amp; any suggestions on how to better handle Android programming without using the R.*.xml</p><p><strong>On running this code, I get the below error:</strong></p><p>(Suspended (exception Resources$NotFoundException))</p><p>ListView.layoutChildren() line: 1596</p><p>ListView(AbsListView).onLayout(boolean, int, int, int, int) line: 1112</p><p>ListView(View).layout(int, int, int, int) line: 6569    </p><p>FrameLayout.onLayout(boolean, int, int, int, int) line: 333 ...</p><p><strong>Code:</strong></p><p>public class MyList extends ListActivity{</p><pre><code>static final ArrayList&lt;HashMap&lt;String,String&gt;&gt; list =     new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);</code></pre><p>//CUSTOM LIST</p><pre><code>    LinearLayout mainLayout=new LinearLayout(this);    ListView myListView=new ListView(this);    mainLayout.addView(myListView);    LinearLayout ListItemLayout=new LinearLayout(this);    TextView title = new TextView(this);    TextView author = new TextView(this);    TextView price = new TextView(this);    ListItemLayout.addView(title);    ListItemLayout.addView(author);    ListItemLayout.addView(price);    SimpleAdapter adapter = new SimpleAdapter(        this,        list,        ListItemLayout.getId(),        new String[] {""title"",""author"",""price""},        new int[] {ListItemLayout.getChildAt(0).getId(),ListItemLayout.getChildAt(1).getId(),ListItemLayout.getChildAt(2).getId()}    );         populateList();    setListAdapter(adapter);  }private void populateList() {    HashMap&lt;String,String&gt; map = new HashMap&lt;String,String&gt;();    map.put(""title"",""Professional Android "");    map.put(""author"", ""Meier"");    map.put(""price"", ""$54.99"");    list.add(map);    map = new HashMap();    map.put(""title"",""Android 2"");    map.put(""author"", ""Sayed"");    map.put(""price"", ""$48.98"");    list.add(map);    }</code></pre><p>}</p>","556816","","","","","2011-01-09 14:06:30","(exception Resources$NotFoundException))ListView.layoutChildren() line: 1596","<android><android-layout>","2","0","","",""
"4638778","1","","","2011-01-09 10:57:29","9","13620","<p>I'm looking for reference documentation for the NDK libraries, anyone know where to find them? not java APIs. I can't find any in the NDK directory or online.</p>","203251","","","","","2012-10-11 23:42:18","NDK API reference docs?","<android><android-ndk>","7","5","3","",""
"4638832","1","4639012","","2011-01-09 11:12:31","60","49383","<p>HI!I have a relative layout which I am creating programmatically:</p><pre><code> RelativeLayout layout = new RelativeLayout( this );    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,            LayoutParams.WRAP_CONTENT);</code></pre><p>Now I have two buttons which I want to add in this relative layout. But the problem is both buttons are being shown on the left of the RelatiiveLayout overlapping on each other. </p><pre><code>buttonContainer.addView(btn1);buttonContainer.addView(btn2);</code></pre><p>Now I want to know how can I programmatically set the the <code>android:layout_alignParentRight=""true</code>""or  <code>android:layout_toLeftOf=""@id/btn""</code> attribute of buttons as we do in the xml?</p><p>regardsFAS</p>","568710","","6391","","2011-01-09 12:08:57","2013-05-09 22:58:16","How to programmatically set the layout_align_parent_right attribute of a Button in Relative Layout?","<android><relativelayout><layoutparams>","2","0","21","",""
"4638939","1","","","2011-01-09 11:43:14","4","8029","<p>i need some help in how to start developing two android applications (on one phone) which communicate with each other.1. Application A sends a string to application B2. Application B receives the string for example ""startClassOne"", app B using a method starts classOne and gets the result. The result is send back (again as string!) to Application A.3. Application A writes in console the received string from B.</p>","568728","","","","","2013-03-27 13:52:34","android communication between two applications","<android><communication>","1","2","5","",""
"4639078","1","4640910","","2011-01-09 12:21:54","11","3446","<p>Is there are way to switch between different languages within an app using androids multilanguage support (<code>values-de</code> folder for german and <code>value-en</code> folder for english)? </p>","566904","","1324019","","2012-06-29 01:05:40","2012-06-29 01:05:40","Change language dynamically using androids multilanguage support?","<android><multilingual>","1","0","4","",""
"4639105","1","","","2011-01-09 12:30:32","1","4864","<p>I'm trying to save a location via application context, so I did the following :</p><p>myApp Class :</p><p>import android.app.Application;</p><p>import com.google.android.maps.GeoPoint;</p><pre><code>public class myApp extends Application {  private GeoPoint Tunis = new GeoPoint(microdegrees(36.827589),microdegrees(10.171165));  private GeoPoint myLocation=Tunis;  public GeoPoint getMyLocation(){    return myLocation;  }  public void setMyLocation(GeoPoint s){    myLocation = s;  }  private int microdegrees(double value){   return (int)(value*1000000);  }}</code></pre><p>My manifest :</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:name="".myApp""&gt;        &lt;uses-library android:name=""com.google.android.maps""/&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;/application&gt;</code></pre><p>and in my main activity I did this :</p><pre><code>myApp appState = ((myApp)getApplicationContext());</code></pre><p>and this causes a NullPointerException when I launch the application :( can you please tell me why this exception occurs ? I thought that in myApp class I initialized MyLocation to an existing GeoPoint ?</p><p>Thanks,</p>","552264","","","","","2012-08-27 19:30:08","Android getApplicationContext Nullpointerexception","<android><nullpointerexception>","1","1","","",""
"4639111","1","","","2011-01-09 12:32:04","1","689","<p>I'm new in Android and I have to do an application (in android) that consumes a NET WCF service with httpbasicbinding. I have heard about use of ksoap2-android, json and restfull but I don't know which is the best way for my app.</p><p>Anyone can suggest me anything?</p><p>Another problem is my WCF service return complex objects made by Linq To Sql and I don't know how can I use it in Android.</p><p>Thanks in advance!</p>","568751","","","","","2011-01-09 12:45:25","Android application consuming WCF","<android><wcf>","1","1","0","",""
"4639152","1","4756514","","2011-01-09 12:41:38","0","949","<p>I am trying to play a mp4 video from the resource within the app, either res/raw or assets, but i am having no luck, nor can i find any tutorials or solutions that work anywhere, hoping someone hear can provide the answer.</p><p>Code below that i thought would work but doesnt, please show me how?</p><p>ThanksLucy</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.video);        final Button button = (Button) findViewById(R.id.play);           button.setOnClickListener(new Button.OnClickListener() {               public void onClick(View v) {                   Uri uri = Uri.parse(""android.resource://com.video.play.test/"" + R.raw.test2);                 Intent intent=new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri, ""video/mp4"");                 startActivity(intent);               }         });  }</code></pre>","558558","","558558","","2011-01-09 19:17:59","2011-03-29 15:50:43","Android: How can i play Video in the internal MediaPlayer from a Resource, Can anyone Help?","<android><media-player>","2","0","1","",""
"4639345","1","4639408","","2011-01-09 13:27:45","0","676","<p>Say I have a framelayout as the view of a appwidget. The framelayout have several children to form a layered structure. Depending on the application logic, the children in the framelayout can be removed or added. Is it possible to do so programmatically since a view of appwidget is a RemoteView ?</p>","388887","","","","","2011-01-09 13:36:45","how to programmatically create/populate the view of a appwidget in android","<android><appwidget>","1","0","","",""
"4639430","1","","","2011-01-09 13:38:47","0","1277","<p>I'm trying to implement steganography on Android...but the bitmap gets compressed when it's stored, and that changes the pixel values.  Is there any other way to store the image?</p><p>Thanks in advance!!</p>","568796","","368003","","2011-01-09 14:10:45","2013-03-23 12:32:41","android steganography","<android><steganography>","2","2","","",""
"4639447","1","4639498","","2011-01-09 13:42:15","0","297","<p>Can i get a view by calling findIdBy(R.id.x) in a Service?thanks</p>","508197","","","","","2012-06-26 11:04:12","Service and view","<android>","2","1","","",""
"4639611","1","","","2011-01-09 14:14:47","1","837","<p>i'm tryng to populate a TableLayout witth data that i get from a MySql database, i get the data from a php script that execute the query and return a JSONArray.</p><p>The query seem to work and i get a correct JSONArray, but i get a NullPointerExeption while running this code:</p><pre><code>            JSONArray jArray = new JSONArray(result);            TableLayout tl = (TableLayout) findViewById(R.layout.list);            TableRow tr = new TableRow(this);            TextView title = new TextView(this);            TextView author = new TextView(this);            for(int i=0;i&lt;jArray.length();i++){                    JSONObject json_data = jArray.getJSONObject(i);                    title.setText(json_data.getString(""title"").toString());                    author.setText(json_data.getString(""author"").toString());                    tr.addView(title);                    tr.addView(author);                    tl.addView(tr);                    tr.removeAllViews();            }</code></pre><p>""result"" contain a valid JSONArray, probably something go wrong in the for cycle, but i don't understand where is the error!</p><p>Thanks for your help!</p>","561438","","","","","2012-10-23 11:56:35","Android - cannot populate a TableView with JSONArray data","<android><json><tablelayout>","0","3","0","",""
"4639704","1","","","2011-01-09 14:33:00","0","768","<p>i would like to know how to showthe check box that makes some application the default in the createChooser dlg.</p><p>thanks in advance. </p><hr><p>yes David i would like to know how to clear the app from being default. also i would like to know whether i can call any intent if i know its action, category, package and ""class name"", can I?</p><p>I actually tried to call some activity i previously known its intent contents put some SECURITY EXP. raised. why? </p>","465935","","1288","","2012-11-22 02:54:45","2013-03-11 02:21:08","Android Default application","<android><checkbox><default>","1","0","","",""
"4639732","1","4652307","","2011-01-09 14:38:55","0","839","<p>I have a list adapter that handles objects with some image and text and I want to:</p><ul><li>display context menu displayed when long click happens on whole list item</li><li>start some activity when image is clicked</li><li>handle clicks on links inside TextView (for now just displaying Toast message)</li></ul><p>This is my current adapter implementation:</p><pre><code>public class StatusAdapter extends ArrayAdapter&lt;BlipStatus&gt; {    @Override    public View getView(final int pos, final View convertView, final ViewGroup parent) {        // snip...        final Status status = statuses.get(pos);        // snip...        final View s = v.findViewById(R.id.status);        if (!(s instanceof TextView)) throw new RuntimeException(""Expected textView instance"");        TextView stv = (TextView) s;        stv.setText(prepareStatusContent(status.getBody()));        stv.setLinksClickable(true);        stv.setMovementMethod(LinkMovementMethod.getInstance());        // snip...        final View a = v.findViewById(R.id.avatar);        if (!(a instanceof ImageView)) throw new RuntimeException(""Expected imageView instance"");        String p = status.getAvatarPath();        try {            ((ImageView) a).setImageBitmap(AvatarUtils.getAvatarFromPath(p));        } catch (IOException e) {            Log.w(TAG, ""Failed to fetch avatar from path : "" + p);        }        a.setOnClickListener(new View.OnClickListener() {            public void onClick(final View view) {                final Context c = getContext();                final Intent i = new Intent(c, UserActivity.class);                i.putExtra(UserActivity.USER_NAME, status.getUser());                c.startActivity(i);            }        });        return v;    }    private CharSequence prepareStatusContent(String s) {        SpannableString ss = new SpannableString(s);        Pattern p = Pattern.compile(URL_PATTERN);        Matcher m = p.matcher(s);        while (m.find()) {            int start = m.start();            int end = m.end();            final String url = s.substring(start, end);            ss.setSpan(new ExternalUrlSpan(new View.OnClickListener() {                public void onClick(View view) {                    Toast.makeText(getContext(), url, Toast.LENGTH_LONG);                }            }), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);        }        return ss;    }}</code></pre><p>and ExternalUrlSpan class:</p><pre><code>public class ExternalUrlSpan extends ClickableSpan {    private final View.OnClickListener listener;    public ExternalUrlSpan(View.OnClickListener listener) {        super();        this.listener = listener;    }    @Override    public void onClick(View view) {        listener.onClick(view);    }}</code></pre><p>Additionaly I'm calling </p><pre><code>registerForContextMenu()</code></pre><p>method with a ListView instance using my adapter as an parameter in an activity code. </p><p>In a result I'm having list displaying elements with clickable image that starts some activity as expected and context menu available after long click on an element. But when I'm trying to click a link inside text view of list element it gets hovered but whole click event is handled by context menu related listener and . </p><p>Does anyone know how to make it work altogether?</p>","11409","","","","","2011-01-10 22:38:02","Clickable link in TextView with context menu attached to it","<java><android><listview><textview>","1","0","","",""
"4639778","1","","","2011-01-09 14:47:30","8","3295","<p>I developed codes to send SMS to more than one persons. But current problem is that I cannot know which person is got the message and which is sent failed. I want to know each of sent SMS status and the receiver phone number, is it can be done?</p>","429079","","","","","2011-05-06 08:42:35","How to monitor each of Sent SMS status?","<android><sms>","1","2","4","",""
"4639918","1","","","2011-01-09 15:13:47","0","528","<p>i have this problem for some time now and i don't know what to do anymore. i am trying to get the values back from a shared Preference, but i keep getting this unable to unlink data error. i don't know what to do anymore, the only explanation i have seen so far for this error is that it is trying to access a file from a local directory that's not there. it seems it is trivial, but i can't get any values back from the shared preferences stored. </p><p>Any idea on what might be the problem? </p><p>by the way, i am trying to use it in an appWidget, in case that helps. Thank you</p><p>edit: here is the code that saves the preference:</p><pre><code>public class WeatherForecastConfigure extends Activity implements OnClickListener {    private int appWidgetId;      SharedPreferences prefs;    EditText cityText;    Button save;    Spinner update;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        prefs = getSharedPreferences(""myWeatherPrefs"", 0);         Intent launchIntent = getIntent();         Bundle extras = launchIntent.getExtras();         appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,                         AppWidgetManager.INVALID_APPWIDGET_ID);         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);    }    @Override    public void onClick(View v) {        int selection = v.getId();        switch(selection){        case R.id.SaveButton:               savePreferences();               Intent resultValue = new Intent();               resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,appWidgetId);               setResult(RESULT_OK, resultValue);               finish();       }    }    private void savePreferences() {        prefs = getSharedPreferences(""myWeatherPrefs"", 0);        String city = cityText.getText().toString();        Editor editor = prefs.edit();        editor.putString(""citySet"" + appWidgetId, city);        editor.commit();    }</code></pre><p>and here is where am trying to access it in a service:</p><pre><code>public class weatherForecast extends Service implements Runnable  {     public static final String TAG = ""WeatherForecastService"";     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"");    }*/    public void onStart(Intent intent, int startId){        URL url;        Log.d(TAG,""onStart"");           prefs = getApplicationContext().getSharedPreferences(""myWeatherPrefs"", 0);            city = prefs.getString(""citySet"" + appWidgetID,""nothing"");            Log.i(TAG, ""service city is "" + city);        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);           }           RemoteViews remoteView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.weather_appwidget);           AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getApplicationContext());</code></pre><p>my widget class:</p><pre><code>public class WeatherWidgetProvider extends AppWidgetProvider{    SharedPreferences prefs;    @Override        public void onEnabled(Context context){    }    public void updateForecast(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){    }        @Override     public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds){            for (int appWidgetId : appWidgetIds) {                RemoteViews remoteView = new RemoteViews(context.getPackageName(),                                R.layout.weather_appwidget);                appWidgetManager.updateAppWidget(appWidgetId, remoteView);        }                 super.onUpdate(context, appWidgetManager, appWidgetIds);        }    @Override    public void onReceive(Context context, Intent intent){        Log.d(""onReceive"", ""gets called first"");        final String action = intent.getAction();        if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) {            Bundle extras = intent.getExtras();            final int appWidgetId = extras.getInt    (AppWidgetManager.EXTRA_APPWIDGET_ID,                    AppWidgetManager.INVALID_APPWIDGET_ID);            if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {                this.onDeleted(context, new int[] { appWidgetId });            }        } else {            Intent service = new Intent(context, weatherForecast.class);               service.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);               context.startService(service);        }           super.onReceive(context, intent);        }    public void onDisabled(Context context) {        context.stopService(new Intent(context,weatherForecast.class));        super.onDisabled(context);}}   </code></pre>","316843","","316843","","2011-01-09 20:56:59","2011-01-09 20:56:59","unable to unlink data, no such file or directory exist error on retrieving shared preference","<android>","0","2","","",""
"4639958","1","","","2011-01-09 15:26:10","2","7433","<p>I want to create a widget that behaves similar to the gallery widget but scrolls vertically instead of horizontally. That is images in gallery should be vertically placed on screen and can be scroll vertically.Does anybody help me please?</p>","568868","","","","","2013-05-12 13:37:39","How I can create vertical gallery in Android?","<android><scrolling><gallery>","3","1","3","",""
"4640026","1","","","2011-01-09 15:37:37","3","1200","<p>Trying to initiate an intent to send an SMS to multiple recipients with the following code:</p><pre><code>Intent smsIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(""sms"", destination, null));</code></pre><p>However in the destination string say I have ""555-555-5555,555-555-5556"".  The comma delimiter is working fine on a Samsung vibrant.  However, this will not work on a nexus 1.  On the nexus one i need to use a semicolon as the delimiter and then it works.  On the nexus one, if I use commas as the delimiter, it only picks up the last phone number.  If I use the semicolon, the nexus one picks up all the phone numbers however, it then breaks the vibrant. With the semicolon, the vibrant does not pick up any of the phone numbers.  Any insights?</p>","2350112","","","","","2013-09-24 09:26:49","Intent to send an SMS to multiple contactcs","<android><sms><contacts>","2","0","1","",""
"4640028","1","4640111","","2011-01-09 15:38:08","0","3412","<p>I would like to create a context menu (long press on a textview) that will show a list of options.Difference from regular context menu will be, that the use is different: user will long click on the textview, menu will popup, user will not release finger, point to the menu item, release finger. This will fire the action.</p><p>Any idea how ot do it?>Can you refer me to an example</p>","380490","","","","","2011-01-09 15:57:17","Android custom context menu","<android><contextmenu>","2","0","","",""
"4640039","1","4640139","","2011-01-09 15:40:12","8","4107","<p>The documentation at <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#getWritableDatabase%28%29"">http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#getWritableDatabase%28%29</a> states:</p><blockquote>  <p>Database upgrade may take a long time,  you should not call this method  [getWritableDatabase] from the  application main thread, including  from ContentProvider.onCreate().</p></blockquote><p>This begs the question: for best practice, where should getWritableDatabase be called from?</p><p>My feeling is that, perhaps, it should be called once upon application launch with a callback to mark the database as ready. Is this correct?</p>","349003","","236247","","2011-06-28 16:05:55","2011-11-16 04:55:30","Where should Android applications call SQLite getWritableDatabase?","<android><sqlite>","3","0","2","",""
"4640096","1","","","2011-01-09 15:54:22","0","996","<p>I am trying to implement an iframe with a search-box in my web page.</p><p>The thing is that I have a web-page from one domain let say this page is http:///myPage.htmland I have in its html an iframe element which reference to another html on a different domain. let say the element is like so /iframe_content.html""></p><p>and in the http:///iframe_content.html page I have an input text box I want to use as a search-box.</p><p>The problem is when I surf with Android 2.2 to my original web-page, I see the iframe I embed in my html and when I press the input-text-box I don't see the virtual keyboard Android browser should supply in-order to insert some text into it.</p><p>Can anyone help?</p>","510468","","","","","2011-06-10 19:35:04","Android keyboard does not show when pressing input text box","<android><iframe><keyboard><webkit><textinput>","1","1","","",""
"4640191","1","4640862","","2011-01-09 16:12:42","5","1337","<p>I'm a bit confused about debugging on a device. When I use the emulator, after the debug session, I simply close the emulator window...but when debugging on my device, how can I close the session??simply disconnecting the USB cable?</p><p>And the installed .apk ( installed by Eclipse ) should be removed manually?</p>","167194","","403455","","2012-09-09 12:58:39","2012-09-09 12:58:39","Terminate debug on device","<android><eclipse><debugging>","2","0","2","",""
"4640363","1","4715726","","2011-01-09 16:48:14","2","960","<p>I would like to have two overlapping SlidingDrawers (spanning the whole application window) with their handles side by side so that the user can open both drawers easily.However, it seems that the handle is always positioned horizontally centered (for a vertical SlidingDrawer) so that the handles collide. I tried both FrameLayout and RelativeLayout for the parent, but layout options like android:layout_alignRight seem to be ignored for the handles.</p>","341927","","","","","2011-01-17 16:59:12","Position of SlidingDrawer handle?","<android><layout><slidingdrawer>","1","0","","",""
"4640379","1","4640795","","2011-01-09 16:53:30","0","987","<p>Basically I want to create an application on Android device which able to send a message to my third-party server without being connected to internet through wi-fi or 3G service.Is there anyway to achieve this?</p>","483253","","","","","2011-01-09 18:03:43","Send message to a server from android device without internet connection","<android>","2","3","","",""
"4640455","1","","","2011-01-09 17:04:51","0","591","<p>I'm just started looking at developing apps. I have made some of the tutorials (HelloWorld), but when I try to make a WebView app following the tutorial for that it won't work. Each time I run the app on my phone I get the ""Force Close"". I use eclipse. I'm sorry that i cannot be more specific - but my point is that my knowledge doesn't go further than failing in a tutorial.</p><p>Because of me huge lack of knowledge about developing I would be grateful if anyone would like to help me developing an app for android phones, using webview to show www.lectio.dk.</p><p>Christian.</p>","568946","","750987","","2011-05-29 06:30:30","2011-05-29 06:30:30","Problem with Webview app","<android><eclipse><webview>","1","1","","",""
"4640558","1","","","2011-01-09 17:26:14","1","1302","<p>I am looking for best practices while developing in-app payment apps on android?</p><p>How do you you store the data on android so that the information is not wiped off by an upgrade nor is it easily visibly to prying eyes? The data essentially says that this user has already paid for the app.</p>","119031","","","","","2011-03-31 12:40:22","How to implement in app payment in android?","<java><android><in-app-purchase>","3","2","","",""
"4640638","1","4641259","","2011-01-09 17:39:04","2","578","<p>What is the Android <a href=""http://developer.android.com/reference/android/webkit/WebView.PictureListener.html"" rel=""nofollow"">WebView.PictureListener</a> and when is it called exactly? The documentation is quite vague about it.</p><p>Is the picture the content of the WebView? Is it called each time the content of the WebView changes (ie: each time a img element is loaded)?</p>","143378","","143378","","2011-01-09 18:24:08","2011-01-09 19:32:10","What is the PictureListener?","<android><webview>","1","0","1","",""
"4640668","1","","","2011-01-09 17:43:20","1","792","<p>I'd like to write an app that merges multiple images into a movie on Android. JMF has a basic implementation (<a href=""http://www.koders.com/java/fid8AE9208DC5FB846910DFD3F935D64E7C9A5BB784.aspx"" rel=""nofollow"">JpegImagesToMovie</a>). But, JMF isn't supported on Dalvik. </p><p>Is there an alternative library that I can use for this ?  Or if there is no library available, does anyone have any pointers for what I need to research to implement myself.</p><p>Rgds, Kevin.</p>","156477","","156477","","2011-01-09 19:53:37","2011-07-08 04:28:36","Android - Merge image files to a movie (but not using JMF)","<android><jmf>","1","3","1","",""
"4640708","1","","","2011-01-09 17:49:44","7","2179","<p>My customers are having a problem with my app, and I have been unable to reproduce the problem on my development phone. How to debug this problem? The android Log class is great, but my customers do not know how to use 'adb' or the USB debug cable. Is there some way to redirect Log output to a file on the phone's SD card? Then the customer could easily email the log file to me. Even if this redirection requires programming on my part, I could at least distribute a 'debug' version of the app.</p><p>Thanks,Tom</p>","568993","","","","","2013-02-07 07:52:42","Redirect Log output to sdcard on customer's phone","<android><logging>","3","0","2","",""
"4640731","1","4641008","","2011-01-09 17:53:50","8","4490","<p>Im at a bit of loss on this one on how to produce sections in a ListView when you use both Cursors and a Custom SimpleCursorAdapter.</p><p>Many of the docs out there reference using getView() etc, or creating several Adapters and adding section headers.</p><p>But these all appear to be based on BaseAdapters, ListAdapters, and ArrayAdapters etc.</p><p>Has anybody dealt with anything similar previously?</p><p>If not, any tips on how to make this work?</p><p>ThanksSimon</p>","509326","","","","","2011-09-01 10:24:52","SimpleCursorAdapter with Sections in Android","<android><listview><cursor><sections>","2","0","2","",""
"4640888","1","","","2011-01-09 18:23:05","0","585","<p>Whenever I press more than 1 or 2 seconds on an image in a webpage, the browser comes with this dialog. For my application I want the user to execute a long touch on the screen without having this annoying dialog.  </p><p>I tried following things with changing success</p><ul><li>adding the selectable=""false"" to the img tag</li><li>calling the event.preventDefault() method in the touchstart, touchend and touchmove event handlers connected to the div having the image</li><li>using the '-webkit-user-select: none;' as css style</li><li>set the image as background-image of the div</li></ul><p>The background-image thing was the only trick that worked, but I wonder if it's the only solution to this problem.</p>","288988","","","","","2011-03-14 20:54:33","How to avoid the popup from the android browser asking to save or view an image","<javascript><android><webkit>","0","4","0","",""
"4640962","1","4641227","","2011-01-09 18:34:02","1","1021","<p>I have a <b>LinearLayout</b> which I wanna inflate into my <b>SectionedAdapter as a Header</b>. LinearLayout have one ImageView and one TextView. I tried this but it's not working...</p><pre><code>SectionedAdapter adapter = new SectionedAdapter() { protected View getHeaderView(String caption, int index, View convertView, ViewGroup parent) { TextView result=(TextView)convertView;if (convertView == null) {result = (TextView) getLayoutInflater().inflate(R.layout.my_main_layout, null).findViewById(R.id.label);}result.setText(caption);return(result); }};</code></pre><p>I get</p><pre><code>01-09 21:23:02.336: ERROR/AndroidRuntime(308): FATAL EXCEPTION: main01-09 21:23:02.336: ERROR/AndroidRuntime(308): java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.ListView.setupChild(ListView.java:1761)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.ListView.makeAndAddView(ListView.java:1730)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.ListView.fillDown(ListView.java:652)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.ListView.fillFromTop(ListView.java:709)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.ListView.layoutChildren(ListView.java:1580)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.AbsListView.onLayout(AbsListView.java:1147)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.View.layout(View.java:7035)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.os.Handler.dispatchMessage(Handler.java:99)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.os.Looper.loop(Looper.java:123)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at java.lang.reflect.Method.invokeNative(Native Method)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at java.lang.reflect.Method.invoke(Method.java:521)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-09 21:23:02.336: ERROR/AndroidRuntime(308):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Ofcourse, casting (TextView) is a problem..?</p>","455268","","455268","","2011-01-09 21:24:28","2011-01-09 21:24:28","SectionedAdapter (inflate layout)","<android><adapter>","2","0","1","",""
"4641072","1","4641117","","2011-01-09 18:55:00","39","42229","<p>How can i set the value for the attribute <code>layout_weight</code> for button in android dynamically from java code ?</p>","508377","","368003","","2011-01-09 18:56:41","2014-02-24 22:25:13","How to set layout_weight attribute dynamically from code?","<android>","4","1","5","",""
"4641115","1","4641578","","2011-01-09 19:05:34","13","5717","<p>I'm trying to use a SeekBar to display both the length of a track played by a MediaPlayer class and to enable seeking within the track.</p><p>Seeking within the track works well. However, updating the progress value using setProgress while the track is playing seems to cause a slight skip.</p><p>In the onCreate method I create a Thread with a loop which updates the SeekBar's progress value for the current track. This loop resets when the track is changed.</p><pre><code>private void createProgressThread() {    _progressUpdater = new Runnable() {        @Override        public void run() {            //Exitting is set on destroy            while(!_exitting) {                _resetProgress = false;                if(_player.isPlaying()) {                    try                    {                        int current = 0;                        int total = _player.getDuration();                        progressBar.setMax(total);                        progressBar.setIndeterminate(false);                        while(_player!=null &amp;&amp; current&lt;total &amp;&amp; !_resetProgress){                            try {                                Thread.sleep(1000); //Update once per second                                current = _player.getCurrentPosition();                                 //Removing this line, the track plays normally.                                progressBar.setProgress(current);                             } catch (InterruptedException e) {                            } catch (Exception e){                            }                                    }                    }                    catch(Exception e)                    {                        //Don't want this thread to intefere with the rest of the app.                    }                }            }        }    };    Thread thread = new Thread(_progressUpdater);    thread.start();}</code></pre><p>Ideally I would rather not use a thread as I understand that this has disadvantages. Also please excuse the exception swallowing - it is difficult to keep checking for all MediaPlayer states in response to UI events. However, my real problem is that the music is skipping. </p><p>Could anyone suggest an alternative way to update the progress and explain why the call to setProgress is causing the track to skip even with the use of a seperate thread?</p><p>Thanks in advance.</p>","4950","","","","","2013-10-04 14:22:27","Android SeekBar setProgress is causing my MediaPlayer to skip","<android><multithreading><music-player>","1","0","7","",""
"4641129","1","","","2011-01-09 19:09:03","1","666","<p>I am now trying to do a project which is, there will be a server on windows pc and there are some clients on android devices.The point is the server one should control the android devices.For example it choose a image or video, send them to the clients and the clients play or show them.Remember the clients should be control by the server.   So could anyone tell me a proper way to do that, which protocol should i use, how do i send the files to the clients and how do the clients react? I am thinking of using java for the server and of course the client will use android application.    Thank you.</p>","569002","","","","","2013-03-11 16:26:13","Server on windows, clients on android","<java><android><client>","1","0","","",""
"4641181","1","4641246","","2011-01-09 19:18:26","0","414","<p>Can you use any unlocked Motorola Droid phone for Android development? Say one you bought off of eBay?</p>","517733","","488657","","2012-10-13 21:18:35","2012-10-13 21:18:35","Android Dev Phone","<android><phone>","6","0","","",""
"4641317","1","4642332","","2011-01-09 19:43:35","0","2570","<p>Okay so I put in the adwhirl jar and permissions and all that and I add the the layout to my main xml and added the java stuff, I have no errors or warnings so I am very confused on what I am doing wrong. Here is my source code, layout, manifest, and log cat</p><p><strong>JAVA SOURCE CODE</strong></p><pre><code>public class ListA extends Activity implements OnClickListener, AdWhirlInterface {    //**Sets the EditText view to txtNumber    EditText txtNumber = null;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);        if (layout == null) {          Log.e(""AdWhirl"", ""Layout is null!"");          return;        }        // These are density-independent pixel units, as defined in        // http://developer.android.com/guide/practices/screens_support.html        int width = 320;        int height = 52;        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();        float density = displayMetrics.density;        width = (int) (width * density);        height = (int) (height * density);        AdWhirlTargeting.setAge(23);        AdWhirlTargeting.setGender(AdWhirlTargeting.Gender.MALE);        String keywords[] = { ""online"", ""games"", ""gaming"" };        AdWhirlTargeting            .setKeywordSet(new HashSet&lt;String&gt;(Arrays.asList(keywords)));        AdWhirlTargeting.setPostalCode(""94123"");        AdWhirlTargeting.setTestMode(false);        AdWhirlAdapter.setGoogleAdSenseAppName(""AdWhirl Test App"");        AdWhirlAdapter.setGoogleAdSenseCompanyName(""AdWhirl"");        // Optional, will fetch new config if necessary after five minutes.        AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5);        // References AdWhirlLayout defined in the layout XML.        AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.adwhirl_layout);        adWhirlLayout.setAdWhirlInterface(this);        adWhirlLayout.setMaxWidth(width);        adWhirlLayout.setMaxHeight(height);        // Instantiates AdWhirlLayout from code.        // Note: Showing two ads on the same screen is for illustrative purposes        // only.        // You should check with ad networks on their specific policies.        AdWhirlLayout adWhirlLayout2 = new AdWhirlLayout(this,            ""46a9e26bb1f5499ab7b00c9807ae034b"");        adWhirlLayout2.setAdWhirlInterface(this);        adWhirlLayout2.setMaxWidth(width);        adWhirlLayout2.setMaxHeight(height);        RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(            LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        adWhirlLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);        layout.setGravity(Gravity.CENTER_HORIZONTAL);        layout.addView(adWhirlLayout2, adWhirlLayoutParams);        TextView textView = new TextView(this);        textView.setText(""Below AdWhirlLayout from code"");        layout.addView(textView, adWhirlLayoutParams);        layout.setGravity(Gravity.CENTER_HORIZONTAL);        layout.invalidate();      }      public void adWhirlGeneric() {        Log.e(AdWhirlUtil.ADWHIRL, ""In adWhirlGeneric()"");        //**This makes it so that the EditText view can be called        //**into the dialer        txtNumber =  (EditText)(this.findViewById(R.id.txtNumber));        //**Handles what the button dialer is going to do        final Button btndialer = (Button) findViewById(R.id.dialer);        btndialer.setOnClickListener(new OnClickListener(){            public void onClick(View v) {            Intent dialIntent=            new Intent(Intent.ACTION_CALL,Uri.parse(""tel:*""+(txtNumber.getText()).toString()));            startActivity(dialIntent);            finish();            Toast.makeText(ListA.this, R.string.Dial_notification,                    Toast.LENGTH_LONG).show();               }              });      //**Handles what the button redialer is going to do        Button btnredialer = (Button) findViewById(R.id.redialer);        btnredialer.setOnClickListener(new OnClickListener() {             public void onClick(View v) {            Intent dialIntent=new Intent(Intent.ACTION_CALL,Uri.parse(""tel:*""));            startActivity(dialIntent);            Toast.makeText(ListA.this, R.string.Dial_notification,                    Toast.LENGTH_LONG).show();               }              });    }    //**This calls the contacts view using the button.    //**Make sure to use import android.provider.Contact.contacts;    //**Do not use import android.provider.contacts; (this is for an older version)    private static final int CONTACT_PICKER_RESULT = 1001;      public void doLaunchContactPicker(View view) {          Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,                  Contacts.CONTENT_URI);          startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);      }    public void onClick(View view) {}    //**Grabs the results for the contact picker and calls it back into the activity.    protected void onActivityResult(int requestCode, int resultCode, Intent data) {          if (resultCode == RESULT_OK) {              switch (requestCode) {              case CONTACT_PICKER_RESULT:                  Cursor cursor = null;                  String Number = """";                  try {                      Uri result = data.getData();                      Log.v(NOTIFICATION_SERVICE, ""Got a contact result: ""                              + result.toString());                      // get the contact id from the Uri                      String id = result.getLastPathSegment();                      // query for everything email                      cursor = getContentResolver().query(Phone.CONTENT_URI,                              null, Phone.CONTACT_ID + ""=?"", new String[] { id },                              null);                      int emailIdx = cursor.getColumnIndex(Phone.DATA);                      // let's just get the first email                      if (cursor.moveToFirst()) {                          Number = cursor.getString(emailIdx);                          Log.v(NOTIFICATION_SERVICE, ""Got email: "" + Number);                      } else {                          Log.w(NOTIFICATION_SERVICE, ""No results"");                      }                  } catch (Exception e) {                      Log.e(NOTIFICATION_SERVICE, ""Failed to get email data"", e);                  } finally {                      if (cursor != null) {                          cursor.close();                      }                      EditText emailEntry = (EditText) findViewById(R.id.txtNumber);                      emailEntry.setText(Number);                      if (Number.length() == 0) {                          Toast.makeText(this, ""No email found for contact."",                                  Toast.LENGTH_LONG).show();                      }                  }                  break;              }          } else {              Log.w(NOTIFICATION_SERVICE, ""Warning: activity result not ok"");          }  }    public boolean onCreateOptionsMenu(Menu menu) {          MenuInflater inflater = getMenuInflater();          inflater.inflate(R.menu.menu, menu);          return true;                    }          public boolean onOptionsItemSelected(MenuItem item) {              // Handle item selection              switch (item.getItemId()) {              case R.id.item1:                  Intent i = new Intent(ListA.this, straightapp.class);                  startActivity(i);                     finish();                  return true;              default:                  return super.onOptionsItemSelected(item);              }          }}</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""    xmlns:app=""http://schemas.android.com/apk/res/com.adwhirl""     android:orientation=""vertical""    android:layout_height=""wrap_content""     android:layout_width=""wrap_content""     android:focusable=""true""    android:id=""@+id/layout_main""&gt;&lt;Button android:id=""@+id/Button01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:onClick=""doLaunchContactPicker"" android:text=""@string/GetContacts""&gt;&lt;/Button&gt;&lt;EditText     android:hint=""@string/hint""     android:id=""@+id/txtNumber""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:inputType=""phone""&gt;&lt;/EditText&gt;&lt;Button     android:text=""@string/dialer""     android:id=""@+id/dialer""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:onClick=""OnClick""&gt;&lt;/Button&gt;&lt;Button     android:text=""@string/redialer""     android:id=""@+id/redialer""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:onClick=""OnClick2""&gt;&lt;/Button&gt; &lt;com.adwhirl.AdWhirlLayout        android:id=""@+id/adwhirl_layout""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>MANIFEST</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.app""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".ListA""                  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;meta-data android:value=""bef8fbbc34c64ceaa67d1c230e864150""        android:name=""ADWHIRL_KEY""/&gt;   &lt;/activity&gt;&lt;activity android:name=""straightapp""&gt;&lt;/activity&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.READ_CONTACTS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.CALL_PHONE""/&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt; &lt;/manifest&gt; </code></pre><p><strong>LOG CAT</strong></p><pre><code>01-09 12:33:29.586: DEBUG/AndroidRuntime(663): &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;01-09 12:33:29.586: DEBUG/AndroidRuntime(663): CheckJNI is ON01-09 12:33:29.786: DEBUG/AndroidRuntime(663): --- registering native functions ---01-09 12:33:30.546: DEBUG/AndroidRuntime(663): Shutting down VM01-09 12:33:30.556: DEBUG/dalvikvm(663): Debugger has detached; object registry had 1 entries01-09 12:33:30.576: INFO/AndroidRuntime(663): NOTE: attach of thread 'Binder Thread #3' failed01-09 12:33:31.116: DEBUG/AndroidRuntime(671): &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;01-09 12:33:31.116: DEBUG/AndroidRuntime(671): CheckJNI is ON01-09 12:33:31.316: DEBUG/AndroidRuntime(671): --- registering native functions ---01-09 12:33:32.077: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.adapter/.ListA }01-09 12:33:32.117: INFO/ActivityManager(59): Start proc com.adapter for activity com.adapter/.ListA: pid=677 uid=10037 gids={3003, 1015}01-09 12:33:32.157: DEBUG/AndroidRuntime(671): Shutting down VM01-09 12:33:32.187: DEBUG/dalvikvm(671): Debugger has detached; object registry had 1 entries01-09 12:33:32.207: INFO/AndroidRuntime(671): NOTE: attach of thread 'Binder Thread #3' failed01-09 12:33:32.927: DEBUG/AndroidRuntime(677): Shutting down VM01-09 12:33:32.977: WARN/dalvikvm(677): threadid=1: thread exiting with uncaught exception (group=0x4001d800)01-09 12:33:33.017: ERROR/AndroidRuntime(677): FATAL EXCEPTION: main01-09 12:33:33.017: ERROR/AndroidRuntime(677): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.adapter/com.adapter.ListA}: java.lang.ClassNotFoundException: com.adapter.ListA in loader dalvik.system.PathClassLoader[/data/app/com.adapter-2.apk]01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.os.Handler.dispatchMessage(Handler.java:99)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.os.Looper.loop(Looper.java:123)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at java.lang.reflect.Method.invokeNative(Native Method)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at java.lang.reflect.Method.invoke(Method.java:521)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at dalvik.system.NativeStart.main(Native Method)01-09 12:33:33.017: ERROR/AndroidRuntime(677): Caused by: java.lang.ClassNotFoundException: com.adapter.ListA in loader dalvik.system.PathClassLoader[/data/app/com.adapter-2.apk]01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)01-09 12:33:33.017: ERROR/AndroidRuntime(677):     ... 11 more01-09 12:33:33.037: WARN/ActivityManager(59):   Force finishing activity com.adapter/.ListA01-09 12:33:33.567: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{4403a418 com.adapter/.ListA}01-09 12:33:35.176: INFO/Process(677): Sending signal. PID: 677 SIG: 901-09 12:33:35.196: INFO/ActivityManager(59): Process com.adapter (pid 677) has died.01-09 12:33:35.216: WARN/InputManagerService(59): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43efbb8801-09 12:33:43.859: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{4403a418 com.adapter/.ListA}</code></pre>","424421","","418183","","2011-01-29 18:44:52","2011-01-29 18:44:52","Problem with implementing Adwhirl","<android><adwhirl>","1","5","","",""
"4641430","1","4641634","","2011-01-09 20:03:11","15","10117","<p>Is there any way to remove a listener from a view in android? I have a Checkbox that I attached a checkchangedlistener to. The problem is that calling <code>setChecked()</code> on it causes my listener to fire.</p><p>If I can't just remove a listener, is there a way to prevent the listener from firing when I call <code>setChecked()</code> manually versus it being checked from a touch event?</p>","375874","","","","","2014-01-21 15:17:23","Remove a listener from a view in android","<android><view><checkbox><listener>","5","0","1","",""
"4641524","1","4641550","","2011-01-09 20:18:00","2","388","<p>Alright, So I have an application that receives an intent in a Broadcast Receiver, but what I need to do with it, I cant do without extending Activity, so I launch an activity from that receiver, but how can I get it to do what I want it to do, without starting any UI of any kind? Thanks!</p>","481082","","","","","2011-01-09 20:23:52","Activity With no UI","<android><broadcastreceiver>","1","2","","",""
"4641534","1","4642869","","2011-01-09 20:19:36","3","1204","<p>I'm using drawTextOnPath() to display some text on a Canvas and I need to know the dimensions of the text being drawn.  I know this is not feasible for paths composed of multiple segments, curves, etc. but my path is a single segment which is perfectly horizontal.  I am using Paint.getTextBounds() to get a Rect with the dimensions of the text I want to draw.</p><p>I use this rect to draw a bounding box around the text when I draw it at an arbitrary location.</p><p>Here's some simplified code that reflects what I am currently doing:</p><pre><code>// to keep this example simple, always at origin (0,0)public drawBoundedText(Canvas canvas, String text, Paint paint) {    Rect textDims = new Rect();    paint.getTextBounds(text,0, text.length(), textDims);    float hOffset = 0;    float vOffset = paint.getFontMetrics().descent;  // vertically centers text     float startX = textDims.left;  / 0    float startY = textDims.bottom;    float endX = textDims.right;    float endY = textDims.bottom;    path.moveTo(startX, startY);    path.lineTo(endX, endY);    path.close();    // draw the text    canvas.drawTextOnPath(text, path, 0, vOffset, paint);    // draw bounding box    canvas.drawRect(textDims, paint);}</code></pre><p>The results are -close- but not perfect.  If I replace the second to last line with:</p><pre><code>canvas.drawText(text, startX, startY - vOffset, paint);</code></pre><p>Then it works perfectly.  Usually there is a gap of 1-3 pixels on the right and bottom edges.  The error seems to vary with font size as well. Any ideas? It's possible I'm doing everything right and the problem is with drawTextOnPath(); the text quality very visibly degrades when drawing along paths, even if the path is horizontal, likely because of the interpolation algorithm or whatever its using behind the scenes.  I wouldnt be surprised to find out that the size jitter is also coming from there.</p>","556613","","","","","2011-01-10 00:52:30","How to -accurately- measure size in pixels of text being drawn on a canvas by drawTextOnPath()","<java><android><graphics><canvas>","1","1","1","",""
"4641619","1","4643204","","2011-01-09 20:35:58","0","980","<p>i have implemented a tab layout that consists of four tabs each tab containing a listview. i was using the same setup of listview earlier but not under tab host and it worked fine, ie; when a list item was clicked a new activity would start. but now the list is neither clickable not scrollable.how ever now, when i click all the tabs once and then try to scroll/click rows, it works perfectly fine.  please let me know how do i enable both. the code is as below</p><pre><code>tabHost = (TabHost) findViewById(android.R.id.tabhost);        tabHost.setup();        tabHost.setOnTabChangedListener(this);        list = (ListView) findViewById(R.id.listAll);        list.setEmptyView((TextView) findViewById(R.id.empty));        //list for all        tabHost.addTab(tabHost.newTabSpec(LIST_ALL).setIndicator(""All Events"").setContent(new TabContentFactory() {            public View createTabContent(String arg0) {                try{                    Event event = new Event();                    final String [] eventTitleArray = new String[XmlParser.eventsList.size()];                    String [] eventDateArray = new String[XmlParser.eventsList.size()];                    String [] eventImageLinkArray = new String[XmlParser.eventsList.size()];                for(int i=0;i&lt;XmlParser.eventsList.size();i++){                        event = XmlParser.eventsList.get(i);                        eventTitleArray[i] = event.getTitle();                        if(event.getDistance()!=0.0)                            eventDateArray[i] = event.getsDate() +"" - "" +Double.toString(event.getDistance())+""mi"";                        else                            eventDateArray[i] = event.getsDate();                        eventImageLinkArray[i] = event.getImageLink();                        Log.i(tag , ""event detail""+event.getTitle());                    }                    list=(ListView)findViewById(R.id.listAll);                    adapter= new LazyAdapter(HomeActivity.this, eventTitleArray,eventDateArray,eventImageLinkArray);                    list.setAdapter(adapter);                    list.setFocusable(false);                    list.setOnItemClickListener(new OnItemClickListener() {                        @Override                        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,                                int position, long arg3) {                            Intent intent = new Intent(HomeActivity.this, DisplayActivity.class);                            Bundle b = new Bundle();                            System.out.println(""position in list:""+position);                            System.out.println(""title name in the list:""+eventTitleArray[position]);                            b.putString(""eventTitle"", eventTitleArray[position]);                            intent.putExtras(b);                            startActivity(intent);                            Toast.makeText(getApplicationContext(), ""Detailed view for the Event"", Toast.LENGTH_SHORT).show();                        }                    });                }                catch(Exception e){                    e.printStackTrace();                }                return list;            }        }));        tabHost.addTab(tabHost.newTabSpec(LIST_TODAY).setIndicator(""Events Today"").setContent(new TabContentFactory() {            public View createTabContent(String arg0) {                return list;            }        }));</code></pre>","377337","","377337","","2011-01-09 21:55:32","2011-01-10 02:22:15","android tab layout listview not clickable","<android><android-listview><android-tabhost>","2","0","","",""
"4641625","1","","","2011-01-09 20:37:10","5","1191","<p><strong>Is there a way to fully integrate Python with Java code on Android platform?</strong></p><p>Yes, I saw <a href=""http://stackoverflow.com/questions/101754/is-there-any-way-to-run-python-on-android"">the question about running Python on Android</a> and <a href=""http://code.google.com/p/android-scripting/"" rel=""nofollow"">Android Scripting Environment (ASE)</a>.</p><p>But that doesn't seem to be enough (correct me if I am wrong). I wanted to be able not only to invoke a Python script from within Java code, but have a full integration. The feature I need the most is the ability to have a state of execution of python code saved and be able to run several parts of code on demand against the same execution state.</p><p>On JavaSE I would rely on Jython. I believe <a href=""http://www.jython.org/archive/21/docs/embedding.html"" rel=""nofollow"">its simplest example</a> shows it all (and some other features too, like something I would call variable state introspection):</p><pre><code>    http://www.jython.org/archive/21/docs/embedding.html    PythonInterpreter interp = new PythonInterpreter();    System.out.println(""Hello, brave new world"");    interp.exec(""import sys"");    interp.exec(""print sys"");    interp.set(""a"", new PyInteger(42));    interp.exec(""print a"");    interp.exec(""x = 2+2"");    PyObject x = interp.get(""x"");    System.out.println(""x: ""+x);    System.out.println(""Goodbye, cruel world"");</code></pre><p>Is it possible on Android? Is ASE a way to go?</p>","118587","","118587","","2011-05-17 09:51:41","2011-05-17 09:51:41","android python full integration","<java><android><python><jython><ase>","1","1","","",""
"4641659","1","4645676","","2011-01-09 20:44:08","0","1046","<p>I have a xml based Relative Layout and was attempting to add a small MapView to the layout,  I obtained an API key (debug),  Changed my platform target from Android 2.2 to the appropriate Google APIs platform, and then added the 'uses-library' code to manifest.</p><p>Finally adding in the xml to my relative layout:</p><pre><code>&lt;com.google.android.maps.MapView        android:id=""@+id/mapview""        android:layout_below=""@+id/txAddress""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:clickable=""true""        android:apiKey=""@string/MAPS_API_KEY""    /&gt; </code></pre><p>I did expect this would be all I need, but when attempting to run (on my plugged in Desire HD) when I launch this activity I receive a class not found exception for the MapView.</p><p>So not sure if the issue is related to my particular handset or version of google maps or something I've done wrong..  As this application is intended to eventually be released to the public if using MapViews can be unreliable, then I won't show it and instead have a button that launches the full google maps(if available).</p><p>Any thoughts appreciated.</p><p>Thanks,</p>","333276","","","","","2011-01-10 10:19:49","MapView Class Not Found error.. Unsure why","<android><exception><google-maps>","2","2","","",""
"4641680","1","5003403","","2011-01-09 20:48:21","2","11549","<p>I've tried to update the status using the Facebook graph API with Android <a href=""http://developers.facebook.com/docs/reference/api/status/"" rel=""nofollow"">http://developers.facebook.com/docs/reference/api/status/</a>So, my question is if you can give me some example code to update status using this API. </p>","569121","","881229","","2014-02-14 17:57:13","2014-02-14 17:57:13","Android Facebook Graph API to update status","<android><facebook><facebook-graph-api>","2","0","12","",""
"4641712","1","4691926","","2011-01-09 20:53:09","15","13205","<p>I have a Service and Broadcast Receiver in my application, but how do I launch the service directly from the Broadcast Receiver? using</p><pre><code>startService(new Intent(this, MyService.class));</code></pre><p>does not work in a broadcast receiver, any ideas?</p><p>Thanks!</p><p>EDIT:</p><blockquote>  <p>context.startService(..);</p></blockquote><p>works, I forgot the context part</p>","481082","","481082","","2011-01-09 21:23:32","2013-04-24 08:33:13","Starting Service from BroadcastReceiver","<android><broadcastreceiver>","2","0","2","",""
"4641745","1","4641875","","2011-01-09 20:59:16","0","88","<p>I've made my first android app :-) There's only one activity, and, on events, I modify the root view of the unique activity. My GUI is a series of views inside an unique activity.</p><p>Perhaps it's best to do one activity with only one root view, and, when I want to show another view, create and launch another activity, with only one general view ?</p><p>If so, how to do that ?</p><p>Thanks.</p>","312025","","19750","","2011-01-09 21:01:49","2011-01-09 21:18:15","Series of views or series of activity?","<android>","1","0","","",""
"4641799","1","4642628","","2011-01-09 21:07:54","2","1002","<p>I want as my application to be structured in 2 parts: the logic code and the UI.</p><p>I've tried to implement that using a controller class(here I keep the logic code) inside of each activity. The activity send messages to controller and receive the answer in two ways:</p><ol><li>the answer is returned immediately (if the action is not complex and it can be done in a verry short time)</li><li><p>the activity set some listeners and the controller fire this listener when the action is complete.</p><p>The problems appears when  the controller have a lot of objects(each object should handle a set of actions and for each action I have to set &amp; trigger a listener): it is hard to keep the code syncronized.</p><p>I'm asking if you know a better way to implement this mechanism.</p><p>Thank you.</p></li></ol>","217360","","","","","2011-01-09 23:52:33","How can I separate Logic/UI in Android","<android>","2","0","3","",""
"4641857","1","","","2011-01-09 21:15:08","0","130","<p>Am new to this and can`t get this bit of code to work on my virtual device. I get the following error message. Any input would be really useful.</p><pre><code>Errors:[2011-01-09 21:03:33 - Cat.Talker] Failed to install Cat.Talker.apk on device 'emulator-5554![2011-01-09 21:03:33 - Cat.Talker] (null)[2011-01-09 21:03:33 - Cat.Talker] Launch canceled!</code></pre><p>Cat.java:</p><pre><code>package cat.talker;import android.app.Activity;import android.os.Bundle;import android.media.AudioManager;import android.media.SoundPool;import android.os.Bundle;import android.view.View;import android.widget.Toast;public class Cat extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }public void playSound(View view) { // First parameter defines the number of channels which should be played // in parallel, last one currently not used SoundPool soundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0); int soundID = soundPool.load(this, R.raw.meow1, 1); // Getting the user sound settings AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); float actualVolume = (float) audioManager   .getStreamVolume(AudioManager.STREAM_MUSIC); float maxVolume = (float) audioManager   .getStreamMaxVolume(AudioManager.STREAM_MUSIC); float volume = actualVolume / maxVolume; soundPool.play(soundID, volume, volume, 1, 0, 1f);}}</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ImageViewandroid:id=""@+id/widget30""android:layout_width=""190px""android:layout_height=""136px""android:layout_x=""20px""android:layout_y=""12px""&gt;&lt;/ImageView&gt;&lt;Buttonandroid:id=""@+id/Meow1""android:layout_width=""197px""android:layout_height=""wrap_content""android:text=""Meow1""android:layout_x=""16px""android:layout_y=""161px""android:onClick=""playsound""&gt;&lt;/Button&gt;&lt;Buttonandroid:id=""@+id/Meow2""android:layout_width=""196px""android:layout_height=""40px""android:text=""Meow2""android:layout_x=""17px""android:layout_y=""221px""&gt;&lt;/Button&gt;&lt;Buttonandroid:id=""@+id/Meow3""android:layout_width=""195px""android:layout_height=""42px""android:text=""Meow3""android:layout_x=""17px""android:layout_y=""276px""&gt;&lt;/Button&gt;&lt;Buttonandroid:id=""@+id/Meow4""android:layout_width=""191px""android:layout_height=""40px""android:text=""Meow4""android:layout_x=""18px""android:layout_y=""337px""&gt;&lt;/Button&gt;&lt;/AbsoluteLayout&gt;</code></pre>","569138","","21234","","2011-01-09 21:19:12","2011-01-09 21:22:58","Package not installing on virtual device","<android><packages>","1","1","","",""
"4641966","1","4642519","","2011-01-09 21:33:19","2","950","<p>I'm a total noob and I'm trying to display a little submarine I built in a 3d modeling program in opengl (Blender). </p><p>The submarine is built using a long cylinder with a sphere intersecting on the end of it. </p><p>The problem that I'm getting is that when I look at the result, I can see the entire sphere through the cylinder. I can also see the end of the cylinder through the sphere. This appears when I have lighting on. I'm using ambient and diffuse lighting. I just want to see half the sphere on the outside of the cylinder and I don't want to see any innards.</p><p>I have face culling on and it removes the front faces of both objects, but I clearly see the sphere. </p><p>Below I pasted my onSurfaceCreated function where I set up all the opengl parameters. Any suggestions are appreciated!</p><pre><code>@Overridepublic void onSurfaceCreated(GL10 gl, EGLConfig config) {    //    gl.glEnable(GL10.GL_DEPTH_TEST);    //gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glEnable(GL10.GL_POLYGON_OFFSET_FILL);    gl.glEnable(GL10.GL_LIGHTING);    gl.glEnable(GL10.GL_LIGHT0);    // Define the ambient component of the first light    float[] light0Ambient = {0.1f, 0.1f, 0.1f, 1.0f};            gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, FloatBufferFromFloatArray(light0Ambient, 4));    // Define the diffuse component of the first light    float[] light0Diffuse = {0.7f, 0.7f, 0.7f, 1.0f};    gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, FloatBufferFromFloatArray(light0Diffuse, 4));    // Define the specular component and shininess of the first light    float[] light0Specular = {0.7f, 0.7f, 0.7f, 1.0f};    float light0Shininess = 0.4f;    //gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, FloatBufferFromFloatArray(light0Specular, 4));            // Define the position of the first light    float[] light0Position = {1.0f, 0.0f, 0.0f, 0.0f};    gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, FloatBufferFromFloatArray(light0Position, 4));     // Define a direction vector for the light, this one points correct down the Z axis    float[] light0Direction = {0.0f, 0.0f, -1.0f};    //gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPOT_DIRECTION, FloatBufferFromFloatArray(light0Direction, 3));    // Define a cutoff angle. This defines a 90° field of vision, since the cutoff    // is number of degrees to each side of an imaginary line drawn from the light's    // position along the vector supplied in GL_SPOT_DIRECTION above    //gl.glLightf(gl.GL_LIGHT0, gl.GL_SPOT_CUTOFF, 180.0f);    gl.glEnable(GL10.GL_CULL_FACE);    // which is the front? the one which is drawn counter clockwise    gl.glFrontFace(GL10.GL_CCW);    // which one should NOT be drawn    gl.glCullFace(GL10.GL_BACK);    gl.glClearDepthf(10f);    gl.glPolygonOffset(1.0f, 2);    initShape();    gl.glScalef(0.5f, 0.5f, 0.5f);}</code></pre>","417678","","44729","","2011-01-10 13:40:23","2013-01-31 19:11:36","Android and OpenGL - See object through another object","<android><opengl-es><light>","5","3","","",""
"4642038","1","","","2011-01-09 21:45:32","1","2829","<p>How can i make the keyboard disappears (by code) when i click outside the editable are like textbox in android ?</p>","508377","","508377","","2011-01-09 21:54:51","2013-02-14 06:25:51","How can we make keyboard disappears if we click outside the textbox in android?","<android>","1","2","1","2013-08-27 12:42:42",""
"4642125","1","","","2011-01-09 22:00:03","0","1250","<p>i want to add an icon to a specific contact upon it's _ID and link this icon action to my application.i need this icon appear when user open contacts and select this user to view, here i want to put myicon under ""Call cell"", like whatsapp icon for the registered contacts</p>","569160","","","","","2011-02-08 19:18:41","how to add icon to android contact that link to my application","<android>","1","0","","",""
"4642140","1","","","2011-01-09 22:04:45","4","1014","<p>I've implemented a PCM decoder that writes to an <code>AudioTrack</code> object. </p><p>Everything seems great, however, I need to get some sort of notification from the <code>AudioTrack</code> object when the last written chunk has stopped playing.</p><p>I've noticed that there are callback methods such as <code>setNotificationMarkerPosition,</code> however, I couldn't find any extensive documentation as how to use them.</p><p>Thanks in advance!</p>","109097","","1288","","2011-05-16 15:39:03","2011-05-25 01:11:22","Notification message from AudioTrack stream","<java><android><pcm>","1","1","2","",""
"4642417","1","4647172","","2011-01-09 22:57:06","0","1428","<p>I have a <code>ListActivity</code> which uses a <code>SimpleCursorAdapter</code> to display database content. I am  having problems getting the view refreshed when the underlying database changes.</p><p>As an experiment, I've added a call to <code>Cursor.requery()</code> in the activity's <code>onResume()</code>, for debugging, so all I have to do is flip to a different activity and back and it should force a refresh. I've also overridden <code>onContentChanged()</code>, for debugging. It transpires that <code>requery()</code> is being called, but this is not resulting in a call to <code>onContentChanged()</code>.</p><p>I suspect the cursor is using stale cached data. The operation which prompts the change actually involves wiping and replacing the whole database. Rather than simply requerying, I think I need to throw away the cursor and rebuild it from scratch.</p><p>I have tried closing and reopening the underlying database, in conjunction with <code>Cursor.requery()</code>, but the cursor doesn't seem to like having the db pulled from under its feet like this. (The list ends up empty.)</p><p>Edit: I've also tried calling <code>adapter.notifyDataSetChanged()</code> alongside the <code>requery()</code> in <code>onResume()</code>, but it makes no difference.</p><p>Any advice?</p>","385478","","385478","","2011-01-09 23:09:09","2011-01-10 13:10:37","Android: Cursor requery when replacing entire database","<android><database><listview><cursor><refresh>","2","0","0","",""
"4642465","1","4642882","","2011-01-09 23:08:01","0","1656","<p>Is there a way to display the values that were last entered values into an EditText field?  I currently am able to save the last entered values to my database and pre-populate the last used value into the field itself but I would like to show the list of values underneath the field when it is clicked on.</p>","22231","","22231","","2013-01-05 18:36:38","2013-01-05 18:36:38","Want to show last used values in Android text field","<android>","2","2","2","",""
"4642469","1","4642557","","2011-01-09 23:09:31","1","11481","<p>I want to be able to browse the files using android application and get the path of selected files. How can i do that ??</p>","508377","","","","","2013-03-27 14:13:53","How to browse files stored on android SD memory?","<android>","4","0","","",""
"4642481","1","","","2011-01-09 23:11:26","14","35758","<p>On the iPhone, a maps.google.com URL is intercepted and loaded by the native google maps application. I would like do the same on Android, but Google Maps is being loaded in the browser.</p><p>So, in a web page, is it possible to have this url <a href=""http://maps.google.com/maps?saddr=brighton&amp;daddr=timbuktu"">http://maps.google.com/maps?saddr=brighton&amp;daddr=timbuktu</a> open in the Android Google Map application ?</p><p>I see from <a href=""http://stackoverflow.com/questions/2662531/launching-google-maps-directions-via-an-intent-on-android"">this</a> question that you can do it from another app via an Intent. Can you trigger these Intent's from the browser ?</p><p><strong>Edit</strong> - On further testing, I've found that the user will be prompted to open the link in browser or map app for standard html links to maps.google.maps :</p><pre><code>&lt;a href=""http://maps.google.com/maps?saddr=brighton&amp;daddr=timbuktu""&gt;show route&lt;/a&gt;</code></pre><p>I'm having the problem because I'm using javascript to set the window.location.href via a Location API callback (so I can get the user's location and then open the map).  I've opened a <a href=""http://code.google.com/p/android/issues/detail?id=13888"">bug report</a> for this.</p>","156477","","156477","","2011-01-10 10:48:52","2013-10-15 16:35:18","Android - launch google map via web url","<android><browser><android-intent>","2","2","6","",""
"4642506","1","","","2011-01-09 23:20:03","0","219","<pre><code>Intent myIntent = new Intent(Main.this, Selected.class);</code></pre><p>Main.this.startActivity(myIntent);  myIntent.putExtra(""NAME"", ""yeah"");</p><p>when i want to retrieve the ""yeah"" in my other class it doesn't work :</p><pre><code>    test = (TextView)findViewById(R.id.test);    String myIntentString = icicle !=null? icicle.getString(""NAME""):null;    if(myIntentString==null){        Bundle extras = getIntent().getExtras();        myIntentString = extras != null ? extras.getString(""NAME"") : ""nothing passed in"";    }        test.setText(myIntentString);</code></pre>","439058","","","","","2011-01-10 03:13:00","My intent give me nothing ","<android><android-intent><bundle>","2","0","","",""
"4642670","1","4642811","","2011-01-09 23:59:34","3","4195","<p>I've been following the best practices for creating layouts for differing screen sizes as per this guide: <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>I've now come to doing some drawing work using methods of the Canvas class:</p><p>eg.   canvas.drawLine(60, 320, 120, 320, linePaint);</p><p>Can any one help with how I am supposed to make those pixel values (60/120/etc) in to density pixels so that the line is scaled correctly? Otherwise the line will not appear as I intend, it'll be too far down and too long on smaller screens for example.</p><p>Thanks for any replies.</p>","563718","","1140748","","2012-05-06 16:09:10","2012-05-06 16:09:10","Android: How to handle drawing with canvas methods on different screen sizes?","<android><canvas><pixels>","2","0","1","",""
"4642829","1","","","2011-01-10 00:39:53","7","4404","<p>I'm using Eclipse 3.6 (Helios) for mac os X. I downloaded from the Eclipse download page, unzip and put it in Applications folder. Then, i start the Eclipse and choose the workspace (the default, Documents/Workspace). After this, i tried to install new software by going to Help->Install New Software. The problem is that a error occur with the following message:""Cannot complete the request. This installation has not been configured properly for software update. See the error log for details.""</p><p>And the error log has:""Could not locate the running profile instance. The eclipse.p2.data.area and eclipse.p2.profile properties may not be set correctly in this application's config.ini file.""</p><p>I'm trying to do this because i wanna install ADT for android developments (and i can't perform the very first step of the ""how to"").</p><p>What i can do to fix this??</p><p>Thank you in advance</p>","569242","","","","","2011-08-31 04:26:52","Eclipse problem when install new software","<android><eclipse><adt><helios>","3","0","0","",""
"4642858","1","","","2011-01-10 00:49:12","1","831","<p>I'm building some sort of wizard to create user accounts in Sync and Manage account. I use a ViewFlipper my activity has to be an AccountAuthenticatorActivity. That said it also means I can't inherit PreferenceActivity. </p><p>So I looked up in the code of PreferenceActivity and I believe it should be possible to have a PreferenceView that inherit from ListView. The Activity part of PreferenceActivity isn't really needed as far as I know. </p><p>Though the PreferenceManager is what really blocks me.</p><pre><code>private PreferenceManager onCreatePreferenceManager() {    PreferenceManager preferenceManager = new PreferenceManager(this, FIRST_REQUEST_CODE);    preferenceManager.setOnPreferenceTreeClickListener(this);    return preferenceManager;}</code></pre><p>This function imply that we can instatiate PreferenceManager using the operator new. Apparently, the sdk hide the constructor of the PreferenceManager. I'm kind of confused. </p><p>Is there a way to inflate my preferences and display them without PreferenceActivity?</p>","54606","","","","","2012-12-04 08:14:10","How to display Preferences in a View","<android><preferences>","2","0","","",""
"4642878","1","4643769","","2011-01-10 00:55:19","0","874","<p>I have a mapView to which I add a MyLocationOverlay.  It displays fine when the app starts from scratch (goes through onCreate).  If I exit the app (back button) and then start it again (onResume), the overlay is gone.</p><p>I have tried to fix this for 10+ hours.  All sorts of messing with re-adding the overlay.  Resetting the overlays.  Changing the maps location so it's forced to redraw.  Trying to manually invalidate or force a redraw of the overlay.  NOTHING has worked.</p><p>From the way the code looks, the Overlay object exists and everything is working fine - but it's just not on the map. </p><p>Is anybody else having this problem?</p><p>(Droid Incredible, 2.2)</p>","569246","","","","","2011-01-10 04:50:57","MyLocationOverlay dissappears, is not there onResume","<android><google-maps><android-mapview><mylocationoverlay>","2","0","","",""
"4642914","1","","","2011-01-10 01:06:42","2","1325","<p>i was just wondering if there was a simple way to see if an application running on android is currently in full screen.  is there a way to query android to see if you're currently in full screen mode or something like that?</p>","436605","","","","","2013-10-13 20:51:01","Is there a way to determine if Android app is running full screen?","<android>","7","0","1","",""
"4642993","1","4643193","","2011-01-10 01:23:43","1","2974","<p>When my app first opens my first activity that is presented to the user can vary based on configuration options. I only know how to hard code the first activity that runs when the app is running by adding something like this in the Manifest</p><pre><code>&lt;activity android:label=""@string/app_name"" android:name="".MyFirstActivity""&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>Where MyFirstActivity is the class name of the first activity class to be run. How can I dynamically select which activity to run first when the app is first launched rather than hard code it in the manifest?</p><p>Thanks!</p>","467569","","","","","2011-01-10 02:19:39","Help with first Android Activity","<android><activity>","1","1","","",""
"4642995","1","4643086","","2011-01-10 01:23:48","2","675","<p>My pc is mac mini and I found that Eclipse is too slow.Is there another faster IDE different from Eclipse for android development?</p><p>Welcome any comment</p><p>Thanks</p><p>interdev</p>","262325","","","","","2011-01-10 02:42:11","Is there another IDE different from Eclipse for android development?","<android>","5","2","2","",""
"4643032","1","7801762","","2011-01-10 01:33:46","0","1100","<p>I have to following code to launch and the audio recorder on Android:</p><pre><code>final Intent recordSoundIntent = new Intent(""android.provider.MediaStore.RECORD_SOUND"");String fileName = Environment.getExternalStorageDirectory() +File.separator + UUID.randomUUID() + "".3gpp"";recordSoundIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(newFile(fileName)));startActivityForResult(Intent.createChooser(recordSoundIntent,getString(R.string.record_sound_chooser)), INTENT_SOUND_RECORDING);</code></pre><p>My problem is the following:</p><p>My filename (fileName) has no effect, the Uri returned fromdata.getData() returns in my last test run: content://media/external/audio/media/41.However, this file is created on my sdcard: recording34485.3gpp. If itis not possible to set custom location upon creating sound it is thelocation to this file I would like.</p>","354459","","827418","","2011-07-21 04:19:51","2011-10-18 20:52:01","Trouble set location to recorded audio","<android><audio><recorder>","1","1","","",""
"4643112","1","","","2011-01-10 01:53:13","0","82","<p>I've put a SeekBarPreference in my PreferenceScreen (xml), but the value isn't saved and also the default value isn't taken in account.The bar is always at zero.</p><p>Here the piece of code:</p><pre><code>&lt;PreferenceCategory        android:title=""mySettings""&gt;    &lt;SeekBarPreference            android:key=""m_set""            android:defaultValue=""210""            android:title=""Transparency""            android:max=""255""            android:summary=""Adjust..."" /&gt;&lt;/PreferenceCategory&gt;</code></pre><p>Any idea?Other stuff like CheckBoxPreference works fine.</p>","476846","","","","","2011-02-09 19:21:18","SeekBarProperties not working","<android><android-preferences>","1","0","","",""
"4643174","1","4643201","","2011-01-10 02:14:28","2","1468","<p>The <code>LocationManager</code> provides the method <a href=""http://developer.android.com/reference/android/location/LocationManager.html#removeProximityAlert%28android.app.PendingIntent%29"" rel=""nofollow"">removeProximityAlert(PendingIntent)</a>, but how does one remove a ProximityAlert (or simply all of them) when you no longer have a handle to the <code>PendingIntent</code>?  The GPS icon remains in the status bar, and I have set no expiration for the ProximityAlert.</p><p>Uninstalling the application that spawned it does not help.</p>","105137","","","","","2013-05-09 18:38:33","cancel all proximity alerts","<android>","1","0","1","",""
"4643290","1","","","2011-01-10 02:44:09","0","1431","<p>I was publishing my first APP but i have a problem, I have tested my app with a lot of AVD then i tested with my phone(Galaxy S) and with my girlfriend phone (Galaxy 5) before publishing, when i tried to publish i received a msg to specify an API level requirement.  then i put this code</p><pre><code> &lt;uses-sdk android:minSdkVersion=""4""               android:targetSdkVersion=""7""             /&gt;</code></pre><p>then i tested in the AVD and i had no problem, but when i publish and tested in my Galaxy S, i encountered a crazy layout of my app, i do no why, so i go back to the Eclipse and tested direct to my galaxy S and get the same error, so i take this part of the code out and then tried again in my galaxy S and the layout is all OK, so i`m probably doing some thing wrong. </p><p>Many Thanks Sorry my poor English i`m from Brazil.</p>","569305","","","","","2011-03-07 03:54:00","Problems with layout using <uses-sdk android:minSdkVersion - Android","<android><apk>","4","0","","",""
"4643320","1","4820931","","2011-01-10 02:52:42","9","2142","<p>I am trying to set the screen brightness from a widget.  We know this is easily possible since tons of widgets do this already, but how.....</p><p>In a service I call from the widget I do this to set the brightness:</p><pre><code>Settings.System.putInt(this.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 200);</code></pre><p>That works great except it does not ""refresh"" the screen to apply the new settings.  Turning the screen off and on does refresh the display settings, so we know that the code works.</p><p>I also read on several sites that something like this will refresh the screen, but we cannot use this since we are in a widget.  The widget activity and the service cannot use getWindow.</p><pre><code>WindowManager.LayoutParams lp = getWindow().getAttributes();lp.screenBrightness = 100 / 100.0f;getWindow().setAttributes(lp);</code></pre><p>How else are all these widgets like Beautiful Widgets, Power control, Extended controls, etc doing this?</p><p>Update:Another poster recommended kicking off an empty activity and executing the WindowManager refresh.  That works but it brings up an ugly black screen for a second.  Since the other widgets don't do this, there has to be a way to keep the ugly blank black screen from showing.</p>","242904","","242904","","2011-01-10 03:23:31","2012-10-14 11:35:51","Refreshing the display from a widget?","<android>","2","2","","",""
"4643666","1","4643681","","2011-01-10 04:24:01","0","347","<p>I am new to Android.can anyone tell me about Android that how can we run sample application on eclipse in android.while i run emulator opens but nothing is displayed on the screen.Even HelloWorld Application is also not runnning. </p><p>My setup appears to be correct, I verified again.</p>","244523","","","","","2011-01-10 04:26:21","Android basic question","<android>","1","1","","",""
"4643676","1","","","2011-01-10 04:25:26","2","1253","<p>I use my custom implementation tabhost. Create a new activity as follows:</p><pre><code>public class TabsActivityGroup extends ActivityGroup {  //  //...  //  private void startGroupActivity(String activityID, Intent activityIntent) {    final LocalActivityManager localActivityManager = getLocalActivityManager();    Window window = localActivityManager.startActivity(activityID, activityIntent);    // after call destroy activity window equals null on android 1.6 (emulator). Why?    // on android 2.2 window not equal null    if (window != null) {     View view = window.getDecorView();     tabsContentFrameLayout.addView(view, new ViewGroup.LayoutParams(     ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));    }  }  //  //...  //}</code></pre><p>But after call destroy activity:</p><pre><code> getLocalActivityManager().destroyActivity(className, true);</code></pre><p>I'm trying to make call to start activity,  but get window equal null from this code:</p><pre><code>Window window = localActivityManager.startActivity(activityID, activityIntent);</code></pre><p>On a device with firmware 2.1 (Hero) and 2.2 (Desire) works all good, but on emulator with android platform not work ;(</p><p>Now I am studying source code android platform 2.2, to understand why window equal null.</p><p>I will be glad of any help.</p><p><strong>Temporary solution:</strong></p><pre><code>public static boolean isEmulator(Context context) {                                                                      TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);      final String deviceId = telephonyManager.getDeviceId();                                                          if (deviceId == null) return true;                                                                               if (CommonHelper.isNotNull(deviceId) &amp;&amp; deviceId.equals(NULL_IMEI)) {return true;} else { return false;}}if (!isEmulator(this)) {     getLocalActivityManager().destroyActivity(className, true);}</code></pre>","396628","","396628","","2011-01-22 16:45:15","2011-01-22 16:45:15","Start activity did not work for android emulator","<java><android><activity><group>","1","0","","",""
"4643694","1","","","2011-01-10 04:29:32","1","830","<p>I am making an app that handles SMS messaging and I'd like that as well as allowing the user to type in the number they want the SMS sent to, for a fixed number to be there already so that the SMS gets sent there too. This is the XML of my app:</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=""Enter the phone number of recipient""    /&gt;    &lt;EditText         android:id=""@+id/txtPhoneNo""          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""                /&gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""                 android:text=""Message""        /&gt;         &lt;EditText         android:id=""@+id/txtMessage""          android:layout_width=""fill_parent""         android:layout_height=""150px""        android:gravity=""top""                 /&gt;              &lt;Button         android:id=""@+id/btnSendSMS""          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:text=""Send SMS""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>Here's my Java code, also I'm using some deprecated classes that I intend to change but haven't done so so far any recommendation on those is appreaciated as well =)</p><pre><code>public class SMS extends Activity {    Button btnSendSMS;    EditText txtPhoneNo;    EditText txtMessage;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                btnSendSMS = (Button) findViewById(R.id.btnSendSMS);        txtPhoneNo = (EditText) findViewById(R.id.txtPhoneNo);        txtMessage = (EditText) findViewById(R.id.txtMessage);        btnSendSMS.setOnClickListener(new View.OnClickListener(){            public void onClick(View v){                                String phoneNo = txtPhoneNo.getText().toString();                String message = txtMessage.getText().toString();                                 if (phoneNo.length()&gt;0 &amp;&amp; message.length()&gt;0)                                    sendSMS(phoneNo, message);                                else                    Toast.makeText(getBaseContext(),                         ""Please enter both phone number and message."",                         Toast.LENGTH_SHORT).show();            }        });            }  //---sends an SMS message to another device---    @SuppressWarnings(""deprecation"")    private void sendSMS(String phoneNumber, String message)    {                String SENT = ""SMS_SENT"";        String DELIVERED = ""SMS_DELIVERED"";        PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,            new Intent(SENT), 0);        PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,            new Intent(DELIVERED), 0);        //---when the SMS has been sent---        registerReceiver(new BroadcastReceiver(){            @Override            public void onReceive(Context arg0, Intent arg1) {                switch (getResultCode())                {                    case Activity.RESULT_OK:                        Toast.makeText(getBaseContext(), ""SMS sent"",                                 Toast.LENGTH_SHORT).show();                        break;                    case SmsManager.RESULT_ERROR_GENERIC_FAILURE:                        Toast.makeText(getBaseContext(), ""Generic failure"",                                 Toast.LENGTH_SHORT).show();                        break;                    case SmsManager.RESULT_ERROR_NO_SERVICE:                        Toast.makeText(getBaseContext(), ""No service"",                                 Toast.LENGTH_SHORT).show();                        break;                    case SmsManager.RESULT_ERROR_NULL_PDU:                        Toast.makeText(getBaseContext(), ""Null PDU"",                                 Toast.LENGTH_SHORT).show();                        break;                    case SmsManager.RESULT_ERROR_RADIO_OFF:                        Toast.makeText(getBaseContext(), ""Radio off"",                                 Toast.LENGTH_SHORT).show();                        break;                }            }        }, new IntentFilter(SENT));        //---when the SMS has been delivered---        registerReceiver(new BroadcastReceiver(){            @Override            public void onReceive(Context arg0, Intent arg1) {                switch (getResultCode())                {                    case Activity.RESULT_OK:                        Toast.makeText(getBaseContext(), ""SMS delivered"",                                 Toast.LENGTH_SHORT).show();                        break;                    case Activity.RESULT_CANCELED:                        Toast.makeText(getBaseContext(), ""SMS not delivered"",                                 Toast.LENGTH_SHORT).show();                        break;                                        }            }        }, new IntentFilter(DELIVERED));                SmsManager sms = SmsManager.getDefault();        sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);            } }</code></pre>","28586","","","","","2014-01-06 13:09:05","How can I set a fix phone number in an Android app","<android><sms>","3","0","","",""
"4643806","1","4643848","","2011-01-10 04:59:59","0","2976","<p>how can we insert symbol of copyright in application programatically?? if possible then please provide me example</p>","432559","","","","","2011-01-10 05:08:40","how can we insert symbol of copyright in application programatically?","<android>","2","1","","2012-11-20 02:22:44",""
"4643850","1","4644010","","2011-01-10 05:09:04","8","5196","<p>I have a problem with AlarmManager, I set the code for scheduling a repeating alarm and after I run the application, the alarm runs fine. Even if I click on Home button (and the application is paused), the alarm still runs on its interval.</p><p>The problem is if I open the Task Manager and force close the application, then the alarm stops from running.</p><p>Is this a normal behavior, is there any way to avoid this and keep the alarm running after closing the application?</p><p>The code is below - the method is called by the ApplicationContext class, onCreate().</p><pre><code> private void scheduleAlarm() {  if (alarmScheduled == true) { return; } // we only need to schedule once.  int alarmInterval = Def.pref(getApplicationContext()).getInt(""alarmInterval"", 30);  final Intent intent = new Intent(getApplicationContext(), CollectorAlarmReceiver.class);  final PendingIntent pending = PendingIntent.getBroadcast(getApplicationContext(), 0, intent, 0);  AlarmManager alarmMgr = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE);  alarmMgr.cancel(pending); // cancel others.  alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+1000,    alarmInterval*1000, pending);  Def.log(TAG,""scheduleAlarm(): alarm scheduled, interval: ""+alarmInterval+"" seconds"");  alarmScheduled = true; }</code></pre><p>Receiver code:</p><pre><code>public void onReceive(Context context, Intent intent) {    Log.i(TAG, ""CollectorAlarmReceiver invoked, starting CollectorService in background"");    context.startService(new Intent(context, CollectorService.class));    Intent collectorService = new Intent(context,CollectorService.class);    collectorService.putExtra(""action"", CollectorService.ACTION_BACKGROUND_REQUEST_MESSAGES);    context.sendBroadcast(collectorService);}</code></pre><p>Thanks!</p>","569380","","569380","","2011-01-10 06:52:19","2014-03-08 18:44:48","Android alarm is cancelled after closing the application","<android><alarmmanager>","5","3","2","",""
"4643920","1","4643977","","2011-01-10 05:25:17","0","529","<p>I have developed an application on android.I have used Map overlay class in application.When i try to install the application its showing in console<br>[2011-01-10 10:39:38 - GeoTourProject] Uploading GeoTourProject.apk onto device 'emulator-5554'[2011-01-10 10:39:39 - GeoTourProject] Installing GeoTourProject.apk...[2011-01-10 10:39:45 - GeoTourProject] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY[2011-01-10 10:39:45 - GeoTourProject] Please check logcat output for more details.[2011-01-10 10:39:45 - GeoTourProject] Launch canceled!Can anybody tell me how to proceed with it?Thanks in advance</p>","475349","","","","","2011-01-10 05:40:25","Application not installing on android emulator","<android>","2","2","","",""
"4643930","1","4643957","","2011-01-10 05:26:54","1","481","<p>I am working on an application in android. Where I need to use menu through out application. Actually it will be used for navigating within application from one activity to other and so on... I am  wondering that it will need to write <strong>onOptionMenuCreat</strong> and <strong>OnOptionMenuSelect</strong> methods in each activity. <strong>Also if I make one parent activity where these two methods could be written even then on each activity Option Menu will be created again.</strong> So handling same menu while it is created again is becoming work of afaik. Any good design suggestions are most welcomed. Another very important thing how to map that user was on witch activity last time while selecting same menu again. My app has total five menu options so that means there are five different ways to move within application simultaneously.</p><p>Please Do tell me solution for both issues. Thank You.</p>","569375","","","","","2011-01-10 05:33:19","How to Use Menu in Complete Application in Android","<android><menu><navigation>","1","0","","",""
"4643971","1","4644345","","2011-01-10 05:37:28","2","3314","<p>I have a gallery in my app, is there a way change the position of it? </p><p>I tried <code>android:gravity=""center""</code> but that did nothing. Cant get the gallery to move.</p><p>Also can the gallery be made bigger? By an exact size too? I don't want it to be fullscreen but i do want it to be bigger than it normally is. Close to fullscreen. Nothing i've done has changed it.</p><p>Any ideas?Thanks in advance.</p>","565672","","","","","2011-01-10 19:05:45","Android - Change position and size of gallery?","<android>","1","0","","",""
"4644006","1","4644068","","2011-01-10 05:43:40","1","120","<p>Some say it doesnt start on their HTC Hero, another says it doesnt open in their Cliq, etc.  I built the entire app using my Droid X to debug.  Now that the app is released, and the code is interacting with so many different types of hardware, how do I figure out what may be going wrong for these users?</p><p>In my Crash errors log I have one record of a crash, and I believe I've already fixed this.  It was certainly not responsible for the crashes that users are complaining about.</p>","216363","","","","","2011-01-10 05:57:47","My App works perfectly on my Droid X, reviewers complain of crashes on other devices - how to debug?","<android-emulator><android>","2","0","","",""
"4644162","1","4644344","","2011-01-10 06:11:21","1","252","<p>I just finished the NotepadV1-3 tutorial for Android apps, and I was thinking of creating my own inventory app for fun, which for now basically consists of a list of names (such as ""DVD"" or ""Grocery""), each of which can be clicked, which will bring up another specific list associated with that name. However, with the SQLiteDatabase.insert(..) method, the ContentValue can only take (among many others) ""String, String"" as argument, and I can't figure out how to input into the database a list of Strings associated with a particular key. I'm having trouble researching on how to resolve this as I am not that familiar with SQL.</p><p>What would be the best way to store a key with its associated list of Strings?</p><p>Any pointers and suggestions are appreciated!</p><p>Android newb :[</p>","569421","","457982","","2011-01-10 06:19:57","2011-01-10 19:37:38","Beginning android: how to map a string to a list","<android><string><list><key>","1","0","","",""
"4644217","1","","","2011-01-10 06:24:46","1","716","<p>I need to read files from sdcards to display on emulator.I've to split text files,image files,video files separately .when i click any file,its contents have to play or display.How could i do that.?Thanks in adv.</p>","555948","","199972","","2012-06-25 08:48:01","2012-06-25 08:48:01","Reading data from sdcard in android","<android><android-sdcard>","0","1","","",""
"4644239","1","4646417","","2011-01-10 06:28:34","2","4804","<p>From last 5 days I am search for a best working pice of code for twitter in android using OAuth... I found a lot. But not a single 1 is running perfectly. Any how i get some code. Its working but I have a problem. I am wondring what I have to write in  String callBack = ""?"" so that my android browser redirect me to my application back instead of staying there after authentication..  If I am not using a CallBack and use <strong>OAuth.OUT_OF_BAND</strong> then browser show  a pin code and dose not redirect browser back to my application. Please Help me to let me know what I am doing wrong.</p><p>Here my code goes</p><pre><code>package com.example.tweeter;import oauth.signpost.OAuth;import oauth.signpost.OAuthProvider;import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;import oauth.signpost.commonshttp.CommonsHttpOAuthProvider;import oauth.signpost.exception.OAuthCommunicationException;import oauth.signpost.exception.OAuthExpectationFailedException;import oauth.signpost.exception.OAuthMessageSignerException;import oauth.signpost.exception.OAuthNotAuthorizedException;import org.apache.http.client.HttpClient;import org.apache.http.impl.client.DefaultHttpClient;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;public class Tweeter extends Activity {    private String CONSUMER_KEY = ""CONSUMER_KEY"";    private String CONSUMER_SECRET = ""CONSUMER_SECRET"";    private static final Uri CALLBACK_URI = Uri.parse(""PicPuzzle://tkxel"");    private String CALLBACK_URL = ""PicPuzzle://tkxel"";    OAuthProvider provider ;    CommonsHttpOAuthConsumer consumer ;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        consumer = new CommonsHttpOAuthConsumer(                CONSUMER_KEY, CONSUMER_SECRET);        provider = new CommonsHttpOAuthProvider(                ""http://twitter.com/oauth/request_token"",                ""http://twitter.com/oauth/access_token"",                ""http://twitter.com/oauth/authorize"");        provider.setOAuth10a(true);        HttpClient client = new DefaultHttpClient();        String authUrl = ""http://www.yahoo.com"";        try {            //This line work perfect but it not redirect me to my application            authUrl = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND);            //I want to send a calll back but It give exception            ///***  authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URI.toString());        } catch (OAuthMessageSignerException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (OAuthNotAuthorizedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (OAuthExpectationFailedException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (OAuthCommunicationException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));    }    @Override    protected void onResume() {        // this must be places in activity#onResume()          Uri uri = this.getIntent().getData();          if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK_URL)) {              String verifier = uri.getQueryParameter(""oauth_verifier"");              // this will populate token and token_secret in consumer              try {                provider.retrieveAccessToken(consumer, verifier);            } catch (OAuthMessageSignerException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (OAuthNotAuthorizedException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (OAuthExpectationFailedException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (OAuthCommunicationException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }          }          super.onResume();    }}</code></pre><p>And my <strong>AndroidManifest.xml</strong> look like this</p><pre><code>&lt;uses-permission    android:name=""android.permission.INTERNET""/&gt;&lt;application    android:icon=""@drawable/icon""    android:label=""@string/app_name""&gt;    &lt;activity        android:name="".Tweeter""        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;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=""PicPuzzle""            android:host=""tkxel""        &gt;&lt;/data&gt;    &lt;/intent-filter&gt;&lt;/application&gt;&lt;uses-sdk    android:minSdkVersion=""7""/&gt;`enter code here`</code></pre>","486139","","652738","","2011-09-17 16:41:39","2012-03-13 19:46:25","How I can call back in Android using OAuth for Twitter?","<android><callback><twitter-api><twitter-oauth>","1","0","1","",""
"4644242","1","","","2011-01-10 06:29:28","0","255","<p>i am trying to create a DatePickerDialog in the class 'dateDisplay.class'. I am calling this activity from 'main.class'. If I call the 'dateDisplay.class' using startActivity(), then the DatePickerDialog works fine. But actually I am using an ActivityGroup (for using tab in my application) and I am starting the 'dateDisplay.class'  using the following code :</p><pre><code>    Intent dateIntent=new Intent(context,dateDisplay.class);    View v=getLocalActivityManager().startActivity(""2"",dateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();    setContentView(v);</code></pre><p>But an exception is caught, on calling the  onCreateDialog() function. And  the process is suddently stopped. It shows TargetInvocationException is occured. How can I correct the code?Following is my code:</p><pre><code>public  Dialog onCreateDialog(int id,Bundle b)     {       Calendar c=Calendar.getInstance();       int day=c.get(Calendar.DAY_OF_MONTH);       int month=c.get(Calendar.MONTH);       int year=c.get(Calendar.YEAR);       Dialog d = null;       if(id==DATE_DIALOG_ID)       {          return    new DatePickerDialog(this,dateChangeListener,year,month,day);        }       else       {               return null;         }     }</code></pre><p>Please help me..Thank you..</p>","523058","","523058","","2011-01-10 06:49:24","2011-02-01 10:12:59","Exception in DatePickerDialog","<android><exception><datepicker>","1","3","","",""
"4644348","1","4644384","","2011-01-10 06:48:21","7","6060","<p>actually i am new in Android and now i have to add the cookies in my project. i am using HttpsUrlConnection. here is how i am making request and getting response from a webserver and now i have to add cookies aswell.</p><pre><code>   URL url = new URL(strUrl); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod(""POST"");     connection.setRequestProperty(""Content-Type"",     ""application/soap+xml; charset=utf-8"");    connection.setRequestProperty(""Content-Length"", """"+              Integer.toString(request.getBytes().length));    connection.setUseCaches (false);    connection.setDoInput(true);    connection.setDoOutput(true);    // send Request...    DataOutputStream wr = new DataOutputStream (connection.getOutputStream()); wr.writeBytes (request); wr.flush (); wr.close (); //Get response... DataInputStream is = new DataInputStream(connection.getInputStream());     String line; StringBuffer response = new StringBuffer();  while((line = is.readLine()) != null) {    response.append(line);  } is.close(); FileLogger.writeFile(""Soap.txt"", ""RESPONSE: "" + methodName + ""\n"" + response); HashMap&lt;String, String&gt; parameters = null; try {   parameters = SoapRequest.responseParser(response.toString(), methodName);  } catch (ParserConfigurationException e) {  // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) {  // TODO Auto-generated catch block  e.printStackTrace(); } return parameters;</code></pre><p>any help will be appreciative, thanks</p>","397901","","","","","2011-01-10 06:55:10","how to use cookies in HttpsURLConnection in android","<android><cookies><https>","1","0","4","",""
"4644351","1","","","2011-01-10 06:49:46","1","1787","<p>I want to create an music track visualization for an music player application which should look like as below:</p><p><img src=""http://i.stack.imgur.com/avlXc.png"" alt=""alt text"">  </p><p>You can see in the above image that there is an equalizer kind of view and it should vary as the music track is played.</p><p>I need to know the right way to achieve the above visualization, which API to use, etc.</p>","466549","","15168","","2013-10-02 03:59:35","2013-10-02 03:59:35","Android: Music track visualization","<android><visualization><music><player>","1","0","0","",""
"4644394","1","4649258","","2011-01-10 06:57:42","0","759","<p>I tried to make a demo of opengles 2.0 by using android ndk,<br>Logcat showed the error information ""libesl called unimplement opengl es API"".<br>Why?<br>I'm following OpenGL ES 2.0 Programming Guide's first example.<br>Regards,</p>","542792","","","","","2011-09-29 07:07:23","""libesl called unimplement opengl es API""","<android><android-ndk><opengl-es>","2","0","","",""
"4644429","1","4644492","","2011-01-10 07:04:20","2","1106","<p>do anyone know how i know when the keyboard is close? Thanks</p>","508197","","","","","2011-01-10 07:14:00","android keyboard press back to close","<android>","1","0","","",""
"4644449","1","4644546","","2011-01-10 07:07:17","0","1678","<p>I am developing an Android app. It has a login page in which I have to do session management for users and give each time <code>sessionid</code> for each time.</p>","544537","","1128737","","2012-01-13 13:13:20","2012-01-13 13:13:20","Android login app","<android>","1","2","0","",""
"4644634","1","4695318","","2011-01-10 07:39:47","3","6850","<p>I need to know how to detect if the user can't scroll anymore in a webView. I want to generate an action when the user swipes to the left or right, but only if the user can't scroll:</p><pre><code>IF the user swipes to the left AND the webview can't scroll to left THEN do somethingELSE let the webview scroll</code></pre>","569486","","1586312","","2013-01-29 23:36:49","2013-01-29 23:36:49","Android webview : detect scroll","<android><webview><scroll>","2","0","4","",""
"4644666","1","4646829","","2011-01-10 07:45:34","0","4383","<p>I am trying to learn to make a simple app that has a few buttons with each opening another app to eliminate the need for another apps. I just can't figure it out. Also, can I place more than one button in this activity to open another app? I can't really find that answer either. </p><pre><code>Button batteryhistory = (Button)findViewById(R.string.BatteryHistoryButtonDialog);    batteryhistory.setOnClickListener(new View.OnClickListener() {      @Override      public void onClick(View view) {      Intent i = new Intent();        ComponentName n = new        ComponentName(""com.android.settings"",        ""com.android.settings.BatteryHistory"");        i.setComponent(n);        startActivity(i);</code></pre><p>Thanks so much for the help :D</p>","569503","","569503","","2011-01-10 08:20:11","2014-02-27 04:24:18","How to make a button open another app with Java/Android?","<java><android>","2","1","1","",""
"4644680","1","4644715","","2011-01-10 07:48:36","0","478","<p>All.I want to draw a chart in my apps.I used the google's jar,but the jar too simple.Do you know some other third-party jar like this to draw a chart? it must be draw a complex 2D line chart,can control the x and y coordinate‘s value </p>","549576","","","","","2012-04-22 08:16:19","I want to draw a chart in my apps","<android>","1","2","1","",""
"4644683","1","","","2011-01-10 07:49:05","0","636","<p>I'm doing steganography on Android.  My code is as follows:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.src);    picw = mBitmap.getWidth();    pich = mBitmap.getHeight();    pix= new int[picw * pich];    mBitmap.getPixels(pix, 0, picw, 0, 0, picw, pich);try {                      FileOutputStream fos = super.openFileOutput(""dest.png"", MODE_WORLD_READABLE);       mBitmap.compress(CompressFormat.PNG, 100, fos);       fos.flush();                   fos.close();                }catch (Exception e) {             tv.setText(e.getMessage());    } </code></pre><p>My problem is that whenever I save source image with the <code>Bitmap.compress()</code> method, the <code>pix[0]</code> value changes during compression, so I'm unable to extract original data.  How can I fix this?</p>","568796","","2572285","","2013-07-30 12:21:58","2013-07-30 12:21:58","android steganography","<android><steganography>","1","4","","",""
"4644829","1","","","2011-01-10 08:19:48","2","5042","<p>I have a listview with custom BaseAdapter and each row contains a checkbox and three textviews. I am using Layoutinflater to inflate this row from a xml file. However, everytime I check one checkbox, many other checkboxes get checked in the whole list, whereas the original checkbox I wanted to check sometimes gets checked itself, and sometimes it does not. </p><p>Every time a user selects a checkbox, I am storing that checkbox's attached unique value in a collection. Next time the getView method is called, I manually check/uncheck the checkbox before returning the view inside getView() based on if the checkbox's value was already in the collection or not. But despite doing this, it is still marking off those checkboxes, even though the checkedchangelistener for those checkboxes is not firing up. I am doubtful this due to views getting reused in getView, but dont know what is a good way to get this whole thing to work.</p>","553267","","","","","2014-01-26 10:23:37","Checkboxes in android listview having problem","<android><listview><checkbox>","2","2","3","",""
"4644924","1","","","2011-01-10 08:36:33","1","509","<p>Hi How to play media file in an application.I am trying it with the following code but do not know why it is not working for me</p><pre><code>player= new MediaPlayer().create(context, R.raw.lonely);player.start();player.release();</code></pre><p>Help me.Thanks in advance.</p>","555688","","118587","","2011-01-10 08:39:11","2011-01-10 09:07:24","How to play media?","<android>","3","0","1","",""
"4645017","1","4645601","","2011-01-10 08:51:56","0","415","<p>Does anyone know if you can install an apk inside of another apk's storage space? My goal is to create an application which can ""house"" other applications inside of itself. Or possibly if one application can get the INSTALL_PACKAGES permission (which I believe is reserved by SYSTEM?) could it install applications in a specific location on the device or the SD card?</p>","569531","","","","","2011-01-10 11:14:45","Can Android application install another application inside of it's own storage space?","<android><mobile><adb>","2","0","","",""
"4645038","1","","","2011-01-10 08:55:46","1","73","<p>when mobile boot up complete services is going on background and send a mobile imei number through sms </p>","569550","","","","","2011-01-10 09:34:05","In android how to create a background servies","<android>","2","0","","",""
"4645076","1","","","2011-01-10 09:01:13","0","386","<p>When my keyboard is open and i press on the back key to close the keyboard how can i know if the keyboard was close?</p>","508197","","","","","2011-01-10 09:06:36","Keyboard issue - back press","<android>","1","0","","",""
"4645119","1","4645278","","2011-01-10 09:06:11","35","36893","<p>I have an <code>edittext</code> in which I want only integer values to be inserted. Can somebody tell me which property I have to use?</p>","566590","","2102225","","2013-07-20 18:21:37","2014-02-11 00:20:52","how to set only numeric value for edittext in android?","<android><android-edittext>","4","0","6","",""
"4645149","1","4645187","","2011-01-10 09:10:17","1","1951","<p>hi all :)I was studying a piece of source code from the original PowerControl Widget (<code>SettingsAppWidgetProvider</code>) and I've found the following methods:</p><pre><code>    @Override    public void onEnabled(Context context) {        PackageManager pm = context.getPackageManager();        pm.setComponentEnabledSetting(new ComponentName(""com.android.settings"",                                        "".widget.SettingsAppWidgetProvider""),                                        PackageManager.COMPONENT_ENABLED_STATE_ENABLED,                                        PackageManager.DONT_KILL_APP);    }    @Override    public void onDisabled(Context context) {        Class clazz = com.android.settings.widget.SettingsAppWidgetProvider.class;        PackageManager pm = context.getPackageManager();        pm.setComponentEnabledSetting(new ComponentName(""com.android.settings"",                                        "".widget.SettingsAppWidgetProvider""),                                        PackageManager.COMPONENT_ENABLED_STATE_DISABLED,                                        PackageManager.DONT_KILL_APP);    }</code></pre><p>Can someone explain me what they do exactly??thanks in advance for all the answers :)</p><p>edit: I'm sorry my question was bad formulated..I know when they are called but I can't understand what the <code>setComponentEnabledSetting</code> pair do :D</p>","167194","","167194","","2011-01-10 09:20:56","2011-01-10 09:21:23","onEnabled/onDisabled methods with ""setComponentEnabledSettings"" understanding","<android><android-widget>","1","0","","",""
"4645176","1","","","2011-01-10 09:14:11","1","754","<p>I have a small app which is the client running on Android emulator. Server (small Java app in Eclipse) keeps sending strings. Client will receive these strings and display an image if a string in the correct format and right contents is received.</p><p>I send two strings-one with wrong content and the other with correct content. Both strings are received. For the string with wrong content, the appropriate message is shown. But when the string with correct content is received, an image is supposed to be shown. But this doesn't happen. I get a warning ""Activity pause timeout for HistoryRecord"" and then error.</p><p>Code and LogCat below.</p><p>Please help me with this.</p><p>Thank you for time spent and efforts put on this.</p><p>Cheers,Madhu </p><p>Main activity</p><pre><code>public class TCPListen extends Activity implements TCPListener { private TextView mTitle;    /** Called when the activity is first created. */  @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            //setContentView(R.layout.main);         // Set up the window layout          requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);          setContentView(R.layout.main);          getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);          // Set up the custom title          mTitle = (TextView) findViewById(R.id.title_left_text);          mTitle.setText(R.string.app_name);          mTitle = (TextView) findViewById(R.id.title_right_text);          TcpServiceHandler handler=new TcpServiceHandler(this);            handler.execute(""192.168.62.23"");        }        public void callCompleted(String tempStr){         String source = tempStr;         //Log.d(""TCP"", ""C: In the main"" + "" "" + source);       mTitle.setText(source);       if(source.matches(""&lt;MSG&gt;&lt;N&gt;.*&lt;!N&gt;&lt;V&gt;.*&lt;!V&gt;&lt;!MSG&gt;"")) {                   //mTitle.setText(source1);            //tempStr = """";            //String source = ""&lt;MSG&gt;&lt;N&gt;shiftDirection&lt;!N&gt;&lt;V&gt;1&lt;!V&gt;&lt;!MSG&gt;"";               // Match characters lying before message name            String find1 = ""&lt;MSG&gt;&lt;N&gt;"";                 // Match characters lying before message value            String find2 = "".*&lt;!N&gt;&lt;V&gt;"";                 // Mask the characters by replacing them with blank space            String replace = """";            // Mask the characters lying before message name            Pattern pattern = Pattern.compile(find1);            Matcher matcher = pattern.matcher(source);            String output = matcher.replaceAll(replace);            // Split the message and extract message name            String name1[] = output.split(""&lt;!N&gt;"");            String msgName = name1[0];            //Log.i(TAG, ""Message name is"" + msgName);            //Mask the characters lying before message value            Pattern pattern1 = Pattern.compile(find2);            Matcher matcher1 = pattern1.matcher(output);            String output1 = matcher1.replaceAll(replace);            //Split the remaining message and extract message value            String val1[] = output1.split(""&lt;!V&gt;"");            String actVal = val1[0];            //Log.d(""TCP"", msgName);                 //Pass the message name and value for further action                   double msgValue = Integer.parseInt(actVal);                   actionOnData(msgName, msgValue);                 } else Log.i(""TCP"", ""Wrong message"" + source);      }    //Function to display driver messages/images based on individual messages      public void actionOnData(String name, double value) {       String tempName = name;       double tempVal = value;                //while (true) {        if(tempName.equals(""shiftDirection"") &amp;&amp; tempVal == 1) {         Log.d(""TCP"",""C: "" + tempName + "" "" + tempVal);                           Intent myIntent = new Intent();               myIntent.setClassName(""com.example.android.TCPListen"", ""com.example.android.TCPListen.Images"");               //myIntent.putExtra(""Change gear"", ""Shift to next gear!""); // key/value pair, where key needs current package prefix.               startActivity(myIntent);                       } else Log.d(""TCP"", ""Just show an image"");       //}      }}</code></pre><p>Interface</p><pre><code>package com.example.android.TCPListen;public interface TCPListener { public void callCompleted(String msg);}</code></pre><p>Async Task</p><pre><code>public class TcpServiceHandler extends AsyncTask&lt;String, Integer, ArrayList&lt;String&gt;&gt;{        TCPListener _listener;        public TcpServiceHandler(TCPListener listener){            _listener=listener;        }        //@Override        //protected void onPreExecute() {            //you may wish to show a wait screen here        //}                @Override        protected ArrayList&lt;String&gt; doInBackground(String... params) {            //you should do the desktop app connectivity part here         ArrayList&lt;String&gt; StrArr = new ArrayList&lt;String&gt;();          String str = """";         //String str = """";          //while (true) {          try{                         //response=//stream received from desktop app             InetAddress serverAddr = InetAddress.getByName(""192.168.62.23"");           Log.d(""TCP"", ""C: Connecting..."");           Socket socket = new Socket(serverAddr, 1200);           Log.d(""TCP"", ""C: Receiving..."");           //char[] buffer = new char[1024];           //int bytes;              //String end = ""&lt;!MSG&gt;"";              //StringBuilder curMsg = new StringBuilder();                try {                 for(int i = 0; i &lt; 100; i++) {                       BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));                                              StrArr.add(in.readLine());                       //while(str != null) {                       //   StrArr.add(str);                       //}                       //StrArr.add(str);                       //return str;                  }                       //return str;                       //Pass str to main activity for parsing                       //mHandler.obtainMessage(TCPIPCommn.INCOMING_MESSAGE, str).sendToTarget();                                         } catch(Exception e) {                      Log.d(""TCP"",""C: Error"", e);                         e.printStackTrace();                     } finally {                      socket.close();                      Log.d(""TCP"",""C: Done danaadan."");                     }                          }            catch(Exception e){}                     return StrArr;                      //return str;                 //}        }          @Override        protected void onPostExecute(ArrayList&lt;String&gt; responseMessage) {                 //notify your activity that you have received message from desktop app        for (int i = 0; i &lt; responseMessage.size(); i++) {        String RetStr = responseMessage.get(i);        _listener.callCompleted(RetStr);        try {     Thread.sleep(5000);    } catch (InterruptedException e) {     Log.d(""TCP"",""C:Wait error"", e);     e.printStackTrace();    }       }      }    }</code></pre><p>![alt text][1]</p><pre><code>01-10 14:06:30.258: DEBUG/AndroidRuntime(340): &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;01-10 14:06:30.258: DEBUG/AndroidRuntime(340): CheckJNI is ON01-10 14:06:30.457: DEBUG/AndroidRuntime(340): --- registering native functions ---01-10 14:06:31.728: DEBUG/dalvikvm(236): GC_EXPLICIT freed 85 objects / 4160 bytes in 137ms01-10 14:06:31.796: DEBUG/PackageParser(58): Scanning package: /data/app/vmdl72299.tmp01-10 14:06:31.966: INFO/PackageManager(58): Removing non-system package:com.example.android.TCPListen01-10 14:06:31.966: INFO/ActivityManager(58): Force stopping package com.example.android.TCPListen uid=1003701-10 14:06:32.197: DEBUG/PackageManager(58): Scanning package com.example.android.TCPListen01-10 14:06:32.207: INFO/PackageManager(58): Package com.example.android.TCPListen codePath changed from /data/app/com.example.android.TCPListen-2.apk to /data/app/com.example.android.TCPListen-1.apk; Retaining data and using new01-10 14:06:32.216: INFO/PackageManager(58): /data/app/com.example.android.TCPListen-1.apk changed; unpacking01-10 14:06:32.238: DEBUG/installd(34): DexInv: --- BEGIN '/data/app/com.example.android.TCPListen-1.apk' ---01-10 14:06:32.537: DEBUG/dalvikvm(347): DexOpt: load 40ms, verify 99ms, opt 2ms01-10 14:06:32.556: DEBUG/installd(34): DexInv: --- END '/data/app/com.example.android.TCPListen-1.apk' (success) ---01-10 14:06:32.568: WARN/PackageManager(58): Code path for pkg : com.example.android.TCPListen changing from /data/app/com.example.android.TCPListen-2.apk to /data/app/com.example.android.TCPListen-1.apk01-10 14:06:32.568: WARN/PackageManager(58): Resource path for pkg : com.example.android.TCPListen changing from /data/app/com.example.android.TCPListen-2.apk to /data/app/com.example.android.TCPListen-1.apk01-10 14:06:32.568: DEBUG/PackageManager(58):   Activities: com.example.android.TCPListen.TCPListen com.example.android.TCPListen.Images01-10 14:06:32.587: INFO/ActivityManager(58): Force stopping package com.example.android.TCPListen uid=1003701-10 14:06:32.847: DEBUG/dalvikvm(58): GC_FOR_MALLOC freed 6453 objects / 401352 bytes in 116ms01-10 14:06:32.918: INFO/installd(34): move /data/dalvik-cache/data@app@com.example.android.TCPListen-1.apk@classes.dex -&gt; /data/dalvik-cache/data@app@com.example.android.TCPListen-1.apk@classes.dex01-10 14:06:32.918: DEBUG/PackageManager(58): New package installed in /data/app/com.example.android.TCPListen-1.apk01-10 14:06:33.078: INFO/ActivityManager(58): Force stopping package com.example.android.TCPListen uid=1003701-10 14:06:33.177: DEBUG/dalvikvm(123): GC_EXPLICIT freed 265 objects / 12104 bytes in 96ms01-10 14:06:33.287: DEBUG/dalvikvm(121): GC_EXPLICIT freed 762 objects / 42224 bytes in 140ms01-10 14:06:33.507: WARN/RecognitionManagerService(58): no available voice recognition services found01-10 14:06:33.648: DEBUG/dalvikvm(156): GC_EXPLICIT freed 251 objects / 11976 bytes in 393ms01-10 14:06:33.797: DEBUG/dalvikvm(58): GC_EXPLICIT freed 4743 objects / 307528 bytes in 146ms01-10 14:06:33.897: INFO/installd(34): unlink /data/dalvik-cache/data@app@com.example.android.TCPListen-2.apk@classes.dex01-10 14:06:33.917: DEBUG/AndroidRuntime(340): Shutting down VM01-10 14:06:33.926: DEBUG/dalvikvm(340): Debugger has detached; object registry had 1 entries01-10 14:06:33.967: INFO/AndroidRuntime(340): NOTE: attach of thread 'Binder Thread #3' failed01-10 14:06:34.697: DEBUG/AndroidRuntime(352): &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;01-10 14:06:34.697: DEBUG/AndroidRuntime(352): CheckJNI is ON01-10 14:06:34.988: DEBUG/AndroidRuntime(352): --- registering native functions ---01-10 14:06:35.867: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.android.TCPListen/.TCPListen }01-10 14:06:35.927: DEBUG/AndroidRuntime(352): Shutting down VM01-10 14:06:35.957: DEBUG/dalvikvm(352): Debugger has detached; object registry had 1 entries01-10 14:06:35.988: INFO/ActivityManager(58): Start proc com.example.android.TCPListen for activity com.example.android.TCPListen/.TCPListen: pid=359 uid=10037 gids={3003}01-10 14:06:36.017: INFO/AndroidRuntime(352): NOTE: attach of thread 'Binder Thread #3' failed01-10 14:06:36.837: INFO/ActivityManager(58): Displayed activity com.example.android.TCPListen/.TCPListen: 904 ms (total 57691 ms)01-10 14:06:36.926: DEBUG/TCP(359): C: Connecting...01-10 14:06:37.117: DEBUG/TCP(359): C: Receiving...01-10 14:06:37.117: INFO/global(359): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.01-10 14:06:42.057: DEBUG/dalvikvm(123): GC_EXPLICIT freed 103 objects / 5744 bytes in 150ms01-10 14:06:43.169: DEBUG/TCP(359): C: Done danaadan.01-10 14:06:43.186: DEBUG/TCP(359): C: In the parser &lt;MSG&gt;&lt;N&gt;shiftDirection&lt;!N&gt;&lt;V&gt;0&lt;!V&gt;&lt;!MSG&gt;01-10 14:06:43.208: DEBUG/TCP(359): C:Wrong value message shiftDirection01-10 14:06:48.219: DEBUG/TCP(359): C:Wrong format message SD&lt;!N&gt;&lt;V&gt;0&lt;!V&gt;&lt;!MSG&gt;01-10 14:06:53.228: DEBUG/TCP(359): C: In the parser &lt;MSG&gt;&lt;N&gt;shiftDirection&lt;!N&gt;&lt;V&gt;1&lt;!V&gt;&lt;!MSG&gt;01-10 14:06:53.248: DEBUG/TCP(359): C:Correct message shiftDirection 1.001-10 14:06:53.287: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.android.TCPListen/.Images }01-10 14:06:53.879: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{43e45238 com.example.android.TCPListen/.TCPListen}01-10 14:06:58.384: DEBUG/AndroidRuntime(359): Shutting down VM01-10 14:06:58.388: WARN/dalvikvm(359): threadid=1: thread exiting with uncaught exception (group=0x4001d800)01-10 14:06:58.458: ERROR/AndroidRuntime(359): FATAL EXCEPTION: main01-10 14:06:58.458: ERROR/AndroidRuntime(359): java.lang.NullPointerException01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at com.example.android.TCPListen.TCPListen.callCompleted(TCPListen.java:40)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at com.example.android.TCPListen.TcpServiceHandler.onPostExecute(TcpServiceHandler.java:75)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at com.example.android.TCPListen.TcpServiceHandler.onPostExecute(TcpServiceHandler.java:1)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at android.os.AsyncTask.finish(AsyncTask.java:417)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at android.os.AsyncTask.access$300(AsyncTask.java:127)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at android.os.Handler.dispatchMessage(Handler.java:99)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at android.os.Looper.loop(Looper.java:123)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at java.lang.reflect.Method.invokeNative(Native Method)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at java.lang.reflect.Method.invoke(Method.java:521)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-10 14:06:58.458: ERROR/AndroidRuntime(359):     at dalvik.system.NativeStart.main(Native Method)01-10 14:06:58.487: WARN/ActivityManager(58):   Force finishing activity com.example.android.TCPListen/.Images01-10 14:06:58.538: WARN/ActivityManager(58):   Force finishing activity com.example.android.TCPListen/.TCPListen01-10 14:06:59.026: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{43fc82d8 com.example.android.TCPListen/.Images}01-10 14:06:59.087: DEBUG/dalvikvm(58): GREF has increased to 30101-10 14:07:01.427: INFO/Process(359): Sending signal. PID: 359 SIG: 901-10 14:07:01.457: INFO/ActivityManager(58): Process com.example.android.TCPListen (pid 359) has died.01-10 14:07:01.457: INFO/WindowManager(58): WIN DEATH: Window{43f5d848 com.example.android.TCPListen/com.example.android.TCPListen.TCPListen paused=true}01-10 14:07:01.556: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 359 uid 1003701-10 14:07:05.458: DEBUG/dalvikvm(156): GC_EXPLICIT freed 1575 objects / 81008 bytes in 219ms01-10 14:07:09.860: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43e45238 com.example.android.TCPListen/.TCPListen}01-10 14:07:09.860: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43fc82d8 com.example.android.TCPListen/.Images}01-10 14:07:26.170: DEBUG/SntpClient(58): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p><strong>Update</strong></p><p>Instead of AsyncTask in TcpServiceHandler, I used just thread.</p><pre><code>public class TcpServiceHandler implements Runnable {       TCPListener _listener;                 private Activity _act;       public TcpServiceHandler(TCPListener listener, Activity act){             _listener = listener;           _act = act;       }             public synchronized void run() {           // TODO Auto-generated method stub                    //if(socket==null){                 try {                   InetAddress serverAddr = InetAddress.getByName(""192.168.178.24"");                   Socket socket = new Socket(serverAddr, 1200);           //                   while(true){                    try {                                                    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));                           final String str = in.readLine();                           this._act.runOnUiThread(new Runnable(){                           public void run() {                               _listener.callCompleted(str);                               }                                                         });                                                                    }                    catch(Exception e){                        e.printStackTrace();                    }                   }               } catch (UnknownHostException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               } catch (IOException e) {                   // TODO Auto-generated catch block                   e.printStackTrace();               }       }     }</code></pre><p>This client (based on TCP sockets) will receive messages (strings) in the format <code>&lt;MSG&gt;&lt;N&gt;shiftDirection&lt;/N&gt;&lt;V&gt;1&lt;/V&gt;&lt;/MSG&gt;</code> and has to display an image or show some driver assistance info. Such messages keep coming every 100 ms. </p><p>Is this a good way of doing this task? If this is not the right way or if there is a better alternate way, I would be grateful for any such suggestion.</p>","487851","","487851","","2011-01-24 13:25:06","2011-01-24 13:25:06","Null pointer exception probably due to synchronisation issues; problem in starting activity","<android><activity><timeout>","1","0","","",""
"4645198","1","4645426","","2011-01-10 09:17:28","-1","3478","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4639430/android-steganography"">android steganography</a>  </p></blockquote><p>Has anyone implemented steganography on android?  </p><p>Can anyone post sample code for it?</p>","568796","","731947","","2013-03-23 12:33:27","2013-03-23 12:33:27","steganography on android","<android><steganography>","1","5","","2011-01-11 17:33:45",""
"4645233","1","4645334","","2011-01-10 09:22:09","2","279","<p>I asked a question the other day regarding sending an object to an activity using an intent as a parcel but I am unsure how to do it in my situation. I have a variable of type object <code>Object x;</code> which is set with something like this: <code>x = edit.getText().toString();</code> and in this instance x becomes a String object but I also have it able to set x as both an Integer and an SQLDate type. Looking at examples of how to send an object as a parcel it seems to me you have to know what the datatype is before hand even for custom datatypes. Any help with this will be greatly appreciated as i'm completely stuck on this.</p><p>Flow is:</p><p><code>Object x;</code> - is created.</p><p><code>x = String object||Integer object||sqldate object</code> - x is assigned a value</p><p><code>i.putExtra(""object"", x);</code> - x is sent through to the next activity after being parcelled.</p>","400406","","","","","2011-01-10 09:44:17","Trouble using parcels to send Object of unknown datatype","<java><android><parcelable>","2","0","","",""
"4645244","1","","","2011-01-10 09:23:58","1","539","<p>Can I play video/audio as widget in Android?</p>","569592","","1304064","","2012-08-15 13:26:34","2013-07-22 08:15:19","Can I play any video/audio as widget in android?","<android><widget>","2","0","","",""
"4645323","1","","","2011-01-10 09:33:51","0","168","<p>I want to develop an app that checks against a DB what to do after receiving an SMS, that is, it will receive a message and depending on the content or number or both, it performs different actions, it occurred to me that the best way to do this was by checking against a DB am I right? And if so, can this be done? I have no experience on Android dev. </p>","28586","","","","","2011-01-10 09:57:07","Check against a DB when an SMS is received on an Android phone","<android><database><sms>","2","0","","",""
"4645443","1","4647032","","2011-01-10 09:48:37","2","2011","<p>I've searched around the web to learn more about animating a character in Android but didn't fully understood it. I ask here maybe you could give me some advices or hints on how to make it in the best possible way.</p><p><strong>Scenario</strong></p><p>Imagine 5 drawn characters (let's say 5 human heads). I need to animate them. By animation I mean make eyes blink, smile, laugh etc. Right now I am working on making bitmap resources on each animation. For example for the blink animation, basically I have 3 images, one with eyes open, one with eyes half closed, one with eyes closed. I need to animate the character to use all these 3 images.</p><p>This is all the animation I need, nothing more fancier. Any suggestions from where to start ?</p>","379865","","","","","2012-08-14 12:07:03","Recommended way to make animation in Android","<android><animation><2d>","2","0","1","",""
"4645447","1","4645996","","2011-01-10 09:49:40","1","826","<p>I am creating an custom preference which contains an <code>EditText</code>.</p><p>The problem is when user clicks the <code>EdiText</code> for input suggestion box opens up and <code>EditText</code> looses focus. When <code>EditText</code> is clicked again for input, no problem occurs until 'blank space' is entered, which results in suggestion box and hence loss of focus.</p><p>What I mean by suggestion box is the box which pops up when entering text in <code>EditText</code></p><p><img src=""http://i.stack.imgur.com/9i782.png"" alt=""Suggestion Box on EditText""></p>","447238","","157882","","2011-10-14 05:02:58","2011-10-14 05:02:58","Custom Preference Including EditText","<android><input><edittext><autosuggest>","2","0","","",""
"4645461","1","4726242","","2011-01-10 09:52:16","9","1642","<p>I'm writing some tests to test my sqllite database code. Can someone here explain if there would be a difference writing those tests using the context I get from <a href=""http://developer.android.com/reference/android/test/AndroidTestCase.html#getContext%28%29""><code>AndroidTestCase.getContext()</code></a> or using an <a href=""http://developer.android.com/reference/android/test/IsolatedContext.html""><code>IsolatedContext</code></a>.</p>","3414","","3414","","2011-01-13 17:11:27","2013-07-28 17:08:02","IsolatedContext vs. AndroidTestCase.getContext()","<android><testing><context>","2","1","1","",""
"4645475","1","","","2011-01-10 09:53:59","4","672","<p>Is there is for the android an app maker tool like the ones in the iPhone ?? tools that can help the developer to develop an application easily... especially for the general things and nothing new in it... like the GUI and the action listener... I mean the developer should care about how to implement the functionality rather than wasting his time in the Gui it self and the other stuff...</p>","408389","","","","","2013-12-06 14:55:13","Is there is an app maker for the android?","<android>","5","0","","2013-06-13 13:45:12",""
"4645489","1","4645552","","2011-01-10 09:54:57","4","3283","<p>Friends,</p><p>I am displaying an array in ListView.</p><p>I change data of array dynamically on button click and call </p><pre><code>adapter.notifyDataSetInvalidated();</code></pre><p>It does not maintain scroll bar position of list. (the lenght of data source to list is always same). Could any one guide me how to keep the last state of ListView ?</p><p>Any help would be appreciated.</p>","249991","","469983","","2011-02-18 13:58:29","2012-02-13 23:10:58","how to maintain scroll bar position in android listview?","<android><listview>","1","0","1","",""
"4645595","1","","","2011-01-10 10:09:20","9","31490","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3393610/how-to-get-friends-birthday-list-using-facebook-api"">How to get friend&#39;s birthday list using facebook api?</a>  </p></blockquote><p>I want to display the list that contain information like name, id, birthday, location from facebook in android application.</p><p>I am beat successful in work though the following code I have get the friend's name and ID</p><pre><code>           Bundle parameters = new Bundle();    mAccessToken = facebook.getAccessToken();    try {        parameters.putString(""format"", ""json"");        parameters.putString(TOKEN, mAccessToken);        String url = ""https://graph.facebook.com/me/friends"";        String response = Util.openUrl(url, ""GET"", parameters);        JSONObject obj = Util.parseJson(response);        Log.i(""json Response"", obj.toString());        JSONArray array = obj.optJSONArray(""data"");        if (array != null) {            for (int i = 0; i &lt; array.length(); i++) {                String name = array.getJSONObject(i).getString(""name"");                String id = array.getJSONObject(i).getString(""id"");                Log.i(name,id);            }        }                 ............                ............</code></pre><p>but not get birthday, location, etc fields in json response. what is mistake?</p>","562296","","519718","","2013-01-14 16:54:09","2013-01-14 16:54:09","How to get all friends name, id, birthday, location, etc.. from facebook API in android?","<android><facebook>","5","4","9","2012-08-30 11:27:29",""
"4645619","1","","","2011-01-10 10:13:13","2","433","<p>How to find the list of suggestions giving by keyboard while typing.I want to get the list of suggestions of soft keyboard when we type on any TextView/EditText.I know how to hide those suggestions but trying to get their list .Means suppose we are typing ab then the corresponding suggestion  are visible, how to find those suggestion list.Is ther any inbuilt apk for this.Please help me.Thanks in advance.</p>","555688","","555688","","2011-01-10 12:33:19","2011-01-10 12:33:19","Finding list of dictionary words suggestions giving by keyboard while typing?","<android>","0","0","1","",""
"4645639","1","","","2011-01-10 10:16:01","2","669","<p>java: </p><p>public int[] native getArray(int[] a);</p><hr><p>c:</p><pre><code>JNIEXPORT jintArray JNICALL  net_tq5_ArrayTest_getArray(JNIEnv *env, jobject obj, jintArray arr) {return arr;}</code></pre><hr><p>java: </p><pre><code>int[] a = new int[]{1,2,3,4,5};int[] b = getArray(a);for(int i=0; i&lt;a.lenght; i++){   Log.i(""ArrayTest: "", """" + b[i]);}</code></pre><hr><p>The result will be:</p><pre><code> ArrayTest: 0 ArrayTest: 0 ArrayTest: 0 ...</code></pre><hr><p>Why ?Help!</p>","401559","","401559","","2011-01-10 10:54:23","2011-01-10 10:54:23","Jni jintArray params error","<java><android><arrays><jni>","1","0","","",""
"4645653","1","4646472","","2011-01-10 10:17:30","-1","191","<p>Hi I want to get the value in spinner in the run time the same i want to edit that get values.Is it is possible .... And tell me the way.</p><p>Thank you,  </p>","565106","","","","","2012-08-03 11:02:38","I want to get and edit the values in spinner in the runtime","<android><spinner>","2","0","","",""
"4645664","1","","","2011-01-10 10:18:42","3","885","<blockquote>  <p>Hi Friends,</p>    <p>I have an Home screen Widget, which is  invoking the webservice and display  some content. Now the issue is  whenever the Device loses the  Connection I need to update the widget  with the message ""No connection"" and  whenever the device regains the  connection I have to again update the  widget by calling the webservice. Any  Ideas please do share.</p>    <p>Thanks in advance</p>    <p>The following Link also provides good  solution:</p></blockquote><p><a href=""http://stackoverflow.com/questions/3307237/how-can-i-monitor-the-network-connection-status-in-android"">How can I monitor the network connection status in Android?</a></p>","28557","","28557","","2011-01-10 11:25:46","2011-01-10 11:25:46","Android: Update the Widget on Network Connection Availability","<android><android-widget><android-networking>","0","0","","",""
"4645690","1","4645871","","2011-01-10 10:20:40","0","961","<p>I am currently looking to create an application in Android where a user can answer a questionnaire and that information is saved. The questionnaire will be in a sqlite database and can have different set on answers, and their can be several questionnaires the user can choose to fill. how do i go about firstly having the ability to create a dynamic questionnaire view for the user? </p>","569654","","","","","2013-03-20 13:12:26","android questionnaire activity","<android>","1","1","","",""
"4645742","1","","","2011-01-10 10:25:55","0","1406","<p>I would like to ask that MulticastSocket is supported in android 2.3?</p><p>I have a module on Java Server. This server will send information uninterprupted. And I have a module Android Client (on emulator virtual device). I will start android client first for it to wait to receive server's information Then I will start Java server to send information. Finally I wanna my emulator can receive info from java server. PS: I will be successful if 2 modules are all java.</p><p>This is my server module (very simple)<br></p><pre>public class Server {<br>   public Server() throws IOException, InterruptedException{<br>      DatagramSocket socket = new DatagramSocket();  <br>      byte[] b = new byte[1024]; <br>      DatagramPacket dgram = new DatagramPacket(b, b.length,InetAddress.getByName<br>(""239.0.0.1""), 5000);        System.err.println(""Sending ""+b.length+"" bytes to ""+dgram.getAddress()+':'+ <br>dgram.getPort());       while(true) {   <br>         System.err.print(""."");   <br>         socket.send(dgram);   <br>         Thread.sleep(1000); <br>      } <br>   }<br>}<br></pre><p>This is my android emulator (also very simple)<br></p><pre>public class ClientForm extends Activity {<br>   private EditText edcontentview;<br>   @Override<br>   public void onCreate(Bundle savedInstanceState){<br>      super.onCreate(savedInstanceState);<br>      setContentView(R.layout.clientform);<br>      edcontentview = (EditText)findViewById(R.id.edtcontentview);<br>      MulticastLock _wifiMulticastLock = ((WifiManager)this.getSystemService(Activity.WIFI_SERVICE)).createMulticastLock(""_wifiMulticastLock"");<br>        _wifiMulticastLock.setReferenceCounted(true);<br>                _wifiMulticastLock.acquire();<br>      new Thread(new Runnable(){<br>                     @Override<br>         public void run() {<br>            byte[] b = new byte[1024];<br>            final DatagramPacket dgram = new DatagramPacket(b, b.length); <br>            MulticastSocket socket = null;<br>            try {<br>               socket = new MulticastSocket(5000);<br>               socket.joinGroup(InetAddress.getByName(""239.0.0.1""));<br>            } catch (IOException e) {<br>               e.printStackTrace();<br>            }  <br>            while(true) {   <br>               try {<br>                  socket.receive(dgram);<br>                  Thread.sleep(1000);<br>               } catch (IOException e) {<br>                  e.printStackTrace();<br>               } catch (InterruptedException e) {<br>                  e.printStackTrace();<br>               }   <br>               new Handler().post(new Runnable() {<br>             @Override<br>                  public void run() {<br>                     edcontentview.append(""Received "" + dgram.getLength() +     "" bytes from "" + dgram.getAddress());<br>                                             }<br>               });<br>               dgram.setLength(b.length);<br>            }<br>         }<br>      }).start();<br>   }<br>}<br></pre>","569682","","1288","","2011-03-14 04:09:57","2014-01-27 01:57:48","MulticastSocket","<android><networking>","2","0","1","",""
"4645786","1","4656993","","2011-01-10 10:29:58","0","239","<p>I am writing a questionaire app wherein four answers from SQLLite db need to be added to four normal buttons (not radiobButtons) in the view.</p><p>I am querying the database and getting the results as cursor.I am unable to attach the results to four buttons,but am able to attach the same to List View as below</p><pre><code>Cursor c = sampleDB.rawQuery(""SELECT Answer From'+SAMPLE_TABLE_NAME+'"", null);                   if (c != null ) {          if  (c.moveToFirst()) {           do {            String firstName = c.getString(c.getColumnIndex(""Answer""));            results.add(firstName);           }while (c.moveToNext());          }          }         this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,results));</code></pre><p>How do I attach the cursor results to the button?</p>","569668","","116938","","2011-06-04 02:24:06","2011-06-04 02:24:06","How to populate Buttons from ListAdapter In Android","<android><android-layout><listadapter>","1","0","","",""
"4645851","1","4646054","","2011-01-10 10:35:22","0","3497","<p>I'm trying to add a simple jar file which contains some statics.I have created a libs folder and copy the jar into. I have configure the project's build path in the Eclipse IDE.In one of the project's classes i have a referance to one of the static members of the jar file, but it failde to build and the jar's classes are unseen to the application and the Eclipse mark it as an error.How it can be solved?Thanks,Eyal.</p>","341497","","","","","2011-01-10 13:14:40","Adding external Jar file to Android Application using Eclipse","<android><eclipse><jar>","2","1","","",""
"4645854","1","4646716","","2011-01-10 10:35:43","0","2102","<p>I have an add button, a textbox called edittext, and a listview.  When I click the add button data currently in edittext should move to list view.  How can I make this happen?</p>","569553","","1159478","","2012-08-16 22:07:15","2012-08-16 22:07:15","add data from edittext to listview in android","<android>","4","0","0","",""
"4645960","1","5350179","","2011-01-10 10:47:42","22","59016","<p>I want to set the camera orientation according to the device orientation in Android but nothing seems to be working. I tried to rotate the Surface as well as the camera parameters but the camera preview in portrait mode always comes upside down. I would need to rotate it by 90 degree clockwise for it to be correct. Here is the code I am using right now which works in landscape mode only.</p><pre><code>    SurfaceHolder.Callback surfaceCallback = new SurfaceHolder.Callback() {    @Override    public void surfaceDestroyed(SurfaceHolder holder) {        camera.stopPreview();        camera.release();        camera = null;    }    @Override    public void surfaceCreated(SurfaceHolder holder) {                  initCamera();               }    private Size getOptimalPreviewSize(List&lt;Size&gt; sizes, int w, int h) {        final double ASPECT_TOLERANCE = 0.2;        double targetRatio = (double) w / h;        if (sizes == null)            return null;        Size optimalSize = null;        double minDiff = Double.MAX_VALUE;        int targetHeight = h;        // Try to find an size match aspect ratio and size        for (Size size : sizes) {            Log.d(TAG, ""Checking size "" + size.width + ""w "" + size.height                    + ""h"");            double ratio = (double) size.width / size.height;            if (Math.abs(ratio - targetRatio) &gt; ASPECT_TOLERANCE)                continue;            if (Math.abs(size.height - targetHeight) &lt; minDiff) {                optimalSize = size;                minDiff = Math.abs(size.height - targetHeight);            }        }        // Cannot find the one match the aspect ratio, ignore the        // requirement        if (optimalSize == null) {            minDiff = Double.MAX_VALUE;            for (Size size : sizes) {                if (Math.abs(size.height - targetHeight) &lt; minDiff) {                    optimalSize = size;                    minDiff = Math.abs(size.height - targetHeight);                }            }        }        return optimalSize;    }    @Override    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {        Camera.Parameters parameters = camera.getParameters();        List&lt;Size&gt; sizes = parameters.getSupportedPreviewSizes();        Size optimalSize = getOptimalPreviewSize(sizes, width, height);                 Log.d(TAG, ""Surface size is "" + width + ""w "" + height + ""h"");        Log.d(TAG, ""Optimal size is "" + optimalSize.width + ""w "" + optimalSize.height + ""h"");                   parameters.setPreviewSize(optimalSize.width, optimalSize.height);                   // parameters.setPreviewSize(width, height);                    camera.setParameters(parameters);        camera.startPreview();    }};  </code></pre>","48066","","","","","2012-04-18 21:29:02","How to set Android camera orientation properly?","<android><camera><orientation><surfaceview>","4","1","21","",""
"4645961","1","4646379","","2011-01-10 10:47:42","2","2067","<p>I need to check existing database before creating new database on android 2.2. How to check it?</p>","488433","","","","","2011-01-10 13:42:21","How to check existing database before creating new database on android 2.2?","<android><database><sqlite>","2","0","","",""
"4645967","1","","","2011-01-10 10:48:16","4","1184","<p>I'm currently developing my first Android app and am having some issues rendering images. The image itself is great quality to begin with, but upon rendering it the quality drastically lowers. Edges become jagged and it just looks poorly done. Everyone I've showed it to thus far has almost immediately noticed it, without any prompting about it. [start on left, end on right:]</p><p><a href=""http://i.stack.imgur.com/gld5A.png"" rel=""nofollow"">http://i.stack.imgur.com/gld5A.png</a></p><p>I'm trying everything I am aware of and every tip I've been able to find by looking around online, but nothing seems to fix it.</p><p>Currently, I get the image as a Bitmap and scale it:</p><pre><code>Bitmap holeImage = BitmapFactory.decodeResource(res, R.drawable.hole_image);Bitmap holeImageBMP = Bitmap.createScaledBitmap(holeImage, width, height, true);</code></pre><p>Once I have the image, I create a Paint, set a few smoothing attributes to true, and then draw it on the canvas:</p><pre><code>Paint smoothingPaint = new Paint();smoothingPaint.setAntiAlias(true);smoothingPaint.setFilterBitmap(true);smoothingPaint.setDither(true);canvas.drawBitmap(holeImageBMP, 0, 0, smoothingPaint);</code></pre><p>Yet, as you can obviously see above, the image quality drastically decreases. I've seen plenty of images being rendered beautifully and I'm honestly just not sure what's going on so any advice would be great!</p><p>Other notes: I'm using a SurfaceView method to handle the drawing, similar in nature to the LunarLander example given in the SDK.</p><p>Thanks again!</p>","569696","","","","","2011-01-10 11:03:24","Jagged edges on images rendered in Android","<java><android><bitmap><image-scaling><android-image>","2","0","1","",""
"4645968","1","","","2011-01-10 10:48:17","1","1385","<p>I want to set customised horizantal bar to my options menu.how to do that?Is there any method or attribut available?</p><p>Please dont give link of setMenuBackgound() method already available in stack overflow.</p><p>Regards,Android Developer</p>","486216","","486216","","2011-01-10 11:03:38","2011-02-15 03:25:39","how to set custom Horizantal divider line to menu android?","<android><menu>","1","0","","",""
"4645978","1","","","2011-01-10 10:49:25","2","474","<p>have a settings dialog/activity where I allow the user to change the locale.  Within that activity i call </p><pre><code> Resources res = ctx.getResources(); // Change locale settings on the device DisplayMetrics dm = res.getDisplayMetrics(); android.content.res.Configuration conf = res.getConfiguration(); conf.locale = new Locale(language_code.toLowerCase(), coutry_code.toUpperCase()); res.updateConfiguration(conf, dm); </code></pre><p>and call onChanged() for my settings ListView...  everything changes perfectly.  Very nice. Then I hit the back button to go back to the previous activity thinking everything should be switched; nope.  Everything is still in the previous locale.  So I added the above code in the onResume() of the activity thinking that would do it; nope.  Also, when I click the menu button of this activity again (not first time) I do not get called in onCreateOptionsMenu() it just displays the previous menu. My question is what is the correct way to force existing activities to reload using the new local? </p>","233618","","","","","2011-01-10 11:05:54","what is the correct way to force existing activities to reload using the new local","<android>","2","0","","",""
"4646063","1","4648412","","2011-01-10 10:58:22","1","1425","<p>So here's my image:</p><p><img src=""http://i.stack.imgur.com/jDk6A.png"" alt=""raw""></p><p>The problem is, draw9patch can't create normal 9 patch from this (shows errors in padding). Neither does android scale it correctly if I create 9 patch manually, like so:</p><p><img src=""http://i.stack.imgur.com/vrDUI.png"" alt=""manual 9 patch""></p><p>I believe that it's a color issue, that android sees the borders of my original image as a part of 9 patch paddings and thus, scales incorrectly.</p><p>Is there a way, to create a 9 patch from this?</p><p>Thanks in advance :)</p><p><strong>EDIT</strong></p><p>There must be NO extra empty border around original image, or it will persist and will have a white lines around it.There must be 1 extra pixel added to every side of the raw image to contain 9 patch paddings, so if the original width was 50px, it will be now 52 px.It's not the first time I'm making a nine patch&lt; just this time it doesn't work.If you don't believe me, try and do it in draw9patch.bat and you'll see that it doesn't add extra border at the top and shows error even on the original image.</p><p><strong>EDIT</strong>Ok. NVM, just had to make raw image a bit wider. Now it scales right,</p>","495663","","495663","","2011-01-10 16:38:34","2011-01-10 16:40:06","9 patch drawable probelm","<android>","3","0","","",""
"4646114","1","4695287","","2011-01-10 11:03:46","1","817","<p>Can anyone tell me how can i install or port my own driver(EX: Display driver) on android emulator and how to test it....</p><p>Thanks, Manju</p>","505580","","","","","2011-01-14 19:53:35","How to port my own device driver on android emulator","<android><driver><port>","1","0","","",""
"4646121","1","4779748","","2011-01-10 11:04:26","5","9828","<p>I'm using ksoap2-android to make a call to wcf service over SSL. I can get it to work without SSL, but now I want to make the call over SSL, but I've run in to some problems.</p><p>I'm using the HttpsTransportSE instead of HttpTransportSE, but I'm getting the error:javax.net.ssl.SSLException: Not trusted server certificate</p><p>How can I fix this?</p><p>Can I add the server certificate to the Keystore in Android to solve the problem?</p><pre><code>private static final String SOAP_ACTION = ""http://example.com/Service/GetInformation"";private static final String METHOD_NAME = ""GetInformation"";private static final String NAMESPACE = ""http://example.com"";    private static final String URL = ""dev.example.com/Service.svc"";public static Result GetInformation(){    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);    PropertyInfo property = new PropertyInfo();    property.name = ""request"";    Request request =        new Request(""12"", ""13"", ""Ben"");    userInformationProperty.setValue(request);    userInformationProperty.setType(request.getClass());    request.addProperty(property);    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    envelope.dotNet = true;    envelope.setOutputSoapObject(request);    envelope.addMapping(NAMESPACE, ""Request"",new Request().getClass());    HttpsTransportSE transport = new HttpsTransportSE(URL, 443, """", 1000);    //HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);    transport.debug = true;    try    {        transport.call(SOAP_ACTION, envelope);                  return Result.FromSoapResponse((SoapObject)envelope.getResponse());    }    catch (IOException e)    {        e.printStackTrace();    }    catch (XmlPullParserException e)    {        e.printStackTrace();    }    return null;}</code></pre>","566615","","566615","","2011-01-10 11:23:36","2013-04-11 14:05:16","Not trusted certificate using ksoap2-android","<android><soap><ssl><https><android-ksoap2>","4","0","1","",""
"4646139","1","","","2011-01-10 11:05:47","0","735","<p>Could someone please show me a sample code snippet where you use two buttons; one to turn off and one to turn on the screen. I cant get it to work. Thanks!</p>","557187","","","","","2011-01-10 11:19:58","Android wakelock question","<android><wakelock>","2","1","","",""
"4646157","1","4646343","","2011-01-10 11:07:24","10","20063","<p>Is there any nice tool to check memory leaks in android? </p><p>any help will be appreciative.</p>","397901","","","","","2013-01-25 00:05:43","tool to check memory leaks in android","<android><memory><memory-leaks>","4","0","3","",""
"4646203","1","","","2011-01-10 11:13:17","1","2008","<p>I want to programtically set date, time and timezone in android. Is it possible. There are conflicting answers where some say is it possible and others say it is not possible.</p>","608209","","","","","2011-01-10 12:00:41","Android change timezone, time and date","<android><date><time><timezone>","2","2","1","",""
"4646408","1","4646457","","2011-01-10 11:38:59","1","2190","<p>I want to change the background image of the activity after every 30 seconds in android.</p><p>Does anyone know, how to accomplish this?</p><p>Thanks in Advance,-Neha</p>","535026","","","","","2011-08-28 19:58:22","How to change the background image of an activity at regular interval in android?","<android><image><background>","1","3","1","",""
"4646421","1","","","2011-01-10 11:40:20","0","367","<p>I am developing an application in android.In which i have to send sms to url from android application.I have used the following code  </p><pre><code>SmsManager sm = SmsManager.getDefault();String number = ""6508570720"";startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts(""sms"", number, null)));</code></pre><p>How can i send multiple sms to url from android application??</p>","475349","","457982","","2011-01-10 11:51:15","2011-01-10 11:51:15","sending message to url in android","<android><url><sms>","0","2","1","",""
"4646486","1","","","2011-01-10 11:50:12","8","9787","<p>I am looking for a library/API that I wish to integrate to an Android application so that I can read any PDF files from within the application instead of using any third party applications! </p><p>By any PDF, I mean, say an Article in a magazine. I have the entire content of the article in PDF format. I would fetch the pdf from a server and download it into my device. Without using any external application like pdf reader, I would like to load this article.</p><p>Any suggestion on this is welcome!!</p><p>Thanks</p>","510659","","510659","","2011-01-12 04:19:42","2012-07-28 20:52:10","Reading PDF from within an Android application","<android><pdf>","1","2","11","",""
"4646506","1","4646756","","2011-01-10 11:53:02","1","5494","<p>My application requires an image to be selected from gallery.</p><p>I start activity:</p><pre><code>Intent intent = new Intent();intent.setType(""image/*"");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent,""Select Picture""), PICK_IMAGE);</code></pre><p>It will prompt to select from gallery or OI file manager</p><p>For the OI file manager, I get the path from Uri as follow:</p><pre><code>Uri selectedImageUri = data.getData();filemanagerstring = selectedImageUri.getPath();</code></pre><p>Now how do I get Bitmap image from the filemanagerstring?</p>","415865","","","","","2012-06-05 14:21:03","How to get Bitmap image from OI file manager path?","<android>","1","0","","",""
"4646508","1","","","2011-01-10 11:53:18","12","1094","<pre><code>I use the following code to start the SMS application:   Intent smsIntent=new Intent(Intent.ACTION_SENDTO,   Uri.parse(""sms:""));smsIntent.putExtra(""sms_body"", ""Message Body"");startActivity(smsIntent);</code></pre><p>It works fine if user selects standard ""Messaging"" application. But if user selects GV the message body text is ignored. </p><p>I have also tried the following as suggested in some forums:</p><p>smsIntent.putExtra(Intent.EXTRA_TEXT, ""Message Body"");</p><p>I have searched all the forums I know of and tried lot of things. Nothing worked for me.  Am I missing something here? Does GV need a special handing that it can’t be treated as regular “Messaging” app? </p>","569736","","","","","2012-02-16 00:51:18","How to pass text to Google Voice SMS Programmatically?","<android><sms><voice>","1","3","3","",""
"4646575","1","","","2011-01-10 12:01:36","1","639","<p>I want to make an app to record voice call. I have read many relevant articles about it. I am aware that latest Galaxy comes with this feature. But wanted to know a few things:</p><ol><li>When we use the native AudioRecord::start(), where is the recorded data stored in the File System?</li><li>What is the format of the recorded data?</li><li>how to access that data to manipulate it?</li></ol><p>Thanks in advance.</p>","569785","","","","","2011-01-10 12:12:45","Record the voice call packets in a file","<android>","1","0","1","",""
"4646584","1","4646918","","2011-01-10 12:03:10","2","6385","<p>Is it possible to get latitude and longitude from Google map on touch event?</p><p>For example: if i touch the New York on map, it should give me the latitude and longitude of New York.</p>","411359","","3023877","","2014-03-06 13:17:26","2014-03-06 13:17:26","how to get lat and long on touch event from google map?","<android><google-maps><google-maps-api-3><latitude-longitude>","3","0","","",""
"4646655","1","4646757","","2011-01-10 12:10:57","0","300","<p>Ive googled for some information on smartphone browser sizes so I can make a site that fits:</p><p>blackberryiphoneandroid</p><p>But doesnt seem to be any hardcore dimensions floating around anybody know the info or has sources where I can find out?</p>","223863","","","","","2011-01-10 12:21:23","Is there any documentaion about smart phone browser screen sizes?","<iphone><android><blackberry><mobile><smartphone>","1","0","","",""
"4646660","1","4646746","","2011-01-10 12:11:18","0","204","<p>This is a hard one to explain but here goes. I have 2 arrays, one with the column names of the table I want to insert into <code>([column1, column2, column3 etc...])</code> and the second array contains the data to be inserted in the same array positions as the first array, <code>([data1, data2, data3 etc...])</code>I would like to know how to create an sql query from these values in the arrays so I can execute the statement. I have a feeling the best way is to either use ContentValues (I have no idea where to start with that) or the <code>db.insert()</code> command. it would be very easy if there was a way to pair up each item from the first array with the data item for the second and then somehow add them to the database. Oh and the data stored in the second array is made up of more than one datatype which I guess makes this more difficult.</p><p>Sorry if this is a confusing and long winded question.</p>","400406","","","","","2011-01-10 12:20:00","Adding data to sqlite database give 2 arrays containing the data","<java><android><sqlite>","1","0","","",""
"4646828","1","4647405","","2011-01-10 12:31:07","0","604","<p>i cant get clearview in this...i need reuse the listview datas for some purpose, i wish to how to move the listview data to a edittext.. kindly assist with sample code..</p>","569553","","","","","2011-01-10 13:40:39","to move listview data to edit text,","<android>","2","0","0","",""
"4646850","1","","","2011-01-10 12:33:16","0","400","<p>i'm using feed.jar of libs-for-android, and i need to parse json data.I've founded JsonContentHandler.java class similar to XmlContentHandler.java used in demos.</p><p>Can you give me an example on how to use JsonContentHandler?</p><p>thank you.</p><p>ps: <a href=""https://code.google.com/p/libs-for-android/"" rel=""nofollow"">https://code.google.com/p/libs-for-android/</a></p>","251434","","","","","2011-05-29 14:12:57","libs-for-android: Example with JsonContentHandler?","<android><json><parsing><libs>","1","0","","",""
"4646885","1","","","2011-01-10 12:37:11","1","104","<p>Can you please tell me how can i pick android Word suggestions programatically from android.</p>","395661","","","","","2011-01-10 12:37:11","picking Android word suggestions programatically","<android>","0","2","1","",""
"4646913","1","4646955","","2011-01-10 12:40:01","9","23324","<p>Im adding images to a folder on the SDCARD.Since the images and my folder is not immediately visible in the Gallery imtrying to get the MediaScannerConnection to update and show thefolder/images in the gallery.This is not working so good for me since nothing shows up in Gallery.Im only testing in Eclipse AVD.</p><p>I dont see much talk about this maybe because the scanFile is new since api8.Could someone show how this is done?</p><p>Im trying it in both a service and Activity but keep getting uri=null when onScanCompleted. </p>","538837","","","","","2014-03-19 06:30:22","Android How to use MediaScannerConnection scanFile","<android>","8","2","8","",""
"4646921","1","4646952","","2011-01-10 12:41:14","2","878","<p>I have an Activity that retrieves information from a remote server and displays it in a TableLayout.The function that retrieves the information from the server has its own timeout, and exception is thrown when the timeout gets exceeded.</p><p>Now, when the activity is loaded, I want the function to be fired, and a progressDialog to be shown while the function works, and to be hided if the function is done working, or if a timeout exception was thrown.</p><p>The problem: I've put the code that do all the functionality described above in the onCreate() function. Nothing is shown on the emulator screen, since the onCreate() function hasn't finished running...</p><p>I've also tried to put the code in the onStart() function... same unwanted results...</p><p>I'm trying to avoid using of threads, because the functionality needs many variables that the thread will not has access to them...</p><p>How can i implement the wanted behavior?? </p><p>Thanks.</p>","501560","","473070","","2011-01-10 12:49:13","2011-01-10 12:49:13","Long operations on Activity's onCreate()","<android><progressdialog>","2","0","1","",""
"4646960","1","4653926","","2011-01-10 12:46:23","0","579","<p>I have string that include <strong>(look: string)</strong> (in this format) within the text that displayed in my <strong>""textview""</strong> i wanna linkify the <strong>""string""</strong> part and than delegate to another activity , how can i achieve this, my knowladge about regular expression is not so good ?</p>","155332","","","","","2011-01-11 03:30:01","Textview regular expression in string Android?","<java><android><regex>","2","0","","",""
"4646971","1","4726527","","2011-01-10 12:47:40","2","2392","<p>I am a little bit confused about the native heap on android, I would like know the native heap max size, there is a way to know it? </p><p>Like </p><pre><code>getRuntime().maxMemory()  </code></pre><p>which I use for know the maximum limit  of VM heap. </p><p>Another question is relative at how the native heap memory is released, I read that IS NOT the GC of Dalvik which free that memory, is correct? If yes, when the memory of native heap is released? Thanks a lot in advance for any suggestion. pedr0 </p>","554892","","","","","2011-01-18 16:37:33","Native Heap Maximum size and release of memory","<android>","1","0","3","",""
"4646989","1","5792873","","2011-01-10 12:49:43","3","718","<p>I need to display in scrollable TextView really large amount of text (up to several megabytes). It's pretty clear that one need to somehow chunk text and display it slice by slice. The only question how to do it technically. Anyone can advise?</p>","472270","","","","","2011-04-26 15:46:22","How to display in TextView really large text (several megs)?","<android><textview><large-files>","1","0","","",""
"4647051","1","","","2011-01-10 12:56:50","0","822","<p>I'm pretty new to Android development and trying to resolve following problem:</p><p>I have following xml code (downloaded from internet)</p><pre><code>&lt;root&gt;    &lt;country&gt;        &lt;id&gt;1&lt;/id&gt;        &lt;name&gt;Foo&lt;/name&gt;    &lt;/country&gt;    &lt;country&gt;        &lt;id&gt;2&lt;/id&gt;        &lt;name&gt;Bar&lt;/name&gt;    &lt;/country&gt;&lt;/root&gt;</code></pre><p>Which I parse in Hashtable (something like php's associative array)</p><pre><code>1=&gt;Foo2=&gt;Bar</code></pre><p>Now I need to populate ListView with this data, and when user click on the row get country's id. Until now I haven't found a way to do so, am I forced to create a content provider and call a query on data?</p><p>If I'm not wrong for getting data i shoud use getSelectedItemId() on listview, but how to populate it and set this id for each row is the problem. </p><p>Thx in advance. </p>","77867","","","","","2011-01-10 13:11:48","Populate ListView with Hashtable","<android><listview><hashtable>","0","2","","",""
"4647116","1","4648082","","2011-01-10 13:04:22","2","895","<p>I have developed one android application for the devices with exact screen size of 480x800. Now i have no idea about how to publish this app for this particular screen size. If i filter by using  tag in manifest , it can accept both 480x800 (WVGA800)and 480x854 (WVGA854). But my app is suitable only for WVGA800.</p>","376035","","881229","","2014-01-06 19:48:19","2014-01-06 19:48:19","How to publish Android app into market for particular screen resolution?","<android><google-play>","2","1","","",""
"4647149","1","4647232","","2011-01-10 13:08:19","4","6150","<p>I can't set OnClickListener in a dialog of the android application. It finishes with an error. The log is:</p><pre><code>01-10 12:35:45.792: ERROR/AndroidRuntime(918): FATAL EXCEPTION: main01-10 12:35:45.792: ERROR/AndroidRuntime(918): java.lang.NullPointerException01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.htmleditor.MainActivity.onCreateDialog(MainActivity.java:169)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.app.Activity.onCreateDialog(Activity.java:2482)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.app.Activity.createDialog(Activity.java:882)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.app.Activity.showDialog(Activity.java:2557)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.app.Activity.showDialog(Activity.java:2524)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.htmleditor.MainActivity$2.onClick(MainActivity.java:106)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.view.View.performClick(View.java:2485)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.view.View$PerformClick.run(View.java:9080)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.os.Handler.handleCallback(Handler.java:587)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.os.Handler.dispatchMessage(Handler.java:92)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.os.Looper.loop(Looper.java:123)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at java.lang.reflect.Method.invokeNative(Native Method)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at java.lang.reflect.Method.invoke(Method.java:507)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-10 12:35:45.792: ERROR/AndroidRuntime(918):     at dalvik.system.NativeStart.main(Native Method)01-10 12:35:48.002: ERROR/InputDispatcher(67): channel '4065a710 android.htmleditor/android.htmleditor.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x801-10 12:35:48.012: ERROR/InputDispatcher(67): channel '4065a710 android.htmleditor/android.htmleditor.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!</code></pre><p>I have two versions of the code. Both of them provoke the error</p><p>MainActivity, function Oncreate()</p><pre><code>insertImage.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                  Dialog dialog = new Dialog(MainActivity.this);                    dialog.setContentView(R.layout.dialogimage);                    dialog.setTitle(""Insert image"");                    final EditText fieldForURL = (EditText)findViewById(R.id.fieldForURL);                    Button on = (Button)findViewById(R.id.okImage);                    on.setOnClickListener(new OnClickListener() {                        @Override                        public void onClick(View v) {                            visualPane.getText().insert(visualPane.getSelectionEnd(),""&lt;img src=\"""" + fieldForURL.getText().toString() + ""\""&gt;"");                          }                    });                    dialog.setCancelable(true);                    dialog.show();                //showDialog(IDD_CUSTOM_INSERT_IMAGE);            }        });</code></pre><p>or function OnCreateDialog()</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);      AlertDialog.Builder alert = new AlertDialog.Builder(this);     alert.setTitle(""Create table"");    alert.setCancelable(false);    Dialog dialog = null;    dialog = new Dialog(this);    switch (id) {        case IDD_CUSTOM_INSERT_TABLE:            dialog.setTitle(""Insert table"");            dialog.setContentView(R.layout.dialogtable);               okTableDialog =  (Button)findViewById(R.id.okTable);            cancelTableDialog = (Button)findViewById(R.id.okTable);            fieldForRows = (EditText)findViewById(R.id.entry01);            fieldForColumns = (EditText)findViewById(R.id.entry02);            fieldForWidthOfBroder = (EditText)findViewById(R.id.fieldForBorder);            okTableDialog.setOnClickListener(new OnClickListener() {                    @Override                    public void onClick(View v) {                        TableAction tablAc = new TableAction(visualPane);                        tablAc.insertTable(fieldForRows.getText().toString(),fieldForColumns.getText().toString(), fieldForWidthOfBroder.getText().toString());                    }                });            return dialog;        case IDD_CUSTOM_INSERT_IMAGE:            dialog.setTitle(""Insert image"");            dialog.setContentView(R.layout.dialogimage);              final EditText fieldForURL = (EditText)findViewById(R.id.fieldForURL);            Button on = (Button)findViewById(R.id.okImage);            on.setOnClickListener(new OnClickListener() {                    @Override                    public void onClick(View v) {                        visualPane.getText().insert(visualPane.getSelectionEnd(),""&lt;img src=\"""" + fieldForURL.getText().toString() + ""\""&gt;"");                      }                });            return dialog;        default:            return alert.create();    }}</code></pre><p>If I comment-out ""setOnClickListener"" in both cases, the programm will not finish with an error</p><p>Please help, why it happens?</p>","565447","","","","","2011-01-10 13:17:05","Can't set OnClickListener in a dialog of the android application","<android>","1","0","","",""
"4647218","1","4647653","","2011-01-10 13:15:01","3","1066","<p>i'm working with the youtube json from google-api-client :</p><pre><code>{    ""apiVersion"": ""2.0"",    ""data"": {        ""updated"": ""2011-01-05T13:48:33.146Z"",        ""totalItems"": 4,        ""startIndex"": 1,        ""itemsPerPage"": 1,        ""items"": [            {                ""id"": ""YfUzMkAlOBI"",                ""uploaded"": ""2010-12-29T16:50:47.000Z"",                ""updated"": ""2010-12-29T16:50:47.000Z"",                ""uploader"": ""devandroidcs"",                ""category"": ""Entertainment"",                ""title"": ""Teste 2"",                ""description"": ""Description do teste2"",                ""tags"": [                    ""mobile""                ],                ""thumbnail"": {                    ""sqDefault"": ""http://i.ytimg.com/vi/YfUzMkAlOBI/default.jpg"",                    ""hqDefault"": ""http://i.ytimg.com/vi/YfUzMkAlOBI/hqdefault.jpg""                },                ""player"": {                    ""default"": ""http://www.youtube.com/watch?v\u003dYfUzMkAlOBI&amp;feature\u003dyoutube_gdata_player"",                    ""mobile"": ""http://m.youtube.com/details?v\u003dYfUzMkAlOBI""                }...}</code></pre><p>at this point i should create a  field name called default at my parse java class.Already done this parse  work with the other fields , the problem is that  , default isa private java name  so i can't call a variable default .</p><p>how can i manage that ?</p>","569873","","244296","","2011-01-10 14:15:09","2012-12-10 10:05:03","pojo parse gson with invalid java names","<java><android><json>","2","0","1","",""
"4647231","1","","","2011-01-10 13:17:01","0","2748","<p>I have developed one application. I want this application to work in background (minimize the application on button click). When user clicks on button the application should minimize and should run in background. How do I accomplish this?</p>","383597","","28169","","2011-01-10 13:54:14","2012-10-26 22:33:14","Android minimize application","<android>","2","0","","",""
"4647234","1","","","2011-01-10 13:17:11","0","192","<pre><code>public void Click(View view){this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);    Handler handler = new Handler();     handler.postDelayed(new Runnable() {          public void run() {              this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);         }     }, 30000); }</code></pre><p>I want the screen to wake up after 30 sec (its set to 15 seconds timeout). But this doesnt work. What am i doing wrong? If theres a better way to do this, please provide a code sample, since im a newbie. THanks</p>","557187","","","","","2011-01-10 15:28:23","android: waking up the device","<android><flags>","1","0","","",""
"4647239","1","","","2011-01-10 13:17:47","1","295","<p>Im new to Android and I tried a tutorial for camera API. The tutorial works fine. When I use HTC desire I can see the camera view in both portrait and landscape, but when I use Samsung Galaxy I get a the camera view only in a landscaped view. I tried the following code to rotate the camera view as well..</p><pre><code>        Camera.Parameters parameters = camera.getParameters();                                parameters.setRotation(90);</code></pre><p>then the camera doesn't work as expected. (screen splits into 4 and not clear).Does anyone have an idea for this issue ? Thanks.</p>","511737","","","","","2011-01-10 14:52:07","Android camera being landscaped in some devices","<android><view><camera><portrait>","1","0","","",""
"4647299","1","4647702","","2011-01-10 13:25:13","14","5740","<p>I have an Android Spinner view in my layout. I would like that spinner to show only a single text item when closed, but when the user clicks on it (i.e. opens the spinner dialog) I would like to show more extensive information for each item, including an icon and an additional description text view. As it is now the spinner shows the very same layout (icon, title + description) in both states.</p><p>If I attach an ArrayAdapter to the spinner, then I get access to something called ""setDropDownViewResource"" but that's not necessarily what I need, since my spinner data is fetched from a Cursor not from an Array of any kind (I have, as of now, created my own adapter, extending BaseAdapter).</p><p>Anyone who can help me?</p>","569885","","569885","","2011-01-12 07:08:06","2013-06-30 00:55:00","Android Spinner with different layouts for ""drop down state"" and ""closed state""?","<android><spinner>","2","0","4","",""
"4647318","1","4647385","","2011-01-10 13:27:01","0","155","<p>I want to display 3 different websites one after another by creating their respective webviews in android and combine all 3 child views into single parent view. I want to see each view by applying fling gesture, but I am having problem in extending the View class, to hold 3 web views, Can anybody throw some light on this?</p><p>If you have any other suggestions you are free to pour in. Right now I am able to display only one website, I want two more to follow this. Since the web result are basically the browser output, we cant fling upon a browser so how should I go ahead with it.</p>","466590","","","","","2011-01-10 13:36:32","combining 3 webviews into one view","<android><webview><android-webview>","1","0","","",""
"4647347","1","","","2011-01-10 13:29:45","0","1055","<p>I am using the google books api for an Android app that I am building. This is a sample of the XML file</p><pre><code>&lt;dc:description&gt;This trilogy includes &amp;amp;quot; The Hitchhiker&amp;amp;#39;s Guide to the Galaxy&amp;amp;quot; , &amp;amp;quot; TheRestaurant at the End of the Universe&amp;amp;quot; , &amp;amp;quot; Life, Universe and Everything&amp;amp;quot; and &amp;amp;quot; So Long ...&lt;/dc:description&gt;&lt;dc:format&gt;590 pages&lt;/dc:format&gt;&lt;dc:format&gt;book&lt;/dc:format&gt;</code></pre><p>And this is a fraction of the code I'm using to extract the description</p><pre><code>if ( entry.getElementsByTagName( ""dc:description"" ).item( 0 ) != null ) {  Element d = ( Element ) entry.getElementsByTagName( ""dc:description"" )      .item( 0 );  b.setDescription( d.getFirstChild( ).getNodeValue( ) );}</code></pre><p>The problem is when using the HTML.fromHtml(Str) function it cuts off the text at the first HTML entity (so in this example it says simply </p><blockquote>  <p>This trilogy includes</p></blockquote><p>When I run the same code outside of Android it works ok and at least shows the string with the escape characters, i.e.</p><pre><code>This trilogy includes &amp;quot; The Hitchhiker&amp;#39;s Guide to the Galaxy&amp;quot; , &amp;quot; TheRestaurant at the End of the Universe&amp;quot; , &amp;quot; Life, Universe and Everything&amp;quot; and &amp;quot; So Long ...</code></pre><p>If I then manually add this to the app the HTML.fromHtml() works fine so I guess the problem is Android's implementation of the parser. </p><p>A similar problem is <a href=""http://stackoverflow.com/questions/4131906/android-decoding-html-in-xml-file"">Android decoding html in xml file...</a>. I have tried setting the validation of the factory to false, and as it is an RSS feed I cannot declare an HTML root element (as suggested in this post).</p>","425459","","","","","2011-02-24 08:42:48","Android parsing HTML entities using DOM parser for RSS feed","<java><android><html-parsing><rss><dom-parser>","1","0","","",""
"4647410","1","4647560","","2011-01-10 13:41:16","2","2047","<pre><code>for(int i=0;i&lt;StoreparsrData.title.size();i++){        HashMap&lt;String,String&gt; temp = new HashMap&lt;String,String&gt;();        Bitmap bt=Utility.getBitmapFile(StoreparsrData.url.get(i).toString());         ImageView img=(ImageView)findviewbyid(R.id.img);        img.setImageBitmap(bt);</code></pre><p>but iwant to convert this <code>img.setImageBitmap(bt);</code> to string so its input for </p><pre><code>temp.put(""image"",image );    temp.put(""title"",StoreparsrData.title.get(i).toString());    temp.put(""description"", StoreparsrData.description.get(i).toString());    temp.put(""lastbuilddate"", StoreparsrData.lastBuildDate.get(0).toString());    list.add(temp);    }</code></pre><p>so its show image Pls Reply me</p>","545951","","37298","","2011-01-10 13:45:37","2011-01-11 08:42:17","HashMap<String,String> temp = new HashMap<String,String>(); for pass image","<android>","1","3","2","",""
"4647606","1","7538412","","2011-01-10 14:06:55","6","892","<p>I recently noticed that when trying to run my application on the Gingerbread emulation, that FTP broke. I am currently using the apache commons external library for FTP support, but for some reason it works on every other Android OS except 2.3 (Gingerbread)</p><p>Here is my FTP code</p><pre><code>FTPClient ftp = new FTPClient();ftp.connect(SERVER);ftp.login(""anonymous"", ""anonymous"");ftp.setFileType(FTP.BINARY_FILE_TYPE);ftp.enterLocalPassiveMode();InputStream is = ftp.retrieveFileStream(""file.txt"");byte[] data = new byte[1024];fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);int x = 0;while((x=is.read(data,0,1024))&gt;=0){    fos.write(data,0,x);}fos.flush();fos.close();ftp.logout();ftp.disconnect();</code></pre><p>As I said, this is tested and works on 1.6, 2.1 and 2.2, but not 2.3. I've tried all day to figure out why and how to fix it but I can't find any solution.</p><p>I was therefore wondering if anybody have experience with FTP and Gingerbread and if you might be so nice to guide me in the right direction.</p><p>Thanks.</p>","569926","","","","","2011-09-24 10:23:55","Cannot connect to FTP on Gingerbread","<android><ftp>","2","4","1","",""
"4647714","1","","","2011-01-10 14:20:05","0","185","<p>I am programming an assignment and I need to figure out how to read a database file that Is created using a PHP script I have coded. I am new to the Android platform and have spent hours in the past week following tutorials but am still struggling. I need to read from the database and display in a UI on the screen. I’m sure it can’t be too difficult but I’m slipping up somewhere! Any help would be truly appreciated.</p><p>Current PHP Script-</p><pre><code>&lt;html&gt;&lt;body&gt;&lt;?php//Connect to college database$studentnum = ""SY090627"";$con = mysql_connect(""localhost"",""******"",""*******"");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db(""computin_mobile"", $con);//Select all needed student data//Must include custext from student table to retrive students college username$result = mysql_query(""SELECT * FROM students, time WHERE (time.CusText5='$studentnum' AND students.StuRef ='$studentnum') ORDER BY time.DayNum ASC, time.StartTime"");$newLine = ""\n"";try{  //create the database  $database = new SQLiteDatabase('myDatabase.sqlite', 0666, $error);}catch(Exception $e){  die($error);}//add Lesson table to database$query = 'CREATE TABLE Lessons ' .         '(Day TEXT, StartTime TEXT, EndTime TEXT, Teacher TEXT, Description TEXT, Room TEXT)';if(!$database-&gt;queryExec($query, $error)){  die($error);}while($row = mysql_fetch_array($result))  {//insert data into database$dayr = $row['Day'];$query =  'INSERT INTO Lessons (Day, StartTime, EndTime, Teacher, Description, Room) ' .  'VALUES (""'.$row['Day'].'"", ""'.$row['StartTime'].'"", ""'.$row['EndTime'].'"", ""'.$row['Teacher'].'"", ""'.$row['Description'].'"", ""'.$row['Room'].'"")';if(!$database-&gt;queryExec($query, $error)){  die($error);}  }//read data from database$query = ""SELECT * FROM Lessons"";if($result = $database-&gt;query($query, SQLITE_BOTH, $error)){  while($row = $result-&gt;fetch())  {    print(""Day: {$row['Day']} &lt;br /&gt;"" .          ""Start Time: {$row['StartTime']} &lt;br /&gt;"".          ""End Time: {$row['EndTime']} &lt;br /&gt;"".          ""Teacher: {$row['Teacher']} &lt;br /&gt;"".          ""Description {$row['Description']} &lt;br /&gt;"".          ""Room: {$row['Room']} &lt;br /&gt;&lt;br /&gt;"");  }}else{  die($error);}?&gt; &lt;/body&gt;&lt;/html&gt; </code></pre>","569947","","1465910","","2012-09-29 11:18:37","2012-09-29 11:18:37","Having problems reading from a DB","<php><android><database><sqlite>","1","10","","",""
"4647767","1","","","2011-01-10 14:24:53","1","12655","<p>After looking on the net for 2 days I finally decided to post on SO.</p><p>Well I simply want to publish a photo in my android app on to facebook.</p><p>AM using the official android-facebook-sdk. I imported to example project and in the upload section add my code to upload photo. like</p><pre><code>mUploadButton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Bundle params = new Bundle();        params.putString(""method"", ""photos.upload"");        Bitmap temp = BitmapFactory.decodeResource(getResources(),R.drawable.facebook_icon);        ByteArrayOutputStream baos = new ByteArrayOutputStream();        temp.compress(Bitmap.CompressFormat.JPEG, 100, baos);        byte[] imgData = baos.toByteArray();        params.putByteArray(""picture"", imgData);        mAsyncRunner.request(null, params, ""POST"", new SampleUploadListener());    }});</code></pre><p>But it doent work :(</p><p>I went through the links in this forum too like:<a href=""http://stackoverflow.com/questions/3323496/looking-for-android-facebook-sdk-examples"">Looking for android Facebook SDK examples</a></p><p>but am not able to post. :(</p><p>Kindly help me.THanks.</p>","569918","","1765573","","2013-07-19 08:20:45","2013-07-19 08:20:45","android facebook publish photo","<android><facebook><photo><publish><facebook-android-sdk>","1","1","7","",""
"4647909","1","4647925","","2011-01-10 14:37:21","0","2669","<p>I'm very new to android jdk,</p><p>anyone knows how to play <code>.avi</code> in it?</p>","522431","","","","","2011-01-10 14:41:10","How to play .avi video with android 2.2 sdk in java?","<java><android>","1","0","1","2013-10-28 06:59:21",""
"4647959","1","4787704","","2011-01-10 14:42:11","1","4750","<p>I'm developing a mobile website for iPhone and Android browsers.</p><p>As I was playing around with an Iphone 4 and a HTC Desire I found out that the two devices react differently on orientation change. If I load the website in portrait mode and then rotate the device to horizontal mode, the Iphone zooms closer to the content using the same width (320px). With an Android device, if I rotate it seems that the viewport changes, so there isn't any zooming going on (width >320px), instead the websites gets wider.</p><p>My current viewport (I already tried setting a fixed width of 320px):</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width; initial-scale=1.0;"" /&gt;</code></pre><p>Now my question: Is there a way to make the Android Webkit browser ""zoom in"" like an iPhone on orientation change from protrait to horizontal?</p><p>Thank you very much in advance!</p><p>Andrew</p>","463709","","","","","2013-06-24 12:31:18","Mobile Website: Orientation change from portrait to horizontal","<iphone><android><orientation><viewport>","2","0","2","",""
"4648007","1","","","2011-01-10 14:47:02","0","1106","<p>i want to add a images to grid view and then to linear layout.i tried below code</p><pre><code>    protected LinearLayout asLayout(final String message,final String path,boolean back){    LoaderImageView liv=new LoaderImageView(this,path);    imageView = new ImageView(mContext);    imageView.setLayoutParams(new GridView.LayoutParams(100,120));    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);    (imageView).setPadding(10, 10, 10, 10);    liv.setBackgroundColor(0xFF000000);         linearWrapper = new GridView(mContext);    linearWrapper.addView(asLayout(fmsg,fpath,true));            linearWrapper.addView(asLayout(smsg,spath,false));          linerLayout.addView(linearWrapper);</code></pre><p>the gridview was added but the images in grid view are not added .so please tell me the solution to how to add the gridview images to linearlayout.</p><p>Thanks in advance</p><p>Best Regards</p>","745367","","","","","2011-06-01 17:42:12","how to add gridview image to linearlayout in android","<android><gridview><android-linearlayout>","1","0","","",""
"4648008","1","","","2011-01-10 14:47:19","2","346","<p>I have an IntentService and have to send a broadcast to the client activity for updating the UI. Where is the best place to do this? Is it ok to send it from the onHandleIntent method? Or is there a method (in the main thread) that gets called when the onHandleIntent method is over?</p><p>Thanks a lot</p><p>Gratzi</p>","460611","","","","","2011-04-06 23:08:53","Activity notified by an IntentService","<android>","1","0","","",""
"4648033","1","4655958","","2011-01-10 14:49:37","0","1078","<p>I have a header where I have the text: ""Huidige Locatie"" and beneath that I have an image of a country flag.</p><p>I declared the TextView and ImageView in the layout as follows:</p><pre><code>&lt;LinearLayout            android:id=""@+id/locatiebalk""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:paddingTop=""5sp""            android:orientation=""horizontal""&gt;            &lt;LinearLayout                android:id=""@+id/vlaggenlocatie""                android:layout_width=""105sp""                android:layout_height=""fill_parent""                android:paddingLeft=""14sp""                android:orientation=""vertical""&gt;                &lt;TextView                    android:id=""@+id/huidiglocatie""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:text=""Huidige locatie""                    android:textColor=""#000000""                    android:textSize=""12sp""/&gt;                &lt;ImageView                    android:id=""@+id/flag""                    android:layout_width=""fill_parent""                    android:layout_height=""46sp""                    android:gravity=""left""                    android:src=""@drawable/nl""/&gt;                &lt;/LinearLayout&gt;</code></pre><p>(I close the tags correctly later on, just showing the relevant part)</p><p>In the Graphical Layout of Eclipse it shows it the right way:</p><p><img src=""http://i.stack.imgur.com/31mJ1.png"" alt=""alt text""></p><p>But in the Simulator and on my phone it showes it like this:<img src=""http://i.stack.imgur.com/IUx4Q.png"" alt=""alt text""></p><p>What is the best way to do this?</p>","517460","","","","","2011-01-11 09:17:19","Align dynamic Image and Text in Android","<android><layout><alignment>","2","0","","",""
"4648096","1","4648127","","2011-01-10 14:57:06","0","765","<p>I've made my app handle ACTION_VIEW intents for a certain data type, which it does fine. I can't seem to work out how to actually detect whether my app has been launched in this way though, and how to get at the attached data. Can someone point me in the right direction? Here's an excerpt from my manifest, if it helps.</p><pre><code>&lt;activity android:name="".MyApp""          android:label=""@string/app_name""          android:screenOrientation=""portrait"" &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;data android:mimeType=""audio/wav"" /&gt;            &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","319618","","","","","2013-07-11 12:00:29","If my app was started via ACTION_VIEW, how do I retrieve the attached data?","<android><android-intent><intentfilter>","2","0","","",""
"4648201","1","6451192","","2011-01-10 15:07:58","1","456","<p>In my android app, I'd like to put buttons in the handle of a SlidingDrawer. </p><p>1) Do you think it's correct from a design point of view ?</p><p>2) How do I prevent the buttons to get focus when the handle is dragged ?</p><p>Thanks a lot.</p>","569558","","","","","2013-09-30 04:44:11","Buttons in a SlidingDrawer","<android><focus><slidingdrawer>","2","0","","",""
"4648239","1","8657127","","2011-01-10 15:12:19","2","3427","<p>I just figured out how to implement android c2dm client but on the server side i have some troubles. I made search running through the internet but all the samples are too complicated for me or they are written down in python. I need some basic samples for server side in C# or java. Could you suggest anything for me ? Thanks.</p>","569002","","469983","","2011-10-27 08:53:37","2012-04-26 09:17:10","Android C2DM Server Side","<c#><java><android><android-c2dm>","3","0","2","",""
"4648332","1","","","2011-01-10 15:23:50","8","1614","<p>I have written an application and now it's time to publish it. I'm wondering where to publish it (in Market or in my Website) thinking about future updates, are there any advantages I should know about when publishing on my site? What are the advantages or disadvantages if I publish it in Android's Market or in my site? I hope I'm making myself clear.</p><p>Best Regards.</p>","526924","","1055241","","2011-11-25 11:49:26","2011-11-25 11:49:26","Advantages of publishing an app in Android Market","<android>","5","1","2","",""
"4648413","1","4652856","","2011-01-10 15:33:15","9","2275","<p>First of all, I do not want to start a religious war here, and pardon me for telling you a little story first.</p><p>I originally chose emacs as my editor of choice during the time when I was able to make a choice. As an intern I was forced to use Vi for a small software shop where we are required to ssh to the servers (not to mention a very slow connection) and edit code from there because we're not allowed to have local copies of the source code. During that time, I was an Emacs uber noob who doesn't know about tramp. I didn't even know that I could start a shell at Emacs, so I gave Vi a try just to see what's in it for me.</p><p>At first, it felt like being forced to wear clothes I don't like, but time passed by and I came to like Vim. Two years of vim (and still counting) has been very productive learning experience for me. My current setup involves xmonad - a window manager, gnu screen - for fast shell switching, firefox with vimperator, and of course, vim. At work, I do my coding stuff using Vim+Eclim because all my other co-workers use Eclipse and I have to conform somewhat. In my workplace, I'm regarded as the guy who knows his way around Vim; but still, I secretly use Emacs at home.</p><p>I want to get back up to speed in Emacs, but in order for me to do that, I must use it for what I'm currently doing at work because I spend most of my time there. Vim+Eclim really helped me a lot with java stuff (code completion, imports, etc.) and I'm thinking of using its Emacs port, but I'm also trying out other alternatives that would not require me to have an eclipse process running in the background. Basically, I want something with code completion and on-save compile like what Eclipse/Eclim has. Is jdee/malabar mode enough to do this? Also, I'm coding Android stuff and I want Emacs to know where the Android libraries are, since most of the fundamental ones aren't usually imported as normal. </p>","373596","","","","","2011-01-10 23:52:02","What happened to emacs' java?","<java><android><emacs><editor>","2","2","3","",""
"4648477","1","","","2011-01-10 15:38:52","0","373","<p>I am developing android apps, yet I used shared-pref and JSON(rest web service) for storing data. I generally tend to prefer less sophisticated technologies, as I believe more complexity results in more issues. But for my new app, it may be better to have db-like storage. </p><p>What do you think about using SQLite in Android , is it really light? Have you experienced performance or compatibility issues developing SQLite for Android?</p><p>Namely would you recommend SQLite over simpler alternatives as android storage solution?</p><p>Thanks</p>","155626","","","","","2011-01-10 15:53:44","SQLite as Android storage?","<android><sqlite>","1","0","","",""
"4648503","1","","","2011-01-10 15:41:16","4","851","<p>I have a bit of a problem with a game I am working on. The game runs very well on most devices, except Samsung Tab and Galaxy S (it could be more, but I have reports about those two). </p><p>What happens on those devices is that the app appear extremely sluggish for 15s-120s then speeds up dramatically (from 5fs to 30fps, which is the normal performance elsewhere). This seems to happen only when the game is installed (or reinstalled).</p><p>What could cause that problem?</p><ul><li>On the first run, we create a couple of files on the SD card to store settings, but I doubt that could have a lasting effect?</li><li>The JIT takes a whiles to kick in? But it runs perfectly fine on other platform with and without the JIT. Admitedly, by disabling the JIT, it appears that the slowdown will last longer on the Tab, so there may be an effect.</li><li>Could it be that the device tries to rearrange out the objects are laid out in memory? The game does take quite a bit of space in memory.</li><li>Is there any known problem with Samsung devices? (It appears to be a problem on those only)</li></ul><p>Any help is welcome.</p>","3610","","","","","2011-01-19 22:06:58","Android: performance increase of the app after 15s-120s. Why?","<android>","1","4","3","",""
"4648519","1","","","2011-01-10 15:43:00","0","240","<p>Please tell that which Versions of (Android Development Tools i.e. Java JDK, Android SDK, Eclipse &amp; ADT Plugin) are MOST Compatible/Promising with 2.3 Gingerbread &amp; in which Order I should Install them. please mention, if some tool is omitted.</p>","514892","","","","","2011-01-11 16:24:03","Which Versions of ""Android Development Tools"" are most Promising/Compatible with Gingerbread & In which order, they should be installed?","<android>","1","0","","",""
"4648525","1","","","2011-01-10 15:43:34","1","401","<p>I am fairly new to the android sdk and databases and have been searching for an answer to this quite some time.</p><p>I am trying to build an app which has multiple tables within a database. e.g. one for weapons, armours etc.</p><p>However, my DatabaseManager class which handles all of my table creating, DatabaseHelper inner class and populating of data is creating for an extremely large class requiring high maintenance. Every time I would like to add or remove a table column I need to change quite a few areas of code,- Every reference to the addition of a row in that table with data- The method that the above calls- The method returning all of the database rows- The code in the helper class creating the table- Any specific update methods</p><p>My question is this: Surely there must be some better way of coding this system, maybe using a database isn't the best way to go, or am i just not used to such large classes having only learned java at university and my largest class consisting of a mere 400-600 lines of code.</p><p>Thanks for any help!</p>","570024","","","","","2011-01-10 16:42:32","Extendable accessing of sqlite database on android platform","<java><android><database><sqlite><maintainability>","1","1","","",""
"4648709","1","","","2011-01-10 15:59:59","1","155","<p>I know android not includes all of java's library.but I just want to know can I add the jars to replace with  some of java's lib. not included in Android?thank you all in advance.</p>","551273","","","","","2011-01-10 16:01:59","Does Android do All the things that Java can do?","<java><android>","0","1","","",""
"4648793","1","","","2011-01-10 16:09:55","0","415","<p>I know this topic was asked trillions of times throughout the web, but there is no one place answering it. </p><p>in my application, I have a welcome screen. when I run the program end-to-end everything is just fine - open/close activities and show dialogs of all sorts.<br>but, when I reach the welcome screen and from there pressing the <strong>BACK</strong> button - everything becomes messy:<br>1) the dialog i want to show cause BadTokenException (i'm using <code>this</code> and not <code>getApplicationContext()</code> ).</p><p>2) I tried use try/catch to catch the exception - and it really passed the <code>showDialog</code> line. but then, in the 2nd. run, when reaching a <code>showDialog</code> expression, it throws <code>IllegalStateException: View.com.android.internal.policy.impl.PhoneWindow$DecorView@44a59830 has already been added to the window manager</code>.</p><p>moreover, I understand that pressing HOME causes the onPause in the activity, while BACK causes onDestroy, but what goes wrong ??</p><p>i'm trying to fix that issue for <strong>more than a week</strong>, but with no success.any ideas ?</p>","566155","","","","","2011-01-10 16:17:22","BadTokenException - BACK button","<android>","1","0","","",""
"4648875","1","4648962","","2011-01-10 16:17:37","0","5997","<p>I have the following code to try and set the weight of a linearLayout to 0.7, after looking at the documentation and some examples online it says it takes 3 parameters but in my code it will not let me:</p><pre><code>LinearLayout linear = new LinearLayout(this); linear.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));</code></pre><p>So here it sets both the height and the width but the last parameter it says in the documentation is the weight and it wont let me put it in there.</p>","400406","","","","","2011-01-10 17:01:41","Set LinearLayout weight in code rather than xml problem","<java><android><android-linearlayout>","3","0","","",""
"4648881","1","4649208","","2011-01-10 16:18:07","0","125","<p>As the title says, I need a simple explanation: Is Android view the same as Control in .NET? As we have button view, textfield view, etc., it looks like it's the same as control in .NET.</p>","437039","","","","","2011-01-10 16:50:53","Is Android view the same as Control in .NET?","<.net><android><view><control>","3","0","1","",""
"4648911","1","4648947","","2011-01-10 16:20:40","6","10379","<p>Eclipse Helios 3.6<br />Windows XP SP3</p><p>I have used Eclipse to download the guava SDK by doing:<br />1) In Eclipse go to <em>Help > Install New Software...</em><br />2) In the ""<em>Work with:</em>"" text box I used the following URL<br /></p><p><a href=""http://svn.codespot.com/a/eclipselabs.org/guava-bundle/trunk/repository/"">http://svn.codespot.com/a/eclipselabs.org/guava-bundle/trunk/repository/</a><br /><br />3) It found the Guava: Google Core Libraries for Java 1.5 Runtime and SDK, so I clicked ok to each message and they seemed to install fine.<br /><br />Now I want to use it in my code (for an Android app) I am trying to add an import to one of my class files </p><pre><code>import com.google.common.collect.MapMaker;</code></pre><p>I get a compile error message</p><blockquote>  <p>The import com.google cannot be  resolved</p></blockquote><p>Is there any special step I need to perform in order add the library to my project? <br /><br />I have been looking through the project properties, I've got a feeling I need to add an entry to <em>Java Build Path > Libraries</em> but I do not know what to add.</p>","379115","","","","","2011-01-10 16:44:52","How to add Guava to Eclipse project","<java><android><eclipse><guava>","4","0","1","",""
"4648926","1","4649240","","2011-01-10 16:22:29","0","603","<p>I have this problem, when I try to make a new bitmap for another one, like this: </p><pre><code>first_data = Bitmap.createBitmap(data, 0, 0, data.getWidth() / 2,data.getHeight()); second_data =  Bitmap.createBitmap(data, data.getWidth() / 2, 0, data.getWidth() / 2, data.getHeight() ); </code></pre><p>I meet an OutOfMemoryException... </p><p>If i use only the original full image I don't meet this issues, I think that Bitmap.createBitmap() make a copy of the original first image. There are a way to specify that I DON'T WANT make a copy of that? Thanks a lot!</p>","554892","","","","","2011-01-10 16:54:46","Create a subset of Bitmap without make a copy","<android>","1","2","","",""
"4648937","1","4649211","","2011-01-10 16:24:00","1","343","<p>I fetch JSON from the web with AsyncTask and also parse JSON in method doInBackground(). I start my progressDialog in onPreExecute() and dismiss it in onPostExecute(). The problem is that my dialog is never dismissed and then i receive wait/force close question or the emulator just freezes. I tried parsing JSON from local file and it worked. My second log.d() in doInBackground() is never printed, only the first one.  </p><p>My doInBackground() looks like this:</p><pre><code>private class DownloadFilesTask extends AsyncTask&lt;String, Void, String&gt; {     protected String doInBackground(String... url) {        DefaultHttpClient httpClient = new DefaultHttpClient();        URI uri;        InputStream data=null;        String x="""";        try {                       uri = new URI(url[0]); //url of my JSON file            HttpGet method = new HttpGet(uri);            HttpResponse response = httpClient.execute(method);            data = response.getEntity().getContent();            byte [] buffer = new byte[data.available()];             Log.d(""First: "",""ziv"");            while (data.read(buffer) != -1);             Log.d(""Second: "",Integer.toString(buffer.length));            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 += ""Date:"" + post.getString(""created_at"") + ""\n"";                 x += ""Post:"" + post.getString(""text"") + ""\n\n"";            }        }            catch (IOException je)        {            je.printStackTrace();           }        catch (URISyntaxException ur) {            ur.printStackTrace();        }        catch (JSONException je) {            tvData.setText(""Error w/file: "" + je.getMessage());        }        return x;    }</code></pre><p>Where am i doing mistekes?</p>","324417","","","","","2011-01-10 16:53:07","ProgressDialog is never dismissed when fetching JSON with AsyncTask","<java><android><json><android-asynctask>","2","0","","",""
"4649061","1","4649225","","2011-01-10 16:36:05","0","144","<p>I'd like to get a list of apps on an Android device that are able to use (or to be launched with) PNG's.</p><p>I'm using this code:</p><pre><code>final Intent msg = new Intent(Intent.ACTION_MAIN, null);msg.setType(""image/png"");final List pkgAppsList = context.getPackageManager().queryIntentActivities(msg, 0);</code></pre><p>But it return zero, which does not reflect reality.Any other ways of asking the framework about app abilities?</p><p>Pom</p>","54155","","","","","2011-01-10 16:53:02","Android: Listing app intents able to use png's","<android>","1","0","","",""
"4649086","1","","","2011-01-10 16:38:21","1","644","<p>I am trying to run the emulator and each time I tried it it gives me the same error message 'Application stopped unexpectedly' I tried sorting it by killing the adb process in the task manager. The log cat error says:</p><p>WARNING: Application does not specify an API level requirement!Device API version is 7 (Android 2.1-update1)</p><p>I do not know how this could be sorted, or if there is any other issue.</p><p>Please help, thanks! </p><p>Amrita</p>","570110","","","","","2011-05-10 06:47:52","Running the Android emulator","<android><android-emulator>","2","1","1","",""
"4649153","1","4649933","","2011-01-10 16:45:44","0","292","<p>I received my new computer friday and after moving over all of my development projects, my Eclipse ""hover"" popups have quit working. What I mean is usually when I hover over an element/method/etc... , a small window with the javadoc info will pop up telling me parameters, and a description of the method. Now it just says:</p><p>Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc.</p><p>I've already seen <a href=""http://stackoverflow.com/questions/4516063/error-in-java-this-element-has-no-attached-source-and-the-javadoc-could-not-be-fo"">this</a> SO post and tried it. Although I will say there are 15 different packages when you go into preferences>java>installed jre's>edit. All point to an http:// address for the docs. </p><p>Also the Android documentation I installed doesn't pull up either (which is what I'm developing for).</p>","302994","","","","","2011-01-10 18:17:57","New computer, broken Eclipse","<java><android><eclipse><javadoc>","1","3","","",""
"4649183","1","4653552","","2011-01-10 16:48:27","8","6044","<p>I've opened a bug but i was wondering if anyone encountered this issue and knows a workaround.If you define a text view with a hint inside it, give it right gravity (android:gravity=""right"") then if you define android:singleLine=true or android:maxLines=""1"" or android:scrollHorizonatally=""true"" you don't see the hint. removing the right gravity returns the hint to the left side, removing all the tree params i mentioned above puts the hint on the right side. i want my hint on the right, but i need a single horizontal line...</p><p>here's the sample layout that doesn't show the hint:</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:padding=""5dp""&gt;            &lt;EditText android:layout_width=""fill_parent""                android:layout_gravity=""center_vertical|right""                android:layout_height=""wrap_content""                android:layout_margin=""6dp""                android:textSize=""16sp""                android:paddingRight=""5dp""                android:id=""@+id/c""                android:gravity=""right""                android:hint=""hello!!!""                android:scrollHorizontally=""true""                android:maxLines=""1""                android:singleLine=""true""/&gt;&lt;/LinearLayout&gt;</code></pre><p>i checked on 1.6 and 2.1 emulators and it reproduces 100%, i'm prettysure it's a bug, i don't see the connection between single line and the hint.... what's more the hint got it's own layout in the TextView (mLayout and mHintLayout both exists, in onDraw if the text length is 0 mHintLayout if mHint is not null is used).</p>","312288","","","","","2014-03-11 13:22:50","hint and textview with right gravity and a singleline","<android><textview><hint>","7","0","0","",""
"4649345","1","4649556","","2011-01-10 17:03:16","0","778","<p>This is my first post, and I've only recently started programming for Android and OpenGl, so be nice to me :)</p><p>I'm writing a little app that will include one screen that will use a palettised image for quick changes in colour. For speed I thought I could implement the system using a shader, so I have a shader up and running using the fantastic examples from the Open GL ES 2.0 programming guide. The problem that I've been banging my head over for the past couple of days is coming up with a way of referencing my palette data within the shader.</p><p>My shader currently is:</p><pre><code>precision lowp float;varying vec2      v_texCoord;uniform sampler2D s_texture;uniform int       s_palette[204];  // Specify a palette of 64 rgb entriesvoid main(){   vec4 col = texture2D( s_texture, v_texCoord );   int index = (int(col.r * 255.0) * 3;   gl_FragColor = vec4(float(s_palette[index]) / 255.0, float(s_palette[index+1]) / 255.0,  float(s_palette[index+2]) / 255.0, 1.0);}</code></pre><p>After playing around with this for ages and not getting very far I discovered that if I reference my palette data by a constant value I could get results, but not by referencing with a variable. Having searched for a while with Google I discovered that this was just the way it was with GLSL 1.1 and was fixed with GLSL 1.3.  I believe Android is running on GLSL ES1.0 which is based on GLSL 1.3, so it should work, but I can't for the life of my get it to work.  I can't find anything in the GLSLES specs that would suggest it's not possible either, so where am I going wrong?</p><p>If it simply isn't possible, then does anyone have any other ideas how to get around this rather crippling flaw in my plan?</p>","524147","","349130","","2011-01-10 17:25:25","2011-01-10 17:27:12","Array indexing in fragment shader","<android><opengl-es>","1","0","","",""
"4649420","1","4649462","","2011-01-10 17:12:55","2","5742","<p>I downloaded the android source code for callLog UI for the Contacts, Call log, and Dialer applications using this link <a href=""https://android.googlesource.com/platform/packages/apps/Contacts/"" rel=""nofollow"">https://android.googlesource.com/platform/packages/apps/Contacts/</a></p><p>Now, I want to use it on eclipse. But when I try to import the project,it says it didnt found the project. Then I tried to set all the configurations manually, but it show a lot of errors with the importing, the AndroidManifest.xml, with the R.java, etc.</p><p>So is there any way of import this directly as a project to eclipse?</p><p>Thanks.</p>","399459","","399459","","2012-12-17 15:26:52","2014-01-04 09:06:29","How to import the Android source code in Eclipse?","<android><android-widget><android-layout><android-manifest><android-source>","2","1","1","",""
"4649438","1","4649842","","2011-01-10 17:14:23","19","25016","<p>What is the best way to retrieve the dimensions of the Drawable in an ImageView?</p><p>My ImageView has an Init-Method where i create the ImageView:</p><pre><code>private void init() {    coverImg = new ImageView(context);    coverImg.setScaleType(ScaleType.FIT_START);    coverImg.setImageDrawable(getResources().getDrawable(R.drawable.store_blind_cover));    addView(coverImg);}</code></pre><p>At some point during the layout oder measure process i need the exact dimensions of the Drawable to adjust the rest of my Components around it.</p><p><code>coverImg.getHeight()</code> and <code>coverImg.getMeasuredHeight()</code> don't return the results that i need and if i use <code>coverImg.getDrawable().getBounds()</code> i get the dimensions before it was scaled by the ImageView.</p><p>Thanks for your help!</p>","457378","","","","","2014-04-11 20:21:56","How to get the Dimensions of a Drawable in an ImageView?","<android><imageview><dimensions>","3","0","9","",""
"4649508","1","4649616","","2011-01-10 17:20:13","10","48910","<p>I know we have back button in android to move us back on the previous form, but my team leader asked to put a back button functionality on button click</p><p>How can I do this?</p>","566590","","27385","","2013-08-26 10:31:45","2013-08-26 10:31:45","Trigger back-button functionality on button click in Android","<android>","6","0","3","",""
"4649522","1","4649542","","2011-01-10 17:21:56","0","3765","<p>i have created a calendar where a suer can scroll through previous and next months calendar but the issue i am having is when the user tries to scroll into the previous month. </p><p>when the user clicks to the previous month the first time the app is run, it works but when the user clicks again it doesnt dispite the value i am sending to the Calendar.Set() being 100% correct and even debugged it yet the actual calendar doesnt update and therefore returns me the same month as the current one!</p><p>here is my code below.</p><pre><code>@Overridepublic void onClick(View v) {    // get current month    int currentMonth = mCurrentMonth.get(Calendar.MONTH);    Log.d(TAG, ""day = "" + mCurrentMonth.get(Calendar.DAY_OF_MONTH));    Log.d(TAG, ""currentMonth in onClick = "" + currentMonth);    if (v == mPreviousMonthButton) {        Log.d(TAG, ""mPreviousMonthButton CLICKED "");        // if current month is january        // decrement the current year and set month to december        if (currentMonth == Calendar.JANUARY) {            int currentYear = mCurrentMonth.get(Calendar.YEAR);            mCurrentMonth.set(Calendar.YEAR, currentYear - 1);            mCurrentMonth.set(Calendar.MONTH, Calendar.DECEMBER);        } else {            // else decrement the month            Log.d(TAG, ""currentMonth-- = "" + currentMonth);            mCurrentMonth.set(Calendar.MONTH, currentMonth);            Log.d(TAG,                    ""month in previus button = ""                            + mCurrentMonth.get(Calendar.MONTH));        }        // save the month        setDateForMonth();    } else if (v == mNextMonthButton) {        Log.d(TAG, ""mNextMonthButton CLICKED "");        if (currentMonth == Calendar.DECEMBER) {            int currentYear = mCurrentMonth.get(Calendar.YEAR);            mCurrentMonth.set(Calendar.YEAR, currentYear + 1);            mCurrentMonth.set(Calendar.MONTH, Calendar.JANUARY);        } else {                                currentMonth--;            mCurrentMonth.set(Calendar.MONTH, currentMonth + 1);            Log.d(TAG, ""currentMonth++ = "" + currentMonth + 1);            Log.d(TAG,                    ""month in next button = ""                            + mCurrentMonth.get(Calendar.MONTH));        }        // save the month        setDateForMonth();    }}</code></pre><p>here is the code that actually updates the UI. the problem is somwhere in the onClick as it returns the wrong month in the code below:</p><p>private void setDateForMonth() {</p><pre><code>    monthList.clear();    Log.d(TAG, "".........setDateForMonth..........."");    Log.d(TAG, ""...................."");    Log.d(TAG, ""month = "" + mCurrentMonth.get(Calendar.MONTH));    Log.d(TAG, ""year = "" + mCurrentMonth.get(Calendar.YEAR));    CalendarMonth[] months = CalendarUtils            .constructMonthViewArray(mCurrentMonth);    for (int i = 0; i &lt; months.length; i++) {        monthList.add(months[i]);        Log.d(TAG, monthList.get(i).getDay());    }    Log.d(TAG, ""...................."");    mAdapter = new CalendarMonthAdapter(mContext, monthList);    mMonthGridView.setAdapter(mAdapter);    Months[] month = Months.values();    String currentMonth = month[mCurrentMonth.get(Calendar.MONTH)]            .toString();    String year = Integer.toString(mCurrentMonth.get(Calendar.YEAR));    mMonthLabel.setText(currentMonth + "" "" + year);}</code></pre><blockquote>  <p>private enum Months {         January,  February, March, April, May, June,  July, August, September, October,  November, December    };</p></blockquote>","444668","","444668","","2011-01-11 09:01:55","2013-05-28 10:39:05","Java Calendar date month not set correctly","<java><android><calendar>","4","2","","",""
"4649562","1","4651659","","2011-01-10 17:28:26","22","15078","<p>I have two system that I've installed Eclipse (3.6) and the Android development tools (SDK, ADT). They both have the same versions. However, on one system, under the File -> New menu, there are Android specific items - New Android Project, New Android XML file. But on the other, those specific menu items are not there. Yes, I can get to the items by choosing File -> New -> Project, then in the dialog pick Android Project, but was wondering why I don't have the specific items.</p><p>I've tried reinstalling Eclipse and the Android items, but the menu items just don't match.</p><p>Anyone more familiar with Eclipse and it's add-ons like Android have any idea? (Both system do have the ""Open Android AVD and SDK"" item under the window menu, FWIW)</p><p>Thanks.</p>","180359","","","","","2013-10-26 21:40:11","Eclipse with Android SDK missing menu items","<android><eclipse>","3","0","5","",""
"4649569","1","4664347","","2011-01-10 17:28:59","10","903","<p>as mentioned above, I want to get the total number of battery chrarges.The batery Intent I'm already using only shows me Level, Voltage, Temperature ... but not the total loading cycles.</p>","570168","","418613","","2012-06-08 12:34:15","2012-06-08 12:34:15","How to read the number of battery charges?","<java><android><power-management>","1","3","4","",""
"4649597","1","","","2011-01-10 17:32:09","0","1031","<p>is it possible to format a textview for a widget so that it looks like the text below the apps.</p><p>like in this screenshot:</p><p><img src=""http://i.stack.imgur.com/94DYd.png"" alt=""alt text""></p><p>i am looking for the exact textcolor, the exact dropshadow and the rounded background.</p>","97688","","","","","2011-01-10 18:22:59","android: format textview","<android><textview>","1","0","","",""
"4649662","1","","","2011-01-10 17:38:13","2","1045","<p>I'm wondering how Handlers are processed in Android/DalvikVM. I'm writing an application for Android, and in one class I have a Handler method which receives messages from another class. Will the Handler method act as a Thread and be asynchronous to the run() method in the same class, or will it wait until a line of code in the run() method is finished (sort of atomic operation)? Or something else?</p><p>I'm wondering, because I want to add messages to a queue in the Handler method, and process and remove them in the run() method (producer-consumer).</p><p>My code structure:</p><pre><code>public class Parser implements Runnable {    public void run() {            while(true) {            // Remove a byte from the ring buffer and parse it            byte b = Ringbuffer_read();            // Parse        try {                Thread.sleep(40);            } catch (InterruptedException e) {}           }    }    private final Handler mHandler = new Handler() {        @Override        public void handleMessage(Message msg) {            switch (msg.what) {            case MESSAGE_READ:                // Store all the received bytes in the ring buffer                for (int i = 0; i &lt; msg.arg1; i++) {                    Ringbuffer_store(((byte[]) msg.obj)[i]);                }                break;            }        }    };}</code></pre><p>When will the code in the handler run? Does it interrupt the code in the run() method at any point? Do I have to have some synchronization or semaphores or something around the code in the run() and handler method so that I don't corrupt my buffer?</p>","570184","","570184","","2011-01-14 07:59:43","2011-08-24 06:30:51","How does Android/DalvikVM process Handlers?","<android><handler><producer><consumer>","1","0","","",""
"4649732","1","4649752","","2011-01-10 17:46:39","1","184","<p>I need a storage type that I can set a max number of elements for and whenever I add something to the tail, the head is truncated as necessary with low overhead. I can of course do this manually if I have to. Example</p><p>max = 1000</p><p>fill it with integers 1-1000 : [1,2,...,999,1000]</p><p>add numbers 1000 - 1500 : [500,501,....,1499,1500]</p><p>It has to be as cheap an operation as possible since I will be running multiple threads at this time, one doing audio recording. I don't care about keeping the head elements as they are popped off, I would like to get rid of them in a bulk operation.</p><p>I checked out the queue types in the SDK, not sure which could suit these needs, possibly a linked queue of some kind.</p><p>Thanks for any help</p>","415422","","166749","","2011-01-10 18:11:09","2011-01-10 18:11:09","most efficient data storage object for queuing a max number of elements","<java><android><algorithm><data-structures>","1","0","","",""
"4649808","1","4650589","","2011-01-10 17:54:35","20","5148","<p>I want to implement a SyncAdapter for a content I want to synchronize with a server. It seems that to do so, you need a ContentProvider registered for the authority you specify in the SyncAdapter XML property file.</p><p>As I don't want this content to be accessible to the rest of the phone, I haven't implemented my own ContentProvider and used a personal implementation to store this content.</p><p>Do you know if it is possible to provide a synchronization using a SyncAdapter without providing a ContentProvider?</p><p>Thank you very much.</p>","570202","","","","","2011-01-10 19:23:57","SyncAdapter without a ContentProvider","<android><android-contentprovider><android-syncadapter>","1","1","13","",""
"4649827","1","","","2011-01-10 17:56:52","1","2768","<p>I have a problem with android, with a button. I programmed thebutton like it was in the developer pages to display a text in atextview when clicked, but when I run my application I have to pressmy button twice to make it happen. I thought it might have somethingto do with focus, but I'm not sure.</p><p>Also, when I apply a theme (see styles and themes) I even have topress any button twice, not only the button stated above, but forexample also the 'yes' or 'no' button in the question to quit theapplication (via a Dialog)</p><p>I searched forums for this, but didn't findthe answer I was looking for. Hopefully someone can provide me with anidea.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    root = (LinearLayout) findViewById(R.id.root);    ((Button) findViewById(R.id.btnZoeken)).setOnClickListener(            new Button.OnClickListener(){                @Override                public void onClick(View arg0) {                    zoekOpPostcodes(txtZoeken.getText().toString());                }                private void zoekOpPostcodes(String zoekterm){                                                //more irrelevant code                                         txtResultaat.setText(txtRes);                            }//more irrelevant codeprivate void quit() {    // prepare the alert box    AlertDialog.Builder abQuit = new AlertDialog.Builder(this);    // set the message to display    abQuit.setMessage(""Weet je zeker dat je wil afsluiten?"");    // set a positive/yes button and create a listener    abQuit.setPositiveButton(""Ja"", new DialogInterface.OnClickListener() {        // do something when the button is clicked        public void onClick(DialogInterface arg0, int arg1) {            Toast.makeText(getApplicationContext(), ""Tot ziens!"", Toast.LENGTH_LONG).show();            iRegionForAndroid.this.finish();        }    });    // set a negative/no button and create a listener    abQuit.setNegativeButton(""Nee"", new DialogInterface.OnClickListener() {        // do something when the button is clicked        public void onClick(DialogInterface arg0, int arg1) {            Toast.makeText(getApplicationContext(), ""Afsluiten geannuleerd!"", Toast.LENGTH_SHORT).show();        }    });    // display box    abQuit.show();</code></pre><p>}</p><p>If you need any more of my code for this, ""ask and you shall receive"" :)seems to be something wrong with the ""code"" sections, it doensn't contain all the code, but portions of it under the ""code"" section</p>","570204","","429108","","2012-05-04 15:28:13","2012-05-04 15:28:13","Button clicking twice","<android><button>","1","3","","",""
"4649874","1","4683488","","2011-01-10 18:02:42","0","974","<p>Hi my app has 3 activities one of which is a dialog. I've done this by using this code in the AndroidManifest.xml</p><pre><code>android:theme=""@android:style/Theme.Dialog""</code></pre><p>the application also has a service which can open the dialog even if the application is not visible, however when it does this it also opens one of the other activities in the background. Is there a way to stop this happening so it opens the dialog in front of the current activity (even if the activity is from a different application)?</p><p>Thanks,ng93</p>","364727","","","","","2012-01-19 10:23:16","android dialog opening another view behind it","<android><dialog><notifications>","3","0","","",""
"4649885","1","4649937","","2011-01-10 18:04:15","1","1034","<p>I'm building an android app with a signup activity. When the signup is successful, I want to show an alertbox with a success message and go back to the parent activity.The problem is that the alertbox is shown only for a brief time and then I go back immediately to the parent activity, without pressing any button in the alertbox.my code is:</p><pre><code>case RESPONSE_USER_SIGNUP_SUCCESS:                          showAlertBoxSignupSuccess();            Intent returnIntent = new Intent();            returnIntent.putExtra(""email"", email);            setResult(RESULT_OK, returnIntent);                    this.finish();            break;private void showAlertBoxSignupSuccess() {    AlertDialog.Builder alertbox = new AlertDialog.Builder(this);    alertbox.setTitle(""The account was successfuly created"");    alertbox.setNegativeButton(""OK"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface arg0, int arg1)         {            arg0.dismiss();        }    });    alertbox.show();}</code></pre><p>My question is, how can I make it wait until the the user clicks the button in the alertbox and then go to the parent activity?</p><p>Thank you!!</p>","536912","","","","","2011-01-10 18:09:42","Alert dialog closes without pressing the button","<android><android-layout>","1","0","","",""
"4649969","1","4658800","","2011-01-10 18:13:16","1","2928","<p>I want to open audio attachments in emails with my app. Currently my intent filter is like so:</p><pre><code>&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;data android:mimeType=""audio/wav"" /&gt;        &lt;data android:scheme=""http"" android:host=""*"" android:pathPattern="".*\\.wav""/&gt;        &lt;data android:scheme=""https"" android:host=""*"" android:pathPattern="".*\\.wav""/&gt;        &lt;data android:scheme=""content"" android:host=""*"" android:pathPattern="".*\\.wav""/&gt;        &lt;data android:scheme=""file"" android:host=""*"" android:pathPattern="".*\\.wav""/&gt;&lt;/intent-filter&gt;</code></pre><p>This works for everything I want it to except for email attachments. Currently if I'm sent a wav file, the only thing I can do is preview it, and that opens with Winamp (so clearly 3rd party apps have a way in). I can't find what I should be adding to do this though, does anyone have any idea?</p><p><strong>Edit</strong></p><p>Here's what LogCat has to say on the matter. When I click Preview I get</p><pre><code>01-10 19:28:52.691: INFO/ActivityManager(109): Starting: Intent { dat=content://gmail-ls/messages/xxxxxxx%40gmail.com/439/attachments/0.1/BEST/false cmp=com.google.android.gm/.ViewAttachmentActivity } from pid 19483</code></pre><p>What's bizarre is that Winamp automatically opens, and is not set as default. I'm given no choice...</p>","319618","","319618","","2011-01-10 19:54:38","2011-01-11 14:44:20","Intent filter for email attachments","<android><android-intent><email-attachments><intentfilter>","2","4","0","",""
"4650016","1","4650084","","2011-01-10 18:18:13","6","4597","<p>I extend <code>BroadcastReceiver</code>, and in <code>onReceive()</code> I do whatever I need to do.</p><p><code>onReceive()</code> has a timeout, from the documentation:</p><blockquote>  <p>there is a timeout of 10 seconds that  the system allows before considering  the receiver to be blocked and a  candidate to be killed</p></blockquote><p>This creates a problem when I am in debug mode. I need more than 10 seconds (sometimes). If I don't do all my debugging in 10 seconds my connection is closed and debugging is stopped.</p><p>Can I increase the timeout or disable it for debugging purposes?</p><p>Thanks.</p>","32188","","","","","2013-12-19 17:13:01","BroadcastReceiver onReceive timeout","<android><timeout><broadcastreceiver>","2","2","3","",""
"4650146","1","","","2011-01-10 18:33:56","1","394","<p>i am really stuck on this:</p><p>I have longitude / latitude points to draw on a google map within an android app.Therefor I created a class extending Overlay...</p><p>I get the current longitude/latitude portion of view via:</p><pre><code>GeoPoint topLeft = proj.fromPixels(0, 0);GeoPoint bottomRight = proj.fromPixels(width-1, height-1);int topLat = topLeft.getLatitudeE6();int topLon = topLeft.getLongitudeE6();int bottomLat = bottomRight.getLatitudeE6();int bottomLon = bottomRight.getLongitudeE6();</code></pre><p>The following works (only latitudes):</p><pre><code>if(latLon[0] &gt;= bottomLat &amp;&amp; latLon[0] &lt;= topLat){ // do something; }</code></pre><p>but this does not work (longitudes):</p><pre><code>if(latLon[1] &gt;= topLon &amp;&amp; latLon[1] &lt;= bottomLon) { // do something; }</code></pre><p>latLon[0] is the latitude I want to checklatLon[1] is the longitude I want to check</p><p>Anybody an idea?</p><p>Greetz!</p>","570233","","158288","","2011-01-10 19:19:41","2011-01-12 03:40:55","How to calculate existence of longitude / latitude in current view","<java><android><google-maps><latitude-longitude>","1","0","","",""
"4650159","1","4650618","","2011-01-10 18:35:30","0","537","<p>i have this rss feed to parse that contains several tags. i am able to retrieve the value (child element) for all except for the description tag node. please find below the rss feed</p><pre><code>&lt;fflag&gt;0&lt;/fflag&gt;&lt;tflag&gt;0&lt;/tflag&gt;&lt;ens1:org&gt;C Opera Production&lt;/ens1:org&gt;-&lt;description&gt;&lt;p&gt;Opera to be announced&lt;/p&gt;&lt;p&gt;$15 adults/$12 seniors/$10 for college students&lt;span style=""white-space: pre;""&gt; &lt;/span&gt;&lt;/p&gt;&lt;/description&gt;</code></pre><p>the code that i am using for this is </p><pre><code>    StringBuffer descriptionAccumulator = new StringBuffer();else if (property.getNodeName().equals(""description"")){                    try{                        String desc = (property.getFirstChild().getNodeValue());                        if(property.getNodeName().equals(""p"")){                            descriptionAccumulator.append(property.getFirstChild().getNodeValue());                        }                    }                    catch(Exception e){                        Log.i(tag, ""No desc"");                    }else if (property.getNodeName().equals(""ens1:org"")){                try{                        event.setOrganization(property.getFirstChild().getNodeValue());                        Log.i(tag,""org""+(property.getFirstChild().getNodeValue()));                    }                    catch(Exception e){                    }else if (property.getNodeName().equals(""area"")||property.getNodeName().equals(""fflag"") || property.getNodeName().equals(""tflag"") || property.getNodeName().equals(""guid"")){                    try{                        //event.setOrganization(property.getFirstChild().getNodeValue());                        Log.i(tag,""org""+(property.getFirstChild().getNodeValue()));                    }                    catch(Exception e){                    }else if(property.getNodeName().equals(""p"") || property.getNodeName().equals(""em"") || property.getNodeName().equals(""br"") || property.getNodeName().startsWith(""em"") || property.getNodeName().startsWith(""span"") || property.getNodeName().startsWith(""a"") || property.getNodeName().startsWith(""div"")  || property.getNodeName().equals(""div"")  || property.getNodeName().startsWith(""p"")){                    descriptionAccumulator.append(property.getFirstChild().getNodeValue());                    descriptionAccumulator.append(""."");                    System.out.println(""description added:""+descriptionAccumulator);                    Log.i(""Description"",descriptionAccumulator+property.getFirstChild().getNodeValue());                }</code></pre><p>I tried capturing the value of <code>&lt;description&gt;</code> tag but that dint work out, so I tried using all the usual html formatting tags that are used but still no way out. using any other parser is not an option. could some body please help me out with this. thanks</p>","377337","","","","","2011-01-10 19:26:23","android dom parser issue","<android><rss><domparser><dom-parser>","2","0","","",""
"4650242","1","4650862","","2011-01-10 18:46:07","0","457","<p>I'm trying to install my test app on my device, but I does not go there.</p><p>I've also prepared my phones as described here: <a href=""http://developer.android.com/guide/developing/device.html"" rel=""nofollow""> here</a></p><p>1 - In eclipse I see the device with '??????????' as ID.</p><p>2 - with adb device, I get:</p><pre><code> List of devices attached </code></pre><p>????????????    no permissions</p><p>I edited the /etc/udev/rules.d/51-android.rules....not sure what else to do?</p><p>3 - I copies the app to my SD card and tried to installed it from there ... but at a point the installation stopped and the message was 'Application not installed'</p><p>Also! The app gets intalled on my friends phone via eclipse?</p><p>Can anybody give me a hand with this???</p><p>Thanks!</p>","481828","","390989","","2011-02-04 03:40:57","2011-02-04 03:40:57","Problem installing an app on a device - NO PERMISSIONS","<android><permissions><device>","3","2","","",""
"4650246","1","4651027","","2011-01-10 18:46:23","12","12712","<p>I have an activity with a Dialog theme and I would like to close (finish) this activity when someone touches the screen anywhere outside this activity's window ? How can I do this ?</p>","467780","","","","","2014-04-05 12:03:04","How to cancel an Dialog themed like Activity when touched outside the window?","<android><dialog><activity><touch><cancel>","10","2","10","",""
"4650292","1","4651978","","2011-01-10 18:50:34","0","379","<pre><code>private ArrayAdapter&lt;String&gt; arr_adapt ;str_eye_cat = ""Select^""+str_eye_cat;str_arr = fun.split(str_eye_cat.trim(), ""^"");arr_adapt = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, str_arr);arr_adapt.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);                spn_eye_cat.setAdapter(arr_adapt);</code></pre><p>i have used above code....</p><p>but i want to increase the size of the list in the spinner so that user can see what he is selecting </p>","566590","","566590","","2011-04-19 07:56:16","2011-04-19 07:56:16","how to adjust data in spinner if data's length is too long?","<android><data><spinner>","1","2","","",""
"4650293","1","7112803","","2011-01-10 18:50:40","10","2333","<p>I use BroadcastReceiver to intercept incoming call on Android phone as below</p><pre><code>tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);Bundle bundle = intent.getExtras();String number = bundle.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);</code></pre><p>In the ""private number"" case, I tested on two devices, it shows the number as -1 on HTC Wildfire and -2 on Galaxy S. I checked the android.telephony.PhoneNumberUtils but it could't help me.</p><p>Is there a function or a generic way to detect a private number on Android phone? Thanks</p>","301132","","368003","","2011-01-10 18:52:30","2011-08-18 19:10:46","Android: how to detect a private number programmatically","<android><call><telephony>","1","0","0","",""
"4650522","1","4650573","","2011-01-10 19:15:04","0","612","<p>What is the best platform and setup for running Android SDK?  It is so slow that I cannot stay focused on it.</p><p>If I had any hardware resources at my disposal and cost wasn't an issue, what should I do?</p><p>Also, is there some sort of cloud SDK host that can provide a faster experience.  (Security isn't a concern.  Just need to debug web sites.)</p>","512453","","","","","2011-01-10 19:20:49","What is the fastest Android SDK setup?","<android><android-emulator>","2","3","1","",""
"4650612","1","4650776","","2011-01-10 19:25:59","3","1313","<p>HTML5 supports a <a href=""http://www.quackit.com/html_5/tags/html_iframe_tag.cfm"" rel=""nofollow"">seamless IFRAME</a>, which is a way to do an include of headers and footers of HTML now. I tried this on the Android (2.2) browser, which I thought was supposedly HTML5-based, but it didn't work. Is there a way to do HTML file includes on Android?</p><p>My sample that I tried was composed of an index.html, header.html, and footer.html. In index.html, it had:</p><pre><code>&lt;!DOCTYPE HTML&gt;&lt;iframe seamless=""seamless"" src=""header.html"" sandbox=""allow-top-navigation allow-scripts allow-forms allow-same-origin""&gt;&lt;/iframe&gt;My content goes here&lt;iframe seamless=""seamless"" src=""footer.html"" sandbox=""allow-top-navigation allow-scripts allow-forms allow-same-origin""&gt;&lt;/iframe&gt;</code></pre><p>In header.html, it had:</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;link rel=""stylesheet"" href=""android.css"" type=""text/css"" /&gt;&lt;title&gt;Test App&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;div class=""home page""&gt;    &lt;h1&gt;Test App&lt;/h1&gt;    &lt;div class=""home content""&gt;</code></pre><p>In footer.html, it had:</p><pre><code>    &lt;/div&gt;&lt;!-- .home .content --&gt;    &lt;div class=""home footer""&gt;    &lt;/div&gt;&lt;!-- .home .footer --&gt;&lt;/div&gt;&lt;!-- .home .page --&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>But when I ran the code on a Samsung Galaxy Tab running Android 2.2, I had two IFRAMES that were not seamless, and the page rendered as if it was in HTML4.01.</p>","105539","","","","","2011-01-10 19:43:05","Is There an Ability To Show Seamless IFRAMES in the Android Browser?","<android><html5><iframe>","1","0","","",""
"4650672","1","4819804","","2011-01-10 19:31:50","4","12070","<p>right now I'm using in my application tabhost with single activity and separate views. </p><p>Tab Activity:</p><pre><code>    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TabHost tabs = (TabHost) findViewById(R.id.tabhost);            tabs.setup();    TabHost.TabSpec spec = tabs.newTabSpec(TAB_HOTELS);    spec.setContent(R.id.tab1);    spec.setIndicator(""Hotels"");    tabs.addTab(spec);    spec = tabs.newTabSpec(TAB_LAST_MINUTE);    spec.setContent(R.id.tab2);    spec.setIndicator(""Last Minute"");    tabs.addTab(spec);</code></pre><p>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 android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:id=""@+id/tab1""                android:orientation=""vertical""&gt;                &lt;ListView android:id=""@+id/listaLocalita""                    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" android:id=""@+id/tab2""                android:orientation=""vertical"" android:paddingTop=""60px""&gt;                &lt;TextView android:layout_width=""fill_parent""                    android:layout_height=""100px"" android:text=""This is tab 2""                    android:id=""@+id/txt2"" /&gt;            &lt;/LinearLayout&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>And things are working quite well as long as i'm using one level depth. Unfortunately now I need to make one of the tab to work like following:</p><p>Tab loading ListView with the list of cities, User clicks on city name, tab's content is replaced with the list of the Hotels, user choose a hotel and always in the the same tab, hotel's info is loaded. </p><p>How can i achieve this scenario? LayoutInflater?</p><p>Thanks in advance. </p>","77867","","519334","","2011-12-29 11:04:14","2012-10-31 17:55:33","Changing view inside TabHost (one activity, multiple views)","<android><view><tabs><android-tabhost>","1","2","2","",""
"4650755","1","6995087","","2011-01-10 19:40:02","5","12814","<p>i'm attempting to change the background image of a custom View with some success.  the image will change but the problem is that i still see traces of the old image.  when i attempt to clear the canvas before drawing the new image, it doesn't appear to work.  i create a bitmap to store the image.  when changing the image, i call Canvas.drawColor() before drawing the new image but the old image persists. i've tried drawColor(0), drawColor(Color.BLACK), c.drawColor(0, PorterDuff.Mode.CLEAR), and none of the above works.  as such, i had to post this for review from more experienced minds than mine.</p><p>the actual code is as follows:</p><pre><code>private int bgnd;private boolean switching;public void setBgnd(int incoming){    switching = true;    switch (incoming){    case R.drawable.image1:        bgnd = incoming;        this.invalidate();        break;    case R.drawable.image2:        bgnd = incoming;        this.invalidate();        break;    }}protected void onDraw(Canvas c){    if(switching == true){        Bitmap b = BitmapFactory.decodeResource(getResources(), bgnd);        c.drawColor(0, PorterDuff.Mode.CLEAR);        c.drawBitmap(b, 0, 0, null);        switching = false;    }else{        Bitmap b = BitmapFactory.decodeResource(getResources(), bgnd);        c.drawBitmap(b, 0, 0, null);    }}</code></pre>","2451972","","2451972","","2011-01-11 18:33:23","2012-12-02 09:49:57","Clearing canvas with Canvas.drawColor()","<android><canvas><ondraw>","3","0","3","",""
"4650831","1","","","2011-01-10 19:50:28","0","1738","<p>This one really has me banging my head. I'm sending alphanumeric data from an Android app, through the BluetoothChatService, to a serial bluetooth adaptor connected to the serial input of a radio transceiver.</p><p>Everything works fine except when I try to configure the radio on-the-fly with its AT-commands. The AT+++ (enter command mode) is received OK, but the problem comes with the extended-ascii characters in the next two commands: Changing the radio destination address (which is what I'm trying to do) requires CCh 10h (plus 3 hex radio address bytes), and exiting the command mode requires CCh ATO.</p><p>I know the radio can be configured OK because I've done it on an earlier prototype with the serial commands from PIC basic, and it also can be configured by entering the commands directly from hyperterm. Both these methods somehow convert that pesky CCh into a form the radio understands.</p><p>I've have tried just about everything an Android noob could possibly come up with to finagle the encoding such as:</p><pre><code>private void command_address() {    byte[] addrArray = {(byte) 0xCC, 16, 36, 65, 21, 13};                       CharSequence addrvalues = EncodingUtils.getString(addrArray, ""UTF-8"");      sendMessage((String) addrvalues);}</code></pre><p>but no matter what, I can't seem to get that high-order byte (CCh/204/-52) to behave as it should. All other (&lt; 127) bytes, command or data, transmit with no problem. Any help here would be greatly appreciated.</p><p>-Dave </p>","563002","","","","","2011-01-11 15:41:08","How do you send an extended-ascii AT-command (CCh) from Android bluetooth to a serial device?","<android><bluetooth><ascii><serial><at-command>","1","0","1","",""
"4650889","1","4650939","","2011-01-10 19:57:29","5","3971","<p>According to <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">this doc page</a>, Android 2.3 supports extra large screen sizes (xlarge), and you can declare that your apps supports this size by adding <code>android:xlargeScreens=""true""</code> in the <code>&lt;supports-screens&gt;</code> tag in the Manifest file.</p><p>But, since my app is targeted for a minimum SDK version of Android 2.1, compilation fails complaining about unknown attribute.</p><p>I don't want to use the new SDK because I won't get warnings if I accidentally use 2.3 specific features.</p><p>Is there a way out?</p>","161257","","","","","2011-01-10 20:03:38","How to support extra large screens in Android?","<android><android-manifest>","2","0","2","",""
"4650910","1","","","2011-01-10 20:00:30","2","1971","<p>I'm using my own selector for my ListView, but the default is not used. How are you supposed to set the default background drawable? With the below code I'd expect all of my list rows to be blue until focused or pressed.</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=""#0266e9""                android:endColor=""#0484f2""                android:angle=""90"" /&gt;        &lt;/shape&gt;    &lt;/item&gt;    &lt;item android:state_focused=""true"" &gt;        &lt;shape&gt;            &lt;gradient                android:startColor=""#bbccff""                android:endColor=""#dce4fd""                android:angle=""90"" /&gt;                                        &lt;/shape&gt;    &lt;/item&gt;    &lt;item&gt;                &lt;shape&gt;            &lt;solid android:color=""#FF0000FF""&gt;&lt;/solid&gt;        &lt;/shape&gt;    &lt;/item&gt;&lt;/selector&gt;</code></pre>","317033","","","","","2011-02-26 10:43:49","Android - ListView list selector doesn't use default","<android><selector>","1","1","1","",""
"4651054","1","","","2011-01-10 20:16:00","0","188","<p>Do Iphones or Android based phones have any support for ECN? (ECN is Explicit Congestion Notification, a TCP extension) From the searching I have done, the current answer appears to be ""no"".  Though given that Android phones are based upon the Linux kernel it looks like Android phones, at least in theory, could have ECN turned on rather easily.</p>","48658","","482717","","2011-10-13 03:29:14","2011-10-13 03:29:14","Do Iphones or Android based phones have any support for ECN?","<iphone><android><tcp>","0","2","","",""
"4651066","1","","","2011-01-10 20:17:14","1","2618","<p>I developed a small video camera application. It all works fine except focus. I understand I need to call camera.autofocus, but I don't really know where is the right place to put the call it. Anyone ever succeeded in autofocusing a video camera on android?</p><p>ThankEli</p>","102092","","","","","2011-11-04 13:48:32","Video camera auto focus","<android>","2","0","","",""
"4651136","1","4651244","","2011-01-10 20:23:46","4","3183","<p>I'm doing some rather basic drawing in an app I am working on, and am wondering about the 'proper' way to handle defining the Paint's attributes, such as color, etc.  With strings, styles, menus, layouts, etc being separated from app logic and defined in XML, I was wondering about how to (if possible) define a Paint 'style' in XML in much the same way.</p><p>I've done a number of searches and have come up empty, which may be the answer, but was wondering about other approaches than, say:</p><pre><code>mPaint = new Paint();mPaint.setStyle(Paint.Style.STROKE);mPaint.setColor(0x80808080);</code></pre><p>Thanks,</p><p>Paul</p>","357801","","","","","2011-01-10 20:34:17","Defining a Paint style, color, etc in XML?","<android><xml><coding-style><paint>","1","0","","",""
"4651261","1","","","2011-01-10 20:36:12","0","3072","<p>Im Trying to handle an OnTouch Event inside an activity But I am unable to Handle MotionEvent.ACTION_UP Action. here is my code:</p><pre><code>boardView.setOnTouchListener(new OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            switch (event.getAction())            {            case MotionEvent.ACTION_DOWN:                showToastNotification(""ACTION_DOWN"");                break;            case MotionEvent.ACTION_MOVE:                break;            case MotionEvent.ACTION_UP:                showToastNotification(""ACTION_UP"");                break;            }            return false;        }    });</code></pre><p>Why Is That?</p><p>Thanks in advance </p><p>Kobi</p>","537106","","","","","2011-01-12 07:59:28","Handle OnTouch Event inside an Activity","<android>","3","2","","",""
"4651266","1","4652950","","2011-01-10 20:36:45","0","383","<p>I have the following I wish to achieve: </p><p>Activity A -> Activity B</p><p>Activity B -> Activity A</p><p>On paper it sounds like the same thing as just hitting the back button. Problem is, I don't want Activity B to be popped.</p><p>I need something along the lines of moveTaskToBackground but for a single activity. That way when I go back to it from A again, it can resume.</p><p>To give you some context, Activity A is a list of items. Activity B displays information about the item and plays a song attached to it. While going back from B to A, I want that song to keep playing, that way if the person hits the same option in A they just resume the activity. Otherwise kill that activity and start a new one with the new details and play the new song.</p><p>Greatly appreciated.</p>","570384","","","","","2011-01-11 00:14:45","android: Moving through activities without popping them","<android><activity><pop>","2","0","","",""
"4651354","1","","","2011-01-10 20:46:15","0","1019","<p>I want to download a pdf file on this url but don't download: <a href=""http://sede.juntaex.es/empleodoc/6e22820d-ec8f-400f-9f80-75c007bdfd43"" rel=""nofollow"">http://sede.juntaex.es/empleodoc/6e22820d-ec8f-400f-9f80-75c007bdfd43</a></p><p>I copy and paste on browser and don't work. </p><p>I used this code but does not work</p><pre><code>Intent intent = new Intent();intent.setAction(Intent.ACTION_VIEW);intent.addCategory(Intent.CATEGORY_BROWSABLE);intent.setData(Uri.parse(url));startActivity(intent);</code></pre><p>How I force the download?</p><p><strong>Update:</strong>Obviously I mean downloading the pdf does not work in android browser and does not work either through code above. The download works in the browser on my computer.</p><p>I need to force download how pdf file.</p><p>I want to download the pdf by clicking a button in my application</p>","567984","","567984","","2011-01-10 22:23:42","2012-05-16 06:21:43","Force download PDF","<java><android>","2","5","","",""
"4651366","1","","","2011-01-10 20:47:30","8","3029","<p>I have an Activity that I swear is leaking memory.  The app I'm working on does a lot with images, so I've had to be pretty stingy with memory when working directly with Bitmaps.  I added an Activity, and now if you use this new Activity it basically puts me over the edge with mem usage and I end up throwing the ""Bitmap exceeds VM budget"" exception.  If you never launch this Activity, everything is smooth as it was previously.</p><p>I started reading about memory leaks, and I think that I have a similar situation to what is described in the article in the Android docs.  I'm dynamically creating a bunch of image views and adding a BackgroundDrawable from the resources and adding an OnClickListener as well.  I imagine I have to do some cleanup when the Activity hits onPause in its life cycle, but I'd like to know specifically what is the correct way.</p><p>Here is the code that should demonstrate the objects I'm working with...</p><pre><code>    LinearLayout templateContainer;    .    .    .    ImageView imgTemplatePreview = (ImageView) item.findViewById(R.id.imgTemplatePreview);    .    .    .    imgTemplatePreview.setBackgroundDrawable(getResources().getDrawable(previewId));    imgTemplatePreview.setOnClickListener(imgClick);    templateContainer.addView(item); </code></pre>","53501","","","","","2011-01-12 04:02:55","Android - Memory leak when dynamically building UI with image resource backgrounds","<java><android><memory-management><memory-leaks><virtual-machine>","2","3","6","",""
"4651435","1","4651540","","2011-01-10 20:57:36","0","5577","<p>I want to create a new Cookie in Android. When I do:</p><pre><code>Cookie testCookie = new Cookie();</code></pre><p>I get an error saying, ""Cannot instantiate the type Cookie"". All I want to do is create a new cookie and stick it into a cookie store (uses org.apache.http.client CookieStore not java.net.CookieStore or what not). I cannot use HttpCookie because I cannot cast it to a Cookie. Any thoughts here?</p><p>Edit (Additional Code):</p><p>Here's more or less what I want to do:</p><pre><code>import org.apache.http.client.CookieStore;import org.apache.http.cookie.Cookie;import java.net.CookieManager;CookieManager manager = new CookieManager();CookieStore store = (CookieStore) manager.getCookieStore();Cookie testCookie = new Cookie();store.addCookie(testCookie);</code></pre>","220591","","858515","","2012-10-19 16:23:19","2012-10-19 16:23:19","Creating a new cookie in Android","<java><android><cookies><cookiemanager>","1","1","","",""
"4651441","1","4704268","","2011-01-10 20:58:49","0","1216","<p>Hi I am trying to accomplish the following:</p><p>I have a control that supposed to render 3 android standard controls: imageview and a textview. I am trying to wrap them up in one control with gradient background , so it looks like one button. </p><p>Here is what I tried:in the layout file for the control I added a button</p><pre><code>&lt;Button android:id=""@+id/btnCustomButton"" android:layout_width=""214dp"" android:drawable=""@drawable/custom_button"" android:background=""@drawable/custom_button_background"" android:gravity=""center_horizontal"" android:layout_height=""39dp"" /&gt;</code></pre><p>in the custom_button.xml:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""rectangle"" android:height=""33dp"" android:width=""214dp""&gt;   &lt;ImageView  android:gravity=""left|center_horizontal"" android:id=""@+id/btn_icon"" android:layout_width=""fill_parent""  android:layout_height=""27dp"" /&gt;   &lt;TextView android:id=""@+id/txtLabel"" android:textSize=""15px"" android:textColor=""@color/main_text_black"" android:text=""Search"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:gravity=""center_vertical"" android:singleLine=""true"" /&gt;&lt;/shape</code></pre><p>in the custom_button_background.xml:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:top=""15dp"" android:state_pressed=""true""&gt;            &lt;shape android:shape=""rectangle""&gt;              &lt;gradient android:startColor=""@color/gradient_hl_top"" android:endColor=""@color/gradient_hl_bottom"" android:angle=""270"" /&gt;            &lt;stroke android:width=""3dp"" android:color=""@color/main_text_black"" /&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 android:shape=""rectangle""&gt;              &lt;gradient android:startColor=""@color/gradient_hl_top"" android:endColor=""@color/gradient_hl_bottom"" android:angle=""270"" /&gt;            &lt;stroke android:width=""3dp"" android:color=""@color/main_text_black"" /&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 android:shape=""rectangle""&gt;              &lt;gradient android:startColor=""@color/_gradient_top"" android:endColor=""@color/gradient_bottom"" android:angle=""270"" /&gt;            &lt;stroke android:width=""3dp"" android:color=""@color/main_text_black"" /&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>I can't see the TextView printing ""Search"" but I see the gradient working. What am I doing wrong?</p>","538428","","","","","2011-01-16 07:21:25","several controls in one with drawable background (gradient)","<android><controls><selector><shape>","1","0","","",""
"4651568","1","4651623","","2011-01-10 21:13:21","3","323","<p>Not to keep all my classes in a single src -> 'package_name' folder I'm creating different sub-packages in order to separate my classes by groups like - utilities, models, activities themselves, etc. I'm not sure if it is a good practice and people do the same in real projects.</p>","397991","","","","","2011-01-10 21:49:31","What is a good practice to combine your classes","<java><android>","3","0","","",""
"4651618","1","","","2011-01-10 21:19:31","4","9541","<p>Is it possible to create a drawable that has some sort of animation, whether it is a frame by frame animation, rotation, etc, that is defined as a xml drawable and can be represented by a single Drawable object without having to deal with the animation in code?</p><p>How I am thinking to use it:I have a list and each item in this list may at sometime have something happening to it.  While it is happening, I would like to have a spinning progress animation similar to a indeterminate ProgressBar.  Since there may also be several of these on screen I thought that if they all shared the same Drawable they would only need one instance of it in memory and their animations would be synced so you wouldn't have a bunch of spinning objects in various points in the spinning animation.</p><p>I'm not attached to this approach.  I'm just trying to think of the most efficient way to display several spinning progress animations and ideally have them synced together so they are consistent in appearance.</p><p>Thanks</p><p><strong>In response to Sybiam's answer:</strong></p><p>I have tried implementing a RotateDrawable but it is not rotating.</p><p>Here is my xml for the drawable so far:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android"" android:drawable=""@drawable/my_drawable_to_rotate"" android:fromDegrees=""0""  android:toDegrees=""360"" android:pivotX=""50%"" android:pivotY=""50%"" android:duration=""800"" android:visible=""true"" /&gt;</code></pre><p>I have tried using that drawable as the src and background of a ImageView and both ways only produced a non-rotating image.</p><p>Is there something that has to start the image rotation?</p>","445348","","445348","","2011-01-13 00:39:04","2012-11-21 15:11:50","Is it possible to have an animated drawable?","<android><animation><progress-bar><drawable>","3","0","3","",""
"4651757","1","","","2011-01-10 21:35:06","65","13025","<p>Is it possible to program Android apps in Clojure?Can anybody suggest a good tutorial or book, if it is possible?</p>","570105","","31615","","2011-01-11 02:08:06","2013-12-07 18:45:55","Clojure on Android","<android><clojure>","6","0","18","2013-12-30 05:51:16",""
"4651793","1","4652704","","2011-01-10 21:39:27","0","5359","<p>I'm one of the poor noobs who wanted to put a <code>ListView</code> inside a <code>ScrollView</code>.</p><p>Now I understand that they don't want nested scrollable elements - I'm not sure that I agree with their design but I can understand it. What I cannot understand is why I can't make a non-scrollable <code>ListView</code> and nest it into another Scrollable element. </p><p><code>listView.setScrollContainer(false)</code> seemed like the solution (because I thought it could turn off the scrollability of the <code>ListView</code>) but no luck.</p><p>So can someone explain why Google won't let listViews not scroll - is there a way to do this that this numpty is just oblivious to?</p>","123415","","","","","2011-01-11 21:08:52","Google's Mentality: ListView in ScrollView","<android><android-widget><android-layout>","2","1","","2013-10-18 12:31:59",""
"4651797","1","4828540","","2011-01-10 21:39:50","8","4083","<p>For some reason the database handling solution described in <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications"">this article</a> doesn't work on the HTC Desire HD after it got the OTA update to 2.2.1 (1.72.405.3). It worked on Desire HD before the update and I've failed to reproduce the error on actual devices running 2.1, 2.2 as well as in emulator running all versions.</p><p>Unfortunately you can't created a AVD for emulator running Android 2.2.1 and I've tried a ROM based on 2.2.1 (I have a rooted ordinary HTC Desire) but my application works without problem on it as well. So the question is if it's using the Android SDK in some way it shouldn't that all of a sudden cause the problem? </p><p>I know this is a very specific issue but since more developers than me reporting the problem as well as the fact that you can't create an AVD I hope the question is accepted and I hope someone have a clue what might causing the problem.</p><p>Here's a stack trace sent to my Market account by user:  </p><pre><code>Caused by: android.database.sqlite.SQLiteDiskIOException: disk I/O errorat android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2049)at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1917)at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:889)at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:168)at com.MyApp.DataBaseHelper.createDataBase(DataBaseHelper.java:81)at com.MyApp.InitialActivity.onCreate(InitialActivity.java:33)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2797)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1066)  </code></pre><p>Related methods can be found at pastebin. Since only one hyperlink can be included link could be found in comments below. Note that line 81 found in stack trace is line 10 at pastebin.</p>","287170","","287170","","2011-01-15 20:52:01","2011-04-13 11:05:01","Database handling stoped working on Android 2.2.1 (Desire HD 1.72.405.3)","<android><sqlite>","2","6","4","",""
"4651798","1","4651929","","2011-01-10 21:40:09","0","566","<p>i've searched for days but cant find an answer, perhaps you guys can help.</p><p>I'm creating an android app in eclipse, it all works just one thing is bugging me.</p><p>this is my main.java:</p><pre><code>    package com.test;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Toast;public class Main extends Activity implements OnClickListener {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);     // Add Click listeners for all buttons        View firstButton = findViewById(R.id.btn_rassen);        firstButton.setOnClickListener(this);        View secondButton = findViewById(R.id.button2);        secondButton.setOnClickListener(this);    }    // Process the button click events @Override public void onClick(View v) {  switch(v.getId()){   case R.id.btn_rassen:    Intent j = new Intent(this, Webscreen.class);       j.putExtra(com.test.Webscreen.URL,          ""http://www.google.com/"");       startActivity(j);   break;    case R.id.button2:    Intent k = new Intent(this, Webscreen.class);       k.putExtra(com.test.Webscreen.URL,          ""http://notworkingurltotest.com"");       startActivity(k);   break;  }   }}</code></pre><p>now when it calls the webview.java the page called shows up but not the buttons i created in the layout xml page. does anybody have any idea why this is?</p><p>your help is much appreciated!</p><p>ohw this is my webscreen.java</p><pre><code>package com.test;import android.app.Activity;import android.app.AlertDialog;import android.app.ProgressDialog;import android.content.DialogInterface;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.view.Window;import android.webkit.WebSettings;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Toast;public class Webscreen extends Activity {    public static final String URL = """";    private static final String TAG = ""WebscreenClass"";    private WebView webview;    private ProgressDialog progressDialog;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.webscreen);        this.getIntent().getExtras();         this.webview = (WebView) findViewById(R.string.webview);        String turl = getIntent().getStringExtra(URL);        Log.i(TAG, "" URL = ""+turl);    WebView webview = new WebView(this);    setContentView(webview);        final Activity activity = this;             webview.setWebViewClient(new WebViewClient() {            public boolean shouldOverrideUrlLoading(WebView view, String url) {                              view.loadUrl(url);                return true;            }            public void onLoadResource (WebView view, String url) {                if (progressDialog == null) {                    progressDialog = new ProgressDialog(activity);                    progressDialog.setMessage(""Bezig met laden..."");                    progressDialog.show();                }            }            public void onPageFinished(WebView view, String url) {                if (progressDialog.isShowing()) {                    progressDialog.dismiss();                    progressDialog = null;                }            }            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {                Intent myIntent = new Intent();                myIntent.setClassName(""com.test"", ""com.test.Main"");                startActivity(myIntent);                 Toast.makeText(activity, ""Laden van onderdeel mislukt, probeer het later nog eens! "", Toast.LENGTH_LONG).show();                progressDialog.show();            }            });        webview.loadUrl(turl);    }}</code></pre><p>webscreen.xml layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;!-- &lt;1&gt; --&gt;  &lt;LinearLayout android:orientation=""horizontal""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;    &lt;EditText android:id=""@+id/url"" android:layout_height=""wrap_content""      android:layout_width=""wrap_content"" android:lines=""1""      android:layout_weight=""1.0"" android:hint=""http://""      android:visibility=""visible"" /&gt;    &lt;Button android:id=""@+id/go_button"" android:layout_height=""wrap_content""      android:layout_width=""wrap_content"" android:text=""go_button"" /&gt;  &lt;/LinearLayout&gt;  &lt;!-- &lt;2&gt; --&gt;  &lt;WebView        android:id=""@string/webview""        android:layout_width=""fill_parent""         android:layout_height=""0dip""        /&gt;&lt;/LinearLayout&gt;</code></pre>","570458","","570458","","2011-01-10 21:49:56","2011-01-10 22:36:18","Android app in eclipse","<android><eclipse>","1","3","","",""
"4652011","1","4652540","","2011-01-10 22:01:30","1","8084","<p>I have an activity with a checkbox: if the chekbox is unchecked then stop the service. this is a snippet of my activity code:</p><pre><code>    Intent serviceIntent = new Intent();    serviceIntent.setAction(""com.android.savebattery.SaveBatteryService"");    if (*unchecked*){        serviceIntent.putExtra(""user_stop"", true);        stopService(serviceIntent);</code></pre><p>when I stop the service I pass a parameter ""user_stop"" to say at the service that has been a user to stop it and not the system (for low memory).</p><p>now I have to read the variable ""user_stop"" in void onDestroy of my service: </p><pre><code>public void onDestroy() {super.onDestroy();Intent recievedIntent = getIntent(); boolean userStop= recievedIntent.getBooleanExtra(""user_stop"");    if (userStop) {       *** notification code ****</code></pre><p>but it doesn't work! I can't use getIntent() in onDestroy!</p><p>any suggestion?</p><p>thanks</p><p>Simone</p>","570488","","12707","","2011-01-10 22:08:43","2013-05-28 12:24:58","How to pass a parameter from an activity to a service...when the user stop the service","<android><parameters><service><activity><ondestroy>","4","0","","",""
"4652127","1","4661724","","2011-01-10 22:13:39","1","893","<p>I want a layout such that user can toggle between listview and mapview and menu button click. When the activity is first created it fetches data from server and display list result and upon menu button click maps all result on mapview. The problem I am having is displaying the loading screen initially and again after user click refresh result menu button.My layout is below, activity extends MapActivity. I expect loading view to be gone when list data becomes available of when notifyDataSetInvalidated() is called. I have used similar logic in other activity without mapview and activity extends listactivity and it works but not in this case.</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;LinearLayout         android:id=""@+id/data_view""        android:layout_width=""fill_parent""        android:layout_height=""0dip""         android:layout_weight=""1""        &gt;        &lt;ListView             android:id=""@android:id/list""            android:layout_height=""fill_parent""             android:layout_width=""fill_parent""            android:drawSelectorOnTop=""false""            android:scrollbars=""vertical""             /&gt;        &lt;com.google.android.maps.MapView            android:id=""@+id/map_view""            android:layout_height=""fill_parent""             android:layout_width=""fill_parent""            android:clickable=""true""             android:visibility=""gone""            android:apiKey=""@string/google_maps_api_key""            /&gt;    &lt;/LinearLayout&gt;     &lt;LinearLayout      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:gravity=""center""      android:background=""@color/white""      &gt;      &lt;ProgressBar        android:id=""@+id/emptyProgress""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginRight=""6dip""        style=""?android:attr/progressBarStyleSmall""         /&gt;      &lt;TextView        android:id=""@+id/emptyText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:gravity=""center""        android:text=""@string/loading""         /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","470682","","","","","2011-01-11 19:27:35","android listview mapview layout issue","<android><listview><layout><toggle><android-mapview>","1","0","1","",""
"4652273","1","","","2011-01-10 22:32:33","5","5549","<p>I've got a couple RSS feeds I need to parse for my app and I followed the excellent tutorial here: <a href=""http://w2davids.wordpress.com/android-rssatom-feeds-parsing-with-rome/"">http://w2davids.wordpress.com/android-rssatom-feeds-parsing-with-rome</a>/.  I modified the sample a bit and got it to do what I needed.  So, I went to integrate it into my app and consistently get a Force Quit every time I try to display the list of posts.  My modified version of the code is below.  It always seems to fail when attaching the adapter to the ListView, so I assume my adapter is setup incorrectly.  What's strange us that in the debugger, I can look at the adapter and see the data I'm trying to fetch.  </p><p>Thanks in advance:</p><pre><code>public class View1 extends Activity{    /** Called when the activity is first created. */    private final ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();    private ListView listView;    private ArrayAdapter&lt;String&gt; adapter = null;    private SyndContent desc;    private ArrayList&lt;String&gt; d = new ArrayList&lt;String&gt;() ;    @Override    public void onCreate(Bundle savedInstanceState)        {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.dataview, R.id.ListItemView);                         getRSS(""http://www.example.com/wp/?feed=gigpress&amp;artist=1"");            listView.setAdapter(adapter);            listView = (ListView) this.findViewById(R.id.ListView);            listView.setOnItemClickListener(new OnItemClickListener()                {                    @Override                    public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long duration)                        {                                                           Intent intent = new Intent();                            intent.setClassName(""com.example.idtb"", ""com.example.idtb.ViewRssDescription"");                            intent.putExtra(""desc"", d.get(position));                            startActivity(intent);                        }                });                     }    private void getRSS(String rss)        {            URL feedUrl;            try                {                    Log.d(""DEBUG"", ""Entered:"" + rss);                    feedUrl = new URL(rss);                    SyndFeedInput input = new SyndFeedInput();                    SyndFeed feed = input.build(new XmlReader(feedUrl));                    List entries = feed.getEntries();                    Iterator iterator = entries.listIterator();                    while (iterator.hasNext())                        {                            SyndEntry ent = (SyndEntry) iterator.next();                            String title = ent.getTitle();                            desc = ent.getDescription();                            d.add(desc.getValue());                            adapter.add(title);                        }                    adapter.notifyDataSetChanged();                }            catch (MalformedURLException e)                {                    e.printStackTrace();                }            catch (IllegalArgumentException e)                {                    e.printStackTrace();                }            catch (FeedException e)                {                    e.printStackTrace();                }            catch (IOException e)                {                    e.printStackTrace();                }        }}</code></pre>","197353","","","","","2012-11-23 04:44:06","Parsing RSS on Android","<java><android><rss>","1","1","0","",""
"4652488","1","4652576","","2011-01-10 22:58:50","2","3755","<p>I've got the content from a HttpClient, but I'm not sure where to go next, in order to parse my JSON result. Also, how do I do this asynchronously so that I can display a wait dialog to the user with the option of cancelling the current request (not bothered about the UI example, how do I setup the HTTP class to be cancellable)?</p><pre><code>    HttpClient client = new DefaultHttpClient();    HttpGet request = new HttpGet(""http://mysite/test.json"");    try    {        HttpResponse response = client.execute(request);                    // What if I want to cancel now??        HttpEntity entity = response.getEntity();        InputStream inputStream = entity.getContent();    }</code></pre>","986","","","","","2011-01-10 23:10:15","How to use HttpClient (or other HTTP class) to retrieve JSON asynchronously","<android><json><http><asynchronous>","2","1","1","",""
"4652794","1","4720189","","2011-01-10 23:40:53","3","695","<p>I am trying to download the html file using the ul of the page. I am using Jsoup.This is my code:</p><pre><code>TextView ptext = (TextView) findViewById(R.id.pagetext);    Document doc = null;    try {         doc = (Document) Jsoup.connect(mNewLinkUrl).get();    } catch (IOException e) {        Log.d(TAG, e.toString());        e.printStackTrace();    }    NodeList nl = doc.getElementsByTagName(""meta"");    Element meta = (Element) nl.item(0);     String title = meta.attr(""title"");     ptext.append(""\n"" + mNewLinkUrl);</code></pre><p>When running it, I am getting an error saying attr is not defined for the type element.What have I done wrong? Pardon me if this seems trivial.</p>","556167","","244296","","2011-01-11 00:16:19","2011-01-18 03:46:09","android html download and parse error","<android><html><jsoup>","2","0","","",""
"4652966","1","4653897","","2011-01-11 00:12:03","2","686","<p>On Eclipse with the Android SDK and IDE plugin, when I debug an application with a SecurityException, I only see the exception itself in the log, but the IDE never tells me the details of it. For example, LogCat might have:</p><pre><code>01-10 17:03:35.959: ERROR/System(58): java.lang.SecurityException01-10 17:03:35.959: ERROR/System(58):     at android.os.BinderProxy.transact(Native Method)01-10 17:03:35.959: ERROR/System(58):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)01-10 17:03:35.959: ERROR/System(58):     at android.os.ServiceManager.addService(ServiceManager.java:72)01-10 17:03:35.959: ERROR/System(58):     at com.android.server.ServerThread.run(SystemServer.java:184)</code></pre><p>But no where in this output do you see (1) what line in my code caused the SecurityException, or (2) the exception details -- specifically what permission is missing. I believe this should be on detailMessage.</p><p>In the IDE's debugger, a thread is suspended with RuntimeException, and the variables include another NullPointerException, which is seemingly unrelated to the logged SecurityException.</p><p>How do I get Eclipse/Android SDK to stop on the code that's actually causing a SecurityException to be thrown, and how do I access the details for that exception? Am I missing something painfully obvious in Eclipse?</p>","170431","","","","","2011-01-11 03:24:31","With Eclipse and Android, the IDE never shows the value of an exception","<android><eclipse><debugging><android-emulator>","2","0","1","",""
"4652969","1","","","2011-01-11 00:13:26","8","5965","<p>I am trying to get the Android TTS API to read my ""utterance"" and then call the onUtteranceCompleted() listener unsuccessfully. I've registered my TTS object and it returns SUCCESS, so I can't figure out for the life of me why my callback isn't getting called.</p><p>I've tried searching for help, but it seems others have difficulty with this too. Am I missing something simple?</p><p>Thanks for any help you can offer.</p><pre><code>package com.test.mytts;import java.util.HashMap;import android.app.Activity;import android.media.AudioManager;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.speech.tts.TextToSpeech.OnInitListener;import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;import android.widget.TextView;import android.widget.Toast;public class MyTTS extends Activity implements OnInitListener, OnUtteranceCompletedListener{       TextView tv;    private TextToSpeech _tts;    @Override    public void onCreate(Bundle savedInstanceState)     {        tv = new TextView(this);        tv.setText(""MyTTS: "");        super.onCreate(savedInstanceState);        setContentView(tv);        _tts = new TextToSpeech(this, this);    }    @Override    public void onInit(int status)     {        HashMap&lt;String, String&gt; myHashAlarm = new HashMap&lt;String, String&gt;();        myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM, String.valueOf(AudioManager.STREAM_NOTIFICATION));        myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, ""test"");        if (status == TextToSpeech.SUCCESS)        {            Toast.makeText(this, ""Trying to speak..."", Toast.LENGTH_SHORT).show();            int result = _tts.setOnUtteranceCompletedListener(this);            tv.append(String.valueOf(result));            _tts.setSpeechRate((float) .5);            _tts.speak(""Testing one, two, three"", TextToSpeech.QUEUE_ADD, myHashAlarm);        }        else            Toast.makeText(this, ""Failed to initialize TTS."", Toast.LENGTH_SHORT).show();    }    @Override    public void onUtteranceCompleted(String utteranceId)     {        Toast.makeText(this, ""onUtteranceCompleted"", Toast.LENGTH_SHORT).show();    }    @Override    public void onDestroy()    {        super.onDestroy();        _tts.shutdown();    }}</code></pre>","514360","","168868","","2012-01-01 20:49:11","2013-07-29 10:33:05","Android TTS onUtteranceCompleted callback isn't getting called","<android><text-to-speech>","3","2","2","",""
"4653074","1","4661063","","2011-01-11 00:32:46","2","616","<p>I am having some difficulty with an Android layout problem. I am trying to make a form for users to fill out. This form is defined programmatically (from a server-provided configuration over which I have no control) and thus I must implement it programmatically. The form has several different field types, but for simplicity we can assume they are all simple text fields (EditText).</p><p>I currently have the form implemented as a vertical LinearLayout. For each field I have a horizontal LinearLayout that contains a TextView for a field label and an EditText for the user to enter a value for the field. I have the EditText set to fill the width using LinearLayout.LayoutParams(FILL_PARENT, WRAP_CONTENT).</p><p>This works well when the TextView label is short, but when it is long it causes the EditText to be very small and makes it hard for the user to enter a value. Ideally I would like the EditText to be at least half the width of the screen with the TextView label wrapping if necessary. I've tried a TableLayout with TableRows but I still had difficulty. I would also rather not force a grid and thus waste the space on the lines with short labels (assuming the other requirements are met I'm flexible on this). I would have tried something like a FlowLayout to force the EditText to wrap onto the next line but it's not supported on Android.</p><p>Any suggestions for how I can make this work better? XML-based solutions will be accepted assuming I can port them to a programmatic approach. I would also like to make this as flexible with respect to screen size and orientation as possible, so this means avoiding hard-coding any widths.</p><p>Thanks in advance.</p>","237820","","","","","2011-01-11 18:14:42","Layout Form with Long Labels","<android><edittext><android-linearlayout>","1","2","1","",""
"4653132","1","4653591","","2011-01-11 00:46:49","0","609","<p>So I've used code examples from all over the net and got my app to accurately call a .php file on my server, retrieve the JSON data, then parse the data, and print it.</p><p>The problem is that its just printing to the screen for sake of the tutorial I was following, but now I need to use that data in other places and need help figuring out that process.</p><p>The ultimate goal is to return my db query with map coordinates, then plot them on a google map. I have another app in which I manually plot points on a map, so I'll be integrating this app with that once I can get my head around how to correctly manipulate the data returned.</p><pre><code>        public class Remote extends Activity {    /** Called when the activity is first created. */       TextView txt;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Create a crude view - this should really be set via the layout resources        // but since its an example saves declaring them in the XML.        LinearLayout rootLayout = new LinearLayout(getApplicationContext());        txt = new TextView(getApplicationContext());        rootLayout.addView(txt);        setContentView(rootLayout);        // Set the text and call the connect function.        txt.setText(""Connecting..."");        //call the method to run the data retreival        txt.setText(getServerData(KEY_121));    }    public static final String KEY_121 = ""http://example.com/mydbcall.php"";    private String getServerData(String returnString) {       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"",""1970""));        try{                HttpClient httpclient = new DefaultHttpClient();                HttpPost httppost = new HttpPost(KEY_121);                HttpResponse response = httpclient.execute(httppost);                HttpEntity entity = response.getEntity();                is = entity.getContent();        }catch(Exception e){                Log.e(""log_tag"", ""Error in http connection ""+e.toString());        }        //convert response to string        try{                BufferedReader reader = new BufferedReader(new InputStreamReader(is,""iso-8859-1""),8);                StringBuilder sb = new StringBuilder();                String line = null;                while ((line = reader.readLine()) != null) {                        sb.append(line + ""\n"");                }                is.close();                result=sb.toString();        }catch(Exception e){                Log.e(""log_tag"", ""Error converting result ""+e.toString());        }        //parse json data        try{                JSONArray jArray = new JSONArray(result);                for(int i=0;i&lt;jArray.length();i++){                        JSONObject json_data = jArray.getJSONObject(i);                        Log.i(""log_tag"",""longitude: ""+json_data.getDouble(""longitude"")+                                "", latitude: ""+json_data.getDouble(""latitude"")                        );                        //Get an output to the screen                        returnString += ""\n\t"" + jArray.getJSONObject(i);                }        }catch(JSONException e){                Log.e(""log_tag"", ""Error parsing data ""+e.toString());        }        return returnString;    }       }</code></pre><p>So the code:</p><pre><code>returnString += ""\n\t"" + jArray.getJSONObject(i);</code></pre><p>is what is currently printing to the screen.</p><p>What I have to figure out is how to get the data into something I can reference in other spots in the program, and access the individual elementsie:</p><pre><code>double longitude = jArray.getJSONObject(3).longitude; </code></pre><p>or something to that effect..</p><p>I figure the class getServerData will have to return a Array type or something?</p><p>Any help is appreciated, thanks.</p>","570509","","244296","","2011-01-11 00:47:58","2011-01-11 02:28:32","How to manipulate data after its retrieved via remote database","<java><android><types><maps>","1","0","","",""
"4653169","1","4653285","","2011-01-11 00:52:18","0","599","<p>I perform calculations using a double as follows:</p><pre><code>int minutes;double seconds;double DecMinutes;// Handle Dd in; DMS, and DMm outCalculate myCalculate = new Calculate(inDecimal); {double outMinutes = myCalculate.getMinute();double outSeconds = myCalculate.getSecond();double outDecMinute = myCalculate.getDecMinute();minutes = (int) outMinutes;seconds = outSeconds;DecMinutes = outDecMinute;} // end myCalculate// Convert result back to Stringc = Integer.toString(minutes);((EditText)findViewById(R.id.txtDMSLatMin)).setText(c);((EditText)findViewById(R.id.txtDMmLatMin)).setText(c);c = Double.toString(seconds);((EditText)findViewById(R.id.txtDMSLatSec)).setText(c);c = Double.toString(DecMinutes);((EditText)findViewById(R.id.txtDMmLatDecMin)).setText(c);</code></pre><p>My main concern is with the double DecMinutes output.  Because it's a Decimal-Minutes calculation I need to use double.  My layout already displays the decimal point as a fixed character so instead of displaying 0.0734 I want to display 0734 in the EditText box txtDMmLatDecMin.</p><p>Thanks!!</p>","564884","","","","","2011-01-11 05:04:39","Changing display format of Double number after performing calculations","<android><string><decimal><edittext><numberformat>","1","1","","",""
"4653260","1","","","2011-01-11 01:12:12","0","477","<p>Is it possible to create an Android app that utilizes a Google Latitude API?  I'm assuming you'd probably need a Google Map Key and fingerprint such as you need to access Google Maps through an Android app.</p>","434716","","250259","","2011-11-30 20:16:49","2011-11-30 20:16:49","Is it possible to create an Android app that utilizes a Google Latitude API?","<android><google-maps><google-latitude>","1","1","","",""
"4653264","1","","","2011-01-11 01:14:14","5","3812","<p>I have a <code>PreferenceActivity</code> with a 2 level tree of <code>PreferenceScreen</code>s, something like:</p><pre><code>&lt;PreferenceScreen&gt;  &lt;PreferenceScreen android:key=""A""&gt;     &lt;ListPreference/&gt;     &lt;EditTextPreference/&gt;  &lt;/PreferenceScreen&gt;  &lt;PreferenceScreen android:key=""B""&gt;     &lt;ListPreference/&gt;     &lt;EditTextPreference/&gt;  &lt;/PreferenceScreen&gt;  ...&lt;/PreferenceScreen&gt;</code></pre><p>Each of the lower level preference screens, e.g., A and B, is collecting two related pieces of data.  I want the summary for those parent items to be a combination of the current values of the two sub preferences.</p><p>I tried adding onPreferenceChangeListener's on the leaf preferences and updating the summary from there, but it doesn't seem to take.  The preferences are all created programmatically within the activity, so I'm doing something like this in onCreate:</p><pre><code>   leafListPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {       @Override       public boolean onPreferenceChange(Preference preference, Object newValue) {              // do some work              prefScreenA.setSummary( /* get new summary based on newValue */);              return true;       }  });</code></pre><p>I then tried to find a location where I can be informed that I have returned to the top level preferences screen from a subpage so that I can update at that point.  However, I am confused as to how the lower level screens are being displayed.  It looks like they are actually dialogs, not full Activities since onPause/onResume is not called when moving between them.  Is there some method somewhere that I'm missing that will be called when returning to the top level page?</p><p>I also tried adding a sharedPreferenceChangeListener, as described <a href=""http://stackoverflow.com/questions/531427/how-do-i-display-the-current-value-of-an-android-preference-in-the-preference-sum"">here</a>, but that never seems be called.</p><p>Anyone have any hints on what I'm missing here, or any easier approach I'm missing?</p>","234039","","","","","2013-05-06 12:13:52","PreferenceActivity update summary","<android>","3","0","2","",""
"4653350","1","4657328","","2011-01-11 01:31:49","0","3280","<p>i was wondering if it is possible to save images from the camera preview, maybe 1 image every 2-3 seconds. any examples you can give me?</p><p>i have found this as a possible solution, and i know how to save the image from byte array, but how do i proceed with saving every Nth frame? i was thinking of storing the system uptime and checking it in every frame but it seems kinda lame. Is there a better way? Is there a way i can get info such as preview frame rate?</p><p><a href=""http://stackoverflow.com/questions/1032258/android-how-to-save-a-preview-frame-as-jpeg-image"">Android: How to save a preview frame as jpeg image?</a></p><p>tnx.</p>","448192","","","","","2012-08-27 00:37:06","Capture an image from the camera preview","<android><camera><capture><preview>","2","1","","",""
"4653432","1","4653534","","2011-01-11 01:49:12","1","1522","<p>Hey, I've downloaded the android source code for CallLog, Contacts, Dialing in this link <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=tree</a></p><p>But now, when I try to import this package on Eclipse, imports like:</p><blockquote>  <p>com.google,  com.android.internal.Telephony,  com.android.internal.R,  com.google.android.collect,  android.provider.ContactsContract.Intents.UI,  android.provider.ContactsContract.SearchSnippetColumns,  android.provider.ContactsContract.ProviderStatus,  android.provider.ContactsContract.ContactCounts,  android.content.IContentService,  android.provider.ContactsContract.Intents.UI</p></blockquote><p>And many other imports, show errors saying it <strong>cannot be resolved</strong>.</p><p>So my question is, why it shows this errors? Why I cant implement it without this errors? I use the Google APIs, I've created the project from an existing source code, but I dont know why this happens. </p><p>Thanks.</p>","399459","","","","","2012-02-26 08:39:51","Error when importing com.google, com.android.internal.Telephony, etc","<android><android-layout><android-source>","2","0","1","",""
"4653455","1","4653464","","2011-01-11 01:56:36","7","7316","<p>I would like my Android Dialogs and/or Alerts to be aligned at the very top of the screen sometimes and not simply in the center. Is this possible? How about giving exact x-y coordinates, is that possible?</p>","215266","","114029","","2011-01-11 02:05:07","2011-01-11 02:05:07","Set Android Dialog location","<android><gui><dialog><location><positioning>","1","0","1","",""
"4653468","1","4796967","","2011-01-11 01:59:58","1","479","<p>My WebView application loads a html file and display it. Now how do I register it as a default HTML Reader in the Android system?</p><p>Meaning for example now if I click on an html attachment in email it shows ""Complete Action using"", then lists the HTML Readers in the Android system. How do I register my application to be one of them listed?</p><p>Must I modify my code to allow this? Currently my application is just loading a html attachment from the sdcard.</p><p>Thanks In Advance,Perumal</p>","426201","","","","","2011-01-25 17:43:45","How to register WebView as HTML Reader in Android?","<android>","1","2","1","",""
"4653492","1","4653564","","2011-01-11 02:05:43","4","535","<p>I make a <code>SingleItemAdapter</code> extends <code>ArrayAdapter</code>, this customized Adapter is used for a <code>ListView</code>.  </p><p>In this <code>SingleItemAdapter</code>, I do some database stuff, so I want to throw Exception in <code>getView()</code> method which is initialized GUI.  </p><p>But <code>public View getView(int position,View convertView,ViewGroup parent)</code> throws Exceptionwill get <code>Exception Exception is not compatible with throws clause in ArrayAdapter.getView(int, View, ViewGroup)</code>  </p><p>ArrayAdapter, BaseAdapter, Adapter does not throw Exception, so why?  </p>","509138","","1810243","","2013-02-09 20:15:01","2013-02-09 20:19:40","getView() can not throw Exception","<java><android>","3","2","","",""
"4653571","1","","","2011-01-11 02:23:57","4","810","<p>I would like to animate a single Path on the android canvas.  </p><pre><code>public class MyView extends View {    private Path paths[];    protected void onDraw( Canvas canvas ) {        Paint paint = new Paint();        paint.setStyle(Paint.Style.STROKE);        paint.setStrokeWidth( 8 );        paint.setColor(Color.BLUE);        Path path = new Path();        path.moveTo(75, 11);        path.quadTo(62, 87, 10, 144);        canvas.drawPath( path, paint );        paths[0] = path;        path.reset();        path.moveTo(50, 100);        path.lineTo(150, 200);        canvas.drawPath( path, paint );        paths[1] = path;    }}</code></pre><p>Now I have paths[], I would like to animate each one separately.  I would like it to change alpha like it was growing. At first there is just a little dot, then it grows into a line, repeat.</p><p>Can it be done?</p><p>How?</p>","570628","","1023783","","2012-08-08 03:26:35","2012-08-08 03:26:35","Android: animate the alpha of single Path on a canvas","<android><animation><canvas><path>","0","2","0","",""
"4653608","1","4653673","","2011-01-11 02:31:31","2","986","<p>It seems that the search in the <strong>Google Maps</strong> app is <strong>location aware</strong>. For example, if I search for ""Pitt St"" while in Sydney, it finds the right street straight away. Clicking ""Did you mean..."" brings a list of other ""Pitt St"" close in <strong>nearby suburbs</strong>.</p><p>Is there a way to ge a similar experience in our apps? I tried the standard <a href=""http://developer.android.com/reference/android/location/Geocoder.html"" rel=""nofollow"">Geocoder</a>, but a similar search returns ""Pitt St, New York"" as the first match.</p><ul><li>Is there a set of options I'm missing?</li><li>Is there a different API we can use for this?</li><li>As a last resort, do you think it's reasonable to implement this manually, for example by querying the Geocoder with a max radius of 1km, 10km, 100km, and then sorting the results by distance?</li></ul><p>Cheers</p><p>Romain</p>","51473","","","","","2011-01-11 02:44:07","Location-aware geocoding on Android (just like Google Maps)","<android><google-maps><location><geocoding>","1","0","","",""
"4653643","1","","","2011-01-11 02:38:19","1","956","<p>I have a simple ListActivity that uses a ListAdapter that I'd like to customize the ListView for.  Here is my onCreate, where I specify to use a View rather than using the default ListView generated by setListAdapter():</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // set the listview, empty listview    setContentView(R.layout.main);    getListView().setEmptyView(findViewById(android.R.id.empty));    // set the list properties    getListView().setOnCreateContextMenuListener(this);    .    .    .    &lt;code snipped&gt;    .    .    .    setListAdapter(adapter);}</code></pre><p>You can see that I am setting the emptyView as well.  Here is the XML file 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""&gt;    &lt;ListView      android:id=""@id/android:list""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:fadingEdge=""vertical""        android:dividerHeight=""5dp"" /&gt;    &lt;TextView     android:id=""@android:id/empty""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:gravity=""center""        android:singleLine=""false""        android:text=""@string/message_empty_list"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>My problem is that the ListView, while applying the dividerHeight correctly, is ignoring the :fadingEdge directive when it is in the XML; however, if I set the fadingEdge programatically, it works, i.e.:</p><pre><code>getListView().setVerticalFadingEdgeEnabled(true);</code></pre><p>Any ideas why the listview would be ignoring the fadingEdge specifically?  Am I doing something incorrectly that could be leading to this behavior?</p><p>Thanks!</p>","357801","","","","","2011-01-11 03:55:06","Customizing ListView via XML Problem","<android><xml><listview>","1","0","","",""
"4653645","1","","","2011-01-11 02:39:24","0","6805","<p>I have downloaded android-sdk_r08-windows.zip and installed it in c:.  When I try to run the SDK Manager, it briefly pops up a DOS window then closes.  Trying to run adroid update sdk results in a null pointer exception.  I have tried uninstalling/reinstalling the SDK for both android and java multiple times.  This is on windows XP SP3.  Any ideas?</p><p>Thanks,</p><p>John</p><p>C:\android-sdk-windows>java -version</p><p>java version ""1.6.0_23""Java(TM) SE Runtime Environment (build 1.6.0_23-b05)Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)</p><p>C:\android-sdk-windows>tools\android.bat update sdk[INFO] Starting Android SDK and AVD ManagerNo command line parameters provided, launching UI.See 'android --help' for operations from the command line.java.lang.NullPointerException        at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1155)        at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1134)        at com.android.sdklib.internal.avd.AvdManager.(AvdManager.java:376)        at com.android.sdkuilib.internal.repository.UpdaterData.initSdk(UpdaterData.java:230)        at com.android.sdkuilib.internal.repository.UpdaterData.(UpdaterData.java:107)        at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.(UpdaterWindowImpl.java:86)        at com.android.sdkuilib.repository.UpdaterWindow.(UpdaterWindow.java:54)        at com.android.sdkmanager.Main.showMainWindow(Main.java:297)        at com.android.sdkmanager.Main.doAction(Main.java:260)        at com.android.sdkmanager.Main.run(Main.java:99)        at com.android.sdkmanager.Main.main(Main.java:88)</p>","570698","","","","","2013-02-11 05:32:03","Android installation/SDK Manager issues","<android>","5","0","","",""
"4653679","1","","","2011-01-11 02:45:39","1","2647","<p>I have an SQLite database of items where some of them contain basic HTML such as b and sub tags. I've bound the table to a ListView using a SimpleCursorAdapter. Is there a way to make the ListView format the HTML tags so it displays properly? It seems like the way forward is to get the Cursor to deliver SpannedStrings but I can't work out how to do that.</p>","472939","","","","","2011-07-11 13:12:19","Android: Display HTML formatted text in a ListView when loaded from database","<android><html><sqlite><textview>","3","0","1","",""
"4653760","1","4653797","","2011-01-11 02:59:06","1","482","<p>I am trying to address a resolution issue when designing HTML for webkit browsers.So basically the problem is that webkit browsers can have resolution anywhere from 240x320 to 960x640 and I can't have a separate image/icon set for each one but I do want the pages to look the same on all devices (or very close at least).</p><p>Scaling the image (working with percentages) works but it's a performance degrade:<a href=""http://code.google.com/speed/page-speed/docs/rendering.html#SpecifyImageDimensions"" rel=""nofollow"">http://code.google.com/speed/page-speed/docs/rendering.html#SpecifyImageDimensions</a></p><p>The other option is using vector graphics which is supported in webkit but I am not aware of the performance implications that is going to have on the pages/app.</p><p>The other option is to have a few icon sets for some standard well know resolutions and when you get a browser which is outside of these groups you apply some minor scaling on the set which is closest to the users native resolution.</p><p>So basically what I am asking is, what would be the best route to achieve this with performance in mind?</p><p>Thanks-Assaf</p>","553984","","","","","2011-02-09 03:05:49","webkit raster vs vector images","<android><html><vector><webkit><resolution>","2","0","","",""
"4653763","1","4654256","","2011-01-11 02:59:47","0","1995","<p>This is my very first attempt at including ads in my app. I have read the online documentation and read it word for word. Now, the only part I don't get is how to actually request ads and to add it into my app.</p><pre><code>AdView adView = (AdView)findViewById(R.id.ad);</code></pre><p>That seems to work so far so good.Anything else I do will just force close.For example adding this line:</p><pre><code>adView.setAdListener(this);</code></pre><p>I have implemented AdListener to the Activity.</p><p>By the way, when I hover over the imported classes:</p><pre><code>import com.admob.android.ads.AdView;</code></pre><p>or other similar classes, it says: Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.</p><p>Is that supposed to be correct?</p>","507007","","507007","","2011-01-11 03:05:12","2011-01-11 04:43:38","Android admob adview force close","<java><android><admob>","1","2","","",""
"4653837","1","4654002","","2011-01-11 03:11:56","1","325","<p>If i follow the user guidelines for the notification bar design it has to be dark gray (for android &lt; 2.3) But on sense, the notification bar is black, so my icon is almost invisible.</p><p>Is there a way to detect the senseUI to create a new resources folder just for senseUI ?</p>","478930","","","","","2011-01-11 05:52:04","Notification icon just for senseUI","<android><resources><htcsense>","2","1","","",""
"4653927","1","4670181","","2011-01-11 03:30:01","0","1337","<p>The following Code should speed up my MapView because I'm handling a large set of routes. Unfortunately the ""else"" part does not draw anything. Could somebody help me to understand this. Thx</p><pre><code>    public boolean draw(Canvas canvas, MapView mapv, boolean shadow, long when) {    if ((bmap == null) || (lastLatSpan != mapv.getLatitudeSpan())) {        // bitmap is null - so we haven't previously drawn the path, OR        // the map has been zoomed in/out, so we're gonna re-draw it anyway        // (alternatively, I could have tried scaling the bitmap... might        // be worth investigating if that is more efficient)        // create a new bitmap, the size of the map view        Canvas offscreencanvas = new Canvas();        bmap = Bitmap.createBitmap(mapv.getWidth(), mapv.getHeight(),                Bitmap.Config.ARGB_8888);        offscreencanvas.setBitmap(bmap);        Path path = null;        Projection projection = mapv.getProjection();        // lastLatSpan = mapv.getLatitudeSpan();        for (int j = 0; j &lt; mTourenArray.length; j++) {            GeoPoint[] route = GeoPointFactory                    .createGeoPointArray(mTourenArray[j].getGeoPointArray());            defaultColor = mTourenArray[j].getColorByCat();            path = new Path();            Paint polyPaint = new Paint();            polyPaint.setColor(defaultColor);            for (int i = 0; i &lt; route.length - 1; i++) {                GeoPoint gp1 = route[i];                GeoPoint gp2 = route[i + 1];                if (shadow == false) {                    polyPaint.setAntiAlias(true);                    Point point = new Point();                    projection.toPixels(gp1, point);                    // mode=1&amp;#65306;start                    if (i == 0) {                        RectF oval = new RectF(point.x - mRadius, point.y                                - mRadius, point.x + mRadius, point.y                                + mRadius);                        // start point                        canvas.drawOval(oval, polyPaint);                        Point point2 = new Point();                        projection.toPixels(gp2, point2);                        path.moveTo(point.x, point.y);                        path.lineTo(point2.x, point2.y);                    }                    /* mode=3&amp;#65306;end */                    else if (i == route.length - 2) {                        /* the last path */                        Point point2 = new Point();                        projection.toPixels(gp2, point2);                        path.lineTo(point2.x, point2.y);                        RectF oval = new RectF(point2.x - mRadius, point2.y                                - mRadius, point2.x + mRadius, point2.y                                + mRadius);                        /* end point */                        polyPaint.setAlpha(255);                        offscreencanvas.drawOval(oval, polyPaint);                    }                    // mode=2&amp;#65306;path                    else if (i &lt; route.length - 2 &amp; i != 0) {                        Point point2 = new Point();                        projection.toPixels(gp2, point2);                        path.lineTo(point2.x, point2.y);                    }                }            }            // create an off-screen canvas to prepare new bitmap, and            // draw path on to it            polyPaint.setStrokeWidth(5);            polyPaint.setStyle(Paint.Style.STROKE);            polyPaint.setAntiAlias(true);            polyPaint                    .setAlpha(defaultColor == Color.parseColor(""#6C8715"") ? 220                            : 120);            offscreencanvas.drawPath(path, polyPaint);        } // Outer For End        // draw the bitmap of the path onto my map view's canvas        canvas.drawBitmap(bmap, 0, 0, null);        // make a note of where we put the bitmap, so we know how        // much we        // we need to move it by if the user pans the map        mapStartPosition = projection.fromPixels(0, 0);    } else {        // as we're in onDraw, we think the user has panned/moved the map        // if we're in here, the zoom level hasn't changed, and        // we've already got a bitmap with a drawing of the route path        Projection proj = mapv.getProjection();        // where has the mapview been panned to?        Point offsetPt = new Point();        proj.toPixels(mapStartPosition, offsetPt);        Paint tmpPaint = new Paint();        // create a new bitmap, the size of the map view        // draw the bitmap in the new correct location        canvas.drawBitmap(bmap, offsetPt.x, offsetPt.y, tmpPaint);    }    return super.draw(canvas, mapv, shadow, when);}</code></pre>","255864","","","","","2011-03-11 15:29:16","Android MapView Bitmap Problem","<android>","2","0","2","",""
"4653963","1","4838395","","2011-01-11 03:40:14","0","316","<p>I have a button that when clicked, saves a canvas to an image file and then calls another activity.  The problem I am having is that through testing, I've noticed the user can click the button twice in a row before the activity is called, resulting in two files being written.</p><p>I also noticed the same problem with spinners in another activity. I click them twice in a row in succession and up pops up 2 list views containing all my spinner items.</p><p>I've been trying to Google this without much luck.  Is there a simple fix to this?</p><p>Thanks.</p>","432209","","","","","2011-01-29 17:45:15","Prevent a widget from getting clicked multiple times in a short span","<java><android><android-widget>","3","0","","",""
"4654034","1","4658802","","2011-01-11 03:53:44","1","646","<p>I want to develop Arcgis for android and web service, but I don't know it has an API yet?If it has, it's possible to mark(like google map API) on a map which i get lat and long which collected on my server?</p><p>Thanks ka :)) </p>","538788","","","","","2012-12-10 17:36:24","Is Arcgis possible for android?","<android><web-services><arcgis>","3","3","1","",""
"4654042","1","4654157","","2011-01-11 03:56:21","0","250","<p>I am trying to make an app whereby a picture will be shown, there're a few objects that user needs to identify (i.e. a cup), by touching the cup in the picture on the screen, a circle will be drawn if it's valid.</p><p>So far, I have a surfaceview with a bitmap as drawable to be displayed full screen, and upon touching the screen, a circle will be drawn to the view.</p><p>I could only think of getting the coordinate of the cup manually in the picture(hardcoded), and check it against the coordinate from touch <code>event.getX()</code> and <code>event.getY()</code>. But this would not work as screen resolution changes.</p><p>What is a better way in doing so? It's like I'm trying to find a way to precisely allow touch on certain areas which I've defined in my app.</p>","71724","","","","","2011-01-11 06:38:06","check validity of touch precisely","<android><surfaceview>","3","1","","",""
"4654230","1","","","2011-01-11 04:38:00","1","660","<p>I try to read from google calendar on android, so i download and install the google client api follow the instruction on <a href=""http://code.google.com/apis/gdata/articles/java_client_lib.html"" rel=""nofollow"">instruction</a>I use the sample code from the tutorial website.</p><pre><code>try {         CalendarService myService = new CalendarService(""demo-vibration-1"");         myService.setUserCredentials(account, password);         // Send the request and print the response         URL feedUrl = new URL(               ""https://www.google.com/calendar/feeds/default/owncalendars/full"");         Log.v(TAG, ""Calendar1"");         CalendarFeed resultFeed = myService.getFeed(feedUrl,               CalendarFeed.class);         Log.v(TAG, ""Calendar2"");         for (int i = 0; i &lt; resultFeed.getEntries().size(); i++) {            CalendarEntry entry = resultFeed.getEntries().get(i);            Log.v(TAG, entry.getTitle().getPlainText());         }      } catch (Exception e) {[syntax=""java""][/syntax]         e.printStackTrace();      }</code></pre><p>It compiles and run but throw a parserConfigurationException: org.xml.sax.SAXNotRecognizedException on</p><pre><code>CalendarFeed resultFeed = myService.getFeed(feedUrl,               CalendarFeed.class);</code></pre><p>It fail on android simulate device, but if I run the code on a regular java project it works just fine. I included all the related gdata jar file into my project build path.Is there anyone run into the same problem?</p><p>following is the exception trace01-10 22:06:56.231: WARN/System.err(379): com.google.gdata.util.ParseException: org.xml.sax.SAXNotRecognizedException: http:/xml.org/sax/features/external-parameter-entities01-10 22:06:56.241: WARN/System.err(379):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:708)01-10 22:06:56.241: WARN/System.err(379):     at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)01-10 22:06:56.241: WARN/System.err(379):     at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)01-10 22:06:56.241: WARN/System.err(379):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)01-10 22:06:56.251: WARN/System.err(379):     at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)01-10 22:06:56.251: WARN/System.err(379):     at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)01-10 22:06:56.251: WARN/System.err(379):     at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)01-10 22:06:56.251: WARN/System.err(379):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)01-10 22:06:56.251: WARN/System.err(379):     at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)01-10 22:06:56.261: WARN/System.err(379):     at com.google.gdata.client.Service.parseResponseData(Service.java:2165)01-10 22:06:56.261: WARN/System.err(379):     at com.google.gdata.client.Service.parseResponseData(Service.java:2098)01-10 22:06:56.261: WARN/System.err(379):     at com.google.gdata.client.Service.getFeed(Service.java:1136)01-10 22:06:56.261: WARN/System.err(379):     at com.google.gdata.client.Service.getFeed(Service.java:998)01-10 22:06:56.261: WARN/System.err(379):     at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:638)01-10 22:06:56.261: WARN/System.err(379):     at com.google.gdata.client.Service.getFeed(Service.java:1017)01-10 22:06:56.271: WARN/System.err(379):     at eclipse.pratice.android.calendartest.calendartest.onCreate(calendartest.java:29)01-10 22:06:56.271: WARN/System.err(379):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)01-10 22:06:56.271: WARN/System.err(379):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)01-10 22:06:56.271: WARN/System.err(379):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)01-10 22:06:56.271: WARN/System.err(379):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)01-10 22:06:56.271: WARN/System.err(379):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)01-10 22:06:56.281: WARN/System.err(379):     at android.os.Handler.dispatchMessage(Handler.java:99)01-10 22:06:56.281: WARN/System.err(379):     at android.os.Looper.loop(Looper.java:123)01-10 22:06:56.281: WARN/System.err(379):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-10 22:06:56.281: WARN/System.err(379):     at java.lang.reflect.Method.invokeNative(Native Method)01-10 22:06:56.291: WARN/System.err(379):     at java.lang.reflect.Method.invoke(Method.java:521)01-10 22:06:56.291: WARN/System.err(379):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)01-10 22:06:56.291: WARN/System.err(379):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)01-10 22:06:56.291: WARN/System.err(379):     at dalvik.system.NativeStart.main(Native Method)01-10 22:06:56.291: WARN/System.err(379): Caused by: javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http:/xml.org/sax/features/external-parameter-entities</p>","559600","","756941","","2013-12-11 05:08:58","2013-12-11 05:08:58","Issue with google calendar on android","<android><google-calendar>","0","0","","",""
"4654275","1","4665227","","2011-01-11 04:47:00","1","249","<p>I want to ask is there any api which return list of suggestions of words on giving input in any text control in any platform.</p><p>For example when we type in EditText in android through soft keyboard , keyboard  returns some suggestions so my question is that is there  any api which gives the suggestions of corresponding input words(Platform does not matter).</p><p>I am clearing it by a example suppose i type ab in EditText then the keyboard gives suggestions like Ab abc anita ashima  etc.Please guide me.Thanks in advance</p>","555688","","","","","2011-01-12 04:03:44","Is there any api which give suggestion words?","<iphone><android>","2","2","","",""
"4654385","1","","","2011-01-11 05:07:14","0","570","<p>m Goutham m using android 2.2 i have a problem may be you guys help me in figuring it out.i have a authentication screen when m logging in it is taking so time to load and then it switches to a black screen and then it goes to the actuall mainscreen. how can i make that black screen to white.. plz help me guys...</p><p>Thanx in Advance,Goutham</p>","570805","","","","","2011-01-12 06:42:12","How to get rid of black screen","<android>","2","1","","",""
"4654480","1","4658958","","2011-01-11 05:21:39","8","6750","<p>I developing android app which uses a lot of http requests to web service. At first, I was creating a new HttpClient instance before every request.To increase performance I try to do requests in many threads. So, I created single HttpClient instance, shared by all threads, using ThreadSafeConnectionManager:</p><pre><code>SchemeRegistry registry = new SchemeRegistry();registry.register(new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));BasicHttpParams params = new BasicHttpParams();ConnManagerParams.setMaxTotalConnections(params, 100);HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);HttpProtocolParams.setUseExpectContinue(params, true);ThreadSafeClientConnManager connManager = new ThreadSafeClientConnManager(params, registry);HttpClient client = new DefaultHttpClient(connManager, params);</code></pre><p>But performance decreased, to my surprise. I have measured time, to be spended to exequte requests in such way:</p><pre><code>long startTime = System.currentTimeMillis();HttpResponse response = client.execute(postRequest);long reqTime = System.currentTimeMillis() - startTime;Log.i(""SyncTimer"", ""Request time:"" + reqTime);</code></pre><p>Here this is a log, which I get with simple DefaultHttpClient without parameters new instance per request:</p><pre><code>01-11 11:10:51.136: INFO/SyncTimer(18400): Request time:107601-11 11:10:54.686: INFO/SyncTimer(18400): Request time:105101-11 11:10:57.996: INFO/SyncTimer(18400): Request time:105401-11 11:10:59.166: INFO/SyncTimer(18400): Request time:107001-11 11:11:00.346: INFO/SyncTimer(18400): Request time:117201-11 11:11:02.656: INFO/SyncTimer(18400): Request time:1043</code></pre><p>And what I get with ThreadSafeClientConnManager and single HttpClient instance:</p><pre><code>01-11 11:06:06.926: INFO/SyncTimer(18267): Request time:700101-11 11:06:10.412: INFO/SyncTimer(18267): Request time:338501-11 11:06:20.222: INFO/SyncTimer(18267): Request time:980101-11 11:06:23.622: INFO/SyncTimer(18267): Request time:205801-11 11:06:29.906: INFO/SyncTimer(18267): Request time:626801-11 11:06:34.746: INFO/SyncTimer(18267): Request time:352501-11 11:06:50.302: INFO/SyncTimer(18267): Request time:15551</code></pre><p>What happens and how can I fight this?</p><p><strong>UPDATE</strong></p><p>Use keep-alive advantage - is what I want. But when I create new HttpClient instance for every request connection can not be reused. Despite of this, such version runs faster, reasons of it is unclear for me. </p>","299137","","492624","","2012-07-16 11:37:12","2012-07-16 11:37:12","Android HttpClient perfomance","<android><performance><httpclient>","2","3","9","",""
"4654518","1","","","2011-01-11 05:29:49","3","872","<p>I'm running a basic native function that modifies the pixels of a bitmap. To do this I am getting the pixels via the Bitmap_lockPixels() function. However, this isn't available for versions lower than 2.2. </p><p>How do you recommend I replace this function to retain as much speed as possible?</p>","118241","","118241","","2011-03-05 04:03:13","2013-07-29 14:37:58","Android 2.1 Native Lock Bitmap Pixels","<java><android><bitmap><native><pixel>","1","0","","",""
"4654599","1","","","2011-01-11 05:45:22","0","326","<p>We are using below code to send MMS but in some devices showing ""Messaging"" option but in some devices not showing ""Messaging"" option. And its showing rest of options like bluetooth, dropbox, email, evernote, etc. please correct me if i am doing something wrong.</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.putExtra(""address"", phoneNumber);sendIntent.putExtra(""sms_body"", message);Uri uri = Uri.fromFile(new File(Environment.getExternalStorageDirectory().getPath()+""/tmp.jpg""));sendIntent.putExtra(Intent.EXTRA_STREAM, uri);sendIntent.setType(""image/*"");startActivity(Intent.createChooser(sendIntent, ""Send Image To:""));</code></pre>","516061","","8946","","2011-03-17 17:58:40","2011-03-17 17:58:40","not showing ""Messaging"" option when try to send MMS programatically","<android>","1","1","","",""
"4654612","1","","","2011-01-11 05:47:08","0","1835","<p>I am developing an application in android Geocoder.When I run the applicaion its showing<br>[2011-01-11 11:08:13 - GeoTourProject] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Name'[2011-01-11 11:08:25 - GeoTourProject] Application already deployed. No need to reinstall.[2011-01-11 11:08:25 - GeoTourProject] \GeoTourProject\bin\GeoTourProject.apk installed on device[2011-01-11 11:08:25 - GeoTourProject] Done!</p><p>What should i do to install the application on android stimulator....??</p><p>Thanks in advanceTushar Sahni</p>","475349","","","","","2011-01-11 08:07:00","Application not installing on android emulator","<android>","2","1","1","",""
"4654622","1","4654671","","2011-01-11 05:48:56","1","4137","<p><a href=""http://www.androidpeople.com/android-mediaplayer-example/"" rel=""nofollow"">Here</a>'s an example on how to play video,</p><p>but it embeds the video as resource of the apk,</p><p>how to play an external video ,e.g. the <code>test.mp4</code> under the <code>/download</code> directory of sdcard?</p>","477822","","3110609","","2014-03-10 12:11:48","2014-03-10 12:11:48","How to play external video with java android jdk?","<java><android><video>","4","0","1","",""
"4654649","1","","","2011-01-11 05:53:41","0","489","<p>I am currently able to start an activity and add custom points to it by extending <code>MapActivity</code>.  Unfortunately, it is a very stripped down map, without any ability to get directions. use GPS or any such thing.</p><p>Is there a way to hook into the real Google maps so the user can get quick access to directions to the points of interest?  If not that, can I make the map I have now more robust?</p>","22231","","","","","2011-01-11 05:53:41","How do I add points of interest to a real Google Map?","<android>","0","2","1","",""
"4654669","1","4654692","","2011-01-11 05:59:14","0","88","<p>For example, if we build an application for Android 2.0, will it work on</p><ol><li><p>Droid Incredible</p></li><li><p>Droid Global</p></li><li><p>Droid Pro</p></li><li><p>Droid X</p></li><li><p>Tablet PCs like Samsung Galaxy Tablet (http://www.samsung.com/us/mobile/galaxy-tab )</p></li></ol>","550966","","550966","","2013-05-20 13:01:06","2013-05-20 13:01:06","Android 2.0 application can run on other smart phones : Android","<android><android-screen-support>","1","0","0","",""
"4654690","1","","","2011-01-11 06:04:43","5","3489","<p>I have some saved images at Pictures folder in SD Card. I want to access those images of my folder directly.</p><p>I have used the below code to pick Gallery images directly.</p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK);intent.setDataAndType(Uri.parse(""file:///sdcard/Pictures/""), ""image/*"");startActivityForResult(intent, 1);</code></pre><p>The above code is getting all images from the SD Card. But i need only of my Pictures folder. I also tried Intent.ACTION_GET_CONTENT, the same result.</p><p>Please anybody correct me...</p><p>Thank you.</p>","376035","","","","","2014-01-19 05:48:49","How to get Galley Thumbnail for particular image folder in android?","<android><thumbnails><gallery><sd-card><subfolder>","1","1","2","",""
"4654738","1","6300165","","2011-01-11 06:12:25","0","323","<p>I am facing a bit of problem with getting the route information from Google maps</p><p>I use the following url to get the complete route info. The query contains intermediate destination points<a href=""http://maps.google.com/maps?f=d&amp;hl=en&amp;saddr=45.414569,-75.707324&amp;daddr=45.430579,-75.686953+to:45.436207,-75.684726+to:45.434764,-75.683417+to:45.43415,-75.682838+to:45.429996,-75.683098&amp;ie=UTF8&amp;om=0&amp;dirflg=w&amp;output=kml"" rel=""nofollow"">http://maps.google.com/maps?f=d&amp;hl=en&amp;saddr=45.414569,-75.707324&amp;daddr=45.430579,-75.686953+to:45.436207,-75.684726+to:45.434764,-75.683417+to:45.43415,-75.682838+to:45.429996,-75.683098&amp;ie=UTF8&amp;om=0&amp;dirflg=w&amp;output=kml</a></p><p>This gives me back a kml file but the kml file contains route coordinates only till the first destination point and no futher however if i remove the output parameter, the google map draws all the destinations mentioned in the ""+to:"" clause<a href=""http://maps.google.com/maps?f=d&amp;hl=en&amp;saddr=45.414569,-75.707324&amp;daddr=45.430579,-75.686953+to:45.436207,-75.684726+to:45.434764,-75.683417+to:45.43415,-75.682838+to:45.429996,-75.683098&amp;ie=UTF8&amp;om=0&amp;dirflg=w"" rel=""nofollow"">http://maps.google.com/maps?f=d&amp;hl=en&amp;saddr=45.414569,-75.707324&amp;daddr=45.430579,-75.686953+to:45.436207,-75.684726+to:45.434764,-75.683417+to:45.43415,-75.682838+to:45.429996,-75.683098&amp;ie=UTF8&amp;om=0&amp;dirflg=w</a></p><p>How to get all the route coordinates in KML including all the intermediate destination points</p><p>Thankssurya</p>","539401","","539401","","2011-01-11 06:37:10","2011-06-09 22:44:12","android + KML + support for ""+to:"" tag","<android><kml>","1","0","","",""
"4654770","1","4978202","","2011-01-11 06:17:26","4","7903","<p>How to capture the Android device screen content using  /dev/graphics/fb0  and how to make it an image file using the collected data from frame buffer..i know for this it requires the device to be rooted and i am ok with that..</p><p>Thanks in advance,</p>","505580","","","","","2013-12-12 13:12:24","How to capture the screen using /dev/graphics/fb0 (Android)","<android><driver>","4","0","6","",""
"4654779","1","","","2011-01-11 06:19:16","10","5781","<p>in my application, I need to direct sound from microphone directly to speaker. No other actions.I found a way to direct sound from microphone to earpiece by playing a file and setting speaker off. So I guess speaker can work similarly. However I don' know how to get rid of the playing file thing. Thank you.</p><pre><code>speaker() {    m_audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);    m_audioManager.setSpeakerphoneOn(true);  // not needed I think    //m_audioManager.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL); earpiece need this?    setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);    m_audioManager.setMode(AudioManager.MODE_IN_CALL);</code></pre>","521230","","","","","2013-10-09 10:10:49","how to play sound from microphone to speaker directly on android?","<android><microphone><speaker>","2","0","5","",""
"4654788","1","4655074","","2011-01-11 06:20:46","0","405","<p>I want my app to be shown in the Market, only for devices with large screen. i.e  WVGA800 (480x800, 480x850). Example: Nexus One.</p><p>I have done following changes in the Manifest file.</p><pre><code>&lt;supports-screens android:anyDensity=""true"" android:largeScreens=""true"" android:normalScreens=""false"" android:smallScreens=""false"" android:resizeable=""true""&gt;&lt;/supports-screens&gt;</code></pre><p>After uploading, when i try to search in Market using Nexus one, the app is not showing up. I have also tried with other devices having different screen types.</p><p>Any help on this will be great.</p><p>Thanks</p>","226946","","","","","2011-01-11 07:08:30","Problem Filtering android app based on screen resolution","<android><screen><google-play>","1","0","","",""
"4654811","1","4655155","","2011-01-11 06:23:48","6","5868","<p>I simply cannot find any documentation on what I'm supposed to include in my Feature Graphic. The only info listed is: </p><p>1024w x 500h</p><p>24 bit PNG or JPEG (no alpha)</p><p>Will be downsized to mini or micro</p><p>But what content should it include? Thanks for any help.</p>","416631","","","","","2013-12-06 05:19:58","What is the ""Feature Graphic"" for Android apps?","<android><publish><google-play><graphic>","3","3","1","",""
"4654828","1","4655587","","2011-01-11 06:26:33","2","5694","<p>I just wanna create a text file into phone memory and have to read its content to display.Now i created a text file.But its not present in the path data/data/package-name/file name.txt &amp; it didn't display the content on emulator.</p><p>My code is..</p><pre><code>public class PhonememAct extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView tv=(TextView)findViewById(R.id.tv);        FileOutputStream fos = null;        try {            fos = openFileOutput(""Test.txt"", Context.MODE_PRIVATE);        } catch (FileNotFoundException e2) {            // TODO Auto-generated catch block            e2.printStackTrace();        }        try {            fos.write(""Hai.."".getBytes());        } catch (IOException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        }        try {            fos.close();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        FileInputStream fis = null;        try {            fis = openFileInput(""Test.txt"");        } catch (FileNotFoundException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        int c;        try {            while((c=fis.read())!=-1)                    {                        tv.setText(c);                        setContentView(tv);                        //k += (char)c;                    }        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }            try {                fis.close();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }    }}</code></pre><p>Thanks in adv.</p>","555948","","473070","","2011-01-11 08:19:54","2011-06-02 16:46:00","read text file from phone memory in android","<android>","5","1","2","",""
"4654878","1","","","2011-01-11 06:37:25","18","58752","<p>How do I play YouTube videos in my application? I want to play video by streaming it directly from YouTube without downloading. Also, while playing videos, I want provide menu options. I don't want to play video using default intent. How can I do this?</p>","446366","","23897","","2011-01-11 06:43:00","2014-01-09 12:47:07","How to play YouTube video in my Android application?","<android><youtube>","8","0","17","",""
"4655003","1","4737771","","2011-01-11 06:59:36","3","3023","<p>How to get FileInputStream for file in internal memory in android which is not inside applications default file directory. </p><p>I have created new directory in my application space. So <code>openFileInput(""filename"")</code> will only work for files in <code>getFilesDir()</code>. And <code>openFileInput(""filename"")</code> do not accept argument with path separaters ""/"" so I can change it to ../myfolder/.</p><p>Is there any way to get a <code>FileInputStream</code> on this ? .. </p><p>Note: Using normal APIs File = new File(... ) gives permission denied errors. And I have already created given Context.MODE_WORLD_WRITEABLE as the permission for my custom folder.</p><p>To make it clear :My file is here ==> <code>/data/data/com.app.package/app_myfolder/file1.tmp</code>where""myfolder"" ==> is created with <code>Context.MODE_WORLD_WRITEABLE</code> permissions.</p><p>I want to open <code>FileInputStream</code> on <code>file1.tmp</code>. (Normally your files are here <code>/data/data/com.app.package/files/file1.tmp</code> and <code>getFilesDir()</code> points to this directory, so also <code>openFileInput("""")</code> takes argument which exist in same default directory.)</p>","315619","","473070","","2011-01-11 08:12:38","2011-01-19 16:20:27","How to get FileInputStream for internal memory files in Android ? The file is in my custom folder made in application space","<android><file><memory><internal>","1","1","2","",""
"4655014","1","4740815","","2011-01-11 07:01:02","2","342","<p>I've developed several Android apps now and have created a code base of classes that I frequently use in more than one app.  This code is all in a subversion (svn) repository with each app in its own repository.  Each app then has svn:externals references for the needed packages (e.g., com.company.android.views).  This works great except in the case when the R class has to be imported for custom attributes.</p><p>A custom view has an import like this:</p><pre><code>import com.company.apps.myapp.R</code></pre><p>so that it can have code like this:</p><pre><code>attributes.getBoolean(R.styleable.WebImageView_autoload, autoload)</code></pre><p>That custom attribute is defined in res/values/attrs.xml:</p><pre><code>&lt;declare-styleable name=""WebImageView""&gt;    &lt;attr name=""autoload"" format=""boolean"" /&gt;    ...others&lt;/declare-styleable&gt;</code></pre><p>This works perfectly, but the problem comes when I have a second app that uses this same view.  Now I update the import to <code>import com.company.apps.anotherapp.R</code> so that it will work with ""anotherapp"" and that breaks it with ""myapp.""  When working on several apps at once, this becomes an issue.</p><p>My temporary solution has been to check in an update to the applicable classes and then lock the svn:externals to that specific revision.  Each app ends up being locked to a different revision, which gets messy fast, but that still seems better than copying the various classes into the app's repo directly.</p><p>The only other solution I've thought of it using reflection, something like:</p><pre><code>Class class = Class.forName(context.getPackageName() + "".R"");Field[] fields = class.getDeclaredFields();</code></pre><p>And then loop through the fields, assigning the ones I care about to variables that are used throughout the class.  This seems rather heavy-handed though, especially when we could be talking about several classes needing to do this.</p><p>How can I solve this issue?  Is there a way to dynamically import the com.company.apps.*.R or to somehow generate a different R class that doesn't depend on the specific app?  Or is there some other obvious (or not so obvious) solution I've totally missed?</p>","417513","","","","","2011-01-19 21:11:38","Custom Views and attributes used across Android apps","<java><android><svn><android-custom-view>","1","0","","",""
"4655045","1","4655090","","2011-01-11 07:05:17","0","5359","<p>Can we view PDF &amp; PPT document on Android phone with the help of any software ?Kindly provide your inputs. </p><p>Warm Regards,</p><p>CB</p>","443141","","457982","","2011-01-11 07:30:37","2012-04-26 14:52:38","View PPT & PDF on Android","<android><pdf><powerpoint>","2","1","1","",""
"4655210","1","","","2011-01-11 07:31:12","1","4065","<p>i m not able to get the value that is pass from android in my jsp page. where i made make mistake. Any suggestion!</p><p>below is my code:</p><p>==========================</p><h1>Client : android Activity</h1><pre><code>package org.test2;import java.io.IOException;import org.apache.http.HttpResponse;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class test2Activity extends Activity {    EditText ed;    Button ok;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ed=(EditText)findViewById(R.id.EditText01);        ok=(Button)findViewById(R.id.Button01);        ok.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                // Create a new HttpClient and Post Header                  HttpClient httpclient = new DefaultHttpClient();                HttpGet request=new HttpGet(""http://localhost:8080/t5/jsp1.jsp?name=hiren"");                //HttpPost httppost = new HttpPost(""http://localhost:8080/t5/jsp1.jsp?name=hiren"");                 try {                                   // Execute HTTP Post Request                      HttpResponse response = httpclient.execute(request);                                    } catch (ClientProtocolException e) {                      // TODO Auto-generated catch block                  }catch (IOException e) {                      // TODO Auto-generated catch block                  }            }        });    }}</code></pre><p>=======================================</p><h1>server : jsp</h1><pre><code>&lt;%@ page import=""java.util.*"" language=""java"" contentType=""text/html; charset=ISO-8859-1""    pageEncoding=""ISO-8859-1""%&gt;&lt;!DOCTYPE html PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd""&gt;&lt;html&gt;&lt;head&gt;&lt;script type=""text/javascript""&gt; &lt;/script&gt;&lt;meta http-equiv=""Content-Type"" content=""text/html; charset=ISO-8859-1""&gt;&lt;title&gt;Insert title here&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Parameter value = &lt;%=request.getParameter(""name"") %&gt;&lt;/body&gt;&lt;/html&gt;</code></pre><p>=========================================</p>","489902","","260990","","2011-01-11 07:35:49","2012-10-08 14:08:02","passing parameter from android to servlet/jsp","<java><android><jsp>","3","1","0","",""
"4655235","1","4656323","","2011-01-11 07:34:56","2","5489","<p>I have an application where I have Tab Host. I have certainly four tabs in my Tab Host and one of my tab contains a list of some elements. Now When a user click on the element of the third Tab he is supposed to switched to the first tab and the data of the list element gets displayed there. But when the user initially tries to click on the first Tab without selecting any element from the list of third tab, I need to display the Alert Message that ""Please select an item form the List""</p><p>I wonder how to do that particularly?</p><p>Thanks,david</p>","422859","","","","","2012-04-07 16:49:52","Displaying Alert Message Box on click event","<android><list><alertdialog>","3","0","","",""
"4655266","1","4655346","","2011-01-11 07:40:01","1","931","<p>My App is not using the CALL_PHONE permission neither I've declared it in the manifest, but while installing the app, it shows that app is using CALL_PHONE permission. Please help me about this. I am developing for Android 1.6 and have installed the app for testing from SDCard.</p>","556702","","","","","2011-01-11 07:51:30","Android CALL_PHONE permission issue","<android><permissions>","1","0","","",""
"4655291","1","6741039","","2011-01-11 07:44:13","18","4418","<p>I have read the docs multiple times, but I still cannot figure out the exact semantics of <a href=""http://developer.android.com/reference/android/content/ContentProviderOperation.Builder.html#withValueBackReference%28java.lang.String,%20int%29"">withValueBackReference</a>.</p><p>I see some of the example code (for example the code which adds a new contact) using this method, providing a backReference value of 0. What does this mean?</p><p>The docs have this to say:</p><blockquote>  <p>A column value from the back references takes precedence over a value specified in withValues(ContentValues)</p></blockquote><p>Any help is greatly appreciated.</p>","570930","","427763","","2012-06-19 19:17:26","2012-06-19 19:17:26","Semantics of withValueBackReference?","<android><android-contentprovider>","1","1","20","",""
"4655326","1","4657542","","2011-01-11 07:48:20","0","3989","<p>Is there a way to animate a text color change (from anycolor to white)?</p><p>The only variant I came up with, is placing two textviews (with the same text) in one place, and fading the top one, so the bottom one (that has a white color) will become visible.</p><p>P.S. I scrapped the variant of the 2 TextViews since it looked weird (edges weren't smooth and, since I have a lot of such elements on the screen it was really lagging the scrolling). What I did, was a crazy hack that does the animation with the use of a Thread and setTextColor (that also forces redraw of a textview).</p><p>Since I needed only 2 color changes (from red to white, and from green to white) I hardcoded the values and all of the transition colors between them. So here's how it looks:</p><pre><code>public class BlinkingTextView extends TextView {public BlinkingTextView(Context context, AttributeSet attrs) {    super(context, attrs);}public void animateBlink(final boolean red) {    if (animator != null) {        animator.drop();    }    animator = new Animator(this, red);    animator.start();}public void clearBlinkAnimation() {    if (animator != null) {        animator.drop();    }}private Animator animator;private final static class Animator extends Thread {    public Animator(final TextView textView, final boolean red) {        this.textView = textView;        if (red) {            SET_TO_USE = RED;        } else {            SET_TO_USE = GREEN;        }    }    private TextView textView;    private final int[] SET_TO_USE;    private final static int[] RED = {        -2142396,        -2008754,        -1874854,        -1740697,        -1540490,        -1405563,        -1205099,        -1004634,        -804170,        -669243,        -469036,        -334879,        -200979,        -67337,        -1    };    private final static int[] GREEN = {        -6959821,        -6565826,        -6106293,        -5646758,        -5055894,        -4530309,        -3939444,        -3283042,        -2692177,        -2166592,        -1575728,        -1116193,        -656660,        -262665,        -1    };    private boolean stop;    @Override    public void run() {        int i = 0;        while (i &lt; 15) {            if (stop) break;            final int color = SET_TO_USE[i];            if (stop) break;            textView.post(new Runnable() {                @Override                public void run() {                    if (!stop) {                        textView.setTextColor(color);                                           }                }            });            if (stop) break;            i++;            if (stop) break;            try {                Thread.sleep(66);            } catch (InterruptedException e) {}            if (stop) break;        }    }    public void drop() {        stop = true;    }}}</code></pre>","495663","","495663","","2011-02-04 11:12:59","2013-01-22 20:40:21","Text color animation","<android>","4","0","4","",""
"4655327","1","","","2011-01-11 07:48:30","0","628","<p>I have created one sample application which is used to recognize user voice using android. now i would like to test this application. Can anyone tell me where can i test this application. Is mobile deveice is required to test this app or can i test it in the Emulator which comes with Android SDK?</p>","565035","","565035","","2011-02-12 12:08:23","2011-02-12 12:08:23","Is it possible to check speech recognition in Android Virtual Device?","<android><android-emulator><speech-recognition>","0","2","","",""
"4655384","1","","","2011-01-11 07:57:36","0","75","<p>I am New to Android , I want to create an layout with backgroundimage and  textview,edit text in center in  a table layout ,please help me, by   providing some tutorials , Any guidance would be appreciated </p>","784999","","424413","","2011-01-11 08:45:25","2011-01-11 08:45:25","Need Help in Creating Android User interface?","<android>","2","0","","",""
"4655679","1","5363151","","2011-01-11 08:40:48","0","1244","<p>This is my code :</p><pre><code>getWindow().requestFeature(Window.FEATURE_PROGRESS);WebView mWebView = (WebView) findViewById(R.id.mywebview);mWebView.getSettings().setJavaScriptEnabled(true);final Activity activity = this;mWebView.setWebChromeClient(new WebChromeClient(){     public void onProgressChanged(WebView view, int progress) {             activity.setTitle(""Loading..."");             activity.setProgress(progress * 100);                if(progress == 100)                   activity.setTitle(""My title"");             }});mWebView.loadUrl(URL);</code></pre><p>I want to change the progress style to a circle.</p><p>How to change it?</p>","565579","","56338","","2011-05-09 10:16:41","2012-12-07 08:22:34","Can I change the progress bar in a webview to a progress circle?","<android><webview><progress-bar><loading><circle>","2","0","1","",""
"4655694","1","4656426","","2011-01-11 08:41:59","1","647","<p>What is wrong in this program, My eclipse IDE doesn't show any errors....when I execute this simple program the emulator shows force close....Anybody please clarify</p><pre><code>import android.app.Activity;import android.view.View.OnClickListener;import android.view.View;import android.os.Bundle;import android.widget.*;public class HelloWorld extends Activity implements OnClickListener {    /** Called when the activity is first created. */    View Et1,Bt1,TxtDisp;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.name_getter);        Bt1=(Button)findViewById(R.id.Btn1);        Et1=(EditText)findViewById(R.id.UserInput);        TxtDisp=(TextView)findViewById(R.id.TextDisp);        Bt1.setOnClickListener(this);          }    @Override    public void onClick(View v) {        // TODO Auto-generated method stub        String userInput=((EditText) Et1).getText().toString();        ((TextView)TxtDisp).setText(userInput);    }}</code></pre>","517525","","","","","2011-01-11 12:08:11","What's wrong in this simple android Program, I get 'Force Close'","<android>","5","6","","",""
"4655709","1","4655749","","2011-01-11 08:44:30","0","3266","<p>I would like to check if my website work and look correctly on the major tablet browsers. Unfortunately, I don't own a galaxy tab; Is there an easy-to-use emulator of some sort that I can use that will show me how the site looks, including the virtual keyboard?</p>","2257","","","","","2011-01-11 09:17:14","How can I test my web-pages on a Samsung Galaxy tablet without having the actual device?","<android><cross-browser><tablet><galaxy>","3","0","1","",""
"4655758","1","","","2011-01-11 08:51:15","0","3478","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to do this thing: I have one layout named ""login.xml"" and other ""main.xml"". I want first load ""login.xml"", input login name and then if login name correct load ""main.xml"". </p><pre><code>public class simpleprogram extends Activity {   /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.login);}</code></pre><p>How to call main.xml correctly?</p>","570996","","","","","2013-12-26 16:56:54","How to connect two layout java android?","<java><android><xml><layout><connection>","3","0","","",""
"4655845","1","4655962","","2011-01-11 09:02:41","13","15005","<p>I have a RelativeLayout with a button inside it. Once the user clicks on that button, I would like to change the background of the parent view (RelativeLayout). I know I can do this by storing the parent view in a variable or setting a tag on the button, but I'd lime to avoid that (I have very good reasons for not wanting this). Isn't there a way to just access the parent view from the button itself?</p>","496854","","","","","2011-01-11 09:18:12","Android: Making changes to a button's parent view","<android><view><parent>","1","1","0","",""
"4655861","1","","","2011-01-11 09:05:02","11","7029","<p>I am currently working on an android App that uses 'JSON' as response from server. Usually I work on the JSON response. But now I have a problem with logcat, if the JSON response string is very long , more than x character (i don't know exactly how much is the max string that could be displayed by logcat), some of the JSON string is missing. </p><p>Although it still could give me the output, I need the information on the JSON string that is transmitted from the server. </p><p>Is there any possibility to display more string on logcat? Like increasing the buffer or any parameter that I could use to increase the maximum string length that could be displayed by logcat.</p>","571010","","592025","","2012-06-04 10:39:58","2013-05-06 10:51:24","Displaying More string on Logcat","<android><logcat>","5","2","3","",""
"4655883","1","4655921","","2011-01-11 09:08:15","4","16516","<p>I am new to Android development. I need some information in order to develop an Android based application. Can you please help me out in this. I am a C# developer using Visual studio. Can you tell me whether I can develop Android based application using Visual Studio? If I can then how to start with ?</p><p>Thanks in advance.</p><p>-Ankit</p>","553152","","253056","","2011-01-18 12:36:29","2012-09-14 06:27:22","Android application development","<android><visual-studio-2010>","7","2","2","2012-10-21 14:12:20",""
"4656060","1","","","2011-01-11 09:28:15","3","764","<p>I am desperately looking for a detailed documentation of the features supported by the Android browser and accessible from the JavaScript API, but still can't find any.</p><p>In particular, I would like details about:-the extent of the html5 canvas implementation in Android wrt. the spec.-the level of support of touch event and gesture event. (I found :<a href=""http://backtothecode.blogspot.com/2009/10/javascript-touch-and-gesture-events.html"" rel=""nofollow"">http://backtothecode.blogspot.com/2009/10/javascript-touch-and-gesture-events.html</a> -but it's 1 year old- and also the quirksmode.org site). </p><p>According to my tests, trapping multitouch event in JavaScript is not supported (in 2.2). But it would be easier to have an official doc than  a test-based approach.-and to a more extent, the status of each HTML5 features in Android default browser. </p><p>Any good pointers ?</p><p>Thx</p><p>Patrick</p>","567080","","","","","2013-05-30 06:32:12","any detailed doc about the supported Javascript API in the Android default browser?","<android>","1","0","","",""
"4656100","1","","","2011-01-11 09:32:35","0","2746","<p>I owned a project from my supervisor which is a video chat app on Android. The app is same as Fring or Qik video chat. But it's new for me, so can anyone give me some advices or start points referrence?</p><p>Thanks!</p>","571044","","","","","2011-01-12 15:26:57","Video chat project on Android platform","<android><video><chat>","1","2","1","",""
"4656183","1","","","2011-01-11 09:41:55","0","3178","<p>I want to make application in which user is online through google account. and also can share it's locaton in google map. and also he/she can find his/her online friends through google map and chat with them.</p><p>How to share my location to google map in android? How can implement this feature in my own android application?</p>","550843","","286204","","2011-01-11 09:51:17","2012-03-12 16:03:47","How to share user location into google map in android?","<android>","1","1","0","",""
"4656199","1","20448306","","2011-01-11 09:43:42","16","16196","<p>We would need a portable printer (handheld, it is important) that can connect to android phone via bluetooth or wifi.</p><h2>What I know currently:</h2><ul><li>No standard printing SDK available for Android this time</li><li>There is a non official SDK called <a href=""http://www.iprintsdk.com/"">iPrint SDK</a>. Have any of you tried it through wifi or bluetooth? Does it work?</li><li><a href=""http://www.printeranywhere.com/"">Printershare</a> also claims to be <a href=""http://www.printeranywhere.com/help-android-integration.sdf"">programmaticly available</a>. It would be ok for me to pay the one time fee $5 for it per phone. It has a lot of supported formats. Have you tried it with any handheld device? I asked them about the list of supported bluetooth printers (since it has a menu item ""search for BT printer""), but they did not answered.</li></ul><h2>What I need to know above the already asked:</h2><ul><li>How do you print from your android app?</li><li>What kind of printer do you use?</li><li>Is it planned in the standard android SDK to include printing? What is the roadmap? Is it available now as Beta or something?</li><li>If we somehow (i dont think so) build own solution for printing via bluetooth, can you recommend standards and protocols to check and learn?</li></ul>","337621","","","","","2013-12-08 00:12:01","Bluetooth and WIFI Printing for Android","<android><printing><bluetooth><wifi><printers>","6","1","6","",""
"4656255","1","","","2011-01-11 09:49:12","2","2115","<p>I want to know when the keyboard is closed, so I'm using <code>android:configChanges=""orientation|keyboardHidden""</code>.  I have to override the method <code>onConfigurationChanged</code>, but nothing seems to happen.  Am I doing something wrong?</p>","508197","","403455","","2012-06-17 14:33:49","2012-06-17 14:33:49","""orientation|keyboardHidden"" not calling onConfigurationChanged","<android><android-configchanges>","2","1","","",""
"4656299","1","","","2011-01-11 09:53:32","0","398","<p>When i click on Voice Search button on Android (SDk 2.2 ) phone then an icon with a mic and text SPEAK NOW appears on phone screen. After speaking any command like ""hello"" a new screen with text ""WORKING"" and a progress bar appears. I want to know where does Voice recognition happen and where does actual Voice Analysis takes place?</p><p>Which APIs can be used to capture both events?</p>","298943","","","","","2011-01-11 10:24:08","Voice Recognition in Android","<android>","1","0","","",""
"4656312","1","4656352","","2011-01-11 09:54:56","4","3235","<p>Hi i'm wondering what is the process i have to follow in order to self-publish an app in my website. Is it just to put the .apk file in the website and provide a link to the user to navigate (from the phone) to the app and install it? </p><p>-Would the user need some extra knowledge to be able to install the app?</p><p>-Can the user install it with one click?</p><p>-What about updates, can the user get a notification when there's a new version?</p><p>-Would the user need to unistall and reinstall the app when upgrading to a newer version?</p><p>Thanks in advance.</p>","526924","","","","","2012-01-14 12:48:17","how to self-publish android app","<android>","3","0","2","",""
"4656326","1","","","2011-01-11 09:56:13","0","2670","<p>I try to run apk file in android, i follo these steps</p><ol><li>First get the Android SDK and unzip it somewhere on your hard drive</li><li>Add SDK_ROOT to your system variables pointing to /tools folder under the sdk</li><li>Run the emulator</li><li>Copy the apk file to /tools folder</li><li>Change directory to /tools and run from commandline $adb install your_application.apk</li><li>Now check applications list in the emulator and you should see the new application installed and ready.</li></ol><p>but i will this type of error :</p><pre><code>'adb' is not recognized as an internal or external command,operable program or batch file.</code></pre>","559068","","114066","","2011-11-17 13:24:16","2011-11-17 20:55:00","how to run apk file in android","<android>","5","0","","",""
"4656379","1","","","2011-01-11 10:02:21","16","15744","<p>I am trying to implement bonjour/zero conf on my android app. I am using jmDns library for searching the all the available devices. Here is the code that I am using for searching the devices in the same network:</p><pre><code>public class ListDevices extends ListActivity {    JmDNS jmdns;    JmDNSImpl impl;    MulticastLock lock;    protected ServiceListener listener;    protected ServiceInfo info;    public ListView lv;    public ArrayList&lt;String&gt; deviceList;    public int cancel = 0;    public final static String TAG = ""ListDevices"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        deviceList = new ArrayList&lt;String&gt;();        showAllPrinters();        setListAdapter(new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_1, deviceList));        lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                    int position, long id) {                // When clicked, show a toast with the TextView text                Toast.makeText(getApplicationContext(),                       ((TextView) view).getText(), Toast.LENGTH_SHORT).show();            }        });        this.listener = new ServiceListener() {            public void serviceAdded(ServiceEvent event) {                deviceList.add(""Service added   : "" + event.getName() + "".""                        + event.getType());                Log.v(TAG, ""Service added   : "" + event.getName() + "".""                        + event.getType());            }            public void serviceRemoved(ServiceEvent event) {                deviceList.add(""Service removed : "" + event.getName() + "".""                        + event.getType());                Log.v(TAG, ""Service removed : "" + event.getName() + "".""                        + event.getType());            }            public void serviceResolved(ServiceEvent event) {                deviceList.add(""Service resolved: "" + event.getInfo());                Log.v(TAG, ""Service resolved: "" + event.getInfo());            }        };    }    public void showAllPrinters() {        Log.d(""ListDevices"", ""in showAllPrinters"");        try {            WifiManager wifi = (WifiManager)                               getSystemService(Context.WIFI_SERVICE);            lock = wifi.createMulticastLock(""fliing_lock"");            lock.setReferenceCounted(true);            lock.acquire();            InetAddress inetAddress = getLocalIpAddress();            jmdns = JmDNS.create(inetAddress, ""TEST"");            ServiceInfo[] infos = jmdns.list(""_http._tcp.local."");            if (infos != null &amp;&amp; infos.length &gt; 0) {                for (int i = 0; i &lt; infos.length; i++) {                    deviceList.add(infos[i].getName());                }            } else {                deviceList.add(""No device found."");            }            impl = (JmDNSImpl) jmdns;        } catch (IOException e) {            e.printStackTrace();        }    }    public InetAddress getLocalIpAddress() {        try {            for (Enumeration&lt;NetworkInterface&gt; en = NetworkInterface                    .getNetworkInterfaces(); en.hasMoreElements();) {                NetworkInterface intf = (NetworkInterface) en.nextElement();                for (Enumeration&lt;InetAddress&gt; enumIpAddr = intf                        .getInetAddresses(); enumIpAddr.hasMoreElements();) {                    InetAddress inetAddress = (InetAddress) enumIpAddr                            .nextElement();                    if (!inetAddress.isLoopbackAddress()) {                        return inetAddress;                    }                }            }        } catch (SocketException ex) {            Log.e(""ListDevices"", ex.toString());        }        return null;    }    @Override    protected void onPause() {        super.onPause();        if (isFinishing()) {            lock.release();        }    }}</code></pre><p>Basically, I am adding them in a list so that I can display a list of all available devices. Now when I am running this code, I am getting no exception/nothing like error. But on the other hand, nothing is added to my list [PS: there atleast 5-6 PCs and Macs are there in the network.</p><p>I also tried to get the list from this code:</p><pre><code>jmdns.addServiceListener(""_http._tcp.local."", listener);</code></pre><p><code>listener</code> is defined in the <code>onCreate</code> of the activity. But this also did not returned any device.</p><p>Please help, suggest what I am doing wrong here. Any help is appreciated!</p>","152867","","995926","","2012-02-23 14:06:45","2012-10-30 20:33:15","Bonjour implementation on Android","<android><bonjour><zeroconf><jmdns>","3","1","14","",""
"4656406","1","4657005","","2011-01-11 10:06:13","5","14756","<p>I want list of fonts used by the android framework.</p>","526359","","","","","2013-08-06 22:34:55","which are default font comes with all android 2.1 and above","<android><fonts>","2","0","","",""
"4656429","1","","","2011-01-11 10:09:34","0","786","<pre><code>String time = starttime.getText().toString();String[] separated = time.split("":"");test.setText(""HH:"" + separated[0].toString() + ""MM:"" + separated[1].toString());</code></pre><p>If i type in 11:11 in my app, i get arrayoutofboundsexception. Ive tried trim() on the string as well. Did i miss something?</p>","557187","","","","","2011-01-11 10:14:30","android/java split problem","<java><android><split>","1","4","","",""
"4656456","1","","","2011-01-11 10:12:04","0","519","<p>I am new in android development. I am making an application using intent which to show a sound and display settings screen. I used the following code to have it.</p><pre><code>Intent viewIntent = new Intent(Settings.ACTION_SOUND_SETTINGS);       this.startActivityForResult(viewIntent,0); </code></pre><p>But it doesnt work. It give me force close the application.</p><p>If anyone help me about this..</p><p>Thanks</p>","401956","","302328","","2011-01-11 10:15:17","2011-12-08 01:48:44","How to start an activity which display ""Sound & Display "" screen","<android><android-intent>","2","2","","",""
"4656503","1","","","2011-01-11 10:16:28","1","282","<p>useing both ddms and telnet geo way to send gps signal to emulator,i can't get gps label on signal bar.And the gps on emulator is turned on.please help me.thanks.</p>","571089","","199972","","2012-06-25 08:23:02","2012-06-25 08:23:02","android emulator can't receive gps signal","<android><android-emulator><gps><signals>","0","1","","",""
"4656586","1","","","2011-01-11 10:25:19","2","198","<p>I'm working on a live wallpaper that is configured using a preferences screen. I use shared preferences to store things like color, speed and movement of the wallpaper. As I've got a lot of settings, I'd like users to be able to:</p><ul><li>save all the current preferences under a profile, where the profile is assign a name by the user.</li><li>the user can then select a profile by name from a list and have all their settings restored.</li><li>the user can also delete profiles.</li></ul><p>Can anyone recommend a nice way of doing this?</p><p>One idea I had was to save all the current preferences to an XML file and selecting a profile would just load the file and set the shared preferences based on this. However, if I had 20 or so profiles, I would need to inspect all the files to produce a list of profile names (as I'd have to store the profile name in each file) which seem inefficient.</p>","571112","","","","","2011-07-12 05:14:26","Implementing 'profiles' that load/save sets of preferences?","<java><android><mobile>","1","0","2","",""
"4656641","1","4656694","","2011-01-11 10:31:44","7","6234","<p>I've been looking for a way to share information to social networks. I've found 2 possible solutions:</p><ul><li>Look for installed apps and sent an intent (like android uses in it's gallery)</li><li>Use the socials network api</li></ul><p>When looking for quick ways to implements i say use the installed apps for that but if it goes customization and generalization i think the second option is the best.</p><p>I've a hard time deciding if one outweighs the other or not.</p><p>So my question is: What is the best approach? One of the ones i suggested or a whole different way?</p>","571088","","","","","2012-06-06 19:49:16","Best way for social sharing in Android","<android><api><sharing><social>","4","0","3","",""
"4656667","1","4659832","","2011-01-11 10:34:54","1","1742","<p>i have a <code>ListView</code> with a custom <code>Servizio</code> object in every row. I'm using <code>SimpleAdapter</code> for this and it's ok.</p><p>The problem is that i can't fill the spinner inside every <code>Servizio</code>. This code inside Servizio.java is causing my app to crash:</p><pre><code>Spinner spinner = (Spinner) findViewById(R.id.spinner);        int m = 3;//Integer.parseInt(camping.rulesList.getMaxPers().get(camping.tipSel));        String[] array_spinner=new String[m];        for (int indice = 0; indice &lt; m; indice++)        {            if (indice == 0) array_spinner[indice] = String.format(""%d persona"", indice+1);            else array_spinner[indice] = String.format(""%d persone"", indice+1);        }        ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(getApplicationContext(), android.R.layout.simple_spinner_item, array_spinner);        aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spinner.setAdapter(aa);</code></pre><p>The same code is working for a single spinner on the main activity... what am i missing?</p><p>Thanks! ;-)</p><p>UPDATE: Here's the Log... Maybe the problem is that ""Attempted to add window with non-application token WindowToken""...</p><blockquote>  <p>01-11 16:23:06.038:  WARN/dalvikvm(12582): threadid=1:  thread exiting with uncaught exception  (group=0x40028a00) 01-11 16:23:06.038:  WARN/WindowManager(103): Attempted to  add window with non-application token  WindowToken{44ac0100 token=null}.   Aborting. 01-11 16:23:06.058:  (...)</p></blockquote>","396133","","396133","","2011-01-12 10:47:47","2011-01-12 10:47:47","Android - spinners inside a ListView","<android><listview><spinner>","1","4","","",""
"4656677","1","","","2011-01-11 10:35:52","2","1500","<p>Im trying to convert  a given date formated in UTC timezone and then converting to the current timezone. But its not working properly, here's the code:</p><pre><code>public String CurrentTimeZone(Date value){    SimpleDateFormat sdf= getReaderFormatter();    sdf.setTimeZone(TimeZone.getTimeZone(""UTC""));    sdf.format(value);    return getCurrentTimeZone().format(value);}</code></pre><p>The problem is that the date value still remains in the current time zone after formating it with the UTC one, so the conversion ends up being from ""current timezone -> current timezone"" and not UTC timezone -> current timezone....</p>","382115","","","","","2011-01-11 10:35:52","Android Time Zone UTC to current conversion not working","<android><timezone>","0","1","","",""
"4656689","1","4723726","","2011-01-11 10:37:04","3","7017","<p>I've stuck a total wall with the AIDL interfacing. I've an app which has to be controlled via 3rd party application (I've enough control over this so I can ask them to implement what ever I need into their activity) </p><p>Originally my app was also an activity with interface and everything but I've changed it to be a background service and for testing, I created a dummy app which manages to start the service app to the background.</p><p>Now I would like a way to request method calls from the service (mainly; start, stop, sendData). I've created the .aidl files for both apps. The aidl file implements only one method (this is courtesy of some other question here.)</p><pre><code>package foo.testapp;interface IScript {     String executeScript(String script); }</code></pre><p>while the other aidl is same except the package is ""foo.otherapp"". The implementations I've found online had same package for both aidl files, but for me this causes an error (guess this is just a problem on my part since I hate namespaces and packages so I often just name them badly, if it's important to change them, I can do it)</p><p>The plan was to use this method to send a string to the service and just have a switch over predefined strings to call a correct method ( could also just implement three different methods if it improves the usage).</p><p>Anyway... I can't get the aidl to connect, I get error ""Unable to start service intent </p><blockquote>  <p>{act=foo.testapp.IScript } : not found</p></blockquote><p>I would this guess has something to do with my misunderstandings ie. packagenames or so)</p><p>this is the implementation in my test <strong>activity</strong> app </p><pre><code>private final IScript.Stub mBinder = new IScript.Stub(){    @Override    public String executeScript(String script) throws RemoteException    {        // TODO Auto-generated method stub    }};IScript mService = null;private ServiceConnection mConnection = new ServiceConnection() {     public void onServiceConnected(ComponentName className, IBinder service)      {         mService = IScript.Stub.asInterface(service);     }     public void onServiceDisconnected(ComponentName className)      {         mService = null;     } };</code></pre><p>Then in OnCreate() method I'll do this:</p><pre><code>bindService(new Intent(IScript.class.getName()),            mConnection, Context.BIND_AUTO_CREATE);</code></pre><p>In service class I have this;</p><pre><code>@Overridepublic IBinder onBind(Intent intent) {    // Select the interface to return.  If your service only implements    // a single interface, you can just return it here without checking    // the Intent.    if (IScript.class.getName().equals(intent.getAction()))     {        return mBinder;    }    return null;}/** * The IRemoteInterface is defined through IDL */private final IScript.Stub mBinder = new IScript.Stub() {    @Override    public String executeScript(String script) throws RemoteException     {        if (script == ""test"")        {            return ""foo"";        }        return ""fail"";    }};</code></pre><p>And finally the manifest files;</p><p>well actually, I've no idea if I have to add something into manifest files when dealing with the aidl. In the one example I saw this;</p><pre><code>    &lt;intent-filter&gt;        &lt;action android:name=""foo.otherapp.IScript"" /&gt;    &lt;/intent-filter&gt;</code></pre><p>and</p><pre><code>    &lt;intent-filter&gt;        &lt;action android:name=""foo.testapp.IScript"" /&gt;    &lt;/intent-filter&gt;</code></pre><p>I would guess that the errors could be anywhere. I've been trying to set this up with chewing gum and band-aids. Guess I've just misunderstood some basic concept of this.</p><p>Anyway, any help is welcome.</p><p>Thanks in advance!</p>","569554","","","","","2011-01-18 11:52:44","AIDL interface between two applications","<android><service><aidl>","2","0","2","",""
"4656720","1","","","2011-01-11 10:41:05","0","195","<p>I am trying to set the first and last elements of a list view to have their backgrounds different to everything in the middle. I have created my custom adapter .xml file and works perfectly when I set everything up statically in their to have each row the same style. As of now i'm just trying to change the first element. I think i'm getting the nullPointerException because i'm not properly referencing the LinearLayout I want the background to be changed. Here is my code:</p><pre><code>for (int i = 0; i &lt; categories.size(); i++){            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();            map.put(""name"", categories.get(i));            LinearLayout linear = (LinearLayout)findViewById(R.id.linearLayout1);            if(i == 0){                linear.setBackgroundResource(R.drawable.background);                Log.v(""First Element"", ""First"");            }            else{                linear.setBackgroundResource(R.drawable.background);                Log.v(""Not First Element"", ""Not First"");            }            mylist.add(map);        }</code></pre><p>I think my problem is due to the fact the <code>R.id.linearLayout1</code> reference is not in the main xml file for this activity, so how do I get the correct reference. If this is not the case then how do I go about having different backgrounds for the top  and last elements of a listView?</p>","400406","","","","","2011-01-11 11:09:53","Custom ListView Adapter nullPointer problem","<java><android><listview>","1","0","","",""
"4656732","1","4824893","","2011-01-11 10:42:29","6","3757","<p>can anyone tell me how to port a native c program on android platform..should i include some c libraries or how exactly...?</p><p>Thanks in advance,</p>","505580","","","","","2013-05-29 06:39:03","How to port native c code on android","<android><c>","4","0","2","",""
"4656737","1","4656788","","2011-01-11 10:43:44","1","2934","<p>How to force webview to open all the urls inside the application?</p><p>Many Thanks,Naveed</p>","565310","","","","","2011-01-11 10:49:00","Force webview to open urls inside application - android app","<android>","1","0","1","",""
"4656747","1","4656795","","2011-01-11 10:44:59","1","2011","<p>EditText doesn't fill the whole height of the window. Here is the code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayout01""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;        &lt;LinearLayout android:id=""@+id/LinearLayout02""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        &gt;            &lt;Button android:id=""@+id/bItalic""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                &gt;&lt;/Button&gt;            &lt;Button android:id=""@+id/bBold""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;Button android:id=""@+id/bUnderline""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;Button android:id=""@+id/bStrike""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""S""                /&gt;            &lt;Button android:id=""@+id/bSub""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;Button android:id=""@+id/bSup""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageButton                 android:id=""@+id/bInsertImage""                android:src=""@drawable/insertimage""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;            &lt;ImageButton                 android:id=""@+id/bInsertTable""                android:src=""@drawable/table""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;        &lt;/LinearLayout&gt;        &lt;FrameLayout            android:id=""@+id/FrameLayout02""            android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            &gt;            &lt;TabHost android:id=""@+id/tabhost""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""&gt;                &lt;TabWidget android:id=""@android:id/tabs""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                /&gt;                &lt;FrameLayout android:id=""@android:id/tabcontent""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:paddingTop=""62px""&gt;                    &lt;ScrollView                         android:id=""@+id/scroll01""                         android:layout_width=""fill_parent""                         android:layout_height=""fill_parent""&gt;                        &lt;HorizontalScrollView                             android:id=""@+id/scroll_hor01""                             android:layout_width=""fill_parent""                             android:layout_height=""fill_parent""&gt;                                &lt;EditText                                     android:id=""@+id/VisualPane""                                     android:layout_width=""fill_parent""                                     android:layout_height=""fill_parent""                                 /&gt;                        &lt;/HorizontalScrollView&gt;                    &lt;/ScrollView&gt;                    &lt;ScrollView                         android:id=""@+id/scroll02""                         android:layout_width=""fill_parent""                         android:layout_height=""fill_parent""&gt;                        &lt;HorizontalScrollView                             android:id=""@+id/scroll_hor02""                             android:layout_width=""fill_parent""                             android:layout_height=""fill_parent""&gt;                                &lt;EditText                                     android:id=""@+id/HTMLPane""                                     android:layout_width=""fill_parent""                                     android:layout_height=""fill_parent"" /&gt;                          &lt;/HorizontalScrollView&gt;                    &lt;/ScrollView&gt;                   &lt;/FrameLayout&gt;            &lt;/TabHost&gt;        &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is a screenshot:<img src=""http://i.stack.imgur.com/gQkhW.jpg"" alt=""http://s48.radikal.ru/i122/1101/a4/030018887e7b.jpg""></p><p>Why doesn't EditText fill the whole height of the window?</p>","565447","","","","","2011-01-11 23:17:44","EditText doesn't fill the whole height of the window","<android><edittext>","3","0","2","",""
"4656810","1","4656827","","2011-01-11 10:51:18","0","1623","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2874191/is-it-possible-to-create-listview-inside-dialog"">is it possible to create listview inside dialog?</a>  </p></blockquote><p>still i can't get a clear view in this &amp; can't create it, can some one help me with a sample code &amp; explaination.</p>","569553","","","","","2011-01-11 10:54:00","create listview inside dialog?","<android>","1","0","","2012-11-14 02:24:24",""
"4656818","1","","","2011-01-11 10:52:17","0","1005","<p>I need to install android SDK.. when I click ""SDK Manager.exe"" and the installation started</p><p>the following message appear ""Downloading Android SDK Platform-tools, revision 1Download finished with wrong size. Expected 3214554 bytes, got 22935 bytes."" how can i solve this problem?</p>","499858","","","","","2011-10-28 22:56:43","Android SDK Platform-tools revision 1 installation failed","<android>","1","0","","",""
"4656841","1","4658011","","2011-01-11 10:56:37","6","21466","<p>I am trying to implement ListView with Delete functionality to delete item from the listview. I am successful to delete but failed to refresh the listview after deletetion of an item from the database.</p><p>Actually, Click on listitem, i am displaying AlertBox for ""Delete"" and ""Cancel"" action, on clicking ""Delete"", item should be removed from the database and as well as from the listview and listview should be refreshed. I have also used <code>notifyDataSetChanged()</code> method.</p><pre><code>lview = (ListView) findViewById(R.id.lview);adapter = new ListView_CustomAdapter(this, listitemDisplay);lview.setAdapter(adapter);lview.setOnItemClickListener(new OnItemClickListener() {     @Override     public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id)     {        Show_Alert_box(v.getContext(),""Please select action."",position);     }});</code></pre><p>and the code for Show_Alert_box:</p><pre><code> public void Show_Alert_box(Context context, String message,int position)     {         final int pos = position;         final AlertDialog alertDialog = new  AlertDialog.Builder(context).create();            alertDialog.setTitle(getString(R.string.app_name_for_alert_Dialog));            alertDialog.setButton(""Delete"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int which) {                    try                    {                        db.open();                                 String[] whereArgs={String.valueOf(pkID)};        return db.delete(DATABASE_TABLE_4,""pk_pkID == ?"",whereArgs);                            adapter.notifyDataSetChanged();                        db.close();                    }                    catch(Exception e)                    {                    }            } });             alertDialog.setButton2(""Cancel"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int which) {                    alertDialog.dismiss();            } });             alertDialog.setMessage(message);            alertDialog.show();     }</code></pre>","379693","","","","","2014-01-06 05:10:21","Android - Listview delete item and Refresh","<android><android-listview>","7","2","1","",""
"4656847","1","4656908","","2011-01-11 10:58:02","0","112","<p>We are building a security mechanism in our <strong>Android App</strong>, for which we need to ensure that we ask user for password every time they enter the app (even when it is running in background). For this I had to write the checks in all <strong>onRestart</strong> of every activity.</p><p>Looking for something similar to iPhone's <strong>AppDelegate</strong> where the code will be called before the activity and I can handle it in central place.</p><p>Let me know if more info is required.</p>","473655","","","","","2011-01-11 11:05:04","Alternative for UIAppDelegate in Android, a common code which will be called before any activity","<android><activity>","1","0","","",""
"4656876","1","4656917","","2011-01-11 11:01:55","3","384","<p>What is the biggest limitation of making/using webapps? I'm thinking that when you use localstorage, offline-browsing and geo-abilities thaht you get from html5 the differences are quite small (except for games).</p><p>The great benefit from using webapps is that they are cross-platfrom compatible!</p>","427625","","","","","2011-01-12 23:50:18","webapps vs native apps","<iphone><android><web-applications><offline-browsing>","5","0","","",""
"4656958","1","4657495","","2011-01-11 11:10:05","4","829","<p>What I'm basically trying to do is pass an instance of my Activity to another object which will build the dynamic UI.</p><p>The main reason I'm doing this is to keep the Activity class clean.</p><p>Are there any repercussions when doing this? Will it affect the garbage collection and cause memory leaks?</p><p>Here is an example of what I'm doing:</p><p>Activity:</p><pre><code>/* uses the instance of the Activity to build Views which are loaded from XML files (for non technical users to add content */ContentHelper ch = new ContentHelper(MyActivity.this);</code></pre><p>Should I keep the dynamic View building within the Activity, or is it alright to pass the instance to other classes to do this?</p><p>If I keep it in the Activity, it just feels bloated to me and much harder to manage.</p>","380579","","","","","2011-01-11 12:15:32","Safe to pass instance of an Activity to another object?","<android><architecture><memory-management>","1","0","3","",""
"4656961","1","4657285","","2011-01-11 11:10:23","6","3257","<p>i am working one application image uploading to sdcard i am scaling that sdcard saved into database some times one error is occurs bitmap size exceeds vm budget</p><pre><code>ouput :01-11 15:39:51.809: ERROR/AndroidRuntime(6214): Uncaught handler: thread main exiting due to uncaught exception01-11 15:39:51.979: ERROR/AndroidRuntime(6214): java.lang.OutOfMemoryError: bitmap size exceeds VM budget01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:384)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:397)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at com.fitzgeraldsoftware.shout.presentationLayer.Shout.onActivityResult(Shout.java:1653)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.Activity.dispatchActivityResult(Activity.java:3624)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3220)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.access$2600(ActivityThread.java:116)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.os.Handler.dispatchMessage(Handler.java:99)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.os.Looper.loop(Looper.java:123)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at android.app.ActivityThread.main(ActivityThread.java:4203)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at java.lang.reflect.Method.invokeNative(Native Method)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at java.lang.reflect.Method.invoke(Method.java:521)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)01-11 15:39:51.979: ERROR/AndroidRuntime(6214):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>how can fix the error please forward some solution thanks in advance </p>","254790","","437703","","2011-02-04 10:02:56","2011-05-26 15:33:05","how to fix error in bitmap size exceeds VM budget","<android><exception><bitmap><size><out-of-memory>","2","0","3","",""
"4656968","1","","","2011-01-11 11:10:56","1","3122","<p>I am writing an game application.  If the user presses the wrong button I want to show an animation and when the animation is complete then finish() my game; </p><p>currently, my animation just starts when the finished is called. I want the animation to complete.  </p><p>Below is my class that implements AnimationListener</p><pre><code>public final class DisplayNextView implements Animation.AnimationListener {    View changeView;    Drawable image;    public DisplayNextView(View parChangeView, Drawable parImage) {        this.changeView = parChangeView;        this.image = parImage;    }    public void onAnimationStart(Animation animation) {        changeView.post(new SwapViews(changeView, image));        changeView.postDelayed(new SwapViews(changeView, null), 1000);    }    public void onAnimationEnd(Animation animation) {    }    public void onAnimationRepeat(Animation animation) {    }}</code></pre><p>This is my main activity method that starts the animation</p><pre><code>private void applyRotation(View parChangeView, Drawable image, float start, float end) {        // Find the center of image        final float centerX = parChangeView.getWidth() / 2.0f;        final float centerY = parChangeView.getHeight() / 2.0f;        // Create a new 3D rotation with the supplied parameter        // The animation listener is used to trigger the next animation        final Flip3DAnimation rotation =               new Flip3DAnimation(start, end, centerX, centerY);        rotation.setDuration(250);        rotation.setFillAfter(true);        rotation.setInterpolator(new AccelerateInterpolator());        rotation.setAnimationListener(new DisplayNextView (parChangeView,image));        parChangeView.startAnimation(rotation);        //return rotation;        }</code></pre><p>This is my the SwapView class this is a thread</p><pre><code>public final class SwapViews implements Runnable {    View changeView;    Drawable image;    public SwapViews(View parChangeView, Drawable parImage) {        this.changeView = parChangeView;        this.image = parImage;    }    public void run() {        final float centerX = changeView.getWidth() / 2.0f;        final float centerY = changeView.getHeight() / 2.0f;        Flip3DAnimation rotation;        changeView.setBackgroundDrawable(image);        //TODO should find a better way!!        if (image==null)            changeView.setBackgroundColor(Color.BLACK);        rotation = new Flip3DAnimation(-90, 0, centerX, centerY);        rotation.setDuration(250);        rotation.setFillAfter(true);        rotation.setInterpolator(new DecelerateInterpolator());        changeView.startAnimation(rotation);    }}</code></pre>","516357","","516357","","2011-01-18 02:35:31","2013-01-05 01:57:48","android wait for animation to finish before activity ends","<android><animation><activity>","2","0","1","",""
"4656986","1","7979110","","2011-01-11 11:12:48","22","12169","<p>I have 5 square ImageButtons that I want to have lined up side by side on the bottom of the screen.  I have each one set (different id's) as: </p><pre><code>        &lt;ImageButton         android:id=""@+id/box1""          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""          android:layout_gravity=""center""         android:adjustViewBounds=""true""         android:scaleType=""fitXY""         android:layout_weight=""1""         android:layout_margin=""1dp""         /&gt; </code></pre><p>and I have the background assigned in main java like this:</p><pre><code>    int[] imageIds = new int[] {R.id.box1,R.id.box2,R.id.box3,R.id.box4,R.id.box5};    for(int i = 0; i&lt;5; i++){        imageButtons[i] = (ImageButton) findViewById(imageIds[i]);        imageButtons[i].setBackgroundResource(R.drawable.blank);    }</code></pre><p>What I would like to have it do is scale the width to fit neatly side-by-side at the bottom of the screen (which it does now ok), but have the height automatically scale to match the width as well. is this possible?  I don't want to use setImageSource because then it puts a border around the imagebutton.</p>","486086","","486086","","2013-05-20 12:31:43","2013-09-21 08:56:22","How do I keep the aspect ratio on image buttons in android?","<android><imagebutton><aspect-ratio>","7","0","10","",""
"4657018","1","4657159","","2011-01-11 11:16:36","3","944","<p>I am displaying 3 different websites using TabHost and TabWidget. I had a doubt about Tabhost, What if I want the Tab content i.e one of the sites to perform some search operation. Not the normal google search.Say I have class A and it takes query string, AFter hitting SEARCH button, can I redirect it to one of the tabs using Intent, making it to display the query result of the entered string? </p><p>The examples I went through say only about text views and list views but no action of any sort takes place in case of webviews other than just displaying a website. I want to know does Tabhost has any limitation to performing with webviews.</p>","466590","","","","","2011-01-11 11:33:56","TabHost in android","<android><webview><android-tabhost>","1","0","1","",""
"4657036","1","4657107","","2011-01-11 11:19:13","2","1154","<p>If i have a simpledateformat object:</p><pre><code>SimpleDateFormat format = new SimpleDateFormat(""HH:mm"");</code></pre><p>And have two times, 12:12 and 13:13 for example, is there an easy way to check if the current time is between the two SimpleDateFormats (The clock is 12:15 for example)? Thanks</p>","557187","","","","","2011-08-10 21:18:54","java/android datetime timespan","<java><android><clock>","3","0","","",""
"4657090","1","4657120","","2011-01-11 11:25:57","0","149","<p>is there any ANDROID SDK Available for New android application i got one link that not Supporting the link is:https://github.com/facebook/facebook-android-sdk.git Any Other for SDk</p>","565024","","","","","2011-01-11 11:29:40","is there any Android Facebook Sdk or Api Avilable","<android><facebook-android-sdk>","1","0","","",""
"4657154","1","4657208","","2011-01-11 11:33:33","0","60","<p>I've got an Activity which displays a list of custom components (in a LinearLayout). Each component represents a user in the database, and contains a button (among other things). When I click the button in the custom component, I want to pass a message back to the Activity to save the the user. The button knows the id of the user. </p><p>I was wondering how best to communicate back to the activity? In the click event of the button, should dispatch a new event (and catch it in the activity)? If so, can I add the user ID into the event? I'm new to events but I think I need to create my own custom event type perhaps?</p><p>The other way I thought of was to pass a reference for the activity into the component, so that the button can just call the method on the activity e.g 'component.parentActivity=this' but although I think it would work, I'm not sure if it's the 'proper' way to do it.</p><p>Thanks</p>","571180","","","","","2011-01-11 11:38:36","Appropriate use of events","<android><events>","1","0","","",""
"4657171","1","","","2011-01-11 11:34:48","4","446","<p>Does somebody know if it is possible that an activity is removed from the activity stack if the device is out of memory? I have an activity A which calls the webbrowser and a webpage then calls an activity B which does something and then should return to activity A. Im using this intent with the flags..</p><pre><code>Intent intent = new Intent(this, acticityToReturnTo.getClass());intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);startActivity(intent);</code></pre><p>..to remove the webbrowser activity and activity B from the activity stack and return to activity A but it does not work. Its always a new instance of activity A which is created instead resuming to the already existing activity a instance. I dont want to use the single instance flag on activity A but this is the only solution currently working for me.. (Im developing for Android 1.6)</p><p>Maybe there is another solution to do what i want?</p>","165106","","","","","2011-01-11 15:23:00","How to return to an activity somewhere in the activity stack?","<android><filter><activity><android-intent>","4","0","2","",""
"4657172","1","4657751","","2011-01-11 11:34:49","0","4425","<pre><code>String projection[] = new String[]{MediaStore.Images.Media.DATA};cursor =managedQuery(Media.EXTERNAL_CONTENT_URI, projection,null,null, null);</code></pre><p>this cursor is returning null when i am trying to run it on device. it works fine on emulator.</p><p>Can someone please point out if there is something that i am missing or doing wrong.</p>","569838","","1084764","","2012-05-09 20:14:23","2012-05-10 02:59:11","managedQuery(Media.EXTERNAL_CONTENT_URI, projection,null,null, null); returns null when running on device","<android><mediastore>","2","1","1","",""
"4657236","1","4657704","","2011-01-11 11:42:03","3","4221","<p>I'm developing an app and when I run it in the Emulator and I've selected a button (not clicked!) it shows an orange layer over it. When i click it i turns yellow.On a HTC device the orange/yellow overlay is green. On a Samsung Galaxy S it's blue.</p><p>I want my app to have the same selection color's throughout the whole app (Blue to be precise).</p><p>Is this possible? If so, how?</p>","517460","","","","","2012-07-10 05:51:57","Change selection color on Button's and TextView's in Android","<java><android><themes><selection>","4","0","","",""
"4657374","1","4657825","","2011-01-11 12:00:39","0","541","<p>Would really appreciate some help with this.</p><p>I have an app which consists of a gallery, text and icons. What i want to do is similar to the android market (example can be seen below). In the android market a whole area is hyperlinked rather than just the text. Hold your finger on one of the apps and it will light up green. That whole area is a hyperlink. Like below:</p><p>Looking to get something like this: <a href=""http://img269.imageshack.us/img269/691/09droid3295x440.jpg"" rel=""nofollow"">http://img269.imageshack.us/img269/691/09droid3295x440.jpg</a></p><p>Is there anyway i can do that to my app? I have a very similar app, the gallery is right at the top with icons down the left and text besides each icon. I'm a bit of a newbie so i'm using nested linearlayouts with textviews and imageviews in each one. </p><p>Is there a way that it can be done? Thanks for any help in advance! </p>","565672","","565672","","2011-01-11 12:14:46","2011-01-11 12:54:08","Android - make whole area hyperlinked instead of just text?","<android><hyperlink>","3","3","","",""
"4657413","1","","","2011-01-11 12:05:27","0","469","<p>I'm developing an Android 2.2 application with OpenGL ES 2.0 stuff in C++.</p><p>Here are my vertex and fragment shader:</p><pre><code>static const char* cubeMeshVertexShader = "" attribute vec4 vertexPosition; attribute vec4 vertexNormal; attribute vec2 vertexTexCoord; varying vec2 texCoord; varying vec4 normal; uniform mat4 modelViewProjectionMatrix; void main() {    gl_Position = modelViewProjectionMatrix * vertexPosition;    normal = vertexNormal;    texCoord = vertexTexCoord; } "";static const char* cubeFragmentShader = "" precision mediump float; varying vec2 texCoord; varying vec4 normal; uniform sampler2D texSampler2D; void main() {    gl_FragColor = texture2D(texSampler2D, texCoord); } "";</code></pre><p>I'm very new on OpenGL ES 2.0 development.</p><p>Someone told me that if I want lights on my render I have to make some complicates modification on vertex and fragment shader. So, I don't how to do that, normals are not necessary.</p><p>My question is: </p><p>How do I modify vertex and fragment shaders for not using normals?</p><p>Thanks</p>","68571","","","","","2011-01-11 12:20:29","Remove normals from vertex and fragment shader","<android><opengl-es-2.0><fragment-shader><vertex-shader>","1","1","","",""
"4657472","1","4657565","","2011-01-11 12:13:10","1","510","<p>I am wondering how can I insert an element at the beginning of the data base? I want to do this because:a) I want to display the elements (ListView) as 'last-inserted on top and first-inserted on the bottom' (like a stack)b) I want to limit the amount of elements in my db. When a new element is added (over the limit) I can put the new one (at the beginning) and delete the last one. (Don't know yet how to delete the last element).</p><p>I was searching for a solution but I am starting to wonder I have any control of how the element are inserted. If not I was thinking about displaying the database from end to bottom. But don't actually know how to do it since the cursor is always set at the beginning of the db. If could achieve this I can solve b) by deleting the first element (again don't know how to achieve this yet). </p>","279670","","","","","2011-01-11 16:02:18","Order of insert in android database","<android><database><insert><order>","2","0","2","",""
"4657493","1","","","2011-01-11 12:15:21","1","886","<p>I must extract an image's url when reading RSS feeds. I was told to use regular expressions but I didn't manage to build a correct pattern. </p>","460611","","291244","","2013-04-29 07:23:06","2013-04-29 07:26:43","Extract image url when reading rss feed","<android>","1","0","","",""
"4657687","1","","","2011-01-11 12:39:11","2","9288","<p>I have an app with a few textboxes and editboxes. The app is working fine but when I am trying to add the scrollview element to see the lower part of app the application is forcibly closing.</p><p>My code 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_height=""fill_parent""       android:layout_width=""fill_parent""&gt;     &lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;      &lt;TextView           android:id=""@+id/EditText01""           android:text=""@string/type1""           android:layout_alignParentLeft=""true""           android:layout_width=""fill_parent""         android:textSize=""20sp""           android:layout_toLeftOf=""@+id/Button01""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;     &lt;EditText          android:id=""@+id/Button01""           android:layout_width=""100sp""           android:layout_alignParentRight=""true""           android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;      &lt;TextView           android:id=""@+id/EditText02""           android:text=""@string/type2""           android:layout_alignParentLeft=""true""           android:layout_below=""@id/EditText01""         android:layout_width=""fill_parent""           android:textSize=""20sp""         android:layout_toLeftOf=""@+id/Button01""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;     &lt;EditText          android:id=""@+id/Button02""           android:layout_width=""100sp""            android:layout_alignParentRight=""true""           android:layout_below=""@id/Button01""         android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;        &lt;TextView           android:id=""@+id/EditText03""           android:text=""@string/type3""           android:layout_alignParentLeft=""true""           android:layout_below=""@id/EditText02""         android:layout_width=""fill_parent""           android:textSize=""20sp""         android:layout_toLeftOf=""@+id/Button01""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;     &lt;EditText          android:id=""@+id/Button03""           android:layout_width=""100sp""            android:layout_alignParentRight=""true""           android:layout_below=""@id/Button02""         android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;           &lt;TextView           android:id=""@+id/EditText04""           android:text=""@string/property""           android:layout_below=""@id/EditText03""         android:layout_width=""fill_parent""           android:textSize=""20sp""         android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;            &lt;Spinner         android:id=""@+id/spinner""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/Button03""        android:prompt=""@string/property""&gt;&lt;/Spinner&gt;        &lt;TextView          android:id=""@+id/EditText05""          android:text=""@string/propage""          android:layout_below=""@id/spinner""              android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;          &lt;Spinner          android:id=""@+id/widget""          android:layout_width=""fill_parent""          android:layout_height=""50sp""          android:layout_below=""@+id/EditText05""          android:prompt=""@string/propage""&gt;&lt;/Spinner&gt;          &lt;TextView          android:id=""@+id/EditText06""          android:text=""@string/income""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/widget""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/Button04""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;EditText           android:id=""@+id/Button04""            android:layout_width=""100sp""             android:layout_alignParentRight=""true""            android:layout_below=""@id/widget""          android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;            &lt;TextView          android:id=""@+id/EditText07""          android:text=""@string/borrow""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/EditText06""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/Button05""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;EditText           android:id=""@+id/Button05""            android:layout_width=""100sp""             android:layout_alignParentRight=""true""            android:layout_below=""@id/Button04""          android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;            &lt;TextView          android:id=""@+id/EditText08""          android:text=""@string/interest""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/EditText07""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/Button06""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;EditText           android:id=""@+id/Button06""            android:layout_width=""100sp""             android:layout_alignParentRight=""true""          android:layout_below=""@id/Button05""          android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;          &lt;Button          android:id=""@+id/Button07""          android:layout_height=""wrap_content""          android:layout_width=""wrap_content""          android:text=""@string/self_destruct""          android:layout_below=""@+id/EditText08""          android:onClick=""selfDestruct"" /&gt;          &lt;TextView          android:id=""@+id/EditText09""          android:text=""@string/output1""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/Button07""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/Button10""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;TextView           android:id=""@+id/EditText10""            android:text=""@string/output2""          android:layout_width=""100sp""             android:layout_alignParentRight=""true""          android:layout_below=""@id/Button07""          android:layout_toRightOf=""@+id/EditText09""          android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;          &lt;TextView          android:id=""@+id/EditText11""          android:text=""@string/output3""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/EditText09""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/EditText12""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;TextView           android:id=""@+id/EditText12""           android:text=""@string/output4""           android:layout_width=""100sp""             android:layout_alignParentRight=""true""          android:layout_below=""@id/EditText10""          android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;          &lt;TextView          android:id=""@+id/EditText13""          android:text=""@string/output5""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/EditText11""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/EditText14""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;TextView           android:id=""@+id/EditText14""            android:text=""@string/output6""          android:layout_width=""100sp""             android:layout_alignParentRight=""true""          android:layout_below=""@id/EditText12""          android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;          &lt;TextView          android:id=""@+id/EditText15""          android:text=""@string/output7""          android:layout_alignParentLeft=""true""          android:layout_below=""@+id/EditText13""          android:layout_width=""fill_parent""          android:textSize=""20sp""          android:layout_toLeftOf=""@+id/Button16""           android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;             &lt;TextView           android:id=""@+id/EditText16""            android:text=""@string/output8""          android:layout_width=""100sp""             android:layout_alignParentRight=""true""          android:layout_below=""@id/EditText14""          android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;     &lt;/ScrollView&gt;     &lt;/RelativeLayout&gt;</code></pre><p>Please help. thanks in advance.</p>","566842","","674039","","2011-12-02 08:46:06","2014-02-17 12:30:47","RelativeLayout scrollview","<android><android-layout>","3","1","","",""
"4657803","1","","","2011-01-11 12:52:13","1","2431","<p>I have got an application which create free sms alerts in one tab and show list of alerts on second tab. List of alerts is fetched from server once I click refresh button see image below.</p><p><img src=""http://i.stack.imgur.com/68Fry.png"" alt=""alt text""></p><p>What I want to do is that once I create alert in tab 1 then when I switch to tab 2, refresh button is automatically clicked or some technique which allow me to call particular function once tab is switched to 2nd tab. Each tab have separate Activity class and my refresh function is written in activity for 2nd tab.</p>","340002","","","","","2011-01-11 13:00:16","android perform action on tab switch","<android><tabview>","1","0","","",""
"4657805","1","4658072","","2011-01-11 12:52:21","1","1155","<p>hii everyone am sowmya am brand new to android please can any one help me, am parsing following local xml file ,but am only getting output for 1st question(first set of tags) but 2nd question(repeated tags) am not getting ,,thanx in advance </p><p></p><p></p><pre><code>&lt;innertag sampleattribute=""innertagAttribute""&gt;&lt;mytag&gt;1)  How did u find the hotel house keeping overall in the year  &lt;/mytag&gt;</code></pre><p>    </p><pre><code>    &lt;innertag sampleattribute=""innertagAttribute""&gt;&lt;mytag&gt;2)  How do u rate the hotel house keeping overall in the year  &lt;/mytag&gt;</code></pre><p>    </p><pre><code>&lt;/outertag&gt;</code></pre><p>////////////////////////////////////////////////////////////////////////////////////////////                               am using this as xml handler file////////////////////////////////////////////////////////////////////////////////////////////package com.itwine;</p><p>import org.xml.sax.Attributes;import org.xml.sax.SAXException;import org.xml.sax.helpers.DefaultHandler;</p><p>public class XMLHandler extends DefaultHandler{</p><pre><code> // =========================================================== // Fields // =========================================================== private boolean in_outertag = false; private boolean in_innertag = false; private boolean in_mytag = false; private boolean in_innertag1 = false; private boolean in_mytag1= false; private boolean in_innertag2 = false; private boolean in_mytag2 = false; private XMLDataSet myParsedExampleDataSet = new XMLDataSet(); private XMLDataSet myParsedExampleDataSet1 = new XMLDataSet(); private XMLDataSet myParsedExampleDataSet2 = new XMLDataSet(); private XMLDataSet myParsedExampleDataSet3 = new XMLDataSet(); // =========================================================== // Getter &amp; Setter // =========================================================== public XMLDataSet getParsedData() {      return this.myParsedExampleDataSet; } public XMLDataSet getParsedData1() {     return this.myParsedExampleDataSet1;} public XMLDataSet getParsedData2() {     return this.myParsedExampleDataSet2;} public XMLDataSet getParsedData3() {     return this.myParsedExampleDataSet3;} // =========================================================== // Methods // =========================================================== @Override public void startDocument() throws SAXException {      this.myParsedExampleDataSet = new XMLDataSet();      this.myParsedExampleDataSet1 = new XMLDataSet();      this.myParsedExampleDataSet2 = new XMLDataSet();      this.myParsedExampleDataSet3 = new XMLDataSet(); } @Override public void endDocument() throws SAXException {      // Nothing to do } /** Gets be called on opening tags like:  * &lt;tag&gt;  * Can provide attribute(s), when xml was like:  * &lt;tag attribute=""attributeValue""&gt;*/ @Override public void startElement(String namespaceURI, String localName,           String qName, Attributes atts) throws SAXException {      if (localName.equals(""outertag""))       {           this.in_outertag = true;      }      else if (localName.equals(""innertag""))      {           this.in_innertag = true;      }      else if (localName.equals(""mytag""))       {           this.in_mytag = true;      }      else if (localName.equals(""tagwithnumber""))       {           // Extract an Attribute           String attrValue = atts.getValue(""thenumber"");           int i = Integer.parseInt(attrValue);           myParsedExampleDataSet.setExtractedInt(i);      }      else if (localName.equals(""innertag1""))      {           this.in_innertag1 = true;      }      else if (localName.equals(""mytag1""))       {           this.in_mytag1 = true;      }      else if (localName.equals(""tagwithnumber1""))       {           // Extract an Attribute           String attrValue = atts.getValue(""thenumber"");           int j = Integer.parseInt(attrValue);           myParsedExampleDataSet1.setExtractedInt(j);      }      else if (localName.equals(""innertag2""))      {           this.in_innertag2 = true;      }      else if (localName.equals(""mytag2""))       {           this.in_mytag2 = true;      }      else if (localName.equals(""tagwithnumber2""))       {           // Extract an Attribute           String attrValue = atts.getValue(""thenumber"");           int k = Integer.parseInt(attrValue);           myParsedExampleDataSet2.setExtractedInt(k);      }      else if (localName.equals(""QIA""))       {           // Extract an Attribute      } } /** Gets be called on closing tags like:  * &lt;/tag&gt; */ @Override public void endElement(String namespaceURI, String localName, String qName)           throws SAXException {      if (localName.equals(""outertag""))       {           this.in_outertag = false;      }      else if (localName.equals(""innertag""))       {           this.in_innertag = false;      }      else if (localName.equals(""mytag""))       {           this.in_mytag = false;      }      else if (localName.equals(""tagwithnumber"")) {           // Nothing to do here      }      else if (localName.equals(""innertag1""))       {           this.in_innertag1 = false;      }      else if (localName.equals(""mytag1""))       {           this.in_mytag1 = false;      }      else if (localName.equals(""tagwithnumber1"")) {           // Nothing to do here      }      else if (localName.equals(""innertag2""))       {           this.in_innertag2 = false;      }      else if (localName.equals(""mytag2""))       {           this.in_mytag2 = false;      }      else if (localName.equals(""tagwithnumber2"")) {           // Nothing to do here      } } /** Gets be called on the following structure:  * &lt;tag&gt;characters&lt;/tag&gt; */ @Overridepublic void characters(char ch[], int start, int length) {      if(this.in_mytag){      myParsedExampleDataSet.setExtractedString(new String(ch, start, length)); }      else if(this.in_mytag1){          myParsedExampleDataSet1.setExtractedString(new String(ch, start, length));     }      else if(this.in_mytag2){          myParsedExampleDataSet2.setExtractedString(new String(ch, start, length));     }}</code></pre><p>}</p>","571256","","","","","2011-01-11 13:38:31","Parsing a local XML file in android","<android><xml>","3","1","1","",""
"4657815","1","4657834","","2011-01-11 12:53:12","3","13075","<p>I have downloaded a JAVA FILE and I don't know how to import it in Eclipse.</p>","516160","","","","","2013-09-09 16:10:35","How to import Java file into Eclipse","<java><android><eclipse>","3","1","","",""
"4657928","1","","","2011-01-11 13:07:57","0","865","<p>In my application i need to rotate an image which is on another image and it feel both are joined at particular point. That point is on upper image at pixel 15,15. when user movies finger on below image surface i need to rotate upper image as both are fixed by that point so need to rotate upper image around that point. for that i use </p><p>resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0,0,width, height, matrix, true);  image.setImageBitmap(resizedBitmap);  matrix.setRotate(rotation, CenterOfRotationX, CenterOfRotationY);</p><p>but that point is not looking fix it still moving from its place.if some one has any idea how to rotate image with particular point or any demo for this please help me. </p><p>Thank You.  Vikram.</p>","395627","","","","","2011-01-11 13:47:22","Rotate image from specific point as fingure moves on screen in android","<android>","1","0","","",""
"4657936","1","4658169","","2011-01-11 13:09:10","0","1787","<p>I'm working on my first android app and have an SQLite database set up and working with it, I've been able to successfully use a cursor to retrieve some data and used SimpleCursorAdapter to make the data appear as a list. </p><p>I'm now looking to <em>retrieve a specific field</em> and <em>put the result into a float variable</em>. However all the examples i find online seem to expect you to be handling large retrievals with multiple rows/columns and they've all been adapted into lists or arrays. <strong>I can't figure out how to just get the contents of that one field into a variable.</strong></p><p>I tried using <code>myVariable = cursor.getFloat(0)</code> which i think is along the right lines but i couldn't get that working either.</p><p>Every time i run my application i just get <code>null pointer exception</code> errors, I've tried some <code>try catch</code> blocks but I'm new to all this in general and haven't had any success in troubleshooting. It might be something a simple as a query typo..</p><p>I'll include the bit of code involved below, but any suggestions general or specific are welcome, Thanks for taking the time to look.</p><pre><code>public void Main(){    //gets the rowId we put with the intent from Budget.java, sets a default value of -1 'incase.    selectedRowId = getIntent().getLongExtra(""rowId"", -1);    Cursor costCursor= FindBudgetForId(selectedRowId);    MyText(costCursor, selectedRowId);}public Cursor FindBudgetForId(long selectedRowId){    SQLiteDatabase db = budgetData.getWritableDatabase();    String rowBudgetQuery = ""SELECT BUDGET_AMOUNT FROM CAT_BUD_TAB WHERE _ID=""+ selectedRowId;    Cursor c = db.rawQuery(rowBudgetQuery,null);    startManagingCursor(c);     return c;}public void MyText(Cursor costCursor, long selectedRowId){          TextView whatDoText=(TextView)this.findViewById(R.id.keypad_text);    whatDoText.setText(""row: "" +(String.valueOf(selectedRowId)));    //set the current  budget amount in the edit text box    retrievedAmount = costCursor.getFloat(3);    EditText inputHint=(EditText)this.findViewById(R.id.cost_input);    inputHint.setText((String.valueOf(retrievedAmount)));}</code></pre>","523874","","805252","","2011-09-30 19:25:17","2011-09-30 19:25:17","How can I get data from a single field into a variable from an SQLite database?","<java><android><database><sqlite><cursor>","2","2","","",""
"4658021","1","4658556","","2011-01-11 13:17:52","1","534","<p>If I use onBackPressed() on Android 1.5, my application crashes. Is there any possibility to deactivate this function if running on an Android 1.5 device?</p><p>The code there is not absolute necessary but a real ""nice to have"", so I would like to keep it on newer devices and just drop it on older ones. </p><p>Is this possible?</p><p>edit: I think I found it, just the old way:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event)  {   if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {       // do something on back.       return true;   }return super.onKeyDown(keyCode, event);}</code></pre>","564256","","564256","","2011-01-11 13:26:00","2011-01-11 14:19:49","Backwards compatibility of onBackPressed","<android><backwards-compatibility>","1","1","","",""
"4658064","1","","","2011-01-11 13:22:28","11","914","<p>I have a game which has been available since July 2010. I've had 18,000 total downloads so far and average rating is 3.5.</p><p>When I search the arcade category it comes out below a lot of other apps which have both lower downloads and a lower ranking. For example one that is some 20 positions higher has 1,000 - 5,000 downloads and 2.5 stars.</p><p>My conclusion to this is that the active installs percentage weights very highly, mine is at 21%.</p><p>Now this low percentage is explainable by two things</p><p>1) Early versions of the app were 'beta' and it took a while to fix on all devices to work stable.</p><p>2) This was a 'demo' product, so I suspect a lot of people uninstalled due to completing the demo.</p><p>I have since updated the app to be ad-supported. In theory people would be more likely to keep this, and also the game has many more features that the original version. I am considering re-releasing the app as a new apk. This should reset the stats and hopefully give me a higher position that I currently occupy. I suspect the current uninstall rate is nowhere near as low because I have been monitoring the active installs vs recent downloads and it is much higher.</p><p>Has anyone got any experience of doing this, and was it a good idea? I don't want to abandon the current version as there are still 4000+ users on it. I guess I could release an update pointing them to the newer version.</p>","465286","","","","","2011-01-11 13:22:28","Android market ranking and active installs","<android>","0","3","5","2011-01-12 01:12:22",""
"4658150","1","4672257","","2011-01-11 13:32:17","0","190","<p>I have a image loaded as a background and when the screen is touched I want to animate that portion of the screen with a frameanimation. My frameanimation consists of 9 different png files which are made from just the portion of the screen I want animated. I can get it working when I use entire backgrounds as the frames for the animations, but when I use setbounds() to tell the frameanimation where to draw, I end up with the frameanimation being scaled up to fill the entire screen, which also erase my background. How can I get the frameanimation to stay it's original size and locate it at the same time? I can post  code later if this isn't clear, i'm not at the comp right now</p><pre><code>public boolean onTouchEvent (MotionEvent event){   switch (event.getAction())   {      case MotionEvent.ACTION_DOWN:         this.setBackgroundResource (R.drawable.nova);         Object bg = this.getBackground         touchAni.setBounds (152, 156, 152+140, 156+140);         touchAni = (AnimationDrawable) bg;         if (!touchAni.isRunning())            touchAni.start ();         else         {            touchAni.stop();            touchAni.start();         }   }}</code></pre>","566145","","566145","","2011-01-11 21:33:03","2011-01-12 18:05:12","How to position a FrameAnimation in android?","<android><graphics>","2","0","","",""
"4658193","1","4661625","","2011-01-11 13:37:49","0","1829","<p>Is there a Mootools way to detect iPhone/Android/others ?I have this Vanilla JS script :</p><pre><code>if ( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/BlackBerry/i) ||navigator.userAgent.match(/iPhone/i) ||navigator.userAgent.match(/Palm/i) ){   window.location = 'address-to-iphone-site';}</code></pre><p>I know how to do this for browsers (<a href=""http://jsfiddle.net/pmqjY/"" rel=""nofollow"">jsfiddle</a>, but not for smartphones.<br>Any help would be welcomed.</p>","358313","","477754","","2011-01-11 13:46:35","2011-01-12 22:42:02","iPhone/Android/etc detection, Mootools way?","<iphone><android><mootools><detection>","2","0","","",""
"4658376","1","4659154","","2011-01-11 13:59:06","10","4334","<p>I'm implementing an Interactive Voice Response application on Android. I would like to know how to determine when the <code>tts.speak()</code> function has done talking so I can call my speech recognizer function.</p>","539878","","404469","","2012-10-16 18:25:42","2014-04-05 01:44:04","How to know when TTS is finished?","<android><text-to-speech>","2","1","3","",""
"4658399","1","4673219","","2011-01-11 14:02:19","1","808","<p>I'm designing a service that will comprise a cloud-based database (with a UI for us to manage the data), and then a mobile app for end-users that displays the data to people who want it (primarily read-only). The end-users will be anonymous, and will NOT each have a user account. </p><p>In theory force.com suits my needs well:</p><ul><li><p>It is a solid, cloud-based database</p></li><li><p>It has an API and mobile SDKs</p></li><li><p>It has a UI, so managing the data is easy, without writing loads of form code</p></li><li><p>It scales</p></li></ul><p>It has advantages over Azure and Google App Engine in that there's already a really neat UI for creating and managing database objects, and running reports/dashboards on the data. That means I can spend more time on the client app.</p><p>However my reading of the docs suggests that force.com is designed for enterprise apps, where every user has a user account, which is very different. So if I used force.com I would be hard-coding login details into the mobile client app and using a session login, combined with a single shared user account with very limited access permissions. i.e. every single API call will be from the same user account, but across tens of thousands of devices.</p><p>My experience of Salesforce is that it's great until you hit a limit, and they come out of nowhere. ""You've hit the limit of lookup fields"" waaaah? ""You cannot access long text fields from formulas"" waaah! ""you cannot add a roll-up summary field to a lookup relationship"" aaaargh! So given this, I need to understand what limits may apply with force.com so I understand what I'm getting into from the start:</p><p>So here are the sub-questions I'm looking to answer: </p><ul><li>Will force.com offer the same per-transaction and per-record charges as database.com?</li><li>Is force.com designed for my scenario, or only enterprise apps where each user signsin?</li><li>Are there any limits on transaction volume? What are the limits for each transaction? I assume there's a governor limit.</li><li><p>Are there any limits on concurrent transactions per user account? The docs seem tosuggest a max 10 which would render force.com useless to me, but will database.com have this limit?</p></li><li><p>Can I bypass the intensely irritating ""activation"" process for accounts, without setting up a cookie on the client OR specifying IP range on the server (neither are practical).</p></li></ul><p>If anyone can shed any light on using force.com in this scenario I'd be very grateful. I'd be particularly interested to hear from anyone who has built such an app.</p><p>This question has been up for a while but seems no-one can help directly. If not with force.com, can anyone recommend a cloud-based platform that might suit my criteria?</p>","477415","","477415","","2011-01-12 16:31:25","2012-07-04 10:36:08","Is force.com a suitable back-end for a public, consumer mobile app?","<android><database><cloud><salesforce><force.com>","4","1","","",""
"4658416","1","","","2011-01-11 14:03:18","13","1862","<p>I have a ListView containing a series of notes.</p><p>Currently I use a layout animation to slide all the notes in from the side when the list first loads; this works perfectly.</p><p>However, I'm trying to figure out how to apply a layout animation only to list items below a certain point.  Say I delete an item on the list: I'd like all items below it to shift up into the deleted note's old spot.</p><p>I've tried finding a way to customize the animation delays or interpolators by child index but haven't found anything appropriate for this location.  Is there a way to do this using a custom layout animation (such as extending LayoutAnimationController) or would I have to do this low level and animate each view individually?</p><p>Any suggestions?</p>","131871","","","","","2013-03-18 19:54:01","How to apply android layout animation only to children above a certain index?","<android><listview><animation><android-listview><layout-animation>","3","1","1","",""
"4658511","1","4658852","","2011-01-11 14:12:51","16","5131","<p>I am working on an Android application that collects sensor data over the course of multiple hours. For that, we have a Service that collects the Sensor Data (e.g. Acceleration, GPS, ..), does some processing and stores them remotely on a server. </p><p>Currently, this Service runs in a separate process (using <em>android:service="":background""</em> in the manifest). This complicates the communication between the Activities and the Service, but my predecessors created the Application this way because they <strong>thought</strong> that separating the Service from the Activities would make it more stable. </p><p>I would like some more factual reasons for the effort of running a separate process. What are the advantages? Does it really run more stable? Is the Service less likely to be killed by the OS (to free up resources) if it's in a separate process?</p><p>Our Application uses <a href=""http://bit.ly/7bLLoO"">startForeground()</a> and friends to minimize the chance of getting killed by the OS. </p><p>The Android docs are not very specific about this, the mostly state that it depends on the Application's purpose ;-)</p><p><strong>TL;DR</strong> What are objective reasons to put a long-running Service in a separate process (in Android)?</p>","367197","","28896","","2011-09-01 22:50:53","2013-08-19 13:25:23","Android - How to decide whether to run a Service in a separate Process?","<android><process><service>","3","2","7","",""
"4658561","1","4658766","","2011-01-11 14:20:23","3","568","<p>I am running windows 7 64 bit.  I downloaded the <a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">android SDK</a> (windows installer) and it prompted me to install Java at the start of the installation.  So, I went out and installed the <a href=""https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u23-oth-JPR@CDS-CDS_Developer"" rel=""nofollow"">latest 64 bit java (JDK)</a>. </p><p>After installing Java I re-ran the installer, but it still says <em>Java SE Development Kit (JDK) not found</em>.  Is it going to hurt anything to download the zip and copy it to my <code>C:\</code> drive and run the SDK manager from there?  Could it be that the android sdk requires the 32 bit jdk?</p>","107455","","","","","2011-12-24 21:14:57","Problems setting up pc for android development","<android><windows-7-x64>","2","0","","",""
"4658590","1","4658920","","2011-01-11 14:23:41","7","27358","<p>Hey, I'm trying to create a design for a list that looks like (and mostly behaves like) the call log, like shown here:</p><p><img src=""http://i.stack.imgur.com/bJPIS.jpg"" alt=""alt text""></p><p>For this I downloaded the source code and I'm studying it for know what class and xml file implement it. </p><p>And I found this two xml files <strong>recent_calls_list_item.xml</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""match_parent"" android:layout_height=""?android:attr/listPreferredItemHeight""android:paddingLeft=""7dip""&gt; &lt;com.psyhclo.DontPressWithParentImageView    android:id=""@+id/call_icon"" android:layout_width=""wrap_content""    android:layout_height=""match_parent"" android:paddingLeft=""14dip""    android:paddingRight=""14dip"" android:layout_alignParentRight=""true""    android:gravity=""center_vertical"" android:src=""@android:drawable/sym_action_call""    android:background=""@drawable/call_background"" /&gt;&lt;include layout=""@layout/recent_calls_list_item_layout"" /&gt;</code></pre><p></p><p>and the other is <strong>recent_calls_list_item_layout.xml</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;View android:id=""@+id/divider""    android:layout_width=""1px""    android:layout_height=""match_parent""    android:layout_marginTop=""5dip""    android:layout_marginBottom=""5dip""    android:layout_toLeftOf=""@id/call_icon""    android:layout_marginLeft=""11dip""    android:background=""@drawable/divider_vertical_dark""/&gt;&lt;ImageView android:id=""@+id/call_type_icon""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:layout_alignParentLeft=""true""    android:layout_marginLeft=""4dip""/&gt;&lt;TextView android:id=""@+id/date""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_toLeftOf=""@id/divider""    android:layout_alignParentBottom=""true""    android:layout_marginBottom=""8dip""    android:layout_marginLeft=""10dip""    android:textAppearance=""?android:attr/textAppearanceSmall""    android:singleLine=""true""/&gt;&lt;TextView android:id=""@+id/label""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:layout_alignParentBottom=""true""    android:layout_marginLeft=""36dip""    android:layout_marginRight=""5dip""    android:layout_alignBaseline=""@id/date""    android:singleLine=""true""    android:ellipsize=""marquee""    android:textAppearance=""?android:attr/textAppearanceSmall""    android:textStyle=""bold""/&gt;&lt;TextView android:id=""@+id/number""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_toRightOf=""@id/label""    android:layout_toLeftOf=""@id/date""    android:layout_alignBaseline=""@id/label""    android:layout_alignWithParentIfMissing=""true""    android:singleLine=""true""    android:ellipsize=""marquee""    android:textAppearance=""?android:attr/textAppearanceSmall""/&gt;&lt;TextView android:id=""@+id/line1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    android:layout_alignParentTop=""true""    android:layout_toLeftOf=""@id/divider""    android:layout_above=""@id/date""    android:layout_alignWithParentIfMissing=""true""    android:layout_marginLeft=""36dip""    android:layout_marginBottom=""-10dip""    android:textAppearance=""?android:attr/textAppearanceLarge""    android:singleLine=""true""    android:ellipsize=""marquee""    android:gravity=""center_vertical""/&gt;</code></pre><p></p><p>And my activity is this:</p><pre><code>public class RatedCalls extends ListActivity {private static final String LOG_TAG = ""RecentCallsList"";private TableLayout table;private CallDataHelper cdh;private TableRow row;private TableRow row2;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.recent_calls_list_item);    Log.i(LOG_TAG, ""calling from onCreate()"");    cdh = new CallDataHelper(this);    table = new TableLayout(getApplicationContext());    row = new TableRow(getApplicationContext());    startService(new Intent(this, RatedCallsService.class));    Log.i(LOG_TAG, ""Service called."");    fillList();}public void onResume() {    super.onResume();    fillList();}public void fillList() {    List&lt;String&gt; ratedCalls = new ArrayList&lt;String&gt;();    ratedCalls = this.cdh.selectTopCalls();    setListAdapter(new ArrayAdapter&lt;String&gt;(RatedCalls.this,            android.R.id.list, ratedCalls));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            Toast.makeText(getApplicationContext(),                    ((TextView) view).getText(), Toast.LENGTH_LONG).show();        }    });}</code></pre><p>}</p><p>And then I tried to run it on the android emulator, and then it the LogCat returned an error like this:</p><blockquote>  <p>Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</p></blockquote><p>So inside the <strong>recent_calls_list_item.xml</strong> I declared this:</p><pre><code>&lt;ListView android:id=""@android:id/list"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:layout_x=""1px""    android:layout_y=""1px""&gt;&lt;/ListView&gt;</code></pre><p>And now with this declared I tried to run in the emulator, but the LogCat returns another error:</p><blockquote>  <p>android.content.res.Resources$NotFoundException: File  from xml type layout resource ID #0x102000a</p></blockquote><p><strong>So, my question is, why is this happening? And if you have another solution for implement a view like this I'm trying.</strong></p><p>Thanks.</p>","399459","","","","","2013-12-01 02:49:55","Error android.content.res.Resources$NotFoundException: File from xml type layout resource ID #0x102000a","<android><android-layout><android-source>","5","0","2","",""
"4658619","1","4658658","","2011-01-11 14:26:29","5","7337","<p>How can I use iptables in an Android application? I need this for a firewall-like functionality i.e. packet filtering, blocking sites etc.</p><p>I'm also not sure whether iptables are available in the Android kernel. </p><p>I previously heard that I'd have to create cross-compiled binaries of iptables – but how can I do that? And how can I use them in the application?</p>","545643","","435093","","2012-10-16 07:06:30","2012-10-16 07:07:56","How to use iptables in an Android application","<android><iptables>","1","0","4","",""
"4658703","1","4662731","","2011-01-11 14:35:12","2","3585","<p>I am trying to use this 3rd Party Signature Capture Android Application with my PhoneGap Application. I have no idea how to ""Call the right Activity"" from my PhoneGap App. My Application is written in html and javascript.</p><p>Please help!</p><p>I have installed the application on my Droid X and it Captures my Signature with my finger. Its super smooth and quick. </p><p><a href=""http://www.binarysolutions.biz/"" rel=""nofollow"">http://www.binarysolutions.biz/</a></p><p>Here are the instructions from their website. They are not very detailed.</p><pre><code>String key      = """"; // set the key, any string you find suitableString fileName = """"; // set the file name (global write permissions)Intent intent = new Intent(""biz.binarysolutions.signature.CAPTURE"");intent.putExtra(key, fileName);intent.setComponent(    new ComponentName(        ""biz.binarysolutions.signature"",        ""biz.binarysolutions.signature.Capture""    ));startActivityForResult(intent, CAPTURE_REQUEST_CODE);Receiving the result@Overrideprotected void onActivityResult    (         int    requestCode,          int    resultCode,          Intent data    ) {    super.onActivityResult(requestCode, resultCode, data);    if (requestCode == CAPTURE_REQUEST_CODE &amp;&amp;         resultCode  == RESULT_OK) {        String fileName = """"; // the same file name as above        Bitmap bitmap   = BitmapFactory.decodeFile(fileName);        // do with bitmap whatever you like    }}</code></pre>","472335","","96313","","2011-02-24 21:49:53","2014-01-21 23:44:09","Signature Capture in PhoneGap Android Application","<android><html5><phonegap>","2","0","1","",""
"4659014","1","4659045","","2011-01-11 15:05:01","1","3052","<p>I just bought the HTC Nexus One and i'm trying to create Air application fon Android. I have downloaded Android SDK for windows and i installed it, but on the tools folder i can't find the adb.exe I'm watching the following video <a href=""http://www.gotoandlearn.com/play.php?id=123"" rel=""nofollow"">http://www.gotoandlearn.com/play.php?id=123</a> that shows the steps from the beginning how to setup Air Applications for Android.</p><p>Using the command prompt i want to check if my device is connected to the pc using the ""adb devices"" command. </p><p>I installed all the available packages for the Android SDK including Usb Driver package, revision 4.</p><p>However i dont have this file. Can you advice me what to do?</p>","495296","","","","","2011-01-11 15:07:53","Could not find adb.exe on my tools folder","<android><sdk><nexus-one>","1","0","","",""
"4659021","1","4659124","","2011-01-11 15:05:45","5","2604","<p>I need your help, may be this question is very easy for you.I have a file in /res/raw folder. For example, it's id is <strong>R.raw.myFile</strong>. I need to get ""File"" object. Such as i can do with file on sdcard</p><pre><code>File file = new File(""/sdcard/myFolder/myFile"");</code></pre><p>How I can do this? </p><p>By the way, sorry for my english if there are some mistakes.</p><p>I need ""File"" object. Not stream.</p>","552246","","552246","","2011-01-11 15:44:11","2011-01-11 15:44:11","Getting File from /res/raw","<android>","1","0","","",""
"4659029","1","","","2011-01-11 15:06:40","2","1507","<p>Does anybody know how you create the that big scrollbar which is used in the contact list? Or the one down there in the screen shot:</p><p><img src=""http://i.stack.imgur.com/ZrV5c.png"" alt=""alt text""></p>","341091","","364708","","2011-01-11 15:51:53","2013-06-05 15:22:14","How do you implement the big scrollbar in android","<android><gui><scrollbar>","3","1","3","",""
"4659036","1","4679372","","2011-01-11 15:07:06","4","1747","<p>I'm trying to use Monkey debuggin tool (from adb) to stress test a <strong>part</strong> of my application.As Monkey acts in a total random way, I'd like it to concentrate on the part of code that might contain an error I'm looking for (very rare bug, and I don't know how to replicate it).</p><p>So, in my Main activity I have 6 buttons, each fires up a new activity. I'd like to set monkey to look only in one of those activities, and every activity accesible from it. I cannot find a reasonable way to do it.</p><p>I've tried the<br><code>adb shell monkey -p my.package.name -c android.intent.category.MONKEY 1000</code><br>and in my manifest file I've put in some activities, that I'm interested in:</p><pre><code>        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.MONKEY""/&gt;                        &lt;/intent-filter&gt;</code></pre><p>But it didn't work. Monkey still fires up activities that are not categorized by this tag.It is crucial for Monkey to work in selected subactivities, because it wastes about 95% of time roaming through my app, outside of subactivities that I actually want to test.</p><p>Also I've tried some simple script to launch the desired subactivity, but with no success.</p><p>Looking for any help,<br>cheers,<br>kajman</p>","571143","","","","","2012-12-17 15:51:19","Using Monkey in a subactivity only (android debugging)","<android><category><intentfilter><subactivity><monkey>","2","0","2","",""
"4659106","1","","","2011-01-11 15:14:42","0","1004","<p>I am currently starting to create an app for a small charity company. But Im not entirely sure how to properly learn how to code for the Android OS. I have searched online for tutorials but most stop at the same stage and only show you how to launch the ""helloWorld"" app.</p><p>My question is this: </p><p>1) Will using solely XML be sufficient to code an app? Does it require working in partnership with java?</p><p>2) Does anyone know of any books, recommended books of course, that break everything down for you step-by-step?</p><p>Cheers</p>","571439","","","","","2014-02-07 02:47:14","Android App - XML or java","<android>","4","0","","",""
"4659134","1","4661853","","2011-01-11 15:16:53","3","1505","<p>I have the following struktur to implement an longclicklistener. It works if I click on a text on the webview which contains a html-link, so I know the structure is not completely wrong.</p><p>I removed this link now and the listener just doesn't listen to clicks anymore. Does anybody know this problem and have some advices?</p><pre><code>    private View.OnLongClickListener mLongClickHandler = new View.OnLongClickListener()   {    @Override    public boolean onLongClick(View view) {        ...        return true;    }};</code></pre><p>...</p><pre><code>mywebview.setOnLongClickListener(mLongClickHandler);</code></pre>","564256","","","","","2013-06-07 09:21:48","onLongClickListener does not work on WebView","<android><webview><onlongclicklistener>","2","3","","",""
"4659218","1","","","2011-01-11 15:25:01","0","292","<p>I'm messing around with a simple app, but I seem to have run into a bit of a strange issue.  My app runs fine on an emulator of 1.6, as well as on my real 2.2 Android device, but for some reason when I went to test it on a 2.0 emulator it decides to have an issue.</p><p>I don't believe going through my entire program is necessary, I've tested it to find that the cause is my LayoutInflater.  My app will crash right after these lines (Well, the second one specifically, but I figured the first was relevant).</p><pre><code>LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View view = layoutInflater.inflate(R.layout.pageview, this);</code></pre><p>I had my fair share of problems getting the custom view this is for to work properly, so it's not too surprising.  I can't quite figure this one out though.  The fact that it works with both older and newer just kind of baffles me.  I'm sure the answer is right in front of me, I'm quite new to this yet, but if somebody could point out my blunder I'd be most grateful.  Thank you. </p>","571451","","","","","2011-01-11 15:25:01","Android LayoutInflater works with 1.6+ but not 2.0?","<android><layout><view><inflate>","0","3","","",""
"4659474","1","","","2011-01-11 15:46:53","-1","310","<p>I am from Europe and I am writing a report about Android Security and regarding this point I have several questions.</p><p>Thank you to help me to better understand.</p><p>Q1 : how an operator can control Android Security and what he can do to protect him ?</p>","571480","","21234","","2011-01-11 15:53:49","2011-01-12 08:01:12","Android Security & Hacking","<android><security><anti-hacking>","1","2","","",""
"4659552","1","","","2011-01-11 15:54:11","7","12654","<p>In my android project I want to draw route on Google maps. I have coordinates of start and end points. On this points I get <code>km</code>-file  from Google web service with points witch across route. For drawing parts of route I use instances of <code>Overlay</code> class. And this solution works, but very slowly. Are there another methods to do that? May be exists ability use built-in Google maps application or any another way?</p>","410919","","766108","","2012-10-25 09:13:31","2012-10-25 09:13:31","Android, draw route on google map","<android><api><google-maps><geolocation><google-direction>","2","1","4","",""
"4659655","1","","","2011-01-11 16:03:44","2","1271","<p>I'm trying to optimize texture memory consumption in my native Android application. I have two counters: first is my own that incremented each time TexImage called:</p><pre><code>g_cbTextureMemory += ImageLineBytes(Format, width) * height;</code></pre><p>You may assume that TexImage called once for texture, in my real code there is decrement of current image size than adding new, if texture reallocated, but actually reallocations doesn't happen.</p><p>Second is from the system:</p><pre><code>adb shell dumpsys meminfo my.app.name</code></pre><p>It gives something like this:</p><pre><code>    ** MEMINFO in pid 3269 [my.app.name] **                    native   dalvik    other    total            size:    39320[*]  6663      N/A    45983       allocated:    21453     3945      N/A    25398            free:       34     2718      N/A     2752           (Pss):     6281     3078    40643    50002  (shared dirty):     2240     4968    12108    19316    (priv dirty):     6232     2684    17948    26864</code></pre><p>After that I do the following: I replace <em>all</em> textures with 1x1 (by sending dummy 1x1 image to glTexImage). I see that meminfo gives another result and difference cell [*] changed on 22Mb. But my counter shows that I have 25Mb of textures, so I expect 25Mb.</p><p>So where in the dump texture memory consumption hidden? To be clear, for 1x1 textures dump is:</p><pre><code>    ** MEMINFO in pid 3269 [my.app.name] **                    native   dalvik    other    total            size:    16892     5575      N/A    22467       allocated:    13211     3574      N/A    16785            free:      208     2001      N/A     2209           (Pss):     6273     3122    17016    26411  (shared dirty):     2252     5032    10756    18040   (priv dirty):      6224     2588     5848    14660</code></pre><p>Why I didn't get 25Mb? Is is statistical error? Does native heap includes texture memory (seems that it is)? Or maybe for some formats Android have internal formats different from that I send? For example, R8G8B8 transformed to something more optimal (seems that it is not)? May it's all ok, and there is rational explanation?</p>","211885","","","","","2011-04-21 00:57:25","OpenGL ES texture memory","<android><opengl-es>","1","0","1","",""
"4659695","1","4659910","","2011-01-11 16:07:08","2","2150","<p>I'm using DefaultHttpClient to make an http connection. I [think] we can set the preferred locale in the http headers [http accept-language] when making a connection, which the server can check and send back content in a matching language (if it wants).</p><p>Anyone know if this is possible, or how to go about doing this with DefaultHttpClient?</p><p>Thanks</p>","291701","","642161","","2011-06-13 15:43:22","2011-06-13 15:43:22","Setting locale with DefaultHttpClient?","<java><android><httpclient>","1","2","","",""
"4659726","1","","","2011-01-11 16:09:51","4","2827","<p>I would like to listen to the mic (I guess using AudioRecord) and perform some action the very moment a person starts to speak. I know I can buffer audio with AudioRecord, but how do I analyze it ? </p>","324096","","82320","","2011-06-08 02:40:04","2011-06-08 02:40:04","Detect the beginning of a sound or voice in Android","<android><audio>","1","2","3","",""
"4659727","1","4659985","","2011-01-11 16:10:02","0","1201","<p>I have 2 problems.  </p><p>The 1st problem.<br>I have a CheckedTextView ""Select All"" item and a list of array items set in a adapter of MutipleChoice. I am current trying to set the state of all the checkboxes of the array items to true/false by selecting the CheckedTextView. It works but there's a bug. Such that when the last item of the array is true, the ""SelectAll"" to true will work, but if the last item of the array is false, it will uncheck all the items. What I want is even if any of the item's state is false, it will be set to true when the checkedtextview is selected to true.   </p><p>The 2nd problem.<br>I can't seem to set the checkedtextview to true when all of the array item's state is true.</p><p>Could it be that I'm doing it the wrong way? Help given would be appreciated..</p><p>This is my method for the CheckedTextView ""Select All""</p><pre><code>private void markAll (Boolean state) {    for (int i = 0; i &lt; lv.getCount(); i++) {        lv.setItemChecked(i, state);    }           }</code></pre><p>This is the coding for checking of the states of the array items  </p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    for(int i = 0; i &lt; lv.getCount(); i++) {        //if even 1 of the item is false, the checkedtextview will be set to false        if(lv.isItemChecked(i) == false) {            ctv.setChecked(false);        }        //if all of the item is true, the checkedtextview will be set to true as well        //the coding should be done in the if-else below, if i'm not wrong        if(...) {        }    }}</code></pre><p><strong>EDIT</strong><br>This is the new code for calling my method        ctv.setOnClickListener(new View.OnClickListener() {</p><pre><code>        public void onClick(View v) {            // TODO Auto-generated method stub            ctv.setClickable(true);            if(ctv.isPressed() &amp;&amp; ctv.isChecked() == false) {                ctv.setChecked(true);                markAll(true);            }            else {                ctv.setChecked(false);                markAll(false);            }        }    });</code></pre><p>This is my xml code for the checkedtextview</p><pre><code>    &lt;CheckedTextView        android:id=""@+id/checkedtext""        android:layout_width=""fill_parent""        android:layout_height=""?android:attr/listPreferredItemHeight""        android:text=""Select all""        android:textAppearance=""?android:attr/textAppearanceLarge""        android:gravity=""center_vertical""        android:clickable=""true""        android:checkMark=""?android:attr/listChoiceIndicatorMultiple""        android:paddingLeft=""6dip""        android:paddingRight=""6dip""/&gt;</code></pre>","504864","","504864","","2011-01-14 06:06:23","2011-01-14 06:06:23","Problem with checking all checkboxes","<android><checkedtextview>","1","0","","",""
"4659836","1","4659874","","2011-01-11 16:18:29","10","4232","<p>Sometimes I know that a GUI element looks like but I don't know the name used in Android. With most other GUI the tutorial would have a list of all GUI elements with a nice graphic besides it so you know what it will look like. Does something link this exist for Android.</p>","341091","","","","","2011-01-11 16:36:38","Is there a graphical overview of all Android GUI element?","<android><gui>","3","3","1","",""
"4659847","1","","","2011-01-11 16:19:37","3","869","<p>How can I get the full path of flash player lite, </p><p>and use it to play my target <code>.swf</code> ?</p>","522431","","","","","2012-05-15 14:19:14","How to play .swf with flash player lite in android 2.2 sdk in java?","<java><android>","1","0","","",""
"4659914","1","4660391","","2011-01-11 16:26:19","0","3063","<p>I have 2 markers on the map and i want to delete them when the user clicks on a button. This is my method:</p><pre><code> public void deleteAllMarkers() {    if(mapView.getOverlays().size() !=0) {         //Log.d(""MAPA "",Integer.toString(mapView.getOverlays().size()));        for (int i=0; i&lt;mapView.getOverlays().size(); i++ ) {            mapView.getOverlays().remove(i);        }        mapView.postInvalidate();    }   }</code></pre><p>The problem is that i have to press my button twice to get rid of both markers, because after the first press only 1 marker disappears.</p><p>What am i doing wrong?</p>","324417","","","","","2011-01-11 17:14:37","How to delete all markers from the mapview with one click in Android?","<android><android-mapview><itemizedoverlay>","1","0","","",""
"4659917","1","","","2011-01-11 16:27:11","5","2845","<p><strong>This will probably be a dumb question, but I don't understand the java date function. Here is some code:</strong></p><pre><code>SimpleDateFormat sdf = new SimpleDateFormat(""hh:mm"");Date s = sdf.parse(var);Calendar scal = java.util.GregorianCalendar.getInstance();scal.setTime(s);   Log.w(""Time: "", Long.toString(s.getTime()));</code></pre><p>If var = ""10:00"" I get ""64800000"".</p><p>If var = ""11:00"" I get ""68400000"".</p><p>If var = ""12:00"" I get ""28800000"".</p><p>If var = ""13:00"" I get ""75600000"".</p><p>If var = ""14:00"" I get ""79200000"".</p><p>If var = ""00:00"" I get ""28800000"".</p><p>What is up with 12:00? Why, when var=12:00 do I get the same result as when it's 00:00? All the other results seem correct. I obviously don't understand the java date function, but I can't seem to find any explanation for this anywhere. This is screwing up my time span calculator.</p>","571534","","","","","2011-01-11 16:36:35","Simple question about java SimpleDateFormat","<java><android><date><simpledateformat>","2","1","1","",""
"4660010","1","4673476","","2011-01-11 16:35:08","1","3547","<p>Using the command prompt i want to check if my HTC nexus one is connected to the pc using the ""adb devices"" command.</p><p>I have installed all the available packages for the Android SDK including Usb Driver package, revision 4 and i have the USB debbuging enabled.</p><p>I would like to change it to Usb Driver package Revision 3 since i have Nexus one.On the available packages i can find only the revision 4. How can i change it back to 3 and maybe this will fix the problem?</p><p>Can you please help me to find out what the problem is and how to solve it, so by using ""adb devices"" command i can be able to see my HTC Nexus one.</p><p>Thank you.</p>","495296","","495296","","2011-01-12 19:11:57","2011-01-12 20:06:57","Connect HTC Nexus one to a PC","<android><sdk><driver><nexus-one>","2","4","","",""
"4660044","1","4771512","","2011-01-11 16:38:06","10","4098","<p>I am attempting to get Android Referral tracking to work. I am following the only documentation I have found here <a href=""http://code.google.com/mobile/analytics/docs/android/#referrals"">http://code.google.com/mobile/analytics/docs/android/#referrals</a>  I have the following in my android manifest file </p><pre><code>&lt;receiver  android:name=""com.google.android.apps.analytics.AnalyticsReceiver""  android:exported=""true""&gt;      &lt;intent-filter&gt;                  &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;          &lt;/intent-filter&gt;  &lt;/receiver&gt;  &lt;receiver android:name=""com.package.Receiver"" android:exported=""true""&gt;          &lt;intent-filter&gt;                  &lt;action android:name=""com.android.vending.INSTALL_REFERRER"" /&gt;          &lt;/intent-filter&gt;  &lt;/receiver&gt;  &lt;uses-sdk android:minSdkVersion=""4""/&gt;  </code></pre><p>com.package.Receiver starts with: </p><pre><code>public void onReceive(Context paramContext, Intent paramIntent) {          String str1 = paramIntent.getStringExtra(""referrer"");          Log.i(""myapp"", ""action: '"" + paramIntent.getAction() + ""'  referrer string: '"" + str1 + ""'""); </code></pre><p>Also with a little bit of decompiling com.google.android.apps.analytics.AnalyticsReceiver has the following code in it: </p><pre><code>public void onReceive(Context ctx, Intent intent)  /*     */   {  /*  24 */     String referrer = intent.getStringExtra(""referrer"");  /*     */  /*  26 */     if ((!  (""com.android.vending.INSTALL_REFERRER"".equals(intent.getAction())))  || (referrer == null))  /*     */     {  /*  28 */       return;  /*     */     }  /*     */ /*  31 */     String formattedReferrer = formatReferrer(referrer);  /*     */  /*  33 */     if (formattedReferrer != null) {  /*  34 */       PersistentEventStore store = new  PersistentEventStore(ctx);  /*  35 */       store.setReferrer(formattedReferrer);  /*  36 */       Log.d(""googleanalytics"", new  StringBuilder().append(""Stored   referrer:"").append(formattedReferrer).toString());  /*     */     } else {  /*  38 */       Log.w(""googleanalytics"", ""Badly formatted referrer, ignored"");  /*     */     }  /*     */   }  </code></pre><p>Note the two lines 36 and 38 that Log ""googleanalytics"" I have tried pushing the above app to the market, downloading it on my Nexus One (after uninstalling a previous version of the app). I have generated a link using the google page I linked to at the beginning of this post </p><p><code>http://www.google.com/url?sa=D&amp;q=http://market.android.com/search%3Fq%3Dpname:com.package.app%26referrer%3Dutm_source%253Dgoogle%2526utm_medium%253Dcpc%2526utm_term%253Drunning%25252Bshoes%2526utm_content%253Dcontent1%2526utm_campaign%253Dslogan&amp;usg=AFQjCNFctwqk1WgWl0bhiIBNVqy3U4OPRw</code></p><p>I attached logcat to my Nexus One while I download the app from that link, I do not see any logs from ""googleanalytics"" or ""myapp"". The rest of the google analytics library does work for my app. I.E. I see records on google analytics about pages hits etc. However all the traffic sources are ""Direct Traffic"". I am at a loss as to what is going on. Does anyone have any insight into what I might be doing wrong? </p>","571533","","234039","","2011-01-11 17:58:10","2012-12-14 22:48:15","Android referral tracking does not work","<android>","3","3","4","",""
"4660163","1","4660969","","2011-01-11 16:50:42","0","513","<p>Probably a really basic answer to this but google is throwing up nonsense. </p><p>Ok, so i have a bunch of nested linear layouts, each one contains a textview and an imageview. What i want is my textview to be linked so that when a user clicks on the text, it will take the user to a new page that is in the same project. Not a website or anything.</p><p>Appreciate any help!!</p>","565672","","","","","2011-01-11 18:04:15","Android - Basic question - link TextView to open new page (internal)","<android>","2","0","","",""
"4660181","1","","","2011-01-11 16:51:58","1","540","<p>Alright, I have this app that runs as a service and takes audio samples every so often, and keeps track of the amplitude. It works beautifully. I have try/catch blocks so that my app doesn't interfere with other apps using the microphone, and all of that. The <em>only</em> problem I have is with the Voice Recognition app. Any other app that uses the microphone, recording memos, the phone, anything, doesn't bother my app because of the catch blocks. However, if the voice recognition app is running when my app tries to take its sample, my app crashes. To my knowledge, my app fails when it reaches the stop() function, for whatever reason...but that's not what I'm here for. </p><p>The thing I would like to know is if there is a way to detect if the Voice Recognition app is running/is started. Like I said, I have the catch blocks in place which work beautifully for every OTHER situation when the microphone wouldn't be accessible, but they, for some reason, don't work for the voice recognition. </p>","519436","","","","","2011-01-11 16:51:58","Detecting Voice Recognition Activation","<android><microphone><recording><voice-recognition>","0","3","","",""
"4660255","1","","","2011-01-11 16:59:11","0","458","<p>The top level layout in my activity is a framelayout. I have completed, debugged and tested this app and it works exactly like it should in all respects on my g1 and  on various emulators. But on 3.7-inch displays running 2.1+, some imageviews packed in a linearlayoutare <strong>periodically</strong> not visible. I know that they are there because you can touch and drag them with effect in the app. So I assume somehowthey have gotten under the SurfaceView that is the main component of the app. This is apparently so even though the SurfaceView is declared in the xml prior to the LinearLayout.  However, the ImageViews IN the LinearLayout are added programmatically towards the end of onCreate().</p><p>Framelayout stacks everything that is added to it, one on top of the other--the only way you will see more than one child of a frame layout is if they are smaller than the screen and are placed apart from eachother.</p><p>Oddly, sometimes the imageviews ARE visible--it is random. Anyway, I've been trying to combat this with framelayout.bringChildToFront(View v) on the linearlayout without success.</p><p>I wonder if anyone has any insight into how the behavior could be random like that, and how I should code these imageviewsto keep this from happening, and why the problem appears only to occur on 3.7 vs 3.2 inch screens (as it happens, the two 3.2-inch screens were both htc, so vendor might be factor too).</p><p>[edit] Actually, I've determined that this is a 2.2 issue, not a screen size (or even vendor) issue.  Can't ensure that ImageViews added to a framelayout with a SurfaceView in it will appear on top of the surfaceview.  I ran some tests in the respective onDraw() methods and the imageviews are 'visible' (0), and nothing does anything to the alpha of the drawables, which are there as well at ondraw(). [/edit] </p><p>Any insight would be welcomed.</p><p>Ken T.</p>","571579","","571579","","2011-01-13 21:01:46","2011-06-11 20:37:08","ImageViews sometimes not displaying in FrameLayout activity","<android><imageview><drawable><android-sdk-2.2>","1","0","","",""
"4660363","1","4662244","","2011-01-11 17:10:45","2","3556","<p>The log reports that the database or cursor was not closed. I basically have an activity with a custom surfaceview and uses a handler to report back to the activity. When I receive the msg I show an alertdialog and also update the database.</p><pre><code>private Handler handler = new Handler() {    public void handleMessage(Message msg) {        switch(msg.what) {        case 1:            dh.open();            dh.updateEvent(""id"", ""name"", ""someone"");            dh.close();            successAlert.show();            break;        case 2:            failAlert.show();            break;        }    }};</code></pre><p>Previously I did not have ""dh.close()"" and thats when the log reported database/cursor not closed. But ever since I added that in, it takes a really long time to complete. Once I get the message, the system seems to hang. Am I doing something wrong or does it usually take this long. I have also tried using a try block with a finally to close the db.</p><p>EDIT:</p><pre><code>public class DatabaseHelper {private Database dbHelper;private SQLiteDatabase db;private Context context;public DatabaseHelper(Context context) {    this.context = context;    //database = new Database(context);}public void open() {    dbHelper = new Database(context);    db = dbHelper.getWritableDatabase();}public void close() {    dbHelper.close();}public void updateEvent(int id, String name, int other) {    ContentValues cv = new ContentValues();    cv.put(""id"", id);    cv.put(""name"", name);    cv.put(""other"", other);    db.update(""stateTable"", cv, ""id="" + id, null);}public boolean checkState(int id) {    db = dbHelper.getReadableDatabase();    Cursor cursor = db.query(""stateTable"", null, null, null, null, null, null);    cursor.moveToPosition(id - 1);    int i = cursor.getInt(2);    android.util.Log.d(""semajhan"", "": "" + i);    if (i == 1) {        return true;    } else {        return false;    }}</code></pre><p>}</p><p>Extended SQLiteOpenHelper:</p><pre><code>public class Database extends SQLiteOpenHelper {private static final String DATABASE_NAME = ""events.db"";private static final int DATABASE_VERSION = 1;private static final String TABLE_NAME = ""stateTable"";private static final String ID = ""id"";private static final String NAME = ""name"";private static final String OTHER = ""other"";private static final String DATABASE_CREATE = ""CREATE TABLE stateTable (id INT, name TEXT, other INT)"";private static final String DATABASE_UPGRADE = ""DROP TABLE IF EXISTS table"";public Database(Context context) {    super(context, DATABASE_NAME, null, DATABASE_VERSION);    // TODO Auto-generated constructor stub}@Overridepublic void onCreate(SQLiteDatabase db) {    // TODO Auto-generated method stub    db.execSQL(DATABASE_CREATE);    // added initial values}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    // TODO Auto-generated method stub    db.execSQL(DATABASE_UPGRADE);    onCreate(db);}</code></pre><p>}</p><pre><code>01-11 13:57:41.239: ERROR/ActivityManager(61): ANR in com.semajhan.soodles  (com.semajhan.soodles/.Level1)01-11 13:57:41.239: ERROR/ActivityManager(61): Reason: keyDispatchingTimedOut01-11 13:57:41.239: ERROR/ActivityManager(61): Load: 1.64 / 0.56 / 0.2601-11 13:57:41.239: ERROR/ActivityManager(61): CPU usage from 35716ms to -1ms ago:01-11 13:57:41.239: ERROR/ActivityManager(61):   44% 862/com.semajhan.soodles: 37% user + 7.2% kernel / faults: 853 minor01-11 13:57:41.239: ERROR/ActivityManager(61):   29% 61/system_server: 27% user + 1.9% kernel / faults: 142 minor01-11 13:57:41.239: ERROR/ActivityManager(61):   0.2% 731/com.android.quicksearchbox: 0% user + 0.2% kernel / faults: 30 minor01-11 13:57:41.239: ERROR/ActivityManager(61):   0.2% 707/com.android.launcher: 0.2% user + 0% kernel / faults: 30 minor01-11 13:57:41.239: ERROR/ActivityManager(61):   0.2% 801/com.svox.pico: 0.1% user + 0.1% kernel / faults: 363 minor01-11 13:57:41.239: ERROR/ActivityManager(61):   0% 117/com.android.systemui: 0% user + 0% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):   0% 41/adbd: 0% user + 0% kernel01-11 13:57:41.239: ERROR/ActivityManager(61): 99% TOTAL: 86% user + 13% kernel + 0% irq01-11 13:57:41.239: ERROR/ActivityManager(61): CPU usage from 1969ms to 2620ms later:01-11 13:57:41.239: ERROR/ActivityManager(61):   54% 61/system_server: 48% user + 6% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):     40% 69/SurfaceFlinger: 40% user + 0% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):     10% 92/InputDispatcher: 7.5% user + 3% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):     1.5% 62/HeapWorker: 1.5% user + 0% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):   44% 862/com.semajhan.soodles: 32% user + 12% kernel / faults: 2 minor01-11 13:57:41.239: ERROR/ActivityManager(61):     24% 874/Thread-13: 24% user + 0% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):     23% 862/studios.soodles: 4.6% user + 18% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):     1.5% 867/Compiler: 0% user + 1.5% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):   0.8% 731/com.android.quicksearchbox: 0% user + 0.8% kernel01-11 13:57:41.239: ERROR/ActivityManager(61):     0.8% 732/HeapWorker: 0% user + 0.8% kernel01-11 13:57:41.239: ERROR/ActivityManager(61): 100% TOTAL: 76% user + 23% kernel</code></pre>","507007","","71034","","2011-01-11 19:53:45","2011-01-11 20:25:47","Android sqlite log reports and db.close()","<java><android><sqlite>","3","4","","",""
"4660397","1","","","2011-01-11 17:15:16","1","453","<p>So I hope it's not a repeated question but, from the following code </p><pre><code>File f = new File(Environment.getExternalStorageDirectory(), TRYVID);  Uri uri = Uri.fromFile(f);mc = new MediaController(this);mp.setMediaController(mc);mp.setVideoPath(""/sdcard/try2.mp4"");</code></pre><p>this is part of a function that's called when a button is pressed, what i'm hoping to achieve is that when the user presses a key, the video plays but i've learned that the videoview does not play anything from the raw folder so i copied the video into the sdcard, but then after i press on the button on the emulator, it just crashes says it has to be close unexpectedly. I tried both the .setVideoPath as well as the .setUri but both does not work hmm anyone can point to my problem here?</p>","571598","","","","","2012-01-24 14:23:28","How to play video from sd folder","<java><android><video><sd-card><android-sdcard>","2","0","","",""
"4660462","1","4660522","","2011-01-11 17:21:08","3","1255","<p>this may sound silly, but i can´t find anywhere how to specify the pivotXType and pivotYType of a ScaleTAnimation.</p><p>I know how to do it programatically, but i need to specify it via XML (i need it for transition between activities, using overridePendingTransition method)</p><p>Here´s the code that works:</p><pre><code> Animation animation=new ScaleAnimation(1,0,1,0,ScaleAnimation.RELATIVE_TO_SELF,(float)0.5,ScaleAnimation.RELATIVE_TO_SELF,(float)0.5);    animation.setDuration(1000);</code></pre><p>Here´s the XML, without the XML attribute i´m looking for</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;scale xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromXScale=""1""    android:toXScale=""0""    android:fromYScale=""1""    android:toYScale=""0""    android:pivotX=""0.5""            android:pivotY=""0.5""    android:duration=""2000""    /&gt;</code></pre><p>I checked out the documentation at <a href=""http://developers.androidcn.com/reference/android/view/animation/ScaleAnimation.html"" rel=""nofollow"">http://developers.androidcn.com/reference/android/view/animation/ScaleAnimation.html</a>, but didn´t find any answer.Thanks.</p>","515925","","","","","2011-01-11 17:26:29","XML Attribute for specifying pivotXType and pivotYType in ScaleAnimation","<android><android-layout>","1","0","1","",""
"4660526","1","4662126","","2011-01-11 17:26:48","3","4653","<p>I'm trying to remote control a live wallpaper from a widget. They're in the same APK, but obviously different processes. Calling an ""activity"" of the live wallpaper is of little use to me since it is a different process. The widget has simple buttons that, when pressed, </p><p>So what (I think) I need is IPC and AIDL.</p><p>First I created the AIDL on the wallpaper side, which worked fine. It has three methods with no extra parameters. But when I added the clientside to the widget, I got an error telling me that I cannot bind to that remote interface because the widget is already a BroadcastListener. I tried getting button handling in without needing the Widget to be a BroadcastListener, but that seems to be impossible.</p><p>Well no problem, right? I just created a service within the widget that binds to the remote interface, because while the widget is a BroadcastListener, the service is not, and everything should be fine. </p><p>Or so I thought.</p><p>Well, I'm getting the widget's buttons to trigger the widget service. Binding to the remote service yields me the following warning:</p><p>Unable to start service Intent (act=com.blabla.IRemoteService): not found.</p><p>I am using getApplicationContext() within the service of the widget to bind to the remote stuff. I do have the widget service in the manifest, but I don't have the remote service in there. When I do put it in there, I get a nonspecific InstantiationException.</p><p>In the Widget's Service onStart() I am doing this:</p><pre><code>getApplicationContext().bindService(new Intent(IWallpaperRemote.class.getName()),   mConnection, Context.BIND_AUTO_CREATE);</code></pre><p>I also have...</p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {    public void onServiceConnected(ComponentName className,            IBinder service) {        mService = IWallpaperRemote.Stub.asInterface(service);        isBound = true;        Log.i(""WidgetServiceConnection"", ""binding to service succeeded"");    }    public void onServiceDisconnected(ComponentName className) {        mService = null;        isBound = false;        Log.i(""WidgetServiceConnection"", ""binding to service lost!"");    }};</code></pre><p>My question is this: Has anyone ever successfully done a remote call from a widget into another application? Considering I am talking about a live wallpaper here, and the fact that I'm not interested in calling an activity within the widget process but cause function calls within the live wallpaper, what options do I have other than IPC, if any?</p><p>And if IPC is the way to go here, what am I doing wrong? </p>","571608","","23427","","2011-02-19 03:41:46","2011-02-19 03:41:46","How to call an Android remote service (IPC) from a Widget / local service?","<android><service><widget><ipc><aidl>","1","2","0","",""
"4660602","1","","","2011-01-11 17:34:26","0","521","<p>Previous question was below which is now solved :). The code below takes data from an XML file and displays it. The data it is displaying is a timetable. I need the application to have a menu for each day (Mon-Fri) then when that is clicked I need it to open a scroll view with just that days lessons in it. Then when a lessons is clicked a toast of the lesson info. Could anyone help me!? Many Thanks</p><p><em>Hi all,I have created a class for reading from an XML file into my Android app. It currently works as a standalone application which I followed from an online tutorial. When I bring it into my main app which has other activites and menus it crashes. Im sure its a simple error but as a Android newbie I cannot seem to get it to work! Any help would be really appreciated - code below,</em></p><p>Nick</p><p><strong>Calling from main menu</strong></p><pre><code>case R.id.timetable_button:Intent i2 = new Intent(this,time.class);startActivity(i2);break;</code></pre><p><strong>XML Activity</strong> </p><pre><code>package mobile.collyers;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 time 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 day[];  TextView start[];  TextView end[];  TextView teacher[];  TextView description[];  TextView room[];  try {   URL url = new URL(     ""http://www.computingcrew.co.uk/mobile/testFile.xml"");   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();   DocumentBuilder db = dbf.newDocumentBuilder();   Document doc = db.parse(new InputSource(url.openStream()));   doc.getDocumentElement().normalize();   NodeList nodeList = doc.getElementsByTagName(""lesson"");   /** Assign textview array lenght by arraylist size */   day = new TextView[nodeList.getLength()];   start = new TextView[nodeList.getLength()];   end = new TextView[nodeList.getLength()];   teacher = new TextView[nodeList.getLength()];   description = new TextView[nodeList.getLength()];   room = new TextView[nodeList.getLength()];   for (int i = 0; i &lt; nodeList.getLength(); i++) {    Node node = nodeList.item(i);    day[i] = new TextView(this);    start[i] = new TextView(this);    end[i] = new TextView(this);    teacher[i] = new TextView(this);    description[i] = new TextView(this);    room[i] = new TextView(this);    Element fstElmnt = (Element) node;    NodeList dayList = fstElmnt.getElementsByTagName(""day"");    Element dayElement = (Element) dayList.item(0);    dayList = dayElement.getChildNodes();    day[i].setText(""Day = ""      + ((Node) dayList.item(0)).getNodeValue());    NodeList startList = fstElmnt.getElementsByTagName(""start"");    Element startElement = (Element) startList.item(0);    startList = startElement.getChildNodes();    start[i].setText(""Start Time = ""      + ((Node) startList.item(0)).getNodeValue());    NodeList endList = fstElmnt.getElementsByTagName(""end"");    Element endElement = (Element) endList.item(0);    endList = endElement.getChildNodes();    end[i].setText(""End Time = ""      + ((Node) endList.item(0)).getNodeValue());    NodeList teacherList = fstElmnt.getElementsByTagName(""teacher"");    Element teacherElement = (Element) teacherList.item(0);    teacherList = teacherElement.getChildNodes();    teacher[i].setText(""Teacher = ""      + ((Node) teacherList.item(0)).getNodeValue());    NodeList descriptionList = fstElmnt.getElementsByTagName(""description"");    Element descriptionElement = (Element) descriptionList.item(0);    descriptionList = descriptionElement.getChildNodes();    description[i].setText(""Description = ""      + ((Node) descriptionList.item(0)).getNodeValue());    NodeList roomList = fstElmnt.getElementsByTagName(""room"");    Element roomElement = (Element) roomList.item(0);    roomList = roomElement.getChildNodes();    room[i].setText(""Room = ""      + ((Node) roomList.item(0)).getNodeValue());    layout.addView(day[i]);    layout.addView(start[i]);    layout.addView(end[i]);    layout.addView(teacher[i]);    layout.addView(description[i]);    layout.addView(room[i]);   }  } catch (Exception e) {   System.out.println(""XML Pasing Excpetion = "" + e);  }  /** Set the layout view to display */  setContentView(layout); }}</code></pre>","571611","","571611","","2011-01-11 20:12:34","2011-01-11 20:12:34","Android ScrollView Problem","<android><android-layout><android-xml>","0","6","","",""
"4660752","1","4660821","","2011-01-11 17:45:32","0","227","<p>I'm creating an Android app and am wondering if there is anything special I need to do to allow other apps access to use a particular Intent from my app for use in theirs?  </p><p>Also, if Intents are inherently allowed to be used by other apps, is there a way to stop that from happening?</p>","235708","","","","","2011-01-11 17:51:19","Anything needed to allow/give Android Apps access to my Intents?","<android><android-intent>","1","0","","",""
"4660823","1","4661122","","2011-01-11 17:51:24","3","9195","<p>I've been struggling with this for hours. I've also checked the documentation and several topics. I found this code in two topics, both guys said the code was working perfectly, but not on my computer. The first Toast appears, but the second one never. What is wrong?</p><pre><code>public class HelloAndroid2 extends Activity {  @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);       Intent intent = new Intent(this, AlarmReceiver.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,    intent, PendingIntent.FLAG_ONE_SHOT);    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (10 * 1000), pendingIntent);    Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();} public final class AlarmReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""Alarm worked."", Toast.LENGTH_LONG).show();    } }</code></pre><p>}</p><p>Since i cannot add the xml code here, here's the link to a print screen:<a href=""http://img823.imageshack.us/img823/2309/alarmxml.png"" rel=""nofollow"">link text</a></p>","571648","","571648","","2011-01-11 19:31:50","2013-01-30 22:06:12","Android alarm not working","<android><alarmmanager>","2","1","2","",""
"4660976","1","4661645","","2011-01-11 18:05:00","2","1320","<p>Would it be at all possible to have an AsyncTask in Android which ""Throws"" things? If I don't @Override the method, it doesn't get called. If I add the ""throws"" at the end, there are compiler errors. For example, I want to do something like:</p><pre><code>class testThrows extends AsyncTask&lt;String,Void,JSONObject&gt; {   @Override   protected JSONTokener doInBackground(&lt;String&gt;... arguments) throws JSONException {      String jsonString = arguments[0];      JSONTokener json = new JSONTokener(jsonString);      JSONObject object = json.getJSONObject(""test"");      return object;   }}</code></pre><p>json.getJSONObject throws a JSONException. Is there any way to do this?</p>","220591","","","","","2011-01-11 19:17:39","How do I override a class method in Java and add a ""throws"" declaration to it?","<java><android><override>","4","1","","",""
"4661155","1","4661325","","2011-01-11 18:23:00","2","1550","<p>I want to get tasks from an exchange server for sync in an android app. I'm not interested in contacts, emails or calendar items, just tasks.</p><p>There seems to be a few ways to connect to an exchange server but the documentation is both vast and opaque.</p><p>My server has OWA enabled but the <a href=""http://msdn.microsoft.com/en-us/library/aa142564%28v=exchg.65%29.aspx"" rel=""nofollow"">API seems unsupported</a>.</p><p>Any advice much appreciated.</p>","268075","","","","","2012-09-14 04:50:53","How should my android app connect to Exchange server?","<android><outlook><webdav><exchange-server><outlook-web-app>","1","0","1","",""
"4661234","1","","","2011-01-11 18:31:16","2","3171","<p>I need to somehow monitor the LogCat log, meaning that while my service is running I need to read the LogCat for new entries.At this moment I know only how to retrieve once the Log:</p><pre><code>Process mLogcatProc = null;    BufferedReader reader = null;    try    {            mLogcatProc = Runtime.getRuntime().exec(new String[]                   {""logcat"", ""-d"", ""ActivityManager:I *:S"" });                    reader = new BufferedReader(new InputStreamReader    (mLogcatProc.getInputStream()));            String line;            final StringBuilder log = new StringBuilder();            String separator = System.getProperty(""line.separator"");             while ((line = reader.readLine()) != null)            {                    log.append(line);                    log.append(separator);            }</code></pre><p>If I remove the -d option it will not exit but also it will not either work.So how can I modify the bellow code in order to continuously read new entries from LogCat?</p>","467780","","321731","","2014-03-09 14:08:15","2014-03-09 14:08:15","How to constanly monitor LogCat file?","<android><logging><monitoring><logcat><continuous>","2","4","3","",""
"4661444","1","4661570","","2011-01-11 18:52:25","1","958","<p>HI,</p><p>I want to create a animal repeller application.I'm new bie to android.I want to play different  frequency sound to repel the animal,but I'm not clear how to play .please help me out .</p><p>Thanx in advance.Praween.</p>","292605","","186558","","2011-01-11 20:13:46","2011-01-11 20:13:46","How to play different frequeny sound in android?","<android><audio>","1","1","","",""
"4661459","1","4661526","","2011-01-11 18:55:25","8","15726","<p>I'm creating a custom dialog containing an EditText so that I can get text data from the user:</p><pre><code>final EditText newKey = (EditText) findViewById(R.id.dialog_result);AlertDialog.Builder keyBuilder = new AlertDialog.Builder(StegDroid.this);keyBuilder.setCancelable(false).setPositiveButton(""Try Again"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {        Log.v(""Dialog"",""New Key: ""+newKey.getText().toString());    }}).setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {       public void onClick(DialogInterface dialog, int id) {            dialog.cancel();       }   });AlertDialog dialog = keyBuilder.create();dialog.setTitle(""Decryption Failed"");dialog.setContentView(R.layout.decrypt_failed_dialog);dialog.show();</code></pre><p>However I always get this exception:</p><pre><code>01-11 18:49:00.507: ERROR/AndroidRuntime(3461): android.util.AndroidRuntimeException: requestFeature() must be called before adding content01-11 18:49:00.507: ERROR/AndroidRuntime(3461):     at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:181)01-11 18:49:00.507: ERROR/AndroidRuntime(3461):     at com.android.internal.app.AlertController.installContent(AlertController.java:199)01-11 18:49:00.507: ERROR/AndroidRuntime(3461):     at android.app.AlertDialog.onCreate(AlertDialog.java:251)...</code></pre><p>at the line of <code>dialog.show()</code>. What should I be doing to get rid of this?</p>","319618","","","","","2012-12-30 17:16:49","Dialog problem: requestFeature() must be called before adding content","<android><dialog>","4","0","","",""
"4661498","1","4661704","","2011-01-11 18:59:41","1","345","<p>I would like to know if spammers have the capabilities to download, crawl and spam mobile apps like they do for web apps. More specifically, is it necessary to authenticate users to the extent that web apps have to? (i.e. captchas or verification links sent to user's email)</p><p>Any insight you could provide or even links to other information on this topic would be much appreciated. Thanks!</p><p>Also, here is some information more specific to my scenario in case this helps:</p><p>I have an existing web app and am currently writing iphone/android apps as an extension of the web app. The web apps and mobile apps use the same database information.</p><p>In my web app, I require users to click a link in their email to activate their account after they fill out a ""create account"" form. However, I would like users to be able to create an account on the mobile app as well but definitely don't want them to have to exit the app to go check their email to click on a link. Ideally, they could just create an account on the mobile app and start using it right away.</p><p>My fear is that automated spam bots could create false accounts without any verification on the mobile apps and thus spam the site. Any logged in user is able to add content that is viewable to everyone. Thus, even though sites like Twitter allow a user to create an account on their mobile app and begin using it before verifying the email address, if spam bots have the capability of downloading my app, creating accounts, and posting stuff, then I need to find another way. </p>","205808","","","","","2011-01-11 19:55:07","Do I need to worry about spam on a mobile app?","<iphone><android><mobile><spam-prevention>","4","0","","",""
"4661664","1","4738699","","2011-01-11 19:19:36","0","1752","<p>I'm developing a native apk for android with NDK 5.</p><p>My question is, how do I access to write and read from external SD card from native code?</p><p>PS: Testing under Galaxy Tab.</p>","558433","","","","","2011-03-14 10:51:09","Acess External SD card with NDK","<android><android-ndk>","2","0","","",""
"4661703","1","4662579","","2011-01-11 19:25:01","1","3848","<p>This is my first tabbed application for Android. I walked through the ""HelloTabWidget"" app on androids website, but I can't figure out how to add content to the tabs. The FrameLayout stacks stuff on top of each other to the top left (from what I've read). I added a couple of textviews and an imageView, but it only displays the last item added. Is there a way to use Linear Layout instead of Frame Layout? If not, how can you place multiple views in the tab? The only thing I have done different from the example is I added a 4th tab. In one of the tab Activities I inserted the following code to try to get multiple items to display:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);            TextView textview = new TextView(this);        textview.setText(""This is the About tab"");        setContentView(textview);        TextView textview2 = new TextView(this);        textview2.setText(""About Test"");        setContentView(textview2);        ImageView imgView = new ImageView(this);        imgView.setImageDrawable(getResources().getDrawable(R.drawable.header));        setContentView(imgView);    }</code></pre><p>Here is the link to the example I followed:<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>","469194","","","","","2011-01-11 20:58:36","Android TabHost Layout Question","<android><android-tabhost><android-linearlayout><framelayout>","2","0","","",""
"4661744","1","4661932","","2011-01-11 19:29:18","1","653","<p>I am trying to implement a custom view, for which I want to be able to pass parameters via an XML layout file.  The catch is these parameters will be more or less arbitrary; they will eventually be used as parameters to construct a URL (it's not worthwhile to build and maintain a complete list of valid params).</p><p>As such, the method in ApiDemos sample code is not necessarily appropriate, given I do not know the names of the parameters.</p><p>What I have attempted to do is the following:</p><pre><code>public Chart(Context context, AttributeSet attributes) {    super(context, attributes);    params = new HashMap&lt;String, String&gt;();    for(int i = 0; i &lt; attributes.getAttributeCount(); i++)         params.put(attributes.getAttributeName(i), attributes.getAttributeValue(i));}</code></pre><p>This may not be the best way to go about this.. but the main issue I have is how do I filter out android: attributes (ie. I don't want android:layout_height, etc. to be in params)?</p>","534173","","","","","2011-01-11 19:51:39","Passing XML parameters to custom views","<android><android-widget><android-layout>","1","0","","",""
"4661809","1","","","2011-01-11 19:36:46","0","493","<p>Frequently, when I play an audio media files from internal storage or SD card, I frequently get this [below] error. I see from <a href=""http://android.git.kernel.org/?p=platform/external/opencore.git;a=blob;f=pvmi/pvmf/include/pvmf_return_codes.h;h=ed5a2539ca85ae60425229be41646b6bd7d9389c;hb=HEAD"" rel=""nofollow"">android.git.kernel</a> what those errors stand for, but for the life of me I can't learn more. I've tried multiple formats, renaming files, etc., but to no avail. The problem is not consistent, and I don't -yet- know why. Anyone?</p><blockquote>  <p>9  Return code for general success    40  */    41 const PVMFStatus PVMFSuccess = 1;</p>    <p>Error due to request not being supported    76  */    77 const PVMFStatus PVMFErrNotSupported = (-4);</p></blockquote><pre><code>01-11 19:04:33.687: DEBUG/MediaPlayerService(1104): player_type: PV_PLAYER**01-11 19:04:33.695: ERROR/PlayerDriver(1104): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported**01-11 19:04:33.695: WARN/PlayerDriver(1104): PVMFInfoErrorHandlingComplete01-11 19:04:33.695: WARN/MediaPlayer-cpp(4893): info/warning (1, 26)01-11 19:04:33.695: INFO/MediaPlayer(4893): Info (1,26)**01-11 19:04:33.703: ERROR/MediaPlayer-cpp(4893): error (1, -4)**01-11 19:04:33.703: WARN/System.err(4893): java.io.IOException: Prepare failed.: status=0x1</code></pre>","564140","","564140","","2011-01-12 00:05:42","2011-01-12 15:01:42","How do you trace a ""PVMFErrNotSupported"" error beyond it's return code?","<java><android><media-player><avaudioplayer>","1","0","","",""
"4661836","1","4705839","","2011-01-11 19:41:16","3","2779","<p>According to <a href=""http://www.youtube.com/watch?feature=player_profilepage&amp;v=PLM4LajwDVc#t=854s"" rel=""nofollow"">this</a> Android C2DM keeps a socket alive with a heartbeat mechanism, making it able to receive push messages. This made me hope I could deliver messages to sleeping phones with an active wifi connection.</p><p>I've made an implementation setting the ""delay_while_idle"" to '0'. The message is delivered if my phones' screen is powered off, but not if the phone goes to sleep (tested with intervals 20mins, 1-6 hours).</p><p>I have acquired a partial cpu lock + a full wifi lock just in case.</p><p>Have I simply made something fundamentally wrong or did I misunderstand the C2DM push functionality?</p><p>Can I send messages to sleeping phones or not?</p>","554284","","469983","","2011-10-27 08:48:24","2011-10-27 08:48:24","Android C2DM sleeping phone","<android><android-c2dm>","1","3","1","",""
"4661843","1","4662618","","2011-01-11 19:42:05","1","1270","<p>I am running into a strange issue with notification icons in my application.</p><p>My application sends and receives data via bluetooth.  When the application is started it creates a notification icon of the application (icon.png).  It will then see there is no bluetooth device connected and change the icon to (warn.png).  The issue is, when the status bar at the top shows warn.png, under the on-going notification drop down it has the origional icon (icon.png) with the text ""No Bluetooth Device connected"".  When a bluetooth device does connect, the status bar icon changes back to the origional icon (icon.png) but under the on-going notification it has the warn icon with the message ""Connection Established"".  </p><p>Below is the code I used:</p><pre><code>private void notification_updates(String DISPLAY_TEXT, String ONGOING_TEXT, int ICON) {Intent intent = new Intent(this,GUI.class);intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK | intent.FLAG_ACTIVITY_SINGLE_TOP);try{    notification.setLatestEventInfo(Monitor.this, ""App_Name"",ONGOING_TEXT,             PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT));    notification.icon = ICON;    notification.tickerText = DISPLAY_TEXT;    notification.flags = notification.FLAG_ONGOING_EVENT; //on going events    notification.flags += notification.FLAG_NO_CLEAR; //no clear.    mManager.notify(APP_ID, notification);} catch(Exception e){    Log.e(TAG, ""Failed to Notifiy the notification manager (create):\n"" + e.toString());}</code></pre><p>}</p>","2206304","","","","","2011-01-11 21:08:20","Android Development Notification Icon Issues","<android><icons><notifications>","1","0","","",""
"4661906","1","","","2011-01-11 19:49:00","1","1052","<p>I'm trying to get the geolocation of the mobile device in a regular website, not a webview of an application or anything native like that. I'm getting a location, but it's highly inaccurate, the accuracy comes back as 3230 or some other outrageous number. I'm assuming that's in meters, either way it's not nearly accurate enough. By comparison, the same webpage on a laptop gets an accuracy of 30-40.</p><p>My first thought was that it was using the Network Provider instead of the GPS Provider, telling me where I am based on tower location and reach. A little research later I found <code>enableHighAccuracy</code> and set it true in the options that I pass. After including that, I still notice no difference.</p><p>Here's the test page's HTML/javascript:</p><pre><code>&lt;html&gt;  &lt;head&gt;    &lt;script type=""text/javascript"" src=""http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0""&gt;&lt;/script&gt;    &lt;script type=""text/javascript"" src=""http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js""&gt;&lt;/script&gt;    &lt;script type=""text/javascript""&gt;      function OnLoad() {        $(""#Status"").text(""Init"");        if (navigator.geolocation) {          $(""#Status"").text(""Supports Geolocation"");          navigator.geolocation.getCurrentPosition(HandleLocation, LocationError, { enableHighAccuracy: true });            $(""#Status"").text(""Sent position request..."");          } else {            $(""#Status"").text(""Doesn't support geolocation"");        }      }      function HandleLocation(position) {        $(""#Status"").text(""Received response:"");        $(""#Position"").text(""("" + position.coords.latitude + "", "" + position.coords.longitude + "") accuracy: "" + position.coords.accuracy);        var loc = new Microsoft.Maps.Location(position.coords.latitude, position.coords.longitude);        GetMap(loc);      }      function LocationError(error) {        switch(error.code) {          case error.PERMISSION_DENIED:            alert(""Location not provided"");            break;          case error.POSITION_UNAVAILABLE:            alert(""Current location not available"");            break;          case error.TIMEOUT:            alert(""Timeout"");            break;          default:            alert(""unknown error"");            break;        }      }      function GetMap(loc)  {        var map = new Microsoft.Maps.Map(document.getElementById(""mapDiv""), {credentials: ""Aj59meaCR1e7rNgkfQy7j08Pd3mzfP1r04hGesGmLe2a3ZwZ3iGecwPX2SNPWq5a"", center: loc, mapTypeId: Microsoft.Maps.MapTypeId.road, zoom: 15});      }    &lt;/script&gt;  &lt;/head&gt;  &lt;body onload=""javascript:OnLoad()""&gt;    &lt;div id=""Status""&gt;&lt;/div&gt;    &lt;div id=""Position""&gt;&lt;/div&gt;&lt;br/&gt;    &lt;div id='mapDiv' style=""position:relative; width:600px; height:400px;""&gt;&lt;/div&gt;  &lt;/body&gt;&lt;/html&gt;</code></pre><p>I'm testing this on a rooted MyTouch 3G running Cyanogen 6.1 stable, Android 2.2 and GPS is enabled. In case rooting was a problem, I have also had various friends and coworkers try the webpage on their non-rooted 2.0+ Android devices. Each phone had various effects on the accuracy, but none were better than 1000, I attribute this to the different carriers. I have not (but eventually will) tested with iPhone or other location-aware cell phones.</p>","160527","","186558","","2011-01-11 20:27:58","2011-01-11 20:27:58","Geolocation through Android's GPS Provider on a website?","<android><geolocation><gps>","0","1","","",""
"4661968","1","","","2011-01-11 19:57:07","1","274","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1657640/android-defer-to-camera"">Android Defer to Camera</a>  </p></blockquote><p>in Evernote's snapshot option it pulls up the camera and the interface looks almost exactly like the default Android camera app.  Did Evernote create their own or is there a way to access the default Camera app from your own app and send the pictures / video back to your app?</p><p>Basically I would like to use the default camera app because they already have all the camera settings, etc.  When I use the Camera according to Android SDK it just shows the camera preview without any of the camera settings options and capture button that the default Camera app has.</p><p>I don't mind creating it all myself, just wanted to know if there was a shortcut that I didn't know about.  Thanks!</p>","571818","","","","","2011-06-13 13:39:55","Android Camera usage and Evernote","<android><camera>","0","1","","2011-06-13 14:09:58",""
"4662038","1","4662396","","2011-01-11 20:03:40","0","1584","<p>i have a navigation bar on the bottom of the screen. I have a set of 3 buttons in this navbar, the buttons have an icon as background button there's no space between eachother. I've been searching in Google how to separate them from eachother but i haven't succeded. The questiion is: how can i separate them from eachother? here's is my xml code:</p><p><strong>Main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;    &lt;LinearLayout     android:layout_alignParentBottom=""true""     android:layout_centerHorizontal=""true""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:orientation=""horizontal""    android:background=""#5E767E""    android:gravity=""center""    &gt;        &lt;Button         android:layout_height=""wrap_content""         android:id=""@+id/back""         android:layout_width=""wrap_content""        android:background=""@drawable/button""        /&gt;        &lt;Button         android:layout_height=""wrap_content""         android:id=""@+id/home""         android:layout_width=""wrap_content""        android:background=""@drawable/button""        /&gt;        &lt;Button         android:layout_height=""wrap_content""         android:id=""@+id/next""         android:layout_width=""wrap_content""         android:background=""@drawable/button""        /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre>","526924","","","","","2011-01-11 20:40:51","how to separate icons from eachother android","<android><android-layout>","2","0","","",""
"4662236","1","8898839","","2011-01-11 20:24:35","1","3474","<p>Any ideas on how Google TV remote app on android platform works. I just tried it today. Paired it over wi-fi and it just started to work. What's the concept behind it? It does not seem to be using Bluetooth. So then how does it work without installing any component on the TV?</p>","260298","","19750","","2011-03-19 16:38:37","2012-01-17 17:15:33","How android remote control works with google TV","<android><google-tv>","2","1","1","",""
"4662310","1","","","2011-01-11 20:32:04","-1","682","<p>my apidemo.java</p><pre><code>public class ApiDemos extends Activity {private ListView lv1;static final String[] COUNTRIES = new String[] {    ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",    ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",    ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"" };    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    lv1=(ListView)findViewById(R.id.ListView01);    lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1 , COUNTRIES));}</code></pre><p>}</p><p>and in my main.xml, i have ListView  with id:ListView01</p><p>want i really want is, a webview for afghanistan, and for rest countries.on selecting them.</p><p><em><strong></em>*</strong><em>PLZ rply soon.....URGENT......<strong></em>**<em>*</em>***</strong>i hv to submit the project IN MY SCHOOL_<strong><em>_</em></strong></p>","571821","","1465910","","2012-09-29 11:17:31","2014-01-07 07:33:55","I have this listview, i want webview for every row in the list, seperate webview for every item","<android><android-listview><android-webview>","2","2","","",""
"4662572","1","4674201","","2011-01-11 20:58:03","0","493","<p>some seconds ago I was debugging my widget and I've found that the <code>onReceive</code> method is called even if my widget isn't on the home screen (it listens for <code>WIFI_STATE_CHANGED_ACTION</code> ). Even if the process of my widget isn't running, it will be started and the method called.The code in the manifest is the following:</p><p>    </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;receiver android:name=""WiFiWidget""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;            &lt;action android:name=""android.net.wifi.WIFI_STATE_CHANGED"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider""                    android:resource=""@xml/widget_info"" /&gt;    &lt;/receiver&gt;&lt;/application&gt;</code></pre><p>The method <code>onReceive</code> simply calls another method <code>toggleState</code> ( to change the wifi state ) and then updates the widget image ( from off to on image or viceversa ).</p><p>Obviously the call of the two methods toggleState and updateWidget ( and so the complete onReceive ) are useless if the widget isn't actually active on the home screen..</p><p>So, I want my <code>onReceive</code> called only if my widget is effectively placed on home screen..there's a way to do this? :)</p><p>thanks in advance for the answers</p>","167194","","167194","","2011-01-12 22:01:03","2011-01-12 22:01:03","onReceive called when it shouldn't","<android><android-widget><android-wifi>","1","2","","",""
"4662749","1","","","2011-01-11 21:14:33","0","110","<p>I am new to Android and mobile phones development. I want to develop an application that needs to have a total control over the ""phone"" of the smartphone, i.e. controlling all the communication of the GSM chip with the cellular system, accessing the SIM card identity that it sends (encrypted) to the cellular system, disabling the cellular antenna and resuming it back, and more of that kind...Can it be done with Android? Does the software (OS) have control over all of the phone components in a smartphone, or there are some parts that are done in the hardware level only? (I guess that the Android API won't enable me to do everything i want, but even theoretically is it possible if I recompile the OS after making the changes there?)Thanks!</p>","571886","","253056","","2011-01-11 21:30:32","2011-01-11 22:22:50","level of control of the os on the phone hardware","<android><hardware><sim-card>","1","0","","",""
"4662920","1","4662995","","2011-01-11 21:35:45","1","969","<p>I know there is way to parse Blender model by exporting it as OBJ (WaveFront) file and then parsing its (plaintext) contents, but this is silly when you're dealing with huge models. It just doesn't make sense to parse the file every time the application loads when the file itself is 5MB heavy (the obj file). </p><p>I came to an idea to parse it once and record all those coordinates into arrays and then just use them to draw the model, but not sure if this is the right way.</p><p>What is the recommended way to load Blender models into Android?</p>","584513","","","","","2011-01-11 21:46:06","What is the best way to render blender model in Android?","<android><opengl-es><blender>","2","0","","",""
"4662941","1","","","2011-01-11 21:38:43","7","1000","<p>My application has a SQLite database in the asset folder. When the user launches my application, the database is created and the tables too.</p><p>This works fine with a lot of devices (Nexus One, Htc Magic, SGS, X10… and even Htc Desire HD v2.2).My application works with all versions of Android (tested on my device (1.6, 2.2, 2.2.1 Htc Magic) and on the emulator (v1,5 until v2.3).</p><p>I have just a problem with <strong>HTC DESIRE HD v2.2.1 1.72.405.3.</strong></p><p>The logcat:</p><blockquote>  <p>android.database.sqlite.SQLiteException: no such table: LISTE: , while compiling: select _id from LISTE  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2833)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2854)  at android.app.ActivityThread.access$2300(ActivityThread.java:136)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2179)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:143)  at android.app.ActivityThread.main(ActivityThread.java:5068)  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:858)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  at dalvik.system.NativeStart.main(Native Method)  Caused by: android.database.sqlite.SQLiteException: no such table: LISTE: , while compiling: select _id from LISTE  at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)  at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)  at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)  at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)  at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:46)  at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:53)  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1417)  at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1387)  ... 11 more</p></blockquote><p>My application create the database but it doesn’t copy the tables of the file of the asset folder  in <code>data\data\packagename\databases\mydatabase</code>.</p><p>My code:</p><pre><code>public void createDataBase() throws IOException{ boolean dbExist = checkDataBase(); if(dbExist){  //do nothing - database already exist }else{  //By calling this method and empty database will be created into the default system path           //of your application so we are gonna be able to overwrite that database with our database.     this.getReadableDatabase();     try {   copyDataBase();  } catch (IOException e) {      throw new Error(""Error copying database"");     } }}private void copyDataBase() throws IOException{ //Open your local db as the input stream InputStream myInput = myContext.getAssets().open(DB_NAME); // Path to the just created empty db String outFileName = DB_PATH + DB_NAME; //Open the empty db as the output stream OutputStream myOutput = new FileOutputStream(outFileName); //transfer bytes from the inputfile to the outputfile byte[] buffer = new byte[1024]; int length; while ((length = myInput.read(buffer))!= -1){  if (length &gt; 0){   myOutput.write(buffer, 0, length);   }     } //Close the streams myOutput.flush(); myOutput.close(); myInput.close();}</code></pre><p>I think that the <code>copydatabase</code> function has a problem but I don't see.</p><p>This code works fine with all devices except the <strong>HTC DESIRE HD v2.2.1 1.72.405.3.</strong></p><p>What problems might exist here for the HTC Desire with the given version above? How can this be remedied?</p>","571908","","571908","","2011-01-11 22:00:39","2011-01-15 14:04:24","missing table in SQLite with specific version of HTC DESIRE HD","<android><sqlite>","1","2","3","",""
"4662952","1","","","2011-01-11 21:39:18","6","1485","<p>I have implemented the BackupAgent as described at <a href=""http://developer.android.com/guide/topics/data/backup.html"" rel=""nofollow"">Data Backup</a>, registered an API key and declared the BackupAgent in my Manifest.The Backup part work's quite well, I think; When I run <code>adb shell bmgr run</code> in command line, the following output appears in LogCat:</p><pre><code>01-11 22:23:09.002: DEBUG/PerformBackupThread(97): starting agent for backup of BackupRequest{app=ApplicationInfo{4547c5b8 com.meins.nightclock} full=false}01-11 22:23:09.002: DEBUG/BackupManagerService(97): awaiting agent for ApplicationInfo{4547c5b8 com.meins.nightclock}01-11 22:23:09.013: DEBUG/BackupManagerService(97): agentConnected pkg=com.meins.nightclock agent=android.os.BinderProxy@4536a7f801-11 22:23:09.032: DEBUG/BackupHelperDispatcher(9122): handling existing helper 'alarms' android.app.backup.FileBackupHelper@44e197b001-11 22:23:09.032: DEBUG/BackupHelperDispatcher(9122): handling existing helper 'prefs' android.app.backup.SharedPreferencesBackupHelper@44e1947801-11 22:23:09.032: VERBOSE/LocalTransport(97): performBackup() pkg=com.meins.nightclock01-11 22:23:09.032: VERBOSE/LocalTransport(97): Got change set key=alarms:alarms size=16 key64=YWxhcm1zOmFsYXJtcw==01-11 22:23:09.042: VERBOSE/LocalTransport(97):   data size 1601-11 22:23:09.062: VERBOSE/LocalTransport(97): Got change set key=prefs:com.meins.nightclock_preferences size=265 key64=cHJlZnM6Y29tLm1laW5zLm5pZ2h0Y2xvY2tfcHJlZmVyZW5jZXM=01-11 22:23:09.072: VERBOSE/LocalTransport(97):   data size 26501-11 22:23:09.072: VERBOSE/LocalTransport(97): finishBackup()</code></pre><p>The restore part on the other hand doesn't work at all, on <code>onReceive()</code> method is not called. When I reinstall my app, the only output which may (?) refer to the BackupAgent is</p><pre><code>01-11 22:14:01.042: DEBUG/vending(7426): [100] LocalAssetCache.updateOnePackage(): No local info for com.meins.nightclock</code></pre><p>When I run <code>adb shell bmgr restore com.meins.nightclock</code> it simply states <code>Unable to restore package com.meins.nightclock</code>.</p><hr><p>I am using the following implementation of <code>BackupAgentHelper</code></p><pre><code>package com.meins.nightclock;import java.io.IOException;import android.app.backup.BackupAgentHelper;import android.app.backup.BackupDataInput;import android.app.backup.BackupDataOutput;import android.app.backup.FileBackupHelper;import android.app.backup.SharedPreferencesBackupHelper;import android.os.ParcelFileDescriptor;import android.util.Log;public class MyBackupAgent extends BackupAgentHelper {    public static final Object[] DATA_LOCK = new Object[0];    private static final String PREFS_BACKUP_KEY = ""prefs"";    private static final String ALARMS_BACKUP_KEY = ""alarms"";    private DataLayerAlarms d;    @Override    public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data,            ParcelFileDescriptor newState) throws IOException {        if (d.backup() != 0)            return;        synchronized (DATA_LOCK) {            super.onBackup(oldState, data, newState);        }    }    @Override    public void onCreate() {        SharedPreferencesBackupHelper preferencesHelper = new SharedPreferencesBackupHelper(this,                getPackageName() + ""_preferences"");        addHelper(PREFS_BACKUP_KEY, preferencesHelper);        FileBackupHelper fileHelper = new FileBackupHelper(this, DataLayerAlarms.BACKUP_FILE);        addHelper(ALARMS_BACKUP_KEY, fileHelper);        d = new DataLayerAlarms(this);    }    @Override    public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState)            throws IOException {        Log.d(toString(), ""onRestore()"");        synchronized (DATA_LOCK) {            super.onRestore(data, appVersionCode, newState);        }        d.restore();    }}</code></pre><p>For the sake of completeness the relevant Manifest part:</p><pre><code>&lt;application    android:icon=""@drawable/icon""    android:label=""@string/app_name""    android:debuggable=""true""    android:backupAgent=""MyBackupAgent""&gt;    &lt;meta-data        android:name=""com.google.android.backup.api_key""        android:value=""AEdPqrEAAAAI4MsUOC-[...]"" /&gt;    ...&lt;/application&gt;</code></pre><hr><p>Does anyone know, why the BackupManager is unable to restore this package?</p>","415304","","810368","","2012-10-29 09:43:26","2014-03-20 23:39:54","BackupAgent: ""unable to restore package ...""","<android><android-backup-service>","1","1","","",""
"4662999","1","","","2011-01-11 21:46:43","1","515","<p>i would like to listen an mp3 file from the web when i m clicking a btn!i was trying to use something like:</p><pre><code>mp.setDataSource (http://....);mp.prepare();mp.start();</code></pre><p>but doesn't work..</p><p>also,i will have 10 btn that will do this job so i want to use prepare and stop in order to stop the mp3 if a second btn is pressed..please help!:)happy new year!</p>","519526","","519526","","2011-07-03 23:21:06","2012-10-31 17:17:19","streaming mp3 from a url","<android>","3","0","","",""
"4663092","1","","","2011-01-11 21:57:50","6","15412","<p>Im trying to make it so that when i click specific items in my listview, it will take me to specific screens. Does anyone know how to do this? Im using the code below for this</p><p>Furthermore. Im trying to make a single back button appear at the bottom of the listview. So far i can only make it appear on every entry in the listview, help would be greatly appreciated!</p><pre><code>import android.app.Activity;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;public class Advertise extends ListActivity {    /** Called when the activity is first created. */    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        // Create an array of Strings, that will be put to our ListActivity        String[] names = new String[] { ""Linux"", ""Windows7"", ""Eclipse"", ""Suse"",                ""Ubuntu"", ""Solaris"", ""Android"", ""iPhone"" };        // Use your own layout and point the adapter to the UI elements which contains the label        this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.advertise,                R.id.label, names));    }    @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        // Get the item that was clicked        Object o = this.getListAdapter().getItem(position);        String keyword = o.toString();        Toast.makeText(this, ""You selected: "" + keyword, Toast.LENGTH_LONG)                .show();        {        }     }}</code></pre>","571928","","","","","2013-03-19 18:30:36","Android- Open new activity on listview clicks","<android><android-widget>","1","2","1","",""
"4663204","1","4664158","","2011-01-11 22:10:43","0","255","<p>In android, there is the ListActivity. However, what if I want multiple lists in the same Activity? For instance:</p><h2>Vehicles    [Add Vehicle]</h2><p>1999 Ford Focus<br>2001 Nissan Altima</p><p><br /></p><h2>Drivers    [Add Driver]</h2><p>John Doe<br>Jane Doe</p><p>How would I create a view like what you see above?  The list of vehicles and list of drivers would be populated based on <code>List&lt;Vehicle&gt;</code> and <code>List&lt;Driver&gt;</code>, respectively.</p><p>I want functionality like the <code>&lt;h:DataTable&gt;</code> in JSF.</p><p>Also, I know about the TableLayout. However, that doesn't help me since I can't attach an array adapter to it or anything like that.</p>","43222","","","","","2011-01-12 00:16:17","Android: viewing tabular data","<java><android>","1","2","","",""
"4663208","1","4663222","","2011-01-11 22:11:05","0","293","<p>what is the easiest way to set some GUI element to a specified color without implementing your own canvas or view or even opengl es.</p><p>thanks!</p>","97688","","","","","2011-01-11 22:13:04","android layout: easiest way to set up a colored square","<android>","1","0","","",""
"4663215","1","","","2011-01-11 22:12:29","4","1237","<p>I'm developing an Android app as well as a website (that does have communication with the Android client as well).  I want to use FB login, but the problem I see is this:</p><p>Client, Use FB login and then gets an access_token.</p><p>How does Client and Web Server communicate just using this access_code since the Web Server needs to know which account the Client is referring to.  I also want to implement FB login on the web site as well.</p><p>One method I was thinking was:</p><p>Client Login:1) Use FB login and get access_token.2) Use access_token to get some User info.3) Give access_token and User info to web server.4) Web server also performs the same FB operation with the access_token and retrieves the User info.5) Validate the User info matches and determine the user account based on that.6) Establish another access_token between Client and Web Server for this link.</p><p>Does this even make it any more valid or perhaps just doing the login and retrieving the user email address as the actual account and tell the Web Server this is the account to use.</p><p>Or has someone done this in another way?</p>","571818","","","","","2011-07-21 05:21:15","Android Facebook login and to web server","<android><web-services><facebook><login>","1","2","","",""
"4663224","1","4663422","","2011-01-11 22:13:09","1","13404","<p>I have some working code in python that I need to convert to Java.</p><p>I have read quite a few threads on this forum but could not find an answer. I am reading in a JPG image and converting it into a byte array. I then write this buffer it to a different file. When I compare the written files from both Java and python code, the bytes at the end do not match. Please let me know if you have a suggestion. I need to use the byte array to pack the image into a message that needs to be sent over to a remote server.</p><p>Java code (Running on Android)</p><h2>Reading the file:</h2><pre><code>File queryImg = new File(ImagePath);int imageLen = (int)queryImg.length();byte [] imgData = new byte[imageLen];FileInputStream fis = new FileInputStream(queryImg);fis.read(imgData);</code></pre><h2>Writing the file:</h2><pre><code>FileOutputStream f = new FileOutputStream(new File(""/sdcard/output.raw""));f.write(imgData);f.flush();f.close();</code></pre><p>Thanks!</p>","442903","","59087","","2011-01-11 22:14:36","2012-04-18 00:09:45","Reading and writing binary file in Java (seeing half of the file being corrupted)","<java><android><file><binary>","2","3","1","",""
"4663242","1","","","2011-01-11 22:15:00","0","436","<p>Hey guys, I have application widget, and I want to send some data to the intent that is attached to PendingIntent, by clicking the widget.here's my code</p><pre><code>final int N = appWidgetIds.length;for (int i = 0; i &lt; N; i++) {    int appWidgetId = appWidgetIds[i];    Intent intent = new Intent(context, UpComingBDays.class);    if(bdaysAmount != 0){    Bundle bundle = new Bundle();    bundle.putIntegerArrayList(""WIDGETIDS"", tempAllIDS);    intent.putExtras(bundle);    System.out.println(""bund insertedddddddddddddd....................."");    }    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,        intent, 0);    RemoteViews remoteView = new RemoteViews(context.getPackageName(),        R.layout.widget_layout);    remoteView.setTextViewText(R.id.widget_text, finalText4TextView);    remoteView.setOnClickPendingIntent(R.id.WidgetImageButton, pendingIntent);    appWidgetManager.updateAppWidget(appWidgetId, remoteView);}super.onUpdate(context, appWidgetManager, appWidgetIds);</code></pre><p>I realize always ""bund insertedddddddddd......"" is printed on CatLog, but the intent's bundle is null.</p><p>what is incorrect? how can i send data by clicking on widget.plz dont offer to use services as my code does not have anything with it.many thanks.</p>","536853","","","","","2011-09-28 17:06:39","Application widget with bundle?","<android><android-widget>","2","0","","",""
"4663314","1","4663384","","2011-01-11 22:22:02","2","2580","<p>The CheckBox class extends the CompoundButton, but add nothing to it. But some how it obtains it's respective look. I found some declarations in Android sources, but wonder how they are mapped to CheckBox class?</p><pre><code>public class CheckBox extends CompoundButton {    public CheckBox(Context context) {        this(context, null);    }    public CheckBox(Context context, AttributeSet attrs) {        this(context, attrs, com.android.internal.R.attr.checkboxStyle);    }    public CheckBox(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }}</code></pre><p>Styles</p><pre><code>&lt;style name=""Theme""&gt;    &lt;item name=""checkboxStyle""&gt;@android:style/Widget.CompoundButton.CheckBox&lt;/item&gt;&lt;/style&gt;&lt;style name=""Widget.CompoundButton.CheckBox""&gt;    &lt;item name=""android:background""&gt;@android:drawable/btn_check_label_background&lt;/item&gt;    &lt;item name=""android:button""&gt;@android:drawable/btn_check&lt;/item&gt;&lt;/style&gt;</code></pre><p><strong>EDIT:</strong></p><p>Probably I was not clear... I understand how the drawable assigned to Widget.CompoundButton.CheckBox style, but how this style assigned to CheckBox class? I see the "".CheckBox"" in the style name, but is this naming convention really what makes the trick? If so, what are the rules? If I derive MyCheckBox from CompoundButton, can I just define the Widget.CompoundButton.MyCheckBox style and it will work? </p>","62192","","62192","","2011-01-11 22:41:42","2011-01-11 22:51:52","How does the CheckBox obtain it's respective drawables?","<android><checkbox><coding-style>","2","0","1","",""
"4663402","1","","","2011-01-11 22:29:04","1","1742","<p>Could anyone tell me how to upload/install the android application, which I created with eclipse, to galaxy tab? Thanks in advance.</p>","524496","","","","","2011-01-11 23:13:17","How to upload my android application to galaxy tab","<android>","2","0","","",""
"4663449","1","","","2011-01-11 22:33:10","0","328","<pre><code>final Intent intent = new Intent(Intent.ACTION_SEND);   intent.setType(""text/plain"");   intent.putExtra(Intent.EXTRA_SUBJECT, ""From my site"");   intent.putExtra(Intent.EXTRA_TEXT, card.text + ""\n\n""     + ""Sent from my site "" + "" ""     + ""http://www.mysite.com"");   startActivity(intent);</code></pre><p>I did this in my application, and after sending the email my application exits, but I don't want it to. After sending the email I want it to return to the screen from my app. Can anyone help me with this?</p>","556163","","319618","","2011-01-11 22:49:23","2011-01-11 23:56:00","How to get the current screen after sending a mail from the app in Android","<android><android-intent>","1","0","","",""
"4663582","1","4663595","","2011-01-11 22:49:56","1","135","<p>This question might be silly...but still:I would like to learn the Android SDK, now I dont have an Android based phone,Can I still develop for it even if I dont own an android phone?</p><p>thanks</p>","427306","","","","","2011-01-11 22:54:01","Android Applications Development without device","<java><android>","3","0","","",""
"4663617","1","4664603","","2011-01-11 22:54:06","0","337","<p>My app is crashing when the map item is selected from my menu.  I think I am doing one of two things (if not both) wrong.  1 - In my menu switch statement I'm not calling the new activity (map) correctly. 2 - My map activity isn't configured correctly.</p><p>FriendsApp.java (I excluded unnecessary bits):</p><pre><code>public class FriendApp extends Activity {/** Called when the activity is first created. */ WebView mWebView;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""http://example.com/myfrienddash.php"");    mWebView.setWebViewClient(new FriendWebViewClient());}//Tell main menu what to do when elements are clicked@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case FRIENDS:     mWebView.loadUrl(""http://example.com/myfrienddash2.php"");        return true;    case MAP:        Intent friendMap = new Intent(FriendApp.this, FriendMaps.class);        startActivity(friendMap);        return true;    case SEARCH:     mWebView.loadUrl(""http://example.com/myfrienddash3.php"");     return true;    case INFO:     mWebView.loadUrl(""http://example.com/myfrienddash4.php"");     return true;    case QUIT:     finish();     return true;    default:        return super.onOptionsItemSelected(item);    }}}</code></pre><p>FriendMaps.java:</p><pre><code>public class FriendMaps extends MapActivity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mapview);    MapView mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);    BuoyItemizedOverlay itemizedoverlay = new BuoyItemizedOverlay(drawable, mapView.getContext());    double longitude = 44.5;    double latitude = -63.4; GeoPoint point = new GeoPoint((int)(longitude * 1E6),    (int)(latitude * 1E6)); OverlayItem overlayitem = new OverlayItem(point, ""what you talking aboot"", ""eh!""); itemizedoverlay.addOverlay(overlayitem);    mapOverlays.add(itemizedoverlay);} //Not using route feature so return false (must be set) @Override protected boolean isRouteDisplayed() {  // TODO Auto-generated method stub  return false; } }</code></pre><p>I am currently just statically adding some coordinates to get it working.</p><p>Any help is appreciated.</p><p>Added 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.company.friendapp""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".FriendApp""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""9"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;activity android:name="".FriendMaps"" android:label=""@string/app_name""     android:theme=""@android:style/Theme.NoTitleBar"" /&gt;&lt;/manifest&gt; </code></pre>","570509","","570509","","2011-01-12 01:32:09","2011-01-12 01:35:31","MapView menu item crashing when loading attempting to load map","<java><android><maps>","1","4","","",""
"4663651","1","","","2011-01-11 22:59:47","9","4323","<p>The title pretty much says it all, but let me provide some more details.</p><p>What we are trying to accomplish is to build a mobile server platform.  We already have a server platform written in Java, that runs on a Tomcat server.  It provides web interfaces, and web service interfaces to clients.  </p><p>This system was built, like most web apps are, to perform in a fixed location.  </p><p>Now, we need to be able to take the web services and server software to remote, unconnected locations.  </p><p>Our idea is, that we will use an Android tablet with Wifi enabled as a server for the clients local to the device.  The server will do its thing running on the tablet to serve local clients, then once the tablet comes back within range of a 3G/4G/EDGE or whatever network, the tablet will uplink the data collected to a master server.   </p><p>The number of clients that could be served is relatively small - no more than 20 or so at a time.  The volume of traffic would be small in the &lt;32K per second range per client, and further the web server and applications have a relatively small footprint.</p><p>If we wanted to go about setting up this stuff on Android, first, is it even possible without rooting the devices?  Second, if it is possible would it run with any kind of decent performance?</p><p>Thanks in advance!</p>","134073","","","","","2013-04-28 11:07:40","Is it possible to run a Tomcat server and a few web applications on an Android device? (ie. a tablet)","<java><android><web-services>","4","3","2","",""
"4663752","1","4673209","","2011-01-11 23:13:51","13","9321","<p>I'm attempting to get a user-chosen theme and feel like I'm frustratingly close. Defining the theme in <code>AndroidManifest.xml</code> works as it should, but (as best I can tell) can't change based on app preferences:</p><pre><code>&lt;application     android:theme=""@style/theme_sunshine""     android:icon=""@drawable/icon""     android:label=""@string/app_name""&gt;</code></pre><p>Alternatively, setting it dynamically in each activity also works:</p><pre><code>someChosenTheme = PreferenceManager.getDefaultSharedPreferences(this).getString(""themePreference"", ""theme_twilight"");setTheme(someOtherChosenTheme);</code></pre><p>But that seems messy, and I'd rather set the theme for the entire app in one place. My first thought was to grab the application context as soon as my main activity launches and do it there:</p><pre><code>getApplicationContext().setTheme(R.style.theme_dummy);</code></pre><p>As best I can tell, <a href=""http://developer.android.com/reference/android/content/Context.html#setTheme%28int%29"">this</a> ought to do the trick, but in fact it's not doing anything - the entire app has the default Android style. Is the above valid, and if so, might I be doing something else dumb?</p><p>I'm working in API level 3 if that matters. Prods in the right direction greatly appreciated!</p><p><a href=""http://stackoverflow.com/questions/3475207/multi-theme-support-in-android-app"">Related question.</a></p>","118220","","29995","","2012-05-05 15:38:36","2012-05-05 15:38:36","Switching application-wide theme programmatically?","<android><themes><android-theme>","2","0","4","",""
"4663762","1","4663811","","2011-01-11 23:15:21","0","481","<p>I am the author of a yet another one navigation application. My users ask me if I can implement location sharing among dynamically defined set of users. It means that it should be not like friends in Google Latitude but like some crew performing some short term task in open area. That's why I do not want to use those community-like location sharing services (may be I'm wrong?) nor I want to support such service by myself.</p><p>I'm thinking of some more general and convenient way of communication like SMS or e-mail. But I'm not sure that I can use them transparently in Android.</p><p>So I will highly appreciate any hints, clues and starting points.</p><p>P.S. By 'real time' I surely mean pseudo-real like 5-30 times per minute.</p>","488489","","","","","2011-01-12 02:40:56","How to share data between users in real time on Android?","<android><social-networking><sharing>","2","0","1","",""
"4663870","1","","","2011-01-11 23:31:42","16","13174","<p>I'm a .NET developer with 10 years experience developing Web &amp; Mobile Apps. I'm looking to branch into iPhone (and possibly Android) development. I'm looking at two products:</p><p>Appcelerator Titanium (http://www.appcelerator.com/)andMonoTouch (http://monotouch.net/)</p><p>I like MonoTouch because of it's standing in the Mono development communitity and it's C#. In saying that Appcelerator looks very straight forward using HTML and Javascript and targets Android too (which is overtaking the iPhone). </p><p>The apps I'm looking to develop are line of business applications with data entry, syncing with back office, etc. </p><p>Can anyone give their opinion on the pro's / con's of using these tools or any experiences. I'm very interested in any thoughts !</p><p>Thanks in advance,Ciaran</p>","319721","","","","","2012-02-09 13:21:50","Appcelerator Vs. MonoTouch - Which one is best for a .NET developer?","<iphone><android><monotouch><appcelerator>","5","1","7","2013-02-25 13:27:35","2011-06-18 15:53:24"
"4663912","1","4669213","","2011-01-11 23:38:00","7","3967","<p>I tried to decrypt a 4.2 MB .dcf file using AES 128 bit key, but it took 33 seconds to decrypt (on function cipher.doFinal(data)), is it normal ?</p><p>Here is a code snippet:</p><pre><code>long start = System.currentTimeMillis()/1000L;            try {                SecretKeySpec skeySpec = new SecretKeySpec(key, ""AES"");                Cipher cipher = Cipher.getInstance(""AES/CBC/PKCS5Padding"");                cipher.init(Cipher.DECRYPT_MODE, skeySpec, ivspec);                 android.util.Log.d(""TEST"", ""Start decoding...."" + String.valueOf(length));                byte[] decrypted = cipher.doFinal(content);                File file2 = new File(Environment.getExternalStorageDirectory().getPath() + ""/test.mp3"");                OutputStream os = new FileOutputStream(file2);                os.write(decrypted);            } catch (Exception ex) {                ex.printStackTrace();            }            long end = System.currentTimeMillis()/1000L;            android.util.Log.d(""TEST"",""Time ""+ String.valueOf(end-start));</code></pre>","431041","","","","","2011-06-18 12:53:58","Slow AES decryption in Android","<android><encryption><aes>","1","5","2","",""
"4663929","1","4673501","","2011-01-11 23:40:22","4","1325","<p>I have the following JNI wrapper C++ code:</p><pre><code>#include ""map_container.h""extern ""C"" {    JNIEXPORT void JNICALL Java_com_map_Map_openMapNative(JNIEnv* env, jobject thiz, jstring path);};static map_container* map = NULL;void Java_com_map_Map_openMapNative(JNIEnv* env, jobject thiz, jstring path){  const char* filename_utf8 = env-&gt;GetStringUTFChars(path, false);  if ( mapview )  {    delete mapview;    mapview = NULL;  }  mapview = new map_container((char*)filename_utf8);  if (filename_utf8)  {    env-&gt;ReleaseStringUTFChars(path, filename_utf8);  }}</code></pre><p>and have <code>com.map.Map.openMapNative</code> declared as static which means that I can operate one map at a time. How do I modify this C++ code so that <code>map_container* map</code> becomes not static and belongs to the exact instance of <code>com.map.Map</code> class? <code>map_container</code> is totally C++ class and has no reflection in Java.</p>","488489","","189950","","2011-01-11 23:44:41","2013-02-10 12:59:59","How do I make JNI method call not static when using native C++ objects?","<android><jni><android-ndk>","3","0","","",""
"4663951","1","","","2011-01-11 23:44:03","2","1121","<p>I am trying to build a coverflow UI on an Android web application using HTML,CSS, JavaScript and some images.</p><p>CSS 3D transforms, which are supported in Safari sine 2009 and on the iPhone since version 2.0, is not supported well on the Android. worse then that, the implementation is buggy on Android 2.1 and Android 2.2, and in each version in a different way.</p><p><strong>Any idea how can I build a coverflow UI on an Android web application using HTML,CSS, JavaScript and some images without CSS 3D transforms?</strong></p>","17781","","","","","2011-01-16 01:48:33","implement a coverflow UI in an Android web application","<android><css><3d><transform><coverflow>","1","2","","",""
"4664067","1","","","2011-01-12 00:02:39","2","934","<p>I know nothing about android platform and can't find answer to this basic question on internet.</p><p>Update: OK I cannot embed Android App per se. But can I embed something in Java in Android Webbrowser ?</p>","310291","","310291","","2011-01-15 09:12:40","2014-01-02 04:15:19","Can Android App be embedded in Web page like old plain java applet?","<android>","5","0","","",""
"4664172","1","4673143","","2011-01-12 00:18:07","0","637","<p>I have a simple app based on the Notepad demo application, and when a user is viewing/editing a note they can launch the dialog activity (TitleEditor) that allows them to change the title of a note.  Currently, when viewing/editing a note, the notes' current title is shown as the activity title.</p><p>So, I launch the TitleEditor dialog activity with startActivityForResult(), and in onActivityResult() I am successfully getting the new title back, no problem.</p><p>The issue relates to then updating the notes view/edit (the active activity) title...  using setTitle() in onActivityResult() with the data passed back does seem to set the title internally (a subsequent call to getTitle() shows the new title has been set), but the actual UI title is not updated until the activity is closed and then re-launched.</p><p>I've used setTitle() in onResume(), and it worked like a charm, but not working here... maybe due to the Activity being 'active'?  Is there any way to change the title of an active activity?</p><p>Thanks,</p><p>Paul</p>","357801","","","","","2011-01-12 19:30:43","Problem changing Activity title onActivityResult","<android><activity><title>","2","0","","",""
"4664180","1","4664344","","2011-01-12 00:19:03","0","668","<p>I show interstitial ads in my app, and I have defined a translation animation that is set to slide the ad in from right to left. The ad slides in just fine, but when the animation starts, the underlying Activity becomes completely black while the ad slides in. I would like to be able to see the underlying Activity and have the ad slide in over it. How do I keep the underlying Activity from being covered with black?</p>","413414","","","","","2011-01-12 00:46:13","Android: Screen goes black behind interstitial ad while it slides in","<android><animation><ads><interstitial>","1","0","","",""
"4664215","1","4664292","","2011-01-12 00:25:10","1","1965","<p>My app has a ListPreference, whose entries come from a network API.  In my PreferenceActivity's onCreate(), I spawn a background thread which makes the API call and then populates the entries of the ListPreference after one or two seconds.</p><p>If the user clicks the ListPreference button on the preference screen before the options have been downloaded, I want to prevent the preference dialog from showing and instead notify the user that the list of options is still being loaded.</p><p>I suspect that correct approach is to override the OnPreferenceClickListener, like this:</p><pre><code>ListPreference dpref = (ListPreference) findPreference(""debug"");String[] s = {""one"", ""two"", ""three""};dpref.setEntries(s);dpref.setEntryValues(s);dpref.setOnPreferenceClickListener(new OnPreferenceClickListener() {    @Override    public boolean onPreferenceClick(Preference preference) {        Toast.makeText(this, ""hi there"", Toast.LENGTH_SHORT).show();        return true;    }});</code></pre><p>The toast gets shown, but the ListPreference chooser dialog is shown as well.  The <a href=""http://developer.android.com/reference/android/preference/Preference.OnPreferenceClickListener.html"" rel=""nofollow"">OnPreferenceClickListener documentation</a> says that onPreferenceClick should return <code>true</code> if the click was handled, but returning <code>false</code> has the same result.</p><p>How do I prevent the preference dialog from showing?</p><p>Is there a better way to handle preferences whose options must be downloaded before viewing?</p>","554487","","","","","2014-03-08 10:34:26","Android: prevent preference dialog for preference which must be loaded over the network","<android><android-preferences>","6","0","1","",""
"4664315","1","4672283","","2011-01-12 00:41:04","0","601","<p>The app code is</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.view.View.OnClickListener;public class app extends PaymentActivity { @Override   public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);           setContentView(R.layout.main);           makePayment();           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?btnI&amp;q=zippyshare"" +q.getText().toString()));                 startActivity(i);                   }           });   } @Override protected void onPaymentCanceled(String arg0) {  // TODO Auto-generated method stub } @Override protected void onPaymentFailed(String arg0) {  // TODO Auto-generated method stub } @Override protected void onPaymentPending(long arg0, String arg1) {  // TODO Auto-generated method stub } @Override protected void onPaymentSuccess(String arg0) {  // TODO Auto-generated method stub }  }</code></pre><p>and the xml file is</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.musicdownloader""  android:versionCode=""1""  android:versionName=""1.0"" android:installLocation=""auto""&gt;  &lt;supports-screens    android:largeScreens=""true""    android:normalScreens=""true""    android:smallScreens=""true""    android:resizeable=""true""    android:anyDensity=""true""    /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;activity android:name="".app""&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:theme=""@android:style/Theme.Translucent.NoTitleBar"" android:name=""com.fortumo.android.FortumoActivity"" android:taskAffinity=""com.fortumo.android.FortumoActivity""/&gt;    &lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;    &lt;uses-permission android:name=""android.permission.VIBRATE"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.SEND_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_SMS"" /&gt;    &lt;uses-permission android:name=""android.permission.RECORD_AUDIO"" /&gt;    &lt;uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_CONTACTS"" /&gt;       &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;       &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;  &lt;uses-permission android:name=""android.permission.INSTALL_PACKAGES"" /&gt;  &lt;uses-permission android:name=""android.permission.READ_OWNER_DATA"" /&gt;  &lt;uses-permission android:name=""android.permission.WRITE_OWNER_DATA"" /&gt;  &lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;  &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;  &lt;uses-permission android:name=""android.permission.READ_CONTACTS"" /&gt;&lt;/application&gt;&lt;/manifest&gt;</code></pre><p>I want somebody to help me with fortumo in app payment.  Why does the app crash??</p>","514611","","54814","","2011-09-30 10:57:32","2011-09-30 10:57:32","Android app crash with fortumo in-app payments","<android><crash><in-app-purchase><fortumo>","1","2","","",""
"4664369","1","","","2011-01-12 00:50:16","1","1842","<p>The issue is unhighlighting bars which are no longer selected in a bar graph plotted by flot in a WebView on Android. Got no other issues drawing the actual graphs (which look beautiful for something so simple btw). I am not extremely knowledgeable in terms of javascript and web design/development but it seems little should have been needed, if it would just work!! :( I believe I'm following the Flot API correctly, if not someone please scream and yell at me.</p><p>Hoping someone has done this before, but if not I've got the minimal necessary code to poke at your droids if inquiring minds would like to test. I've tested on two Nexus Ones (both 2.2.1), and have tried targeting with Andriod 1.5 and 2.2 SDKs (my intention is to target 1.5 if possible). I've been attempting to hack away at this for far to long on my own now.</p><p>What happens:<br>1. Graph loads fine with bars. All bars unhighlighted.<br>2. Select a bar in graph, gets highlighted fine (and a tooltip  is placed).<br>3. Select a different bar in graph, old bar is unhighlighted, old tooltip removed, new bar highlighted and tooltip placed (still no problems).<br>4. Click in the vast darkness of the graph which should then unhighlight the last bar... but it doesn't.  </p><p>I've tried disabling flot's autohighlight and manually doing it as well to no avail. Looking into flot itself and only getting down to drawOverlay() where the issue seems to begin... An even more disturbing bug(?) appears if the fill bar option is enabled in the graph, but I'd rather just forget about that for now. I've tried with the latest version of flot from their svn (r290), but made no different from last public release (v0.6). As a complete guess I'm thinking it's an issue with WebKit's javascript implementation (or something specific to Nexus Ones, which wouldn't be so bad), but if there is any ugly hack to just get it to work I'm all ears.</p><p>I've thrown the graph data directly into the html/js, rather than deal with showing all the code involved in the Java->javascript handler and callbacks.</p><p>The html is placed in 'assets/stats_graph.html' with jquery.js and jquery.flot.js (this will load just fine on its own in firefox):</p><pre><code>&lt;!DOCTYPE html PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd""&gt;&lt;html&gt;  &lt;head&gt;    &lt;meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8""&gt;    &lt;script src=""jquery.js""&gt;&lt;/script&gt;    &lt;script src=""jquery.flot.js""&gt;&lt;/script&gt;    &lt;script id=""source"" language=""javascript"" type=""text/javascript""&gt;        var lastItem = null;        var plot = null;        $(document).ready(function () {            //window.testhandler.loadGraph();            // bind plotclick here            $(""#graphHolder"").bind(""plotclick"", function (event, pos, item) {                if (item) {                    var lastPoint = null;                    if (lastItem != null)                        lastPoint = lastItem.datapoint;                    if (!pointEquals(lastPoint, item.datapoint)) {                        //if (lastItem != null)                        //    plot.unhighlight(lastItem.series, lastItem.datapoint);                        lastItem = item;                        $(""#tooltip"").remove();                        //plot.highlight(item.series, item.datapoint);                             showTooltip(item.pageX, item.pageY, item.datapoint[1]);                    }                } else if (lastItem != null) {                    plot.unhighlight(lastItem.series, lastItem.datapoint); // not unhighlighting anything                    //plot.unhighlight(); // doesn't work either, supposed to unhighlight everything                    lastItem = null;                    $(""#tooltip"").remove();                     }            });            GotGraph();        });        /**         * Show a tooltip above bar in graph         * @param {int} x Left coordinate of div          * @param {int} y Top coordinate of div         * @param {String} contents text to place in div         */        function showTooltip(x, y, contents) {            $('&lt;div id=""tooltip""&gt;' + contents + '&lt;/div&gt;').css( {                position: 'absolute',                display: 'none',                top: y,                left: x,                border: '1px solid #fdd',                padding: '2px',                'background-color': '#fee',                opacity: 0.80            }).appendTo(""body"").fadeIn(200);        }        /**         * Draw the graph. This is a callback which will be called by Java         *          * @param {Object} seriesData         * @param {Object} seriesOptions         */         function GotGraph() { //seriesData, seriesOptions) {            var seriesData = [{                ""bars"":{""lineWidth"":2,""show"":true,""barWidth"":86400000,""align"":""center"",""fill"":false},                ""data"":[[1288569600000,10],[1288656000000,5],[1288742400000,12],[1288828800000,20],[1288915200000,14],[1289001600000,3],[1289174400000,22],[1289260800000,20],[1289347200000,10],[1289433600000,5],[1289520000000,12],[1289606400000,20],[1289692800000,14],[1289779200000,35]]}];            var seriesOptions = {                ""xaxis"":{""twelveHourClock"":false,""minTickSize"":[1,""day""],""tickSize"":[1,""day""],""timeformat"":""%d"",""mode"":""time""},                ""yaxis"":{""min"":0},                ""grid"":{""clickable"":true,""autoHighlight"":true,""hoverable"":false}};            plot = $.plot($(""#graphHolder""), seriesData, seriesOptions);        }        function pointEquals(point1, point2) {            if (point1 != null &amp;&amp; point2 != null &amp;&amp;                typeof(point1) == typeof(point2) &amp;&amp;                point1.length == point2.length) {                var i;                for (i=0;i&lt;point1.length;i++) {                    if (point1[i] != point2[i])                        return false;                }                return true;            }            return false;        }    &lt;/script&gt;  &lt;/head&gt;  &lt;body&gt;    &lt;div id=""graphHolder"" STYLE=""height:200px;width:400px""&gt;&lt;/div&gt;  &lt;/body&gt;&lt;/html&gt;</code></pre><p>The minimal amount of code necessary in onCreate in startup activity:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    WebView mytestView = new WebView(this);    mytestView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    setContentView(mytestView);    mytestView.setBackgroundColor(0);    mytestView.getSettings().setJavaScriptEnabled(true);    mytestView.setClickable(true);    mytestView.setFocusable(false);    mytestView.setFocusableInTouchMode(false);    mytestView.loadUrl(""file:///android_asset/stats_graph.html"");}</code></pre>","572002","","572002","","2011-01-12 21:23:22","2011-04-13 21:48:32","Using Flot's Bar Graph in an Android WebView with Highlighting","<javascript><android><charts><webview><flot>","1","4","1","",""
"4664465","1","","","2011-01-12 01:08:35","0","1164","<p>Is it possible, either through xml or otherwise, to have a spinner wrap it's content up to a certain max width?</p>","476382","","","","","2011-01-12 02:54:41","Spinner with wrap_content and max_width","<android>","1","0","","",""
"4664672","1","4665035","","2011-01-12 01:50:17","0","1370","<p>i am running Eclipse 3.5.0 on a MacBook Pro using the Android SDK. i noticed that on this particular project i am working on i cant seem to actually enter debug mode. i click the little green bug icon in the tool bar and the app starts and runs. but if i switch over to the Debug Perspective i see no indication that it is running in debug mode. furthermore i can not hit any brake points that i have set. this makes debugging code a bit hard. Other projects that i am working on don't have this issue. any ideas on what i need to change in the project to get this to work?</p>","572111","","","","","2011-01-12 03:15:21","clicking the debug button in Eclipse will not start debug mode","<android><debugging>","2","0","","",""
"4664680","1","","","2011-01-12 01:51:18","0","200","<pre><code>camera = Camera.open();Parameters params = camera.getParameters();params.setFlashMode(Camera.Parameters.FL…params.getFlashMode();int mXoom=8;mXoom= params.getMaxZoom();params.setZoom(mXoom);camera.setParameters(params);</code></pre>","572112","","12178","","2011-01-12 02:07:43","2011-01-12 02:07:43","I am creating an App which uses the camera. I need to set the camera to the highest zoom possible on start up. But no zoom happens","<android><parameters><camera><zoom>","0","2","","",""
"4664765","1","4664900","","2011-01-12 02:13:04","0","628","<p>I'm currently working on a simple Android app, and right now I am trying to get it to load in and play sounds.  The problem I am faced with is that I want the sound it uses to be based on a string (With the same name as the sound file).  The reason for this is simplicity in both the code and adding on to it.</p><p>Now unfortunately I can't just slap a string in place of referencing the actual sound, but is there some way for me to compare a string to the entire raw folder to find the matching sound, or some other alternative short of defining every sound manually?</p><p>Thank you for your time.</p>","571451","","","","","2013-08-21 15:40:01","Android Loading & Playing Sound Based on String","<android><string><audio><media-player>","3","1","1","",""
"4664791","1","","","2011-01-12 02:20:44","9","26880","<p>I am trying to create an intent that would open a pdf file on the web (a url) in a pdf reader.  It seems to only work if the file is local.</p><p>I know this is going to depend on whether or not any of the installed apps can handle urls, but since I have several pdf readers installed (some of them claim they can read pdfs on the web) and none of them are responding I wanted to see if there was something wrong with my intent.</p><p>Here is what I am currently using:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse(url), ""application/pdf"");</code></pre><p>Thanks</p>","445348","","","","","2013-08-12 12:53:46","What intent would open a pdf from a url?","<android><pdf><android-intent>","2","1","9","2014-01-24 12:05:36",""
"4664798","1","4664846","","2011-01-12 02:23:15","4","2352","<p>I am new to Android and I was wondering which book to refer for development. Can anyone help me in this regard ?? </p><p>Thanks! </p>","564844","","","","","2012-12-07 19:19:00","Android Book for development","<android>","4","3","1","2012-05-24 12:46:28",""
"4664801","1","4738392","","2011-01-12 02:24:14","0","212","<p>I have the following menu in my FriendApp that uses an Intent to call a MapView.  When I get to the FriendMaps I recreate the menu, but now wondering if I can return to a different page in my webview - I accomplish this in the webview menu by using loadUrl(); but not sure how to do this coming from the map view.</p><p>FriendApp Menu:</p><pre><code>    @Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case FRIENDS:        mWebView.loadUrl(""http://example.com/myfrienddash2.php"");        return true;    case MAP:        Intent friendMap = new Intent(FriendApp.this, FriendMaps.class);        startActivity(friendMap);        return true;    case SEARCH:        mWebView.loadUrl(""http://example.com/myfrienddash3.php"");        return true;    case INFO:        mWebView.loadUrl(""http://example.com/myfrienddash4.php"");        return true;    case QUIT:        finish();        return true;    default:        return super.onOptionsItemSelected(item);    }}</code></pre><p>Then once in the FriendMaps I just mimic that menu, but need to figure out how to return to different pages, instead of just loading the webview's ""main page"".</p><p>FriendMaps menu:</p><pre><code>    @Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case FRIENDS:        Intent friendApp = new Intent(FriendMaps.this, FriendApp.class);        startActivity(friendApp);        return true;    case MAP:        return true;    case SEARCH:        Intent friendApp2 = new Intent(FriendMaps.this, FriendApp.class);        startActivity(friendApp2);        return true;    case INFO:        Intent friendApp3 = new Intent(FriendMaps.this, FriendApp.class);        startActivity(friendApp3);        return true;    case QUIT:        finish();        return true;    default:        return super.onOptionsItemSelected(item);    }}</code></pre><p>So I need to figure out how to get my maps menu working like the first menu.</p>","570509","","","","","2011-01-19 17:13:46","Menu in MapView to return to a specific url in a WebView","<java><android><maps>","1","2","","",""
"4664834","1","","","2011-01-12 02:31:32","0","953","<p>Relevant question: <a href=""http://stackoverflow.com/questions/2205327/android-sqlite-one-to-many-design"">Android: SQLite one-to-many design</a></p><p>This is my first post on here, and it's also my first time dealing with databases. If there are any clarifications, or corrections I can make, please let me know. </p><p>I'm trying to set up an SQLite database to better store items collected from an RSS Feed. I'm trying to have a 3 table set-up. It looks like this:</p><p>Table 1: The Channel Table (items stay in constant order)</p><blockquote>  <p>_id | Feed Location | Channel Title | Channel Description | ...</p></blockquote><p><br/>Table 2: The Item Table (The items should be stored in chronological order for ease of access and deletion)</p><blockquote>  <p>_id | Item Title |...| Channel ID | ...</p></blockquote><p>Where Channel ID has the row number that the Channel the item is part of is located. </p><p>That part is pretty simple, but here's my problem. I want to be able to query items by the categories that are relevant to them. They're included in the XML that'll be parsed, and it'd be great to sort by those values. So I started to set up another table, and implement the same one-to-many relationship described above, but then I ran into a problem. Because the id's of those items are likely to change when more items are parsed, the id's aren't static, and I can't have the categories link the way I did earlier. Also, another challenge I found was the fact that each category might've ideally needed to point to many different items because the Items' could've been relevant to the same Category. </p><p>And that's where I'm stuck. </p>","572126","","","","","2011-01-12 08:16:22","Android: SQLite One-To-Many relationship on a table that has records changing orders frequently","<java><android><database><sqlite>","1","0","","",""
"4664860","1","","","2011-01-12 02:36:37","0","398","<p>Hey all I'm looking to edit my app so that when a text within an xml file is selected, a new window opens. I've found various ways of making a new screen open via a class, but I need it done from a xml file.  My program as a tablayout, and here is some of the stuff displayed within my first tab:</p><pre><code>&lt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;</code></pre><p>        android:id=""@+id/ScrollView01""<br>      android:layout_height=""wrap_content""<br>      android:layout_width=""fill_parent""> </p><p></p><pre><code>    &lt;TextView    android:textColor=""#FFFFFF""    android:text=""First Header here""    android:textStyle=""bold""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;&lt;TextView android:textColor=""#FFFFFF""    android:text=""First body text here""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;</code></pre><p>                    </p><p>So basically I need it so that when a text is selected, a new screen pops up.  As said the reason this specifically has to be done in xml is because this is all apart of a tab layout, It would be great if the next within each tab could open a a new screen. Thanks.</p>","560983","","","","","2011-01-12 02:50:49","Opening a new screen from xml file text","<android><xml><tabs><screen><new-operator>","2","0","","",""
"4664880","1","4664898","","2011-01-12 02:41:32","1","182","<p>First of all, I'm a newbie on Android programming, so please be detailed in your answers.</p><p>I have a layout main.xml file with format similar to</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 xmlns:android = ""http://schemas.android.com/apk/res/android""         android:orientation = ""horizontal""         android:layout_width = ""fill_parent""         android:layout_height = ""fill_parent""&gt;          &lt;EditText          android:id=""@+id/a""                android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         /&gt;         &lt;TextView            android:id=""@+id/xSquared""            android:layout_width = ""fill_parent""             android:layout_height = ""wrap_content""             android:text = ""@string/equationPart1""         /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout    ...    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>In my Java source file, I inflate the UI using command: setContentView(R.layout.main);</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);}</code></pre><p>However, when I run the emulator, the UI does not show up like what I expect. Instead, it just display a simple EditText text box.</p><p>I wonder what is going wrong. Is it because I put a layout inside another layout? I don't think there is any problem with that right?</p>","572124","","","","","2011-01-12 02:44:33","Android: Why my user Interface does not get drawn when I Inflate the resource layout file?","<android><layout><textview><edittext><android-linearlayout>","1","1","0","",""
"4664978","1","","","2011-01-12 03:00:44","2","699","<p>I am trying to create a menu that will behave much like the on-screen keypad of Android, wherein when press-holding a key with accented characters like ""i"", a popup menu for the accented characters is displayed. Then sliding the finger into the button of any accented character within the popup menu highlights/selects the button, and finally releasing the finger, inputs the accented character into the target textbox. I have seen this behavior in Android v2.3, but not on the older versions. Not sure if this is a new feature?</p><p>I would like to know how to handle the touch gesture such that main button (e.g. ""i"") will react to press and hold touch events, and then after the popup appears, the button for ""ï"" will react to the point and release touch events? The user will not need to release the finger, thus the motion will be a press-hold-slide-release between 2 buttons.</p><p>I have tried to find the code used in the Android keypad but was not successful as I only got directed to CharacterPickerDialog which does not show the press-hold-slide-release between 2 buttons, since it requires the user to release the finger before selecting a button in the popup menu.</p><p>Hope anyone can provide some info and insights on this. Thanks in advance!</p>","572143","","","","","2011-01-12 03:00:44","How to handle touch gesture for press-hold-slide-release between 2 buttons","<android><button><popupwindow>","0","0","3","",""
"4664997","1","","","2011-01-12 03:04:13","0","292","<p>I want to create an Android app which requires a function to be run every 30 seconds or so, even when the phone goes to sleep and the user isn't using it. Is this possible to do in Android with services, or do even they shut off when the phone goes to sleep?</p>","572146","","","","","2011-01-12 03:10:22","Continue performing a function while Android phone is asleep?","<android>","1","0","","",""
"4665106","1","4665397","","2011-01-12 03:32:48","5","5600","<p>A great example of the kind of Activity I'm trying to create is the gmail app settings Activity.  It lists all the customizable settings vertically with horizontal rules between each setting. There are variety of fields that usually look identical. For example: text fields usually display a bold heading with a description below and a circled triangle to the right. </p><p>What kind of viewgroup is the root view?What kind of view or viewgroup is each field?</p>","27763","","","","","2012-02-17 09:43:08","What is the typical layout structure of an Android settings activity?","<android><viewgroup>","1","0","","",""
"4665122","1","","","2011-01-12 03:37:32","5","2320","<p>It's extremely easy to get the Bitmap data in the NDK when working with Android 2.2, but with 2.1 and lower, the AndroidBitmap_lockPixels function is not available. I've been searching for the past few hours, but nothing has worked.</p><p>How can I access the pixel data of a bitmap without using that function? </p>","118241","","118241","","2011-01-14 19:09:52","2011-04-26 02:42:05","Android Pass Bitmap to Native in 2.1 and lower","<java><android><android-ndk>","3","2","1","",""
"4665164","1","","","2011-01-12 03:45:40","6","2480","<p>Does anyone know how (or if it's possible) to simulate a call to an actual device (i.e. USB debugging) using the DDMS in eclipse? I have no problems simulating calls to the emulator and the app I'm writing runs fine in both the emulator or the device.</p><p>Platforms:<br>IDE: eclipse on a mac<br>Android Device: droid incredible, usb debugging enabled<br>other: <code>&lt;application android:debuggable=""true""&gt;</code></p><hr><p>figured out you can't call an actual device from the emulator.</p>","572166","","881229","","2014-03-18 19:18:16","2014-03-18 19:18:16","Android DDMS - send calls to actual device","<android><telephony><ddms>","1","0","2","",""
"4665191","1","","","2011-01-12 03:53:15","0","309","<p>From the crash logs that I am getting from the Android market, I can seethat some of my users are getting Force Closes caused byNullPointerExceptions when my code tries to access views that are in myapplication.  In one example, my activity makes a call to findViewById()in onCreate() after I call setContentView().  I get an NPE when I try toaccess the view after the call to findViewById() (still in onCreate).What has me really scratching my head is that this does not happen allof the time (in fact most of the time the code acts as I would expect),but enough to have me concerned.</p><p>I could add code to <em>always</em> check for null and avoid the NPE, but Iwould like to understand what could be causing the sporadic behavior.</p><p>Does anyone know what could be causing this?</p>","419961","","","","","2011-01-12 05:45:24","Activity.findViewById returning null sporadically","<android>","1","1","","",""
"4665208","1","","","2011-01-12 03:57:53","0","326","<p>i want to assign the sound for my phone  if a call coming. so how can i catch event if other phone call my phone</p>","568658","","","","","2011-01-12 04:26:14","handle event android","<android><events>","1","2","","",""
"4665240","1","5316988","","2011-01-12 04:05:34","4","3009","<p>We are trying to build a PTT (push to talk) app. The idea is to send an audio file over the air from one device to another. Is Jingle the only logical choice, if so does anyone have any pointers on how to get this setup in an Android environment? + XMPP Or is there a better solution?</p><p>Worse case scenario I was thinking of having a C2DM push notification fly from one device to another and with every push payload notify the device where the audio file is on the server and have that unit stream the audio file, but it seems too flaky to do it this way, since the push notifications may not always be guaranteed, or it might take some time till it reaches the device, etc. The idea here is to have a real live experience and as fast as possible.</p><p>Any help is kindly appreciated.</p>","395458","","","","","2012-10-06 18:21:15","Jingle on Android and XMPP","<android>","2","0","0","",""
"4665459","1","","","2011-01-12 04:53:31","0","378","<p>I have an SQLite database where I have a table named object_zone. This table has two columns, of type integer: object and zone.</p><p>If I copy the database onto my computer, and query it with:</p><pre><code>SELECT object FROM object_zone WHERE zone = 791</code></pre><p>it returns several rows.</p><p>However, on my Android phone, if I query it with: </p><pre><code>Cursor cursor = database.query( ""object_zone"", new String[] {""object""}, ""zone = ?"", new String[] { Long.toString( zoneId )}, null, null, null);</code></pre><p>Where zoneId = 791, the cursor contains 0 rows. How have I stuffed up the usage of the query function?</p>","504055","","","","","2011-01-12 08:37:13","Issue with SQLite query in Android","<android><sqlite>","2","0","","",""
"4665465","1","4666012","","2011-01-12 04:54:28","0","712","<p>As my requirement is to display a horizontal graph. I have created that graph. But I need to add text before and after the bars, to indicate which bar is what in the graph. I did not get any idea after a brief research. Can any one give some suggestion to do that. Any response will be appreciated.</p><p>Here is my code to draw shapes in my view class.</p><pre><code>public class RectangleView extends View{private ShapeDrawable[] mDrawables1,mDrawables2;public RectangleView(Context context) {super(context);setFocusable(true);setBackgroundColor(0xFFFFFFFF);mDrawables1 = new ShapeDrawable[1];mDrawables2 = new ShapeDrawable[1];mDrawables1[0] = new ShapeDrawable(new RectShape());mDrawables2[0] = new ShapeDrawable(new RectShape());mDrawables1[0].getPaint().setColor(0xFF347235);mDrawables2[0].getPaint().setColor(0xFF348017);}@Override protected void onDraw(Canvas canvas) {Log.d(""0000000"",""9999999"");for (Drawable dr : mDrawables1) {int x1 = 10;int y1 = 45;int width1 = 200;int height1 = 20;dr.setBounds(x1, y1, x1 + width1, y1 + height1);dr.draw(canvas);y1 += height1 + 5;}for (Drawable dr : mDrawables2) {int x1 = 10;int y1 = 20;int width1 = 200;int height1 = 20;dr.setBounds(x1, y1, x1 + width1, y1 + height1);dr.draw(canvas);y1 += height1 + 5;}}}</code></pre><p>and now I have added this view in my activity using the addView() method. I want to place some text left to the bar and some value to the right of the bars.If any one experienced in this, please help me to add the text here. I would look forward to here your response quickly.</p><p>Thanks in advance</p>","524937","","244296","","2011-01-12 04:59:20","2012-08-17 05:33:57","how to add a text before a shape in a view dynamically?","<android>","1","0","","",""
"4665545","1","12363804","","2011-01-12 05:11:23","1","1159","<p>I am basically a embedded systems programmer on linux. However, I would like to try my hand at writing Android applications. With no previous Java experience, are there GUI toolkits or something that can help me. Or is it mandatory to learn Java.Any links, tips for newbies like me will be very helpful</p>","450338","","","","","2012-09-11 06:19:42","Can a systems developer with NO Java programming experience write Android Apps?","<java><android><programming-languages>","5","2","","",""
"4665582","1","","","2011-01-12 05:18:37","0","600","<p>I succeded to call activity from browser link with tag like this.</p><pre><code>&lt;a href=""myapp://launch.myapp.com/activity2?var1=linkClicked""&gt;my app&lt;/a&gt;</code></pre><p>of cource I added actvity setting in AndroidManifest.xml like this.</p><pre><code>&lt;activity android:name="".Activity2"" &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;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;         &lt;data android:host=""launch.myapp.com"" android:scheme=""myapp""         android:pathPrefix=""/activity2""&gt;&lt;/data&gt;   &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>I want to call back from the activity2 with a value.</p><p>Is there any way to receive some value from the activity that was launched by the browser like above?</p><p>In other words I want do something like onActivityResult in the browser andget a value from the activity and set the value on the web page which has launched the activity.</p>","353491","","","","","2012-05-25 13:37:25","How to call back (like onActivityResult) after launching activity from browser by clicking url?","<javascript><android><browser><callback><activity>","1","0","1","",""
"4665652","1","4668668","","2011-01-12 05:36:02","3","907","<p><br>There is 2 APIs, one for <code>QA</code>(testing and debugging ) and other for <code>Production</code><br>I need to run the <code>QA</code> api for debugging (that we created using eclipse) and <code>Production</code> api when we create market apk without changing the code. Is there any way to check using code whether it is debug apk or market apk currently running. Or anything that i can set in manifest<br>Thank you </p>","477754","","","","","2013-03-14 16:24:44","Discriminate Market apk and debug apk","<android><apk>","4","0","","",""
"4665849","1","","","2011-01-12 06:12:07","2","532","<p>I want to test video chatting on android phone through wireless LAN in our lab. However, most of the video chatting apps like Tango or Fringe require access to their server on the Internet. Is there a way for me to test video chatting without access to Internet server? Is setting up a SIP server a good alternative?</p><p>Thanks.</p>","195678","","","","","2011-01-12 06:12:07","video chatting on Android without Internet access","<android>","0","1","0","",""
"4665853","1","4675013","","2011-01-12 06:12:34","1","2548","<p>I've a <code>TableLayout</code> element in my <code>main.xml</code>:</p><pre><code>&lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TableLayout&gt;</code></pre><p>I don't want to hardcode the <code>ImageView</code> in <code>main.xml</code>.</p><p>How to embed the <code>ImageView</code> in <code>.java</code> ?</p>","477822","","477822","","2011-01-12 06:24:04","2011-01-12 23:05:50","How to populate the TableLayout with ImageView dynamically in android jdk?","<java><android>","1","1","1","",""
"4665889","1","4666112","","2011-01-12 06:19:56","0","148","<p>is it possible to do this with a loop so I dont have to type this 70 times for my rows?  This is for Android programming(Java).</p><pre><code> View row1 = findViewById(R.id.row1); row1.setOnClickListener(this); View row2 = findViewById(R.id.row2); row2.setOnClickListener(this); View row3 = findViewById(R.id.row3); row3.setOnClickListener(this); View row4 = findViewById(R.id.row4); row4.setOnClickListener(this); View row5 = findViewById(R.id.row5); row5.setOnClickListener(this); View row6 = findViewById(R.id.row6); row6.setOnClickListener(this);</code></pre>","572286","","572286","","2011-01-12 06:34:46","2011-01-12 06:57:54","setClickListeners with loop","<java><android><loops>","1","4","","",""
"4665931","1","4666072","","2011-01-12 06:26:42","1","1406","<p>I have a spinner in my home.class. When I click on the spinner, the process is stopped showing exception that WindowManager$BadTockenException is caught.</p><p>I am calling this home.class from main.class which extends ActivityGroup.</p><p>If I am simply run only the home.class, the spinner is showing all items. But the problem is only with calling home.class from main.class.</p><p>The following are my code. Please tell me why this is happened.</p><h2>main.class</h2><pre><code>public class main extends ActivityGroup{  public void onCreate(Bundle savedInstanceState)  {      super.onCreate(savedInstanceState);       Intent intent=new Intent(this,home.class);       View view=getLocalActivityManager().startActivity(""1"", intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();       setContentView(view);  }</code></pre><p>}</p><h2>home.class</h2><pre><code>String[] country={""Please selects"",""US"",""INDIA"",""UK""};Spinner s2 = (Spinner) findViewById(R.id.spinnerCountry);ArrayAdapter&lt;CharSequence&gt; adapterCountry=new ArrayAdapter(this,android.R.layout.simple_spinner_item,country);adapterCountry.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);s2.setAdapter(adapterCountry);s2.setOnItemSelectedListener(new OnItemSelectedListener(){     public void onItemSelected( AdapterView&lt;?&gt; parent, View view, int position, long id)     {            countryName=country[position];     }      public void onNothingSelected(AdapterView&lt;?&gt; parent)     {            countryName=country[0];      }</code></pre><p>});</p><h2>Stack</h2><p>Thread [&lt;1> main] (Suspended (exception WindowManager$BadTokenException))<br>    AlertDialog(Dialog).show() line: 245<br>    AlertDialog$Builder.show() line: 802<br>    Spinner.performClick() line: 260<br>    View$PerformClick.run() line: 9080<br>    ViewRoot(Handler).handleCallback(Message) line: 587     ViewRoot(Handler).dispatchMessage(Message) line: 92     Looper.loop() line: 123     ActivityThread.main(String[]) line: 3647<br>    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]<br>    Method.invoke(Object, Object...) line: 507<br>    ZygoteInit$MethodAndArgsCaller.run() line: 839<br>    ZygoteInit.main(String[]) line: 597     NativeStart.main(String[]) line: not available [native method]  </p><p>Thank You....</p>","523058","","523058","","2011-01-12 06:40:23","2011-01-12 06:51:28","Android :WindowManager$BadTockenException on Spinner Click","<android><spinner>","1","0","","",""
"4665942","1","","","2011-01-12 06:27:55","0","2653","<p>I am developing an application in android Which involves searching nearby locations and globally. I am facing a problem when i try to do live http streaming in android stimulator.What to do with live streaming....Anybody knows can respond how should i proceed....I have tried the code like url <a href=""http://stackoverflow.com/questions/4321682/android-source-code-streaming-media"">Android: source code Streaming Media</a></p><p><a href=""http://code.google.com/p/rxwen-blog-stuff/source/browse/trunk/android/streaming_audio/#streaming_audio%2Fres%2Fdrawable"" rel=""nofollow"">http://code.google.com/p/rxwen-blog-stuff/source/browse/trunk/android/streaming_audio/#streaming_audio%2Fres%2Fdrawable</a></p><p>Thanks in advanceTushar Sahni</p>","475349","","","","","2012-07-27 11:30:48","live http streaming in android","<android>","2","2","0","",""
"4665948","1","4665994","","2011-01-12 06:29:02","2","4829","<p>Can i get online users in my friend list via Smack API? Is it possible?</p><p>I am working on app which have chat between users. I had successfully created chat application example just entering name of friend and send chat, but now I want online friends list.</p>","544537","","194894","","2012-10-04 08:58:03","2014-02-12 12:53:11","Can I get online users in my friend list via Smack?","<android><api><smack>","4","0","3","",""
"4665959","1","","","2011-01-12 06:31:56","0","247","<p>When I am running a simple android application I'm getting ""Couldn't find .apk file"". Please help me to resolve this problem....</p><p>I'm Using </p><p>Eclipse SDKVersion: 3.6.1Build id: M20100909-0800OS:-Windows 7Android 2.2</p>","572297","","","","","2011-01-24 04:20:16","Could not find ContactPicker.apk!","<android>","1","1","","",""
"4665973","1","4666086","","2011-01-12 06:34:34","0","470","<p>Firstly, I am new to admob and this is my very first app that includes ads from admob.Just a simple question which I am not too sure about.I have uploaded my first app today and I have been refreshing the admob control panel? page every half an hour or so an the number of ad requests keep going up.I don't think I have anyone who has even downloaded the app and was wondering why it is going up and if that is a good or bad thing.Thanks.</p>","507007","","","","","2011-01-12 06:53:45","Android admob requests keep going up","<java><android><admob>","1","2","","",""
"4666023","1","4666073","","2011-01-12 06:42:31","0","61","<p>I am doing an app where i have to download some videos from my server and i have to store them in internal storage of android device, but the problem is when iam storing the video in internal storage then the android not allowing to play that video if i am saving the same video on SD card it's working fine why it is happening i want to play the video from local storage.</p><p>Thanks,Balaram.</p>","563593","","","","","2011-01-12 06:51:33","Serious problem in android","<android>","1","1","","",""
"4666055","1","4666144","","2011-01-12 06:49:19","1","1139","<p>What is the recommended way to put a header on the android app like the twitter app (screenshot below - header marked).</p><p>I am extending ArrayAdapter to create the listing. But cannot find a way to put the header.</p><p><img src=""http://i.stack.imgur.com/ZCLgq.png"" alt=""alt text""></p><p>Thanks in advance.</p>","48557","","","","","2011-01-12 07:32:27","Android: How to put image as Listview Header as in Twitter","<android><listview>","3","1","","",""
"4666098","1","","","2011-01-12 06:55:36","3","1500","<p>When I add a GZIP-ed file to my Android project's assets, the "".gz"" extension is stripped when the project is packaged. (So, for instance, ""foo.gz"" in my assets folder needs to be accessed in code using <code>getAssets().open(""foo"")</code>.) This doesn't seem to happen with other extensions (e.g., "".html"") that I'm using. The asset is still GZIP-ed (I have to wrap the input stream in a GZIPInputStream to read it).</p><p>Is this standard behavior or a bug? If it's standard, is there any documentation about which extensions are stripped and which are preserved?</p><p>EDIT: I misstated things sightly. I'm experiencing this problem with the Eclipse plug-in. I haven't tried running aapt directly to see if the problem is with the tool itself or with how the plug-in is using it.</p>","535871","","535871","","2011-01-13 00:01:31","2011-01-13 00:01:31","Why does Android aapt remove .gz file extension of assets?","<android><file-extension><assets><aapt><gz>","0","5","","",""
"4666115","1","","","2011-01-12 06:58:19","1","708","<p>I am doing an assignment to open pdf in an android app but the device has not install any pdf viewer.</p><p>How can I easily to create a build in pdf viewer in my app??</p><p>I have no ideas...</p><p>Thanks</p>","558890","","","","","2011-01-24 18:55:29","how to implement build in adobe pdf reader in android app","<java><android>","1","2","","",""
"4666126","1","4666168","","2011-01-12 07:00:00","1","3589","<p>In working with Android, CSS, and jQuery, I'm trying to grasp how to do a slide cover webkit transition like is used in <a href=""http://dev.sencha.com/deploy/touch/examples/kitchensink/"" rel=""nofollow"">Sencha Touch</a>. Basically I have home.html and options.html. I click a button on home.html and it needs to do a slide cover webkit transition from left-to-right, switching from home.html to options.html.</p><p>What's the technique?</p>","105539","","106224","","2012-07-28 18:20:12","2012-07-28 18:20:12","How To Do A Webkit Slide Cover Page Transition","<android><css><webkit><sencha-touch>","1","0","","",""
"4666192","1","","","2011-01-12 07:10:39","3","7410","<p>When a service has been killed, how to restart it automatically?</p><p>sometimes without even calling <code>onDestroy()</code></p>","482527","","674039","","2011-12-05 05:00:46","2013-02-01 17:07:33","How to restart a killed service automatically?","<android><service><ondestroy>","3","2","2","",""
"4666287","1","","","2011-01-12 07:29:12","0","153","<p>I used the following code to have the sound and display activity .</p><p>Intent viewIntent = new Intent(Intent.ACTION_EDIT);        viewIntent.setAction(android.provider.Settings.ACTION_DISPLAY_SETTINGS);        startActivityForResult(viewIntent,1);</p><p>Now i need to edit the sound and display settings and to save the updated settings . Please assist me for this.</p><p>Thanks </p>","401956","","","","","2011-07-15 14:43:11","how can i update sound and display from my activity","<android><settings>","1","0","","",""
"4666311","1","","","2011-01-12 07:34:48","4","2812","<p>Can somebody please throw some light on the arcane error ""Failed toset top app changed"", by the activity manager?I'm wondering what causes this error. In one of my application I'mmaking a view fullscreen and then switching back. For the first timethings are ok but then if i try to make the view full screen again, Iget a crash and the error mentioned above is found on logcat.</p><p>Any help is greatly appreciated.</p><p>Reagrds,M</p>","553140","","","","","2012-10-27 05:26:35","Android error, failed to set top app changed","<android>","3","2","","",""
"4666396","1","4667255","","2011-01-12 07:49:53","2","2557","<p>I am facing trouble to set WrapText kind of facility in EditText.</p><p><strong>Problem</strong>: When i try tp enter data in EditText, it goes beyond the screen width (scrolling horizontally). Instead of it should be appear in next-line.</p><p><strong>Want to perform:</strong> Actually, i want to implement multiline edittext, initially it should display with single-line as usual, but it will be expanded vertically(not horizontally) as when data is being entered.</p><p><strong>Please suggest me what should i do ??</strong></p><p>Please have a look at below image:</p><p><img src=""http://i.stack.imgur.com/ly4uu.png"" alt=""alt text""></p><p>I have done the below XML coding:</p><pre><code>&lt;TableLayout     android:layout_width=""fill_parent""      android:layout_height=""fill_parent""    android:paddingTop=""10dp""    android:paddingLeft=""10dp""    android:paddingRight=""10dp""    android:stretchColumns=""1""&gt;    &lt;TableRow android:id=""@+id/TableRow02"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;        &lt;TextView             android:text=""Name:""             android:id=""@+id/TextView01""             android:layout_width=""80dp""             android:layout_height=""wrap_content""            android:textSize=""16dip""&gt;        &lt;/TextView&gt;        &lt;EditText             android:id=""@+id/txtViewName""             android:layout_height=""wrap_content""             android:layout_width=""wrap_content""            android:inputType=""textFilter|textMultiLine|textNoSuggestions""            android:scrollHorizontally=""false""&gt;        &lt;/EditText&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","379693","","379693","","2011-01-12 09:10:30","2011-10-10 09:11:39","Android - Problem of WrapText in Edittext","<android><android-edittext>","5","2","","",""
"4666668","1","4667700","","2011-01-12 08:31:55","3","7857","<p>I'm searching the internet for a while now, and it seems that currently there is almost no way to develop XNA games for the Android platform. <br /><br />Does anyone of you know any good way to port XNA games to the android platform?<br />XNATouch it doesn't have yet a port for the monodroid, are there any other projects for this?</p>","171910","","171910","","2011-01-12 10:22:32","2011-09-29 09:57:30","Can you run XNA games on Android?","<android><mono><xna><monodroid>","3","1","3","",""
"4666687","1","4666711","","2011-01-12 08:35:01","1","2577","<p>I have a appwidget extends from appwidgetprovider.</p><p>I have created a layout xml file named main_layout.xml and add a button. If i develop a listActivity i reach this button with this path: R.layout.main_layout.button01. </p><pre><code>(Button)findViewById(R.layout.main_layout.button01)</code></pre><p>Activity class has a member method that named findViewById() but appwidgetprovider has not. </p><p>How can i reach my button in my layout?</p><p>sorry for my english</p>","437846","","","","","2011-01-12 08:38:47","How to find view id in appwidgetprovider?","<android><view><appwidget>","1","0","","",""
"4666776","1","4667731","","2011-01-12 08:48:45","9","34945","<p>There are some screen resolutions already defined in Android.They are:QVGA (240×320, low density, small screen)WQVGA (240×400, low density, normal screen)FWQVGA (240×432, low density, normal screen)HVGA (320×480, medium density, normal screen)WVGA800 (480×800, high density, normal screen)WVGA854 (480×854 high density, normal screen)</p><p>How do i know my device screen resolution is which type?</p>","430926","","","","","2013-11-22 07:37:47","Android screen resolution","<android><android-screen>","2","1","6","",""
"4666788","1","","","2011-01-12 08:49:57","0","489","<p>I have an image file (.jpg) which contains image like Face. From my application i want to capture that particular Face part and copy that part into a new bitmap file. I have a rectangular co-ordinates of that Face part, so how do i capture only Face part from the image file and copy that into a bitmap file?? </p><p>Could any body help me to get rid of this problem....</p>","419389","","1471203","","2013-01-09 11:15:16","2013-01-09 11:15:16","How to get ROI of an image in Android","<android>","2","0","","",""
"4666796","1","4666945","","2011-01-12 08:51:00","0","317","<p>I am trying to create media files required for android mediaframeworktest. In the file list they have given</p><p>PD_256kbps_44.1khz_mono_CBR_DPA.mp3<br>NIN_256kbps_44.1khz_mono_CBR_MCA.mp3 etc</p><p>Anybody know what is NIN...MCA and PD...DPA? are they just names or any special format of mp3?</p><p>Please explain.</p><p>ThanksJSE</p>","562518","","","","","2011-01-12 09:10:12","MP3 file format Details","<android><testing><mp3><media><file-format>","1","7","","",""
"4666870","1","4666902","","2011-01-12 09:00:08","0","3575","<p>I am in the process of trying to add dynamic checkbox to my activity. However being a beginner i cant get round the basics of being able to add checkboxes and remove them. Here is my code....</p><p>private void createCheckbox() {</p><pre><code> for(int i=0; i&lt;5; i++){    cb  = new CheckBox(this);    ll.addView(cb);     cb.setText(""Test""); } ll.addView(submit);   submit.setOnClickListener(new View.OnClickListener() {     public void onClick(View v) {        for(int i = 0; i &lt; 5; i++) {             ll.removeView(cb);         }          ll.removeView(submit);        Questions(); }});       </code></pre><p>}ll is a linerlayout object. The idea is when the code runs, 5 checkboxes appear and then once the user clicks on the submit button they get removed. Currently the boxes are being seen, but when the submit button is pressed only one of the five is being removed. I don't understand what i am doing wrong?</p><p>The idea is that the checkboxes will be creating depending on a value with the database and this value could change thats why the checkboxes are not predefined as there could be 4, 5, or 15. I dont know how to make each checkbox have its own identifier, because after this issue i will need to identify them individually because i will need to add text to them from the database and then once the user has check a few buttons i will need to save this into a seperate table. Very confused !!! help!</p>","569654","","","","","2011-01-12 09:04:59","Android Dynamic Checkbox issue","<android>","1","0","","",""
"4666875","1","","","2011-01-12 09:00:48","3","9770","<p>I have an image I want to use as a background to some layout.the problem is the image contains a texture of slant lines, so if i use a 1 pixel width image or a 9 patch the image is stretched and the texture is Twitching, so i can see the slant lines as latitude lines.I saw that he android emulator uses a similar texture in the progress bar indeterminate animation, is there a special/simple definition to order the background image to repeat itself rather than stretch? is there a way to do it with 9 patch, cause eventualy i also need the corners to be round.thanks for the help.</p>","572441","","21234","","2011-01-12 09:07:41","2012-02-07 07:37:19","image background - how to repeat image as background rather than stretch it","<android><image><background><repeat><stretch>","2","2","1","",""
"4666887","1","4891800","","2011-01-12 09:03:15","11","3680","<p>I have created a notification and added a <code>PendingIntent</code> so that the notification is closed when the notification is selected in expanded view.</p><p>My problem is that when the user clicks the <code>Clear</code> button to remove all notifications I am not notified and I need to perform some cleanup when my notification is killed.</p><p><code>FLAG_NO_CLEAR</code> would enable me to ignore the <code>Clear</code> button and keep my notification but I'd prefer to have my <code>Intent</code> triggered correctly to allow cleanup.</p>","572423","","418183","","2011-02-03 20:36:12","2012-10-31 09:45:25","How to know when my notification is cleared via Clear button?","<android><notifications>","1","0","5","",""
"4666892","1","4666939","","2011-01-12 09:04:09","1","2477","<p>i have a grid view with images populated from a list. when i remove an image from the list,i want the grid view to get refreshed.can someone tell me how to do this.</p><p>i have tried to invalidate() the gridview, notify the image adapter that the data set has changed(adapter.notifyDataSetChanged();). but this is not giving the desired results.</p><p>after doing this i am getting a blank in the place where the image that is removed used to be before.</p>","569838","","569838","","2011-01-12 11:30:51","2011-06-23 03:07:26","gridview of images is not getting refreshed","<android><gridview><android-layout><invalidate><android-gridview>","2","0","","",""
"4666908","1","4667167","","2011-01-12 09:05:21","1","756","<p>I am having two package in my application 1.com.fsp.deals and 2.com.facebook.android..</p><p>i declared my package as package =com.fsp.deals in Manifest file.. if i want to use the activity in com.facebook.android how i should call activity in manifest file it showing error as i define as  </p><pre><code>&lt;/activity&gt;      &lt;activity android:name=""com.facebook.android.Example""        android:screenOrientation=""portrait"" android:label=""@string/app_name""        android:windowSoftInputMode=""stateUnspecified|adjustPan""&gt;               &lt;/activity&gt; </code></pre>","555221","","457982","","2011-01-12 09:51:06","2011-01-12 09:51:06","Android manifest","<android><android-manifest>","1","0","","",""
"4666934","1","4666989","","2011-01-12 09:08:57","8","12811","<p>I am new to developing for Android, and am figuring my way around.</p><p>I want to play an audio file based on the click of a button. I have defined the <code>onClickListener()</code> method and the layout file. When I add the wav files to the <code>res/</code> directory, I get the following build error:</p><pre><code>invalid resource directory name temp.wav /hello/res line 1  Android AAPT Problem</code></pre><p>My question is as follows:<br>1. What directory do I need to store audio files in? Currently they are in the res/ folder.<br>2. Also, <code>mp.setDataSource(""/res/temp.wav"")</code> the correct way to invoke the media player?  </p><p>Thanks, Sriram</p>","350685","","","","","2012-05-09 10:33:01","Directory for storing audio files in Android","<android><audio><playback>","4","0","4","",""
"4667064","1","4667102","","2011-01-12 09:24:29","21","17979","<p>Taking inspiration from Android Market, i have implemented a Endless List which loads more data from the server when we reach the end of the List.</p><p>Now, i need to implement the progressbar &amp; ""Loading.."" text as shown<img src=""http://i.stack.imgur.com/H4HvB.png"" alt=""alt text""></p><p>Sample code to take inspiration from would be great.</p>","548903","","85950","","2013-01-30 20:57:03","2013-06-17 14:02:56","Android: Implementing progressbar and ""loading..."" for Endless List like Android Market","<android><android-listview>","2","0","7","",""
"4667229","1","","","2011-01-12 09:42:28","0","338","<p>I detected the textures will be lost when any interrupt happen. </p><p>For exsample, i received a phone call and then back to the opengles activity. The textures i loaded will be lost.</p><p>How can i save these textures?</p><p>ps: These textures loaded on Native C.</p>","572453","","","","","2011-01-19 17:35:39","Texture will be lost when any interrupt happen","<android><c><opengl-es><native><android-ndk>","1","0","","",""
"4667329","1","","","2011-01-12 09:52:00","1","1474","<p>I am using the following code to display images from an url in my imageview:</p><pre><code>private Drawable LoadImageFromWebOperations(String url){    try    {        InputStream is = (InputStream) new URL(url).getContent();        Drawable d = Drawable.createFromStream(is, ""src name"");        return d;    }    catch (Exception e)     {         return null;    }}Drawable drawable = LoadImageFromWebOperations(""http://www.androidpeople.com/wp-content/uploads/2010/03/android.png"");imgView.setImageDrawable(drawable);</code></pre><p>I have a timer that changes the image every 5th second. But in some rare cases the app freezes. Is it because the LoadImageFromWebOperations fails to load the image? Or any ideas what the problem might be, and how to fix it? Thanks!</p>","557187","","","","","2011-08-12 22:00:57","android imageview from url problem","<android><imageview>","1","0","","",""
"4667440","1","4667486","","2011-01-12 10:02:35","1","2114","<p>i am using an imageView to display an image. later i am setting a different image to the view using <code>imageView.setImage(bitmap)</code>.now if i change the orientation of the screen from portrait to landscape, the imageview displays the old image instead of the new image i have set. can someone pls tell me why this happens and how to overcome this. </p>","569838","","473070","","2011-01-12 10:07:56","2011-01-12 11:01:21","strange behavior of image view on changing the orientation of the screen","<android><imageview><screen-orientation><android-configchanges>","2","0","","",""
"4667474","1","4669009","","2011-01-12 10:05:29","0","2612","<p>I have subMenus:</p><pre><code>@Override    public boolean onCreateOptionsMenu(Menu menu) {        SubMenu subMenuFile = menu.addSubMenu(""Font type"");        SubMenu subMenuEdit = menu.addSubMenu(""Font size"");        subMenuEdit.add(Menu.NONE, IDM_FONT_SIZE, Menu.NONE, ""Change size of font"");        return super.onCreateOptionsMenu(menu);    }</code></pre><p>I want to set their typeface. Can I do it? Menu.XML file doesn't support the attribute android:typeface=""serif"". The compiler says: ""Error: String types not allowed (at 'typeface' with value 'Arial')""Then I have done this:</p><pre><code>@Override    public boolean onCreateOptionsMenu(Menu menu) {        SubMenu subMenuFile = menu.addSubMenu(""Font type"");        for(int i = 0; i &lt; fontFaces.length; ++i) {         subMenuFile.add(Menu.NONE, IDM_FONT_TYPE, Menu.NONE, Html.fromHtml(""&lt;b&gt;html&lt;/b&gt;""));        }        SubMenu subMenuEdit = menu.addSubMenu(""Font size"");        subMenuEdit.add(Menu.NONE, IDM_FONT_SIZE, Menu.NONE, ""Change size of font"");        return super.onCreateOptionsMenu(menu);    }</code></pre><p>I have seen, that the submenu supports different styles, but the application finishes with an error. Here is the log:</p><pre><code>01-12 10:04:18.103: ERROR/AndroidRuntime(1078): FATAL EXCEPTION: main01-12 10:04:18.103: ERROR/AndroidRuntime(1078): java.lang.IllegalArgumentException: Invalid payload item type01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.util.EventLog.writeEvent(Native Method)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.app.Activity.onMenuItemSelected(Activity.java:2204)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:748)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:137)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:873)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.widget.ListView.performItemClick(ListView.java:3513)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1800)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.os.Handler.handleCallback(Handler.java:587)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.os.Handler.dispatchMessage(Handler.java:92)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.os.Looper.loop(Looper.java:123)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at android.app.ActivityThread.main(ActivityThread.java:3647)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at java.lang.reflect.Method.invokeNative(Native Method)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at java.lang.reflect.Method.invoke(Method.java:507)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)01-12 10:04:18.103: ERROR/AndroidRuntime(1078):     at dalvik.system.NativeStart.main(Native Method)01-12 10:04:22.393: ERROR/InputDispatcher(67): channel '406c4fb8 android.htmleditor/android.htmleditor.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x801-12 10:04:22.393: ERROR/InputDispatcher(67): channel '406c4fb8 android.htmleditor/android.htmleditor.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!01-12 10:04:23.263: ERROR/InputDispatcher(67): Received spurious receive callback for unknown input channel.  fd=175, events=0x8</code></pre><p>How can I set a typeface of a MenuItem?</p>","565447","","565447","","2011-01-12 12:45:43","2011-01-12 12:53:35","Set a typeface of a MenuItem","<android><menuitem><typeface>","2","1","","",""
"4667479","1","","","2011-01-12 10:06:11","0","611","<p>i want to connect two device using a SSL connection.[ Sake of clarity: these 2 devices are on same Local area OR wi-fi network, there is no internet connection and also there is no server OR some 3rd bridging device].</p><p>i tried to connect those device by using SSLSocket:</p><p><code>SocketFactory socketFactory = SSLSocketFactory.getDefault();                Socket socket = socketFactory.createSocket(""hostname"", 6575);</p><pre><code>            socket.bind(new SocketAddress() {                private static final long serialVersionUID = 1L;            });</code></pre><p></code></p><p>But i am getting connection refused error. Here is the error message that i get in the logcat:</p><blockquote>  <p>java.net.ConnectException:  /192.168.1.34:6575- Connection  refused</p></blockquote><p>Please suggest,is there something wrong in the implementation OR i need to follow a different approach.</p><p>thanks!!</p>","152867","","","","","2011-03-11 13:40:20","android: Connect two devices with a SSL connection","<android><sockets><ssl>","1","0","","",""
"4667517","1","4667592","","2011-01-12 10:09:17","1","560","<p>How can I pass data from a threaded service to the activity that created the service?</p><p>It's a login scenario. The user enters credentials, the activity starts a service which calls an wcf service to confirm the credentials. When this is done I want the service to tell the activity that the login has succeeded/failed.</p>","566615","","","","","2011-01-12 10:17:45","Passing data to activity from threaded service","<android><multithreading><service><activity>","1","0","","",""
"4667552","1","","","2011-01-12 10:12:49","0","476","<p>i m showing some push notification in my app. and its working fine when the device is in ringer mode. But when the device is silent it doesn't play the sound.</p><p>I want that whenever the device is either in silent or ring mode it would play the push notification(Sound) on the device.</p><p>Please help me in this case.</p><p>ThanksVivek Goel</p>","383597","","","","","2013-12-13 13:32:16","android push notifications","<android>","0","2","","",""
"4667671","1","","","2011-01-12 10:25:15","1","856","<p>I didn't understand very well RelativeLayout, I didn't understand why with this XML (it represent an item of a 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=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/sfumatura_riga""    &gt;        &lt;ImageView        android:id=""@+id/featured_new_image""        android:layout_alignParentLeft=""true""                android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/no_foto""         /&gt;        &lt;LinearLayout        android:layout_toRightOf=""@id/featured_new_image""        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginLeft=""5dp""        &gt;        &lt;TextView            style=""@style/featured_new_title""            android:id=""@+id/featured_city""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_marginBottom=""5dp""            android:layout_marginTop=""10dp""        /&gt;        &lt;TextView            style=""@style/featured_name_country""            android:id=""@+id/featured_country""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""        /&gt;    &lt;/LinearLayout&gt;    &lt;TextView            style=""@style/featured_date""            android:id=""@+id/featured_date""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_marginTop=""10dp""            android:layout_marginRight=""5dp""            android:layout_alignParentRight=""true""        /&gt;&lt;/RelativeLayout&gt;                           </code></pre><p>I meet this result, why too much margin at the bottom of the row?<img src=""http://i.stack.imgur.com/U1vXI.png"" alt=""alt text""></p>","554892","","","","","2011-01-12 12:06:03","Relative Layout","<android>","2","3","1","",""
"4667798","1","4667851","","2011-01-12 10:38:40","2","608","<p>can anyone please tell me in android, is it possible to access the list of application names that are using Data connection in background/foreground? If possible how?</p><p>note: I came to know it is possible to access the Total data consumption in bytes by reading TX/RX files. But i couldn't find which applications are using the data connection.</p>","572679","","569101","","2013-02-10 18:21:41","2013-02-10 18:21:41","In android how to programmatically list the apps that use Data connection?","<java><android>","1","0","","",""
"4667856","1","4667913","","2011-01-12 10:46:07","0","383","<p>I've created a dynamic <code>ListView</code> with <code>TextView</code>s and <code>Spinner</code>s, using a <code>SimpleAdapter</code> and a <code>ViewBinder</code>.</p><p><strong>How can I access a <code>Spinner</code> value after the user had selected it?</strong></p><p>I think I need to create references to the spinners inside my <code>ViewBinder</code>, but I don't know how. I tried this but it's not working:</p><pre><code>public boolean setViewValue(View view, Object data,                                String textRepresentation) {mySpinner = (Spinner) view;}</code></pre>","396133","","493939","","2012-06-03 06:17:51","2012-06-03 06:17:51","Accessing objects dynamically created with an adapter","<android><android-listview><android-spinner><simpleadapter><android-viewbinder>","1","1","1","",""
"4667928","1","4668256","","2011-01-12 10:53:42","0","889","<p>I have two edittexts and a button in my layout.When I press the 'done' key in softkeyboard, I need to catch that key event and perform null checking for these edit fields.Can anyone kindly help me on this?</p><p>BR,Rony</p>","264953","","","","","2011-01-12 11:34:29","Capturing Android soft key events","<android><android-emulator><android-widget>","1","0","","",""
"4667959","1","5050236","","2011-01-12 10:57:15","1","3681","<p>What I am trying to achieve over here is, I want to disable wi-fi, camera, mic and every possible tool of communication on the phone when my app gets launched.</p><p>I got code for disabling wifi, which works good<a href=""http://androidsnips.blogspot.com/2010/09/turn-off-on-wifi-in-android-using-code.html"" rel=""nofollow"">http://androidsnips.blogspot.com/2010/09/turn-off-on-wifi-in-android-using-code.html</a></p><p>The other one is for disabling bluetooth<a href=""http://stackoverflow.com/questions/3806536/how-to-enable-disable-bluetooth-programmatically-in-android"">How to enable/disable bluetooth programmatically in android</a></p><p>I am not getting anything related to camera, mic or any possible stuff.</p><p>I hope someone can help :)</p><p>Thanks very much in advance.</p>","371542","","","","","2012-03-29 03:28:31","How to disable mic, camera and any other tool","<android><hardware><camera>","2","3","1","",""
"4667982","1","6371928","","2011-01-12 10:59:13","1","2415","<p>I have a Java desktop application acting like ""server"" and an Android application, that should be acting as a ""client"".<br>""Client"" should send String and receive response String[] from ""server"". The only method, I've came across is using Sockets like this</p><pre><code>Socket socket = null;    try {        Log.d(log_tag, ""creating socket"");        socket = new Socket(""192.168.1.123"", 8090);        Log.d(log_tag, ""creating out"");        DataOutputStream out = new DataOutputStream(socket.getOutputStream());        DataInputStream in = new DataInputStream(socket.getInputStream());        Log.d(log_tag, ""out created. sending data"");        out.writeUTF(""sql"");        Log.d(log_tag, ""data sent"");        Log.d(log_tag, ""receiving data. loop"");        while(in.available() == 0);        Log.d(log_tag, ""received = "" + in.readUTF());        out.close();        in.close();        socket.close();        Log.d(log_tag, ""all closed"");    } catch (UnknownHostException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }    Log.d(log_tag, ""finished"");</code></pre><p>""Server"" is built the same way, except for order of operations(first read, then write response).</p><p><strong>The problem</strong>: Android application freezes on line</p><pre><code>while(in.available() == 0);</code></pre><p>so, InputStream never gets ready and I can't receive server response, but ""server"" reports, that the data was sent.<br>Can you point me to my mistake(it's obvious one, I suppose, but I can't see it)?<br>P.S. Maybe that's the wrong way, but it's not an option to use any mid-layers here. I can't modify server code too.</p>","476583","","","","","2011-06-16 12:38:56","Android to PC data exchange via Socket","<java><android><sockets>","1","2","","",""
"4668001","1","4668392","","2011-01-12 11:00:58","45","51029","<p>I have an imageview that has its height and width set to ""fill_parent"" with a linearlayout that has the same values set. So i suppose this should set my images to fit the screen. But it only fits like 80% (margin top and bottom in landscape mode).</p><p>So ive tried the following code, without success:</p><pre><code>Display display = getWindowManager().getDefaultDisplay();     int width = display.getWidth();    int height = display.getHeight();    imgView.setMinimumWidth(width);    imgView.setMinimumHeight(height);    imgView.setMaxWidth(width);    imgView.setMaxHeight(height);</code></pre><p>Any other ideas?</p>","557187","","255905","","2011-01-12 11:47:27","2013-03-06 04:31:55","android: stretch image in imageview to fit screen","<android><imageview>","3","1","11","",""
"4668103","1","","","2011-01-12 11:12:56","0","824","<p>I have a custom View: ImageZoomView.java which has a setImage, and overrides onLayout and onDraw, as following:</p><pre><code>public void setImage(Bitmap bitmap) {    mBitmap = bitmap; ...}@Overrideprotected void onDraw(Canvas canvas) {    if (mBitmap != null &amp;&amp; mState != null) {        ...        canvas.drawBitmap(mBitmap, mRectSrc, mRectDst, mPaint);    }}@Overrideprotected void onLayout(boolean changed, int left, int top, int right, int bottom) {    super.onLayout(changed, left, top, right, bottom);...}</code></pre><p>And i want to position several ImageZoomViews within a RelativeLayout, using layoutParams rules, but all my views are stuck to position (0,0), I don't know why.</p><pre><code>       ImageZoomView mZoomView = new ImageZoomView(getApplicationContext()); mZoomView.setImage(mBitmap); mZoomView.setId(index+1); RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.RelativeLayout01); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(screenWidth/2, screenHeight/2); if(index &gt; 0)  lp.addRule(RelativeLayout.RIGHT_OF, index); relativeLayout.addView(mZoomView, lp);</code></pre><p>I've tried the exact same code with normal ImageViews, it works and every view is positionned on the right of the (n-1) view...</p><p>Any ideas please?Thanks.</p>","572608","","","","","2011-01-12 13:08:07","position of custom Views within a RelativeLayout","<android><relativelayout>","1","2","","",""
"4668111","1","4668141","","2011-01-12 11:14:04","2","1914","<p>I display a splash screen for about 3 seconds before my first Activity is called. Splash Screen is also an Activity, after 3 seconds it finish()es and starts FirstActivity. Also I have set screen rotation of splash Activity to portrait view.</p><p>Now when I test my app it works fine, but during those 3 seconds of splash screen if i change screen rotation, my First Activity is called two times. </p><p>Is there any way / code snippet that could help me open my First Activity only once, despite screen rotations when Splash Screen Activity is at foreground. ? Thanks for helping :) </p>","435597","","","","","2011-01-12 11:34:17","Android Splash Screen Bug","<android><activity><screen><splash-screen><splash>","3","0","","",""
"4668162","1","","","2011-01-12 11:20:28","0","4149","<p>I am trying to play a few music (wav format) files based on button clicks. I am unable to get MediaPlayer to work properly. Every time I try to instantiate an object of MediaPlayer class, it fails on create(). Before I post the code, here is a run-through of what I am doing:<br>1. A layout file that contains 2 buttons.<br>2. Those buttons are read and onClickListeners defined for them.<br>3. Depending on the button clicked, a function called <code>playAudioFile(View)</code> called which creates the MediaPlayer instance and plays the file. The code for playAudioFile(View) is as follows:  </p><pre><code>   public void playAudioFile(View v) {        /*Steps:         * 1. Take in id of the button.         * 2. Using id, identify what file needs to be played.         * 3. Play file.         */        String path_to_file = null;   //this is the path to the file.        if(b01.getId() == ((Button)v).getId()) {            Log.v(this.toString(), ""Button 01 pressed."");            path_to_file = ""/sdcard/audio/temp1.wav"";        } else if(b02.getId() == ((Button)v).getId()) {            Log.v(this.toString(), ""Button02 pressed."");            path_to_file = ""/sdcard/audio/temp2.wav"";        }        path_to_file = ""file://"" + path_to_file;        Uri streamUri = Uri.parse(path_to_file);        Log.v(this.toString(), ""Path of file = "" + path_to_file);        MediaPlayer mp = MediaPlayer.create(this, streamUri);        if(mp == null) {            Log.v(this.toString(), ""Create() on MediaPlayer failed."");        }        mp.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {            @Override            public void onPrepared(MediaPlayer mp) {                // TODO Auto-generated method stub                try {                    mp.start();                } catch (IllegalStateException e) {                    e.printStackTrace();                    Log.v(this.toString(), ""Illegal state exception thrown in start."");                }            }        });        mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {            @Override            public void onCompletion(MediaPlayer mp) {                // TODO Auto-generated method stub                mp.release();            }        });    }</code></pre><p>I have gone through a lot of posts here on stackoverflow that detail solutions to the above problem. I am encountering this problem after having incorporated all the suggestions made therein. Any help is most welcome.  </p><p>Thanks,<br>Sriram </p>","350685","","","","","2011-08-09 00:53:13","Create() fails in MediaPlayer - android","<android><callback><media-player>","2","5","","",""
"4668163","1","6451203","","2011-01-12 11:20:37","-1","1244","<p>In my application i created a button when the button is clicked it will load all images from the sdcard.</p>","244540","","244540","","2012-05-01 09:54:08","2012-05-01 09:54:08","How to pass a click on an image from one activity to another?","<android>","3","2","","",""
"4668198","1","","","2011-01-12 11:24:01","3","649","<p>In android, how to get EC/IO and BitErrorRate value for GSM network?I am using the API: signalStrength.getCdmaEcio();signalStrength.getEvdoEcio();signalStrength.getGsmBitErrorRate();</p><p>But all of these return -1 value. :(</p><p>please any suggestions?</p><ul><li>Harsha</li></ul>","572679","","","","","2012-11-27 07:40:25","how to get EC/IO and GsmBitErrorRate for GSM value in android?","<java><android>","1","0","0","",""
"4668210","1","4668250","","2011-01-12 11:25:22","23","17781","<p>I got a relative simple question. I have an activity with a lot of EditText's in them. When I open the activity it automatically focusses to the first EditText and displays the virtual keyboard.</p><p>How can I prevent this?</p>","517460","","457982","","2011-01-12 11:41:33","2013-01-22 11:13:06","Automatic popping up keyboard on start Activity","<android><keyboard><focus><edittext>","7","0","5","",""
"4668231","1","4934571","","2011-01-12 11:27:19","2","989","<p>I have data in the form of a 2D array of intensities that should be plotted in a contour plot. In the end it should look like a topographic map with contour lines like the following image:<img src=""http://i.stack.imgur.com/Y7M2B.png"" alt=""alt text""></p><p>The idea is that the typical multitouch gestures (pinch for zooming, dragging for moving around) can be used to navigate the contour plot. The maximum size of the data should be around 4k*4k points, each 4 bytes big.</p><p>Is there some plotting library that I can use, or do I have to start from scratch? Is there an easily implemented algorithm for that?</p>","347857","","","","","2011-02-08 14:56:20","Creating interactive contour plots on Android","<java><android><plot>","1","0","","",""
"4668244","1","4721413","","2011-01-12 11:29:04","2","2569","<p>I am trying to create an extended version of <code>MapView</code>.</p><p>The problem is when extended version of <code>MapView</code> is defined, mapview does not pan.</p><p>I am implementing an <code>onTouchListener</code> Inside my custom map view.</p><p>I also want to know is there any methods from where I can pan the mapview.</p><p>The problem does not persist when stock version of MapView is used with same source code.</p><p><strong>EDIT</strong></p><p><em>MyMapView</em> source:</p><pre><code>public class MyMapView extends MapView{    public MyMapView(Context context, String apiKey) {        super(context, apiKey);    }    public MyMapView(Context context, AttributeSet attrs) {        super(context, attrs);    }    public MyMapView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);    }    @Override    public boolean onTouchEvent(MotionEvent event) {        if(event.getAction()==MotionEvent.ACTION_DOWN){            Log.v(""MyMapView"",""Touched"");        }        return false ;    }}</code></pre><p>my <code>onCreate()</code> from <code>MapActivity</code></p><pre><code>protected void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.mapper);    mMapView=(MyMapView) findViewById(R.id.mapper_map);    mMapView.setSatellite(false);       }</code></pre>","447238","","447238","","2011-01-13 06:55:05","2011-01-18 07:17:54","Android Custom MapView","<android><android-mapview><pan>","2","2","1","",""
"4668344","1","","","2011-01-12 11:40:31","8","7659","<p>How do I enable zoom on my phonegap app for android users?</p><p>I tried to customize ""Sample/src/com/phonegap/Sample/Sample.java"" but it still just doesn't work:</p><p>Any ideas?</p><pre><code>package com.phonegap.Sample;import android.app.Activity;import android.os.Bundle;import com.phonegap.*;import android.webkit.WebSettings;public class Sample extends DroidGap{    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        super.loadUrl(""file:///android_asset/www/index.html"");        WebSettings ws = super.appView.getSettings();        ws.setSupportZoom(true);        ws.setBuiltInZoomControls(true);     }}</code></pre>","572631","","309086","","2013-05-10 11:08:22","2013-05-10 11:08:22","zoom in phonegap for android","<android><phonegap>","3","2","1","",""
"4668382","1","","","2011-01-12 11:46:15","0","1565","<p>Can somebody plz post the xml layout code for this (have a look at the link), really don't get this done...Thanks.</p><p><img src=""http://i.stack.imgur.com/0hq4l.jpg"" alt=""http://img832.imageshack.us/img832/6589/layouthelp.jpg""></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:background=""@drawable/background"" android:layout_gravity=""bottom"" android:orientation=""vertical"" android:baselineAligned=""false""&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""fill_parent"" android:background=""@drawable/logo"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;LinearLayout android:layout_gravity=""center_vertical"" android:id=""@+id/LinearLayout02"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/Button02"" android:layout_gravity=""right"" android:text=""@+id/Button02""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/Button03"" android:text=""@+id/Button03""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/Button01"" android:layout_gravity=""bottom"" android:text=""@+id/Button01""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","572636","","234976","","2011-11-28 02:57:16","2011-11-28 02:57:16","Android layout XML code","<android><xml><layout>","1","5","","",""
"4668396","1","7001334","","2011-01-12 11:47:44","10","3411","<p>I  have an app that allows you to create ""shortcuts"" in Home Screen. But can i detect if the ""shortcuts"" already exist, i didn't have to create it again.Thanks.</p>","430926","","","","","2012-12-06 07:14:02","How to detect shortcut in Home screen","<android>","3","2","5","",""
"4668454","1","","","2011-01-12 11:52:57","1","1614","<p>I'd need to create custom button, but I'd want to use framework's default button highlight colors for pressed and focused states. My question is similar to <a href=""http://stackoverflow.com/questions/3686430/android-use-default-highlight-colors-in-a-custom-button"">this one</a>.</p><p>My selector code looks like this:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@android:drawable/grid_selector_background_pressed""/&gt;    &lt;item android:state_focused=""true"" android:drawable=""@android:drawable/grid_selector_background_focus""/&gt;    &lt;item&gt;        &lt;shape&gt;            &lt;solid android:color=""#EAEAEA""/&gt;            &lt;stroke                    android:width=""0dp""                    android:color=""#A0A0A0""/&gt;            &lt;corners                    android:radius=""0dp""/&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>So I'm basically trying to reference drawables <strong>grid_selector_background_pressed</strong> and <strong>grid_selector_background_focus</strong>. The dev environment does find those drawables as it auto-suggests them upon typing, but then gives ""Resource is not public"" when compiling.</p><p>Is there a way to use the above mentioned framework drawables?</p><p>Pom</p>","54155","","","","","2011-09-06 16:56:25","Android: using framework drawables in custom button selector","<android>","1","0","","",""
"4668477","1","","","2011-01-12 11:55:35","3","1606","<p>I'm trying to develop a background process that intercepts a XMPP message and performs an action, I'm using asmack as the main XMPP library. I presume I need a broadcastReciever that responds to a specific intent. The question is how to raise the intent? It must be possible as this functionality is present in the google talk client.many thanks in advance. </p>","572615","","","","","2011-09-13 04:17:30","XMPP events on Android","<android><android-intent><xmpp><broadcastreceiver><smack>","2","0","2","",""
"4668494","1","4668520","","2011-01-12 11:56:51","0","883","<p>In my application I use cursor to get information from SQLite data base like this:</p><pre><code>Cursor contacts = dataBase.select(""SELECT _idContact FROM Contacts"");  if (contacts.getCount() &gt; 0) {   if (IMLayout.getVisibility() == View.VISIBLE) {    int k = contacts.getCount();    for (int j = 0; j &lt; k; j++) {     if (j == 0) {      contacts.moveToFirst();     } else {      contacts.moveToNext();     }</code></pre><p>What I want is to optimize the ""for"" using Enhanced for loop. For that I have to use an array, or other, but not cursors because the cursors are not working for Enhanced for loop. How to convert the cursor into an arrayList?</p>","477758","","21234","","2011-01-12 11:58:05","2011-01-12 12:06:38","Android:What to use instead of cursor","<java><android><enhanced-for-loop>","2","0","","",""
"4668546","1","","","2011-01-12 12:02:41","0","474","<p>In the solution for out of memory: <a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue"">Android: Strange out of memory issue</a>, it talks about using: decodeFile(File f). How do you handle internal image files that are referred to as R.id.something? these resources are seen as integers?</p>","572655","","21234","","2011-01-12 12:03:35","2011-01-12 13:27:05","OutOfMemory in Android","<android><memory-management>","1","0","","",""
"4668596","1","12475918","","2011-01-12 12:06:58","3","1353","<p>For default Log on android platform has limited amount of character for console output. Around equal a bit more than 3000. Therefore, if the message is longer than 3000 characters, it is not shown on screen. </p><p>I have not found a better solution than this:</p><pre><code>public class Log {    private static int mode = android.util.Log.INFO;    public static void e(String tag, String msg, Throwable tr) {        if ((mode &amp; android.util.Log.ERROR) &lt;= 0) return;        android.util.Log.e(tag, msg, tr);    }    public static void e(String tag, String msg) {        if ((mode &amp; android.util.Log.ERROR) &lt;= 0) return;        android.util.Log.e(tag, msg);    }    public static void w(String tag, String msg) {        if ((mode &amp; android.util.Log.WARN) &lt;= 0) return;        android.util.Log.w(tag, msg);    }    public static void i(String tag, String msg) {        if ((mode &amp; android.util.Log.INFO) &lt;= 0) return;        android.util.Log.i(tag, msg);    }    public static void d(String tag, String msg) {        if ((mode &amp; android.util.Log.DEBUG) &lt;= 0) return;            int length = msg.length();            int kind = 3000;            if (length &gt;= kind) {                int count = length / kind;                int u = length % kind;                int i = 0;                for (i = 0; i &lt; count; ++i) {                    int start = i * kind;                    int end = start + kind;                    android.util.Log.d(tag, msg.substring(start, end));                }                if (u != 0) {                    int start = length - u;                    int end = start + u;                    android.util.Log.d(tag, msg.substring(start, end));                }            } else {                android.util.Log.d(tag, msg);            }    }}</code></pre><p>Is there a better solution to this issue?</p>","396628","","396628","","2011-01-13 17:23:12","2012-09-18 11:16:11","How to increase console output at the android Log class","<java><android><buffer><logging>","1","8","","",""
"4668665","1","","","2011-01-12 12:15:43","1","720","<p>I would like to know if it is possible to access directly a class in an apk from another apk.</p><p>By example, in the notepad tutorial, an activity is launched by these lines of code:<pre><code>     Intent i = new Intent(this, NoteEdit.class);    startActivityForResult(i, ACTIVITY_CREATE);</pre></code> This code accesses directly NoteEdit.class. But in this tutorial, the class containing this code and the NoteEdit class are in the same apk.I would like to know if the same constructor for an intent could be use if the activity is in another apk.</p><p>System classes are, off course, accessible, but they seem to be in a jar file, android.jar.So there seems to be a way to access directly classes inside jar files, I would like to know if there is a way to access direclty classes in other apk.</p>","572674","","","","","2011-01-12 12:24:00","Accessing classes from other apk","<android>","1","0","","",""
"4668776","1","4668835","","2011-01-12 12:27:18","0","392","<pre><code>public Object fetch(String address) throws MalformedURLException,IOException {    URL url = new URL(address);    Object content = url.getContent();    return content;}  private Drawable ImageOperations(Context ctx, String url) {    try {        InputStream is = (InputStream) this.fetch(url);        Drawable d = Drawable.createFromStream(is, ""src"");        return d;    } catch (MalformedURLException e) {        return null;    } catch (IOException e) {        return null;    }    catch (Exception e)     {        return null;    }}try {            Drawable a =ImageOperations(this,""url""); imgView.setImageDrawable(a);        } catch (Exception e1) {            // TODO Auto-generated catch block            e1.printStackTrace();</code></pre><p>This works, but on rare ocasions the app freezes due to a ""SocketException: Adress family not supported by protocol"". Is there any way to fix this? Thanks</p>","557187","","","","","2011-01-12 12:39:46","problem loading image from web (android)","<android><image><url>","2","0","","",""
"4668871","1","4668924","","2011-01-12 12:37:34","6","29425","<p>i want to send email programmatically.</p><p>i tried out the following code.</p><blockquote>  <p>final Intent emailIntent = new Intent(                android.content.Intent.ACTION_SEND);</p><pre><code>  emailIntent.setType(""plain/text"");  emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,          new String[] { ""abc@gmail.com"" });  emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,          ""Email Subject"");  emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,          ""Email Body"");  startActivity(Intent.createChooser(          emailIntent, ""Send mail...""));</code></pre></blockquote><p>but problem is that before sending email the application open the activity </p><p><img src=""http://i.stack.imgur.com/E5L4g.png"" alt=""alt text""></p><p>i want to send email directly without open compose activity. how this possible?</p>","309990","","2441810","","2013-06-01 00:24:05","2013-10-02 03:15:04","Send auto email programmatically","<android><email>","2","2","8","",""
"4668939","1","","","2011-01-12 12:45:42","3","2360","<pre><code>  { January 14, 2011... I have given up to use setListViewHeightBasedOnChildren(ListView listView},  instead, I don't put my listview in a scrollview, and then just put other contents  into a listview by using ListView.addHeaderView() and ListView.addFooterView().   http://dewr.egloos.com/5467045 }</code></pre><p>ViewGroup(the ViewGroup is containing TextViews having long text except line-feed-character).getMeasuredHeight returns wrong value... that is smaller than real height.</p><p>how to get rid of this problem?</p><p>here is the java code:</p><pre><code>    /*    I have to set my listview's height by myself. because    if a listview is in a scrollview then that will be    as short as the listview's just one item.    */    public static void setListViewHeightBasedOnChildren(ListView listView) {    ListAdapter listAdapter = listView.getAdapter();     if (listAdapter == null) {        // pre-condition        return;    }    int totalHeight = 0;    int count = listAdapter.getCount();    for (int i = 0; i &lt; count; i++) {        View listItem = listAdapter.getView(i, null, listView);        listItem.measure(View.MeasureSpec.AT_MOST, View.MeasureSpec.UNSPECIFIED);        totalHeight += listItem.getMeasuredHeight();    }    ViewGroup.LayoutParams params = listView.getLayoutParams();    params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));    listView.setLayoutParams(params);}</code></pre><p>and here is the list_item_comments.xml:</p><p>                    </p>","437606","","437606","","2011-01-14 10:34:26","2013-01-04 15:07:56","ViewGroup{TextView,...}.getMeasuredHeight gives wrong value is smaller than real height","<android>","2","0","4","",""
"4668978","1","","","2011-01-12 12:49:26","1","349","<p>I'd like my application to be notified when system is about to suspend or sleep (before).No matter to acquire a wake lock: i dont want to inhibit the procedure but only to be notified about it.Thank you.L.</p>","520032","","","","","2011-01-12 12:49:26","How to be notified about entering suspend mode?","<android><sleep><notify><suspend>","0","1","","",""
"4669047","1","4696448","","2011-01-12 12:58:08","5","3021","<p>my app uses the RecognizerIntent to record the user's voice and doing some speech recognition. </p><p>Now, I'd like to compare the results to some open source speech recognition engines. Most of them take an audio file as input. My thought was, to capture the sound from the Android's microphone, and start the RecognizerIntent at the same time. But it seems, that accessing the microphone is exclusive.</p><ol><li>Is it possible to use the RecognizerIntent with a recorded audio stream?</li><li>Is it possible to access the microphone simultaneously with two Activites?</li></ol><p>Thanks!</p>","168954","","168954","","2011-01-12 13:36:58","2011-01-21 17:55:25","Android: Accessing the microphone simultaniously (RecognizerIntent + own app)","<android><speech-recognition>","2","1","5","",""
"4669072","1","","","2011-01-12 13:02:19","0","365","<p>I am a .NET developer.</p><p>I want to develop apps for Andriod. Do I need to learn Java to make the same or we do have SDK for .NET developers?</p><p>If Java is the only option that what I need to learn before putting my step forward to learn how to build android apps. Do I need eclipse?</p><p>If .Net framework is available then what is the limitation of that framework? with that can I develop all kind of app which I can make with Java.</p>","298336","","","","","2011-01-12 13:04:59","Andriod for .net","<c#><android><android-sdk-2.2>","0","0","0","",""
"4669104","1","4669155","","2011-01-12 13:06:04","10","16164","<p>Code ...{</p><pre><code>private void createRadioButton() {        final RadioButton[] rb = new RadioButton[5];        for(int i=0; i&lt;5; i++){            rb[i]  = new RadioButton(this);            ll.addView(rb[i]);             rb[i].setText(""Test"");         }         ll.addView(submit);           submit.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                for(int i = 0; i &lt; 5; i++) {                     ll.removeView(rb[i]);                 }                  ll.removeView(submit);                Questions();         }});       }</code></pre><p>The issue i am having is that the radio buttons appear and the user can select any one. Being a beginner im sure i am not setting the radio buttons up correctly. The user is able to select all five buttons and then once selected they cant uncheck them either. The user should only be able to select one option from the five...how can i make this possable?</p>","569654","","432848","","2011-06-28 22:33:52","2013-11-18 05:48:35","Dynamic Radio Button Control","<android>","3","0","3","",""
"4669263","1","6642250","","2011-01-12 13:24:28","0","1297","<p>I am very new to Android programming, but I've taken a fair amount of tutorials. But still, I am having problems with the following.</p><p>I took 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>. Besides, I took this tutorial for button clicks: developer.android.com/guide/topics/ui/ui-events.html</p><p>I have added a button and an EditText to the first tab layout. Just for testing purposes, I would like the EditText to become invisible if I press the button. Here is my code:</p><pre><code>package test.HelloTabWidget;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;public class ArtistsActivity extends Activity{    EditText et;    private OnClickListener mCorkyListener = new OnClickListener()    {        public void onClick(View v) {            et.setVisibility(View.INVISIBLE);        }    };    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.artists);        et = (EditText)this.findViewById(R.id.EditText01);        Button button = (Button)this.findViewById(R.id.Button01);        button.setOnClickListener(mCorkyListener);            }}</code></pre><p>This code is for the first tab. I have actually tried to create a new project and just use standard layout, and then use the code above. Then it works perfectly. So I don't really understand why it won't work here.</p><p><strong>Update:</strong> Works now, but I'm afraid that I have no idea what caused the error and why it is now working.</p>","554002","","554002","","2011-01-15 18:27:53","2011-07-10 16:22:09","Android - button clicks in tab view","<android><button><tabs>","2","6","","",""
"4669321","1","","","2011-01-12 13:31:26","0","1606","<p>I want to merge 3 spannable objects. This code works fine:</p><pre><code>Spannable s1 = new SpannableStringBuilder(""bold"");             s1.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, s1.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);             Spannable s2 = new SpannableStringBuilder(""not"");             Spannable s3 = new SpannableStringBuilder(""BOLD"");             s3.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, s3.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);             finishSpan = (Spanned) TextUtils.concat(s1,s2);             finishSpan = (Spanned) TextUtils.concat(finishSpan,s3);</code></pre><p>//////////////////////////////////////////////////////</p><p>or <code>finishSpan = (Spanned) TextUtils.concat(s1,s2,s3);</code></p><p>I have the same code but when I merge 3 object,the result is wrong.I have checked that the type of certain elements are true.<br>beginningOfModifiedSpannable is bold, selectionSpannable is normal,endOfModifiedSpannable is boldBut their merging is wrong. Only the last part of the result string is bold. Why it happens?? I have the same code above and it works well!</p><pre><code>  Spannable str = contentText.getText();            Spannable selectionSpannable = new SpannableStringBuilder(str, selectionStart, selectionEnd);            StyleSpan[] ss = selectionSpannable.getSpans(0, selectionSpannable.length(), StyleSpan.class);            boolean exists = false;            for (int i = 0; i &lt; ss.length; i++) {                if (ss[i].getStyle() == android.graphics.Typeface.BOLD){                 selectionSpannable.removeSpan(ss[i]);                    exists = true;                }            }            if (!exists){                str.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), selectionStart, selectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);            }            else {             Spannable endOfModifiedSpannable = new SpannableStringBuilder(str, selectionEnd, contentText.getText().length());             Spannable beginningOfModifiedSpannable = new SpannableStringBuilder(str, 0, selectionStart);             Spanned finishSpan = null;             if(beginningOfModifiedSpannable.length() &gt; 0) {              if(endOfModifiedSpannable.length() &gt; 0) {               finishSpan = (Spanned) TextUtils.concat(beginningOfModifiedSpannable,selectionSpannable);               finishSpan = (Spanned) TextUtils.concat(finishSpan,endOfModifiedSpannable);                 }              else {               finishSpan = (Spanned) TextUtils.concat(beginningOfModifiedSpannable,selectionSpannable);              }             }             else {              if(endOfModifiedSpannable.length() &gt; 0) {               finishSpan = (Spanned) TextUtils.concat(selectionSpannable,endOfModifiedSpannable);                     }                  else {                   finishSpan = selectionSpannable;                  }                 }contentText.setText(finishSpan);</code></pre><p><strong>I repeat that I have checked that 3 parts are true</strong>. E.g. I have 3 parts:<b>Hel</b> lo,wor  <b>ld</b></p><p>I have noticed that the first merging is right:</p><pre><code>finishSpan = (Spanned) TextUtils.concat(beginningOfModifiedSpannable,selectionSpannable);</code></pre><p>It looks like <b>Hel</b>lo,wor</p><p>But the second is wrong </p><pre><code>finishSpan = (Spanned) TextUtils.concat(finishSpan,endOfModifiedSpannable);</code></pre><p>or this merging is wrong:</p><pre><code>finishSpan = (Spanned) TextUtils.concat(finishSpan,selectionSpannable,endOfModifiedSpannable);</code></pre><p>And the result of wrong string is:Hello,wo<b>rld</b></p><p>But the true result must be like this:</p><p><b>Hel</b>lo,<b>world</b></p><p>Nonsense!</p>","565447","","565447","","2011-01-12 13:39:53","2011-05-14 01:02:48","Error in merging spannable objects","<android>","1","0","","",""
"4669331","1","","","2011-01-12 13:32:24","0","233","<p>I have such a problem. To get email accounts I want to use class Preferences from com.android.email package and IDE allow me to do this, but when I start my application I get exception NoClassFoundError: com.android.email.Preferences. I also want to add the following items:</p><ol><li>Target of application is 2.1.</li><li>I imported com.android.email package to the project.</li><li> was added to manifest.</li><li>The appliction was istalled as a system application programm.</li></ol>","341998","","","","","2011-01-12 13:32:24","How to use class from third party application in Android?","<android><class><third-party>","0","2","","",""
"4669356","1","","","2011-01-12 13:36:00","0","981","<p>I got a problem with a service: I'd like to create a notification that say to the user that there's no location provider, this is my code:</p><pre><code>Notification notificationNoProvider = new Notification(R.drawable.icon, message, System.currentTimeMillis());Intent notificationIntent = new Intent();PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, 0);notificationNoProvider.setLatestEventInfo(this,message,message, pendingIntent);notificationManager.notify(message.hashCode(), notificationNoProvider);</code></pre><p>The application gives me a NullPointerException in the getActivity method of PendingIntent.I tryed also with getApplicationContext instead of geBasecontext but the application still explode.I've found that the problem is at this line of getActivity:</p><pre><code>public static PendingIntent  [Search] getActivity(Context context, int requestCode,Intent intent, int flags) {    String packageName = context.getPackageName();//here the application explodes</code></pre><p>How can I solve this problem?</p><p>Thanks</p>","499140","","","","","2011-03-09 16:55:55","Android Service notification","<android><service><notifications>","1","0","","",""
"4669358","1","4669381","","2011-01-12 13:36:03","0","172","<p>I want to send the <code>Button</code> <code>View</code> to another activity, eg. </p><pre><code>Button bttn=(Button )findViewById(R.id.bttn)startActivity(new Intent(this,Account.class))</code></pre><p>by using bundles we can send values from 1 Activity to another activity,same way how i can send view to another activity..</p>","555221","","844882","","2012-03-22 20:15:17","2012-03-22 20:15:17","Android Activity","<android>","2","1","","",""
"4669378","1","4669753","","2011-01-12 13:37:43","1","4477","<p>So essentially what I've been trying to do is to get an object (the player) to fire a bullet in a straight line from it in angle and then just continue on, so if the 'gun' is pointed at an angle of 35 degrees ( with 0 degrees being to the right of the screen adding up to 360 going counter-clockwise) then the bullet wil travel at a constant speed (say 5) at that angle from the origin.</p><p>Because the way i've been doing my movement is i've had a function called update that would handle all the drawing and what not and then when it came to movement it would just add a vertical speed and a horizontal speed to the already existing x and y and it's just been too hard to try and work around it so that it adds a suitable horizontal and vertical speed to move at that angle at a constant speed, so any help will be appreciated.-Heath</p>","527926","","","","","2013-06-24 00:01:23","Moving an object from point A to point B in a straight line at a constant speed","<java><android>","1","0","0","",""
"4669398","1","4669440","","2011-01-12 13:40:21","2","2420","<p>here is a line in layout file  <pre><code> <code>&lt;TextView         android:id=""@+id/username""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:text=""@string/username""        android:textAppearance=""?android:attr/textAppearanceMedium""</code>> </code></pre><b>in about context what is the exact meaning of </b> <pre><code>android:textAppearance=""?android:attr/textAppearanceMedium"" </code></pre>is that related to <b>""?[package:][type:]name"" </b> , if yes then what that refers to ?</p>","526359","","","","","2012-03-16 10:49:45","need explanation for android layout syntax","<android><layout>","1","1","","",""
"4669464","1","4669511","","2011-01-12 13:47:06","56","26120","<p>I have an EditText with some dummy text in it. When the user clicks on it I want it to be selected so that when the user starts typing the dummy text gets deleted.</p><p>How can I achieve this?</p>","517460","","","","","2013-07-22 14:18:10","Select all text inside EditText when it gets focus","<android><edittext>","6","0","6","",""
"4669487","1","4670429","","2011-01-12 13:49:50","5","16720","<p>I am planning to create an application which the user can put security to their SMS. Is there a possibility for me to see the source code of the Messaging of Android phone? How?</p>","516160","","","","","2011-10-18 14:58:00","Source code of android messaging","<android><eclipse><sms>","3","0","2","",""
"4669489","1","","","2011-01-12 13:50:14","0","653","<p>I have a FrameLayout containing first a SurfaceView, and second a RelativeLayout which in turn contians various Buttons and TextViews.</p><p>Upon the canvas of the SurfaceView I am drawing numerous Bitmaps, and, via Touch and Motion Events am allowing the user to drag them around.</p><p>These Bitmaps, when dragged around pass <em>underneath</em> the Buttons etc that are inside the RelativeLayout.</p><p>Now, it's my (possibly mistaken) understanding that the ""Z-level"" of the SurfaceView, or whatever it has that passes for it, is entirely unrelated to the <em>actual</em> Z-level of the rest of the Layout.  Is this the case?  If so, how may I get around it, so that dragged Bitmaps are drawn ontop of other Views?  Or what other way can I implement a full-screen canvas and yet not have my buttons etc act like the controls of an overlay.</p><p>I guess what I actually need is an <em>underlay</em>, where touch events can still be picked up by the Buttons etc underneath. But I don't know how to achieve this, as, when redrawing my Canvas, I have to also redraw the background.</p><p>Can I swap the order of the RelativeLayout and the SurfaceView inside the FrameLayout, and then make the background of the Canvas transparent?  If so how?  Will touch events still ""fall through"" to the buttons underneath?</p><p>Thanks for bearing with me, I know I'm a bit of a waffler.</p>","442912","","442912","","2011-01-12 14:04:36","2014-04-17 23:16:23","Android: SurfaceView and Z-Level Question","<android><canvas><transparency><surfaceview><framelayout>","2","0","1","",""
"4669576","1","5458232","","2011-01-12 13:57:47","0","259","<p>I want to include a new service related to mediaserver in my android device.</p><p>I tried making changes to the mediaserver and pushing it into the device.   When i compiled and pushed into the device, the device did not boot. My logcat showed ""MediaPlayer is not published.. waiting..."".    When i checked running the service from the shell it showed, ""link_image[1995]: failed to link mediaserver CANNOT LINK EXECUTABLE""    </p><p>I removed the changes from mediaserver and tried to push the exe into the device. It showed the same problem but when i pushed the mediaserver exe(took backup fearing stuffs like this would happen. .:( )the device boots properly. </p><p>I created a new service and modified init.rc to run the new service but it does not the start the service. Instead it shows CANNOT LINK EXECUTABLE.</p><p>I tried to figure out the prob but the only difference I could find was the chmod to 777 and chown to shell. Even after that it is not booting.. :( If this is solved I think I will be able to make changes to mediaserver. Someone help me find out a solution..!</p>","504712","","","","","2011-03-28 11:21:07","service in android","<android>","1","0","","",""
"4669581","1","4669751","","2011-01-12 13:58:12","0","1119","<p>I have bought a 7'' pad from a chineese supplier, claiming that it is a 'Android 2.0'. But in the settings menu I read this:</p><p>Firmware version: 1.6Kernel version: 2.6.29-00236-g48dbbb-dirtyBuild number: WMT2.1.2_105</p><p>The supplier points at the build number, claiming that this is the 'Android version'. What is the significance of 'build number', anything to do with the 'Android version', or unrelated?And, what is really my 'Android version'? </p>","572789","","","","","2011-01-12 14:16:44","Determine Android version","<android>","2","2","","2011-01-12 14:18:19",""
"4669627","1","4670007","","2011-01-12 14:02:05","16","13514","<p>I am building an app that starts when a user takes a picture using their build-in Android camera, then taps the Share button, then chooses my app as the sharer, which is expecting an incoming path to the picture that was just taken, which it uses for processing.</p><p><strong>Question</strong>: how do I add an option to the ""Share via"" list that points to my app?  Right now there are options like Facebook, Email, Messages, Twitter, Picasa, and I want to add my app w/ an icon.</p><p>I'm stuck!  And, Google'ing for this is not easy, as ""android add to share via list camera"" yields a lot of results.  I'm building the app with AppInventor (AI), but, AI does not allow developers to edit the Share via list, so maybe this will have to be a separate mini app that just adds to the list...?  Hopefully not, because it'd be great to have just 1 app for users to download/install.</p><p>Thanks!</p>","263170","","","","","2011-11-11 11:54:40","Android: how to add app to ""Share via"" list for camera picture","<android>","1","0","11","",""
"4669652","1","4670030","","2011-01-12 14:04:44","0","909","<p>I have a scenatio where i have to find the <strong>longitude and latitude</strong> Using Jscript.</p><p>I have a mobile application where i have to implement this.Or may be there is some way to use GPS to find the device current location</p><p>Please, Help</p><p>Thanks,Regards,Shivam Khare</p>","397868","","397868","","2011-01-12 14:28:39","2011-10-06 20:28:13","find the **longitude and latitude** Using Jscript for Mobile application","<javascript><android><mobile-phones><mobile-website>","3","0","","",""
"4669682","1","4670488","","2011-01-12 14:07:46","1","554","<p>I've seen there are many different ""themes"" for the Android, depending on the device. For example on my HTC WildFire the highlight color is a ""lime green"", and that of the emulator is orange. </p><p>Is there anyway to know what are the main interface colors of the device in which my app is running? </p><p>So i can set (for example) <code>TextView</code>s background colors to match the device theme.</p><p>EDIT: You told me this is not possible so... </p><p>Is there any way to draw a simple rectangle with the highlight color? Maybe a void button?</p><p>Thanks!!</p>","396133","","396133","","2011-01-12 15:35:31","2011-01-13 05:54:44","How to know the colors of a particular Android phone","<android><themes><htc>","4","0","","",""
"4669747","1","","","2011-01-12 14:14:54","0","1046","<p>is it possbile to fill the circle to some degrees i.e(90 or 270 etc).</p><p>thankx</p>","411359","","","","","2011-01-12 14:32:33","is it possible to fill the circle by degrees in android?","<android>","3","0","1","",""
"4669823","1","","","2011-01-12 14:22:12","18","3253","<p>I'm about to develop a major touch-enabled mobile WebKit application.</p><p>I'm looking for <strong>any hints</strong> or advices about things that differ from a standard desktop-based browser(s).</p><p>For example: </p><ul><li><p>on iOS <code>click</code> events do not propagate upward to the <code>body</code> element over elements, except for some cases (links, inputs, elements with attached events, etc.). </p></li><li><p>Android WebKit does not emit events for multi-touch.</p></li></ul><p>I know about these. <strong>Are there some other problems? Do you know about some list of known problems?</strong></p>","437523","","","","","2013-02-08 20:37:49","Gotchas/bugs in development for WebKit on iOS or Android","<android><ios><html5><webkit>","9","0","12","",""
"4669940","1","4671235","","2011-01-12 14:31:59","0","1377","<p>I've download the <a href=""https://www.dropbox.com/developers/releases"" rel=""nofollow"">Dropbox Android API</a>, unpacked the sample project and opened it in Eclipse. However it has trouble with importing the API:</p><pre><code>import com.dropbox.client.DropboxAPI;import com.dropbox.client.DropboxAPI.Config;</code></pre><p>it can't find it. I have <code>dropbox-client-1.0-SNAPSHOT.jar</code> in the lib folder of my project, which is where I assume these classes are, but it can't access them. What do I need to do to get up and running?</p>","319618","","","","","2011-08-13 01:05:32","Dropbox Android API sample project won't run","<android><eclipse><import><dropbox-api>","1","0","2","",""
"4669952","1","4670032","","2011-01-12 14:32:56","0","793","<p>if i create static button in one activity  and use in another activity it shows error as </p><pre><code>/*********************************01-12 19:57:17.030: DEBUG/PhoneWindow(21860): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@2f5671b8 has no id.*************************************/</code></pre><p>my code is ::</p><pre><code>public static LoginButton bttn;  findViewById(R.id.login).setOnClickListener(new OnClickListener(){   public void onClick(View v) {    // TODO Auto-generated method stub    bttn = (LoginButton)findViewById(R.id.login);    startActivity(new Intent(Account.this,Example.class));   }  });</code></pre><p>In 2nd activity i use this static button as</p><pre><code>Account.bttn.init(this, mFacebook);</code></pre>","555221","","473070","","2011-01-12 14:44:21","2011-01-12 15:21:28","Android Activity","<android>","1","0","","",""
"4669956","1","4669999","","2011-01-12 14:33:23","0","268","<p>code...</p><pre><code>submit.setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {      rg.setOnCheckedChangeListener(new OnCheckedChangeListener() {          public void onCheckedChanged(RadioGroup group, int checkedId) {            String id = Integer.toString(checkedId);                DisplayToast(Integer.toString(checkedId));          }      });   }});</code></pre><p>What i am trying to do is have a user select one of the radio buttons (in rg) and then when they click on submit then the toast is displayed. I think the issue is that the onchecklistener can not be inside another listener...is this possible to do?</p><p>The radio buttons are created dynamically and added to rg(radio Group)...</p><pre><code>while (cursor.moveToNext()) {       rb[i]  = new RadioButton(this);   rg.addView(rb[i]);    rb[i].setText(cursor.getString(1));   i ++;}</code></pre>","569654","","473070","","2011-01-12 14:43:05","2011-01-12 14:43:05","Android Radio Button inside Submit Button?","<android>","1","0","","",""
"4669990","1","4670193","","2011-01-12 14:38:14","1","1176","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to do this thing: when I start my application it calling to input a pin code, but if you want to input a number you have to click on the pin field. How to call number keyboard automatically? I'm using Samsung gt-i5500, it's touchscreen.</p>","572853","","","","","2011-01-12 15:16:35","How to call number keyboard automatically?","<java><android><eclipse><keyboard><numbers>","3","0","","",""
"4670002","1","5254315","","2011-01-12 14:39:30","3","4507","<p>I am working on creating a card game for android. I am trying to come up with a layout that will allow the game to be played on all screen sizes and densities.</p><p>I have read: <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>However, I am still confused on the best way to do this.</p><p>For this game, I need the cards laid out in landscape mode, in 5 columns. There are places above the 5 columns for additional cards. It is very similar to solitaire in this respect...but I only have need for 5 columns instead of 7.</p><p>What size card images should be in ldpi, mdpi, and hdpi? </p><p>What type of layout should I use (Table, Linear, Relative)?</p><p>Should I create different layouts for the different screen sizes (small, normal, large)?</p><p>Any examples you can point me to?</p>","572854","","1140748","","2012-05-06 16:08:30","2012-06-08 19:12:14","Flexible android layout for multiple screen sizes/densities","<android><layout><size><screen>","2","2","","",""
"4670098","1","4670236","","2011-01-12 14:49:21","1","65","<p>I'm working pn an andorid app with a tabbed interface and in each tab I want to display text in grid format along with some controls to manipulate the data. Right now I'm using a single table layout but the problem is getting the formatting to work with displaying both the text and controls. The controls end up affecting the width of the text columns. Here's a screenshot:<a href=""http://www.pikefin.com/img/emulator.png"" rel=""nofollow"">http://www.pikefin.com/img/emulator.png</a></p><p>I was wondering if it's possible to get two table layouts working on the same screen? (I played around with this some but couldn't get it to work)</p><p>Or should I be looking at taking a completely different approach?</p>","549226","","","","","2011-01-12 15:03:07","Question about table layouts","<java><android>","2","0","","",""
"4670130","1","4670818","","2011-01-12 14:52:11","2","1099","<p>Is there a way to disable the vibration for the OnLongClick event?</p><p>I want no vibration or if enabled a custom vibration.</p><p>EDIT:Thank you that did it!</p>","566890","","566890","","2011-01-12 20:49:08","2011-01-12 20:49:08","Android: Disable default vibration of OnLongClick","<android>","1","1","","",""
"4670215","1","7635154","","2011-01-12 15:00:36","5","7987","<p>i have a basic function which requires serializing in my android app. The user will add some values to an ArrayList and i want to serialize it to avoid using a database for this little option and of course TO LEARN how to serialize (i'm a begginer) because it seems useful. Anyways the user save something in the arraylist, the program shuts down, the program starts up again and the user is able to see the saved data. How can i implement this? Can you provide some code snippet or a useful link?</p><p>Thanks a lot!!   </p>","526924","","","","","2012-05-13 23:36:19","how to serialize ArrayList on android","<android>","2","5","1","",""
"4670294","1","","","2011-01-12 15:09:09","0","595","<p>I want to make an android app that does video recording. I am using eclipse to do the coding. I would appreciate if someone could help me with the coding. Since i am new to android, it'll be great if I get a detailed reply. Thanks.</p>","570110","","","","","2011-01-12 15:25:58","android video recording","<android><video-recording>","0","2","","",""
"4670296","1","4678940","","2011-01-12 15:09:13","0","396","<p>In my application I have a class that extends the org.xml.sax.helpers.DefaultHandler class. It's purpose is to read rss feeds. My problem is that when reaching the ""enclosure tag"", the characters method doesn't get called, so I can't extract the image's url. Does anybody know why is this happening?</p><pre><code>public class RSSHandler extends DefaultHandler {private RSSFeed feed;private RSSItem item;boolean bFoundChannel = false;final int RSS_TITLE = 1;final int RSS_LINK = 2;final int RSS_DESCRIPTION = 3;final int RSS_CATEGORY = 4;final int RSS_PUBDATE = 5;final int RSS_ENCLOSURE = 6;int depth = 0;int currentstate = 0;private final String CHANNEL_ELEMENT = ""channel"";private final String IMAGE_ELEMENT = ""image"";private final String ITEM_ELEMENT = ""item"";private final String TITLE_ELEMENT = ""title"";private final String DESCRIPTION_ELEMENT = ""description"";private final String LINK_ELEMENT = ""link"";private final String CATEGORY_ELEMENT = ""category"";private final String PUBDATE_ELEMENT = ""pubDate"";private final String ENCLOSURE_ELEMENT = ""enclosure"";private final String LESS_THAN_SIGN = ""&lt;"";private final String GREATER_THAN_SIGN = ""&gt;"";private final String IMAGE_SOURCE_PATTERN = ""src='(.*?)'"";/* * getFeed - this returns our feed when all of the parsing is complete */public RSSFeed getFeed() {    return feed;}public void startDocument() throws SAXException {    // initialize our RSSFeed object - this will hold our parsed contents    feed = new RSSFeed();    // initialize the RSSItem object - we will use this as a crutch to grab the info from the channel    // because the channel and items have very similar entries..    item = new RSSItem();}public void endDocument() throws SAXException {}public void startElement(String namespaceURI, String localName,String qName, Attributes atts) throws SAXException {    System.out.println(""###START_ELEMENT - localName: "" + localName +             ""; qName: "" + qName);    depth++;    if (localName.equals(CHANNEL_ELEMENT)) {        currentstate = 0;        return;    } else if (localName.equals(IMAGE_ELEMENT)) {        // record our feed data - we temporarily stored it in the item :)        feed.setTitle(item.getTitle());        feed.setPubDate(item.getPubDate());    } else if (localName.equals(ITEM_ELEMENT)) {        // create a new item        item = new RSSItem();        return;    } else if (localName.equals(TITLE_ELEMENT)) {        currentstate = RSS_TITLE;        return;    } else if (localName.equals(DESCRIPTION_ELEMENT)) {        currentstate = RSS_DESCRIPTION;        return;    } else if (localName.equals(LINK_ELEMENT)) {        currentstate = RSS_LINK;        return;    } else if (localName.equals(CATEGORY_ELEMENT)) {        currentstate = RSS_CATEGORY;        return;    } else if (localName.equals(PUBDATE_ELEMENT)) {        currentstate = RSS_PUBDATE;        return;    } else if (localName.equals(ENCLOSURE_ELEMENT)) {        System.out.println(""====&gt;&gt;    ENCLOSURE_ELEMENT"");        currentstate = RSS_ENCLOSURE;        return;    }    // if we don't explicitly handle the element, make sure we don't wind up erroneously     // storing a newline or other bogus data into one of our existing elements    currentstate = 0;}public void endElement(String namespaceURI, String localName, String qName) throws SAXException {    depth--;    if (localName.equals(ITEM_ELEMENT)) {        // add our item to the list!        feed.addItem(item);        return;    }}public void characters(char ch[], int start, int length) {    String theString = new String(ch,start,length);    Log.i(""RSSReader"",""_______characters["" + theString + ""] - currentstate: "" + currentstate);    if (theString.equals(LESS_THAN_SIGN) || theString.equals(GREATER_THAN_SIGN)            || (theString.trim().length() == 0)) {        return;    }    switch (currentstate) {    case RSS_TITLE:        item.setTitle(theString);        break;    case RSS_LINK:        item.setLink(theString);        break;    case RSS_DESCRIPTION:        item.setDescription(theString);        break;    case RSS_CATEGORY:        item.setCategory(theString);        break;    case RSS_PUBDATE:        item.setPubDate(theString);        break;    case RSS_ENCLOSURE:        Pattern p = Pattern.compile(IMAGE_SOURCE_PATTERN);        Matcher m = p.matcher(theString);        if (m.find()) {            try {                Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(m.group(1)).getContent());                item.setImage(bitmap);            } catch (MalformedURLException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            }        }        break;    default:        return;    }}</code></pre><p>Thanks a lot,</p><p>Gratzi</p>","460611","","460611","","2011-01-12 15:22:51","2011-12-09 13:09:59","characters method not called for the enclosure tag","<android>","1","2","","",""
"4670321","1","4670399","","2011-01-12 15:11:16","2","657","<p>I've just added the required code to my Android app and released the update to market.</p><p>Thinking about it though, I wondered what the data usage was like. Analytics doesn't send the tracking data immediately, instead it sends cached data at a set time interval or manually with a call in your app.</p><p>In my app I do this every minute. I don't think this is excessive as my app probably won't be open for long periods of time between uses.</p><p>I have three activities in my app that each track as a pageview. If the main activity is loaded it is tracked once. If nothing happens (i.e. no reloads or loads of other activities) after this one tracked pageview, will it continue to send data or will it know nothing has changed and therefore only send further data when more pageviews are tracked?</p><p>Cheers</p>","67419","","","","","2011-01-12 15:18:24","Using Google Analytics with Android - Data Usage","<android><google-analytics>","1","0","","",""
"4670328","1","4670577","","2011-01-12 15:12:00","0","1039","<p>I'm using graph api from youtube , and i am facing some trouble .</p><p>I can send a msg to the wall , it works fine . The problem is that every time ,  it shows the login page and the user have to click at the ok button to send it. I'd like to send it without showing that page  , it should only shows at the first time . I store the token usingshared preferences  , but if i dont call the method facebook.autorize , which shows the login page ,  before trying to send the video , it does not work .</p><p>Am i doing it wrong ? thanks for any help .</p><p>My code :</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.facebook_lay);    init();    acessToken = loadAccessToken();    Log.i(""teste"",""Acesstoken depois do load : "" + acessToken);    if(acessToken == null || acessToken.equals("""")){        login();    }else{        Log.i(""teste"",""Session valid com token salva ? "" + mFacebook.isSessionValid());        sendVideo();    }}private void init(){    mFacebook = new Facebook(APP_ID);    videoUrl = getIntent().getExtras().getString(""videoUrl"");    preferences = this.getSharedPreferences(APPLICATION_PREFERENCES,            Context.MODE_PRIVATE);}private void login(){    mFacebook.authorize(this, new String[] {""publish_stream"",""offline_access""},new AuthorizeListener());}public void postOnWall(String msg) {  Log.i(""teste"", ""Testing graph API wall post"");   try {          Bundle parameters = new Bundle();          parameters.putString(""message"", AUTO_MSG);          parameters.putString(""link"", msg);          mFacebook.request(""me/feed"", parameters,           ""POST"");   } catch(Exception e) {       e.printStackTrace();   }}private void storeToken(String token){    Log.i(""teste"",""storeToken: "" + token);    Editor editor = preferences.edit();    editor.putString(ACESS_TOKEN, token);    editor.commit();}private String loadAccessToken() {    String token = preferences.getString(ACESS_TOKEN, null);    if (token != null &amp;&amp; !token.equals("""")  ) {        return token;    } else {        return null;    }}private void sendVideo(){    dialog = ProgressDialog.show(FacebookView.this, ""Sending"",""Enviando video ..."");    new Thread(){        public void run() {            postOnWall(videoUrl);            dialog.dismiss();            finish();        };    }.start();}class AuthorizeListener implements DialogListener{    @Override    public void onCancel() {        Log.i(""teste"",""Logou candelado!"");        finish();    }    @Override    public void onComplete(Bundle values) {        Log.i(""teste"",""Logou com sucesso!"");        Log.i(""teste"", ""AcessToken : "" + mFacebook.getAccessToken());        Log.i(""teste"", ""AcessToken expires : "" + mFacebook.getAccessExpires());        Log.i(""teste"", ""Session valid : "" + mFacebook.isSessionValid());        storeToken(mFacebook.getAccessToken());        sendVideo();    }    @Override    public void onError(DialogError e) {        Log.i(""teste"",""Erro ao logar: "" + e.getMessage());        finish();    }    @Override    public void onFacebookError(FacebookError e) {        Log.i(""teste"",""FacebookError ao logar: "" + e.getMessage());        Log.i(""teste"",""FacebookError ao logar Causa: "" + e.getCause());        e.printStackTrace();                    finish();    }}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    // TODO Auto-generated method stub    mFacebook.authorizeCallback(requestCode, resultCode, data);}</code></pre>","569873","","","","","2011-03-10 12:09:56","post on facebook wall always show login page .. problem android","<java><android><facebook>","2","0","","",""
"4670475","1","","","2011-01-12 15:24:20","1","800","<p>Hi I got a problem with a spinner, after selecting an item the position of elements in the list change, here's my code:private static class ServerListItemAdapter extends BaseAdapter {</p><pre><code>    private ArrayList&lt;ServerData&gt; serverList;    private LayoutInflater mInflater;    public ServerListItemAdapter(Context context,ArrayList&lt;ServerData&gt; _serverList) {         mInflater = LayoutInflater.from(context);         serverList=_serverList;     }    @Override    public int getCount() {        return serverList.size();    }    @Override    public Object getItem(int pos) {        return serverList.get(pos);    }    @Override    public long getItemId(int pos) {        return serverList.get(pos).hashCode();    }    private void printServerList(){        Log.d(TAG, ""PRINT - start"");        int pos=0;        for(ServerData server:serverList){            Log.d(TAG, pos+"":""+server.serverName);            pos++;        }        Log.d(TAG, ""PRINT - end"");    }    @Override     public View getView(int position, View convertView, ViewGroup parent) {        Log.d(TAG, ""getView -start- pos:""+position);        printServerList();         final ViewHolder holder;         if (convertView == null) {             convertView = mInflater.inflate(R.layout.select_server_list_item, null);             holder = new ViewHolder();             holder.server=serverList.get(position);             Log.d(TAG,""Pos:""+position+"", server:""+holder.server.serverName);             holder.txtServerName=(TextView)convertView.findViewById(R.id.txt_server_name);             Log.d(TAG, ""Set text for position ""+ position+ "": ""+ holder.server.serverName);             holder.txtServerName.setText(serverList.get(position).serverName);             convertView.setTag(holder);         } else {             holder = (ViewHolder) convertView.getTag();         }         Log.d(TAG, ""getView -end- pos:""+position);         return convertView;     }     static class ViewHolder {         TextView txtServerName;         ServerData server;     }}private class ServerData{    public String serverName="""";    public String serverURL="""";    public ServerData(String _serverName,String _serverURL){        serverName=_serverName;        serverURL=_serverURL;    }}</code></pre><p>If I start with a list like { A,B,C} and I select A, the list became {A,B,A} but into the code, as you can see, there's no statement that ask android to do so.</p><p>Thanks</p>","499140","","","","","2011-05-26 20:53:11","Android spinner change position of element after selection","<android>","1","1","","",""
"4670504","1","4670556","","2011-01-12 15:26:51","2","2877","<p>In standard Java, the accessible classes are the classes present in the classpath or whose containing .jar file is in the classpath. By accessible, I mean that you can refer to these classes in your source code. By example, you can type <pre><code>   System.out.println(""hello"");</pre></code>because the System class (or rather its containing .jar) is in the classpath.</p><p>Is there a notion of classpath in Android ?</p><p>What are the accessible classes ?</p><p>In particular, how can I make a class in an apk accessible to classes in other apks ?</p>","572674","","","","","2011-05-20 08:09:14","android classpath","<android>","4","0","0","",""
"4670553","1","","","2011-01-12 15:31:42","1","1195","<p>I have decided to use views for my tab interface... I follow a tab interface tutorial and the result of this tutorial is 4 tabs without content (text) under my tabs..</p><p>I was wondering how views working.. how can I make a method to set content to tab from an another class.. So main.java is my main file with the views (tabs). Tab1.java has google maps navigate code. </p><p>How I can invoke the method setupTab and set the navigation function to tab 1.</p><p>Here you can see my code:<br />Thanks in advance!</p><pre><code> package CustomTabs;      import android.app.Activity;    import android.graphics.drawable.Drawable;    import android.os.Bundle;    import android.view.View;    import android.widget.TabHost;    import android.widget.TextView;    import android.widget.TabHost.TabContentFactory;    import android.widget.TabHost.TabSpec;    public class CustomTabs extends Activity {     private TabHost mTabHost;     private void setupTabHost() {      mTabHost = (TabHost) findViewById(android.R.id.tabhost);      mTabHost.setup();     }     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      // construct the tabhost      setContentView(R.layout.main);      setupTabHost();      setupTab(new TextView(this), ""Tab 1"", getResources().getDrawable(R.drawable.ic_tab_artists));      setupTab(new TextView(this), ""Tab 2"", getResources().getDrawable(R.drawable.ic_tab_artists));      setupTab(new TextView(this), ""Tab 3"", getResources().getDrawable(R.drawable.ic_tab_artists));      setupTab(new TextView(this), ""Tab 4"", getResources().getDrawable(R.drawable.ic_tab_artists));      {       final View v = mTabHost.getTabWidget().getChildAt(0);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }      {       final View v = mTabHost.getTabWidget().getChildAt(1);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }      {       final View v = mTabHost.getTabWidget().getChildAt(2);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }      {       final View v = mTabHost.getTabWidget().getChildAt(3);       v.setBackgroundDrawable(getResources().getDrawable(R.drawable.tab_bg_selector));       TextView tv = (TextView) v.findViewById(android.R.id.title);       tv.setTextColor(this.getResources().getColorStateList(R.drawable.tab_text_selector));      }     }     private void setupTab(final View view, final String tag, Drawable icon) {      TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tag, icon).setContent(new TabContentFactory() {       public View createTabContent(String tag) {return view;}      });      mTabHost.addTab(setContent);     }    }</code></pre>","468003","","","","","2012-08-18 19:59:54","Android Tabs Views","<java><android><xml><tabs><android-tabhost>","1","0","","",""
"4670758","1","4671076","","2011-01-12 15:48:22","0","485","<p>i have created an app with 16 btns,every btn plays a sound mp3.my app starts with no problem.i press and listen one mp3,two mp3...until 7 mp3...there my app forces down.i can play any mp3 i like but i can only play the 7 mp3 i click first,where is my error?</p><pre><code>Button button = (Button) findViewById(R.id.btn);  button.setOnClickListener(new View.OnClickListener() {      public void onClick(View v){        MediaPlayer mp = MediaPlayer.create(ClickAndPlayMusic.this, R.raw.gata);          mp.start();        Toast.makeText(ClickAndPlayMusic.this, ""Cat"", Toast.LENGTH_SHORT).show();    }      });              Button button2 = (Button) findViewById(R.id.btn2);          button2.setOnClickListener(new View.OnClickListener() {             public void onClick(View v){               MediaPlayer mp = MediaPlayer.create(ClickAndPlayMusic.this, R.raw.lion);              mp.start();                                   Toast.makeText(ClickAndPlayMusic.this, ""Lion"", Toast.LENGTH_SHORT).show();           }        });      </code></pre><p>this is the way i have created every music btn...thanks!(hope my answer is understandable)</p><p>ps:this is my logcat view when it forces down:</p><pre><code>01-12 17:59:39.445: WARN/dalvikvm(16090): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)01-12 17:59:39.449: ERROR/AndroidRuntime(16090): FATAL EXCEPTION: main01-12 17:59:39.449: ERROR/AndroidRuntime(16090): java.lang.NullPointerException01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at com.example.ClickAndPlayMusic.ClickAndPlayMusic$1.onClick(ClickAndPlayMusic.java:33)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at android.view.View.performClick(View.java:2461)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at android.view.View$PerformClick.run(View.java:8888)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at android.os.Handler.handleCallback(Handler.java:587)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at android.os.Handler.dispatchMessage(Handler.java:92)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at android.os.Looper.loop(Looper.java:123)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at android.app.ActivityThread.main(ActivityThread.java:4627)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at java.lang.reflect.Method.invokeNative(Native Method)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at java.lang.reflect.Method.invoke(Method.java:521)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-12 17:59:39.449: ERROR/AndroidRuntime(16090):     at dalvik.system.NativeStart.main(Native Method)01-12 17:59:39.457: WARN/ActivityManager(2796):   Force finishing activity com.example.ClickAndPlayMusic/.ClickAndPlayMusic01-12 17:59:39.461: INFO/(2796): dumpmesg &gt; ""/data/log/dumpstate_app_error.log""</code></pre><p>33 line is the mp.start(); in the onClick method of the first btn!</p><p>second logcatview:</p><pre><code>01-12 19:37:39.000: ERROR/PlayerDriver(2584): Command PLAYER_SET_DATA_SOURCE completed with an error or info -401-12 19:37:39.000: ERROR/MediaPlayer(20357): error (-4, -4)01-12 19:37:39.000: ERROR/TAGNAME(20357): Prepare failed.: status=0xFFFFFFFC01-12 19:37:39.000: WARN/System.err(20357): java.io.IOException: Prepare failed.:      status=0xFFFFFFFC01-12 19:37:39.000: WARN/System.err(20357):     at    android.media.MediaPlayer.prepare(Native Method)01-12 19:37:39.000: WARN/System.err(20357):     at com.example.ClickAndPlayMusic.ClickAndPlayMusic.playMedia(ClickAndPlayMusic.java:242)01-12 19:37:39.000: WARN/System.err(20357):     at com.example.ClickAndPlayMusic.ClickAndPlayMusic.access$0(ClickAndPlayMusic.java:237)01-12 19:37:39.000: WARN/System.err(20357):     at com.example.ClickAndPlayMusic.ClickAndPlayMusic$13.onClick(ClickAndPlayMusic.java:191)01-12 19:37:39.000: WARN/System.err(20357):     at android.view.View.performClick(View.java:2461)01-12 19:37:39.000: WARN/System.err(20357):     at   android.view.View$PerformClick.run(View.java:8888)01-12 19:37:39.000: WARN/System.err(20357):     at android.os.Handler.handleCallback(Handler.java:587)01-12 19:37:39.000: WARN/System.err(20357):     at android.os.Handler.dispatchMessage(Handler.java:92)01-12 19:37:39.000: WARN/System.err(20357):     at android.os.Looper.loop(Looper.java:123)01-12 19:37:39.000: WARN/System.err(20357):     at   android.app.ActivityThread.main(ActivityThread.java:4627)01-12 19:37:39.000: WARN/System.err(20357):     at java.lang.reflect.Method.invokeNative(Native Method)01-12 19:37:39.000: WARN/System.err(20357):     at java.lang.reflect.Method.invoke(Method.java:521)01-12 19:37:39.000: WARN/System.err(20357):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)01-12 19:37:39.000: WARN/System.err(20357):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)01-12 19:37:39.000: WARN/System.err(20357):     at dalvik.system.NativeStart.main(Native Method)01-12 19:37:39.008: INFO/MediaPlayer(20357): Info (1,26)01-12 19:37:39.008: ERROR/MediaPlayer(20357): Error (-4,-4)</code></pre>","519526","","321697","","2011-01-12 18:09:30","2011-01-12 18:35:08","My music app dies after 7 songs are played","<android>","2","0","","",""
"4670759","1","","","2011-01-12 15:48:28","5","1825","<p>I am trying to apply blend filters on two images (in this case HardLight). HardLight is not supported in the base Android library, so, I am doing it by hand on each pixel. The first run is working, but the speed is less than stellar. Generating a 500x500 image from a base 500x500 image and a 500x500 filter is taking way too long. This chunk of code is used to generate thumbnails as well (72x72), and it integral to the core of the application. I'd love some advice and/or hints on how to speed this up.</p><p>If huge gains can be made by making the assumption that neither image will have alpha, that is fine. <em>NOTE</em>: BlendMode and alpha are values not used in the example (BlendMode will chose the type of blend, in this case I hardcoded HardLight).</p><pre><code>public Bitmap blendedBitmap(Bitmap source, Bitmap layer, BlendMode blendMode, float alpha) {    Bitmap base = source.copy(Config.ARGB_8888, true);    Bitmap blend = layer.copy(Config.ARGB_8888, false);    IntBuffer buffBase = IntBuffer.allocate(base.getWidth() * base.getHeight());    base.copyPixelsToBuffer(buffBase);    buffBase.rewind();    IntBuffer buffBlend = IntBuffer.allocate(blend.getWidth() * blend.getHeight());    blend.copyPixelsToBuffer(buffBlend);    buffBlend.rewind();    IntBuffer buffOut = IntBuffer.allocate(base.getWidth() * base.getHeight());    buffOut.rewind();    while (buffOut.position() &lt; buffOut.limit()) {        int filterInt = buffBlend.get();        int srcInt = buffBase.get();        int redValueFilter = Color.red(filterInt);        int greenValueFilter = Color.green(filterInt);        int blueValueFilter = Color.blue(filterInt);        int redValueSrc = Color.red(srcInt);        int greenValueSrc = Color.green(srcInt);        int blueValueSrc = Color.blue(srcInt);        int redValueFinal = hardlight(redValueFilter, redValueSrc);        int greenValueFinal = hardlight(greenValueFilter, greenValueSrc);        int blueValueFinal = hardlight(blueValueFilter, blueValueSrc);        int pixel = Color.argb(255, redValueFinal, greenValueFinal, blueValueFinal);        buffOut.put(pixel);    }    buffOut.rewind();    base.copyPixelsFromBuffer(buffOut);    blend.recycle();    return base;}private int hardlight(int in1, int in2) {    float image = (float)in2;    float mask = (float)in1;    return ((int)((image &lt; 128) ? (2 * mask * image / 255):(255 - 2 * (255 - mask) * (255 - image) / 255)));}</code></pre>","157921","","157921","","2011-01-12 17:34:45","2011-01-13 17:05:13","Optimizing Per Pixel Blending on Android Bitmaps","<android><image-processing><bits-per-pixel><color-blending>","3","1","6","",""
"4670877","1","4671083","","2011-01-12 15:58:17","1","148","<pre><code>&lt;FrameLayout            android:id=""@+id/FrameLayout02""            android:layout_height=""fill_parent""            android:layout_width=""fill_parent""            &gt;            &lt;TabHost android:id=""@+id/tabhost""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""&gt;                &lt;TabWidget android:id=""@android:id/tabs""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                /&gt;                &lt;FrameLayout android:id=""@android:id/tabcontent""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:paddingTop=""62px""&gt;                    &lt;EditText                         android:id=""@+id/VisualPane""                         android:layout_width=""fill_parent""                         android:layout_height=""fill_parent""                     /&gt;                    &lt;EditText                         android:id=""@+id/HTMLPane""                         android:layout_width=""fill_parent""                         android:layout_height=""fill_parent""                        /&gt;                  &lt;/FrameLayout&gt;            &lt;/TabHost&gt;        &lt;/FrameLayout&gt;</code></pre><p>How Can I decrease this distance?<img src=""http://i.stack.imgur.com/l18zn.jpg"" alt=""http://s47.radikal.ru/i118/1101/92/6844493547b4.jpg"">I have tried to change the attribute</p><pre><code>android:paddingTop=""62px""</code></pre><p>But it is useless.</p>","565447","","","","","2011-01-12 16:17:11","How Can I decrease the distance in the TabHost?","<android><android-tabhost>","1","0","","",""
"4670917","1","4670950","","2011-01-12 16:02:02","0","49","<p>I have a list of Strings and every row has a button next to it. If the user clicks the button i want to retrieve the data for that row from the onClickListener. This sounds like impossible because there's no way I can retrieve data from a list without onItemClick. Is there a way to accomplish this with a button click instead?</p>","526924","","76465","","2012-06-01 12:13:11","2012-06-01 12:13:11","retrieving listrow data Android","<android>","2","0","","",""
"4670951","1","4671183","","2011-01-12 16:06:05","1","6732","<p>I have created a function that updates some values from a database that I need to use on multiple views.  Right now each class has its own copy of the code.  Basically I read the values and then want to update the text views. </p><p>I made a class for the DisplayTop which does the work, and locally its great.  But somehow I need to get the (TextView)findViewById sent over the the function I think.  I hope I am saying this right.  So what is the call to this and how to I resolved the (TextView)findViewById.  thanks for any help!</p><pre><code> public void DisplayTop2() {  int UserID = 1;  String D=Fun.getCurrentDateString();  String Sql;  Double a = 0.0;  Double b = 0.0;  SQLiteDatabase Db;  String myPath = DB_PATH + DB_NAME;  Db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);  Sql ="" SELECT a,b "" +  "" FROM test "" +  "" where Dte = '"" + D + ""' and UserID = "" + UserID;  try {   Cursor c = Db.rawQuery(Sql, null);   if (c != null ) {    if  (c.moveToFirst()) {     do {      a +=  (c.getDouble(c.getColumnIndex(""a"")));      b +=  (c.getDouble(c.getColumnIndex(""b"")));     }while (c.moveToNext());    }   }   c.close();  } catch (Exception e) {  }  Db.close();  // Here is where the problem is.  The real app has 5 fields.  // I can pass the R.id.a  // But how do I pass the reference to findViewById to the activity that called this  TextView tvt4 = (TextView)findViewById(R.id.a);  D = Fun.round( a,1,BigDecimal.ROUND_HALF_UP);  tvt4.setText( D )  ;   tvt4 = (TextView)findViewById(R.id.b);  D = Fun.round( b,1,BigDecimal.ROUND_HALF_UP);  tvt4.setText( D )  ; };</code></pre>","528130","","","","","2011-01-12 16:27:28","How call reference (TextView)findViewById from another class","<android><views>","1","0","1","",""
"4671073","1","4672445","","2011-01-12 16:16:45","0","199","<p>I want to somehow modify the content of the merge layout from the include tag. Is that possible?</p><p>Layout picAndText.xml:</p><pre><code>&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ImageView          android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:scaleType=""center""        android:src=""@drawable/golden_gate"" /&gt;    &lt;TextView        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_marginBottom=""20dip""        android:layout_gravity=""center_horizontal|bottom""        android:padding=""12dip""        android:background=""#AA000000""        android:textColor=""#ffffffff""        android:text=""Golden Gate"" /&gt;&lt;/merge&gt;</code></pre><p>And the layout xml that uses picAndText.xml:</p><pre><code>&lt;include layout=""@layout/picAndText"" android:id=""@+id/picText"" /&gt;</code></pre><p>Please note this is an example of what I would like to acomplish. I want to reuse complex layouts with multiple children but I need different text on them every time I reuse these without having to copy the whole layout everywhere...</p><p>Thanks!-Jona</p>","398248","","","","","2011-01-12 18:24:23","How to modify the childs text from a merge layout from the include xml tag?","<android><xml><layout>","1","0","","",""
"4671188","1","","","2011-01-12 16:27:44","0","2188","<p>Is it possible to define different classes of the same package in different apk ?By example having <pre><code>    package org.company;    public class A { ... }</pre></code>in an Android projectand <pre><code>    package org.company;    public class B { ... }</pre></code>in another Android project</p><p>Would it be a good thing to do ?</p>","572674","","","","","2011-01-12 18:23:36","same package name in different apk","<android>","2","0","1","",""
"4671233","1","4671376","","2011-01-12 16:31:23","3","1589","<p>I am in the very ealy stages of developing this app but looking into it I have already reached a problem. I need to be able to play an audio file backwards (you know like to reveal hidden messages ;)). I have no experience working with audio on android and have no idea if this is even possible.</p><p>I found a question on here which solves the problem in java (<a href=""http://stackoverflow.com/questions/1267488/play-wav-file-backward"">Click Here For Question</a>)</p><p>But this makes use of the javax.sound library which android does not support. Will I need this library to solve this problem or is there another way to reverse an audio file?</p>","400406","","","","","2012-01-05 16:39:06","Reverse audio file in Android","<android><audio><wav><reverse>","1","0","3","",""
"4671293","1","","","2011-01-12 16:36:19","0","363","<p>I have an android app that uses facebook graph api working just fine  . The problem is that , if the user remove my app from his facebook  , the next time i try to use the android app , it does not ask for permission , what makes my app crashs . How can i notify my app that the user have removed it from facebook .. ?</p><p>In that case i would ask for permission again to install the app .</p>","569873","","","","","2011-01-12 23:01:52","How can i notify my android app That user remove it from facebook?","<android><facebook>","2","0","","",""
"4671388","1","4746956","","2011-01-12 16:44:16","5","2496","<p>I have two Android Preference Screens defined in my Android app in XML.</p><p>For example, Screen 1</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=""screen1""&gt;    &lt;PreferenceCategory android:title=""Preferences""&gt;        &lt;CheckBoxPreference             android:defaultValue=""true""            android:title=""test""            android:key=""test_pref""/&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>and Screen 2</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=""screen2""&gt;    &lt;CheckBoxPreference         android:key=""checkbox""         android:title=""Checkbox""&gt;    &lt;/CheckBoxPreference&gt;&lt;/PreferenceScreen&gt;</code></pre><p>I would like screen 2 to be a separate screen to be accessible in its own right but I would also like its preferences to be a part of screen one also. Is there a simple way I can simply reference screen 2 from within screen 1? Or do I just need to essentially repeat the same preference stuff in a sub preference screen in Screen 1. </p>","516286","","","","","2011-03-29 20:23:37","References a separate Android preference screen from within another Preference Screen in XML","<android><xml><reference><preferencescreen>","2","2","1","",""
"4671428","1","4671472","","2011-01-12 16:46:36","25","20143","<p>The API says that the Alert Dialog can have one, two or three buttons, but the SDK only allows for a positive and negative button. How then can I add a third button?</p>","180825","","","","","2014-02-07 09:57:16","How can I add a third button to an Android Alert Dialog?","<android>","3","0","3","",""
"4671435","1","4671678","","2011-01-12 16:47:04","2","2131","<p>So I'm making an app where I want the users to be able add, edit and rate content, but I do not want to force them to register. Instead I was planning on just using their device id or device token to identify them. I'm planning on making both an iPhone and Android version, so I'm looking for a general solution, but the iPhone version has higher priority, so an iPhone specific solution would also be welcome.</p><p>The problem is that I don't want just anyone to be able to use my web service by sending a phony device id or someone else's device id.</p><p>How would the client prove to the server that it is providing the correct device id?</p>","310121","","","","","2011-07-14 20:00:19","How to make a secure login using UDID or device token?","<iphone><android><security><login><udid>","3","2","1","",""
"4671451","1","","","2011-01-12 16:47:58","0","497","<p>I'm just writing my first android app and in one layout xml file I have four buttons that will display a different layout when pressed.  Instead of creating four seperate screens, I've just put the four layouts in the same layout as the buttons with android:visibility=""GONE"", and then when a button is pressed, I set it's corresponding layout to being visible.</p><p>My question is, is there a best practice or suggested method for keeping track of the active layout so that when a button is pressed you can set the active layout back to visibility=""GONE"" before making the new one visible.  I thought I could just set a string value with the ID of the active layout, but then findViewById wont take the string to get a hold of the layout.  Any help or suggestions would be great.  Thanks!</p>","573038","","","","","2011-01-12 17:37:29","Hiding and showing android layouts - How do you mark active layout?","<android><android-layout><visibility>","1","0","1","",""
"4671515","1","","","2011-01-12 16:54:04","2","4884","<p>If user touchs the screen I can get coordinates of this touch by using methods of MotionEvent getX() and getY().</p><p>But if I understood it right for drawing of canvas other coordinates will be used. </p><p>My colleague meant, these are view and screen coordinates. But he didn't know, if there are some transformations methods.</p><p>Maybe you can help me.</p><p>Thank you in advance,</p><p>Mur</p><p><strong>UPD</strong></p><p>I've got a bit confusion. I'm using osmdroid, they are drawing overlays as canvas. </p><p>So if I'm comparing canvas coordinates they are using for drawing with MotionEvent coordinates I don't understand anything.  </p><p>These are coordinates of rectangle (left, right, bottom, top) 16899.0 / 16948.0 -86483.0 / -86515.0 I've printed out.</p><p>Coordinates of MotionEvent are 252.0 / 223.0</p>","408780","","408780","","2011-01-12 17:36:55","2013-11-14 08:06:25","screen and view coordinates in Android","<android><view><draw>","2","0","","",""
"4671525","1","4673868","","2011-01-12 16:55:06","1","2502","<p>I know how to capture video on android device, but i would like to capture video and add some other information on it e.g. some funny timeclock and save it all to file so the person watching the video will see the exact time of capturing. I would also like to add some watermark.Do you know how can i do it or is it possible on android device? I read the API but couldnt find anything that could help me.</p>","573046","","","","","2011-03-18 17:06:50","Android - capture video with watermark","<android><video-capture><video-processing>","2","0","3","",""
"4671614","1","4745031","","2011-01-12 17:03:01","1","1317","<p>Say I want to do the following:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(path, ""application/epub""); </code></pre><p>At the moment I'm having a tough time finding an app out there that has a filter setup for epub, and was wondering if anyone has any ideas.</p><p>My intent is to load an epub file in an external application, which will be initiated from mine. Tried using Aldiko, but it doesn't seem to have any filters setup for this.</p>","380579","","","","","2011-07-25 21:28:39","Android Intent for EPUB","<android><android-intent><epub>","3","0","","",""
"4671816","1","4671842","","2011-01-12 17:22:03","0","560","<p>I want to sort a 2-dimensional String array like this</p><pre><code>""xx"", ""text 1""""aa"", ""text 2""""mm"", ""text 3""</code></pre><p>to look like this</p><pre><code>""aa"", ""text 2""""mm"", ""text 3""""xx"", ""text 1""</code></pre><p>I have already found a <a href=""http://techthinking.net/2010/02/sorting-two-dimensional-string-array-using-java/"" rel=""nofollow"">method to do this in Java</a>, but this won't work on Android (at least not with 1.6, which is necessary for me), because <code>columnComparator</code> is not available.</p><p>Does anyone know how to do this?</p>","480370","","","","","2011-01-12 17:25:08","Sort 2-dimensional String array on Android","<android>","1","1","","",""
"4671859","1","4672105","","2011-01-12 17:27:04","9","2403","<p>I'm using the Dropbox API. In the sample app, it includes these lines:</p><pre><code>// Replace this with your consumer key and secret assigned by Dropbox.// Note that this is a really insecure way to do this, and you shouldn't// ship code which contains your key &amp; secret in such an obvious way.// Obfuscation is good.final static private String CONSUMER_KEY = ""PUT_YOUR_CONSUMER_KEY_HERE"";final static private String CONSUMER_SECRET = ""PUT_YOUR_CONSUMER_SECRET_HERE"";</code></pre><p>I'm well aware of the mantra 'Secrecy is not Security', and obfuscation really only slightly increases the amount of effort required to extract the keys. I disagree with their statement 'Obfustication is good'. What should I do to protect the keys then? Is obfustication good <em>enough</em>, or should I consider something more elaborate?</p>","319618","","527702","","2013-05-19 02:03:29","2013-05-19 02:03:29","Storing API keys in Android, is obfustication enough?","<android><key><obfuscation><dropbox-api><api-key>","2","1","2","",""
"4671915","1","4672764","","2011-01-12 17:32:19","2","679","<p>I have a activity, which view have a several EditText components.</p><p>When activity starts, the first of EditTexts became focused and keyboard appears. I would like to avoid this 'feature' ( I mean I want that there will be no popup keyboard after activity started)</p>","332311","","","","","2011-01-12 18:58:03","android. Autofocused textview on activity startup","<android><focus><edittext>","2","0","","",""
"4671923","1","4671991","","2011-01-12 17:33:06","15","2939","<p>I'm new to Android and I've seen example code using these annotations.  For example:</p><pre><code>@SmallTestpublic void testStuff() {    TouchUtils.tapView(this, anEditTextView);    sendKeys(""H E L P SPACE M E PERIOD"");    assertEquals(""help me."", anEditTextView.getText().toString());}</code></pre><p>What does that annotation accomplish?</p>","52509","","","","","2011-01-12 18:11:05","What is the purpose of @SmallTest, @MediumTest, and @LargeTest annotations in Android?","<java><android><unit-testing>","1","0","3","",""
"4672011","1","4672137","","2011-01-12 17:40:57","3","3205","<p>I was planning on drawing text with opengl and couldn't figure out how I would get it to draw/build the actually string. If I wanted to draw ""Hello World"", I can create a texture for each letter and draw them all but I know there's got to be an easier way of ""pulling"" out the correct set of characters all at once and then drawing just once. I figured I could get all the separate textures, add them into a vertex array, and then draw the vertex array with only one call to draw, but that seems inefficient. Any tutorials that cover this particular section?</p>","507007","","44729","","2011-01-12 20:33:00","2011-08-10 13:28:40","Android opengl drawing text","<java><android><text><opengl-es>","2","2","1","",""
"4672121","1","4672187","","2011-01-12 17:52:36","4","4514","<p>I have layouts for portrait mode (in folder layout) and for landscape one (in the folder layout-land). This screen is located under one of the tabs, so I had to handle screen rotating (after screen has been rotated, no default screen restart occurs).</p><p>I would like to update view from 'layout-land' when screen rotates to landscape mode and from 'layout' when screen rotates to portrait one.</p><p>How can I do this?</p>","332311","","","","","2011-01-12 17:57:22","android layout-land and screen-rotation handling","<android><layout><screen><rotation>","1","0","","",""
"4672145","1","","","2011-01-12 17:54:22","1","1066","<p>In an Android app, I've got an activity that is somewhat complex and may have threads running at certain times which, when finished, will update the UI. As such, having the Activity destroy and create again (due to orientation change) in the middle of one of these threads could lead to the user having to re-try that action, which is bad.</p><p>As such, I've decided to handle orientation changes myself by having <code>android:configChanges=""orientation|keyboardHidden""</code> in the manifest, and can then override the <code>Activity.onConfigurationChanged(Configuration newConfig)</code> method.</p><p>The root layout for this activity is a RelativeLayout.Currently, I don't actually do anything in <code>onConfigurationChanged()</code> other than call the super().</p><p>After an orientation change, the layout is muddled - some elements which are android:layout_above= are either at the bottom of the screen, or floating way above what they should be floating above.</p><p>Does anyone have any ideas as to how to fix this?</p><p>I'm aware that if I allowed the activity to restart upon an orientation change, it would then use a layout from res/layout-land/, but restarting the activity really seems to be the wrong way to go here.</p><p><strong>Edit:</strong></p><p>I've tried to setContentView(R.layout.displaymap); in the onConfigurationChanged() method and get the following error:</p><pre><code>I/WindowManager(  571): onOrientationChanged, rotation changed to 1D/StatusBar(  571): updateResourcesE/AndroidRuntime( 3813): android.view.InflateException: Binary XML file line #17: Error inflating class java.lang.reflect.ConstructorE/AndroidRuntime( 3813):        at android.view.LayoutInflater.createView(LayoutInflater.java:512)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:620)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.inflate(LayoutInflater.java:407)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.inflate(LayoutInflater.java:320)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.inflate(LayoutInflater.java:276)E/AndroidRuntime( 3813):        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)E/AndroidRuntime( 3813):        at android.app.Activity.setContentView(Activity.java:1626)E/AndroidRuntime( 3813):        at com.apps.virtualtravel.DisplayMap.onConfigurationChanged(DisplayMap.java:1065)E/AndroidRuntime( 3813):        at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:3383)E/AndroidRuntime( 3813):        at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:3449)E/AndroidRuntime( 3813):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1762)E/AndroidRuntime( 3813):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 3813):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 3813):        at android.app.ActivityThread.main(ActivityThread.java:3948)E/AndroidRuntime( 3813):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 3813):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 3813):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime( 3813):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime( 3813):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 3813): Caused by: java.lang.reflect.InvocationTargetExceptionE/AndroidRuntime( 3813):        at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:237)E/AndroidRuntime( 3813):        at java.lang.reflect.Constructor.constructNative(Native Method)E/AndroidRuntime( 3813):        at java.lang.reflect.Constructor.newInstance(Constructor.java:446)E/AndroidRuntime( 3813):        at android.view.LayoutInflater.createView(LayoutInflater.java:499)E/AndroidRuntime( 3813):        ... 20 moreE/AndroidRuntime( 3813): Caused by: java.lang.IllegalStateException: You are only allowed to have a single MapView in a MapActivityE/AndroidRuntime( 3813):        at com.google.android.maps.MapActivity.setupMapView(MapActivity.java:180)E/AndroidRuntime( 3813):        at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:279)E/AndroidRuntime( 3813):        at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:254)E/AndroidRuntime( 3813):        ... 24 more</code></pre>","421636","","19679","","2011-04-07 16:09:21","2012-04-17 11:26:59","Android: Handling orientation changes myself - RelativeLayout is getting messed up","<android><orientation><relativelayout>","1","0","","",""
"4672180","1","4755165","","2011-01-12 17:56:59","3","3461","<p>I'm in the progress of developing an Android app for displaying a number of RSS feeds (yes, I know there are many apps like this already). The data to be displayed is backed by a content provider, and I want to be backward compatible with API level 4.  </p><p>I'm using an <code>ExpandableListView</code> to display the content of three different RSS feeds. The <code>ExpandableListView</code>'s adapter is implemented as a sub-class of <code>SimpleCursorTreeAdapter</code>:</p><pre><code>private class RssFeedLatestListAdapter extends SimpleCursorTreeAdapter {    public static final String FEED_NAME_COLUMN = ""feedName"";    public RssFeedLatestListAdapter(Context ctx, Cursor groupCursor, int groupLayout,            String[] groupFrom, int[] groupTo, int childLayout, String[] childFrom,            int[] childTo) {        super(ctx, groupCursor, groupLayout, groupLayout, groupFrom, groupTo, childLayout, childFrom, childTo);    }    @Override    protected Cursor getChildrenCursor(final Cursor groupCursor) {        final String feedName = groupCursor.getString(groupCursor.getColumnIndex(FEED_NAME_COLUMN));        return managedQuery(LATEST_URI, null,                FeedItemColumns.CATEGORY + "" = ? AND "" + FeedItemColumns.FEED + "" = ?"",                new String[] { mCategory.getId(), feedName }, null);    }    @Override    protected void bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) {        super.bindGroupView(view, context, cursor, isExpanded);        // Bind group view (impl details not important) ...    }    @Override    protected void bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) {        super.bindChildView(view, context, cursor, isLastChild);        // Bind child view (impl details not important) ...    }}</code></pre><p>With this setup, all content is loaded as expected. However, <strong>the UI hangs/stutters</strong> randomly during the loading of the list content. Usually not enough to get an ANR, but still noticeable and very annoying!</p><p>In order to debug this issue, I enabled android.os.StrictMode (great new feature/tool btw!), and started up the emulator (on Android 2.3). When the list content is loaded, I get the following StrictMode output:</p><pre>D/StrictMode(  395): StrictMode policy violation; ~duration=1522 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2D/StrictMode(  395):  at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:745)D/StrictMode(  395):  at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)D/StrictMode(  395):  at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)D/StrictMode(  395):  at com.mycompany.myapp.provider.RSSFeedProvider.query(RSSFeedProvider.java:128)D/StrictMode(  395):  at android.content.ContentProvider$Transport.query(ContentProvider.java:187)D/StrictMode(  395):  at android.content.ContentResolver.query(ContentResolver.java:262)D/StrictMode(  395):  at android.app.Activity.managedQuery(Activity.java:1550)D/StrictMode(  395):  at com.mycompany.myapp.activity.MultipleFeedsActivity$RssFeedLatestListAdapter.getChildrenCursor(MultipleFeedsActivity.java:388)D/StrictMode(  395):  at android.widget.CursorTreeAdapter.getChildrenCursorHelper(CursorTreeAdapter.java:106)D/StrictMode(  395):  at android.widget.CursorTreeAdapter.getChildrenCount(CursorTreeAdapter.java:178)D/StrictMode(  395):  at android.widget.ExpandableListConnector.refreshExpGroupMetadataList(ExpandableListConnector.java:561)D/StrictMode(  395):  at android.widget.ExpandableListConnector.expandGroup(ExpandableListConnector.java:682)D/StrictMode(  395):  at android.widget.ExpandableListConnector.expandGroup(ExpandableListConnector.java:636)D/StrictMode(  395):  at android.widget.ExpandableListView.expandGroup(ExpandableListView.java:608)D/StrictMode(  395):  at com.mycompany.myapp.activity.MultipleFeedsActivity.onReceiveResult(MultipleFeedsActivity.java:335)D/StrictMode(  395):  at com.mycompany.myapp.service.FeedResultReceiver.onReceiveResult(FeedResultReceiver.java:40)D/StrictMode(  395):  at android.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:43)D/StrictMode(  395):  at android.os.Handler.handleCallback(Handler.java:587)D/StrictMode(  395):  at android.os.Handler.dispatchMessage(Handler.java:92)D/StrictMode(  395):  at android.os.Looper.loop(Looper.java:123)D/StrictMode(  395):  at android.app.ActivityThread.main(ActivityThread.java:3647)D/StrictMode(  395):  at java.lang.reflect.Method.invokeNative(Native Method)D/StrictMode(  395):  at java.lang.reflect.Method.invoke(Method.java:507)D/StrictMode(  395):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)D/StrictMode(  395):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)D/StrictMode(  395):  at dalvik.system.NativeStart.main(Native Method)</pre><p>This seems reasonable! In <code>SimpleCursorTreeAdapter.getChildrenCursor()</code>, the content provider is queried on the UI thread, which of course is a bad idea that will most definitely hang the UI!</p><p>I had a look at the <a href=""http://developer.android.com/reference/android/widget/CursorTreeAdapter.html#getChildrenCursor%28android.database.Cursor%29"" rel=""nofollow"">JavaDoc</a> (API level 4) of <code>CursorTreeAdapter</code> (a super-class of <code>SimpleCursorTreeAdapter</code>) and for <code>getChildrenCursor()</code> it says:  </p><p><em>""If you want to asynchronously query a provider to prevent blocking the UI, it is possible to return null and at a later time call setChildrenCursor(int, Cursor).""</em>.  </p><p>Great! Let's do that! I change my implementation of <code>getChildrenCursor()</code> to start a new task responsible for performing the query and setting the children cursor on the adapter. After having started the task, I just return null in <code>getChildrenCursor()</code>:</p><pre><code>@Overrideprotected Cursor getChildrenCursor(final Cursor groupCursor) {    final String feedName = groupCursor.getString(groupCursor.getColumnIndex(FEED_NAME_COLUMN));    new RefreshChildrenCursorTask(groupCursor.getPosition()).execute(feedName);    return null;}</code></pre><p>, where the <code>RefreshChildrenCursorTask</code> is implemented as:</p><pre><code>private class RefreshChildrenCursorTask extends AsyncTask&lt;String, Void, Cursor&gt; {    private int mGroupPosition;    public RefreshChildrenCursorTask(int groupPosition) {        this.mGroupPosition = groupPosition;    }    @Override    protected Cursor doInBackground(String... params) {        String feedName = params[0];        return managedQuery(LATEST_URI, null,                FeedItemColumns.CATEGORY + "" = ? AND "" + FeedItemColumns.FEED + "" = ?"",                new String[] { mCategory.getId(), feedName }, null);        }        @Override        protected void onPostExecute(Cursor childrenCursor) {            mLatestListAdapter.setChildrenCursor(mGroupPosition, childrenCursor);        }    }}</code></pre><p>I reinstalled the app on the 2.3 emulator and started it up. It worked like a charm, bye bye non-responsive UI! But the joy didn't last long ... The next thing to do was to run the same code on the target device (in this case a Samsung Galaxy S running Android 2.2). I then got the following <code>Exception</code> during the loading of the list feed content:</p><pre>E/AndroidRuntime(23191): FATAL EXCEPTION: mainE/AndroidRuntime(23191): java.lang.NullPointerExceptionE/AndroidRuntime(23191):  at android.widget.SimpleCursorTreeAdapter.initFromColumns(SimpleCursorTreeAdapter.java:194)E/AndroidRuntime(23191):  at android.widget.SimpleCursorTreeAdapter.initChildrenFromColumns(SimpleCursorTreeAdapter.java:205)E/AndroidRuntime(23191):  at android.widget.SimpleCursorTreeAdapter.init(SimpleCursorTreeAdapter.java:186)E/AndroidRuntime(23191):  at android.widget.SimpleCursorTreeAdapter.(SimpleCursorTreeAdapter.java:136)E/AndroidRuntime(23191):  at com.mycompany.myapp.activity.MultipleFeedsActivity$RssFeedLatestListAdapter.(MultipleFeedsActivity.java:378)E/AndroidRuntime(23191):  at com.mycompany.myapp.activity.MultipleFeedsActivity$2.run(MultipleFeedsActivity.java:150)E/AndroidRuntime(23191):  at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(23191):  at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(23191):  at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(23191):  at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(23191):  at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(23191):  at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(23191):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)E/AndroidRuntime(23191):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)E/AndroidRuntime(23191):  at dalvik.system.NativeStart.main(Native Method)</pre><p>A quick look at the source code of <code>SimpleCursorTreeAdapter</code> tells me that there is no way that it can cope with null being returned asynchronously from <code>getChildrenCursor()</code>. They seem to have solved this problem in Android 2.3, but how are you supposed to get around it in earlier versions of Android? Do I really have to write my own implementation of <code>CursorTreeAdapter</code> to be able to refresh the children cursor asynchronously?</p><p>Has anybody had the same problem and perhaps even found a (feasible) workaround? If not, could anybody give me a hint on how to proceed!? <strong>I would really appreciate any help</strong> I can get!</p><p>Thanks in advance!</p><p>Regards,Jacob</p>","573104","","573104","","2011-01-29 12:14:44","2011-01-29 12:14:44","SQLite query run on UI thread with ExpandableListView/SimpleCursorTreeAdapter","<android><cursor><expandablelistview><ui-thread>","2","1","2","",""
"4672271","1","","","2011-01-12 18:06:25","5","7001","<p>I have a user setup where they can choose the colors of the  alerts.  the Alert is the background color on a text or button.  But the problem comes in that if they select a dark blue and we have black letters the contrast isnt enough and you cannot read it. </p><p>I have tried to make a function to get the reverse opposing color but havent got too far.  </p><p>Is there such a function?</p>","528130","","","","","2013-09-27 19:57:25","Reverse opposing colors","<java><android><colors>","5","1","","",""
"4672299","1","4673363","","2011-01-12 18:09:54","2","852","<p>I am looking for experience/opinions/learnings from the use of specific methods, file formats (e.g. syncML) and libraries (funambol, others?) for synchronizing lists between multiple mobile devices and a web server?</p><p>We'd like to have the ability for a user to edit lists in multiple mobile devices and in the web, and have them synched periodically, handle gracefully conflicts etc.....without reinventing the wheel.</p><p>syncML experience, libraries (with an Apache style license) for syncML or others and experiences would be much appreciated.</p><p>We are developing on:<br>  - Java SE (appengine and other platforms) for server - so Java Servlet 2.3<br>  - J2ME (on Symbian and others)<br>  - iOS<br>  - Android  </p><p>and so want a solution with broad coverage and good libraries on those platforms if possible.</p><p>Data<br>The items in the lists will be products. This maybe as simple as a text name entered by the user, or a structured product description with many fields. We have an XML format defined for this already will will evolve it. Our preference would be to sync a list of these XML fragments.</p><p>Conflicts<br>We still have to define exactly how conflicts are resolved, or if the user can select the behavior - a bit like ActiveSync and other PC solutions. We don't plan to do anything new in this respect.</p><p>Details<br>We expect for each mobile ""copy"" of the list to store the data in a local datastore, with a date of the last sync with the server and a list of changes sinc. We also expect each item in the list to have a local ID, and a global (server ID) used to help during the sync.</p><p>Over-the-wire-format<br>We prefer to use an XML format for the data transmission during the sync, that has one or a number of lists, and the items inside each list as elements, with the IDs of each as attributes of the elements.</p>","573149","","573149","","2011-01-15 15:07:22","2011-01-15 15:07:22","Best solution for synching lists of objects between mobile and web server","<iphone><android><java-me><sync>","2","0","2","",""
"4672357","1","4672463","","2011-01-12 18:16:19","1","2023","<p>Javadoc says:</p><blockquote>  <p>void android.app.Activity.showDialog(int id) </p>    <p>public final void showDialog (int id)   Since: API Level 1  Simple version of  showDialog(int, Bundle) that does not  take any arguments. Simply calls  showDialog(int, Bundle) with null  arguments.</p></blockquote><p>But if I try to use showDialog(int, Bundle), it says:</p><blockquote>  <p>The method showDialog(int) in the type Activity is not applicable for the arguments (int, Bundle)</p></blockquote><p>So what am I doing wrong or which other possibillity is there for giving an argument to the Dialog?</p>","570168","","570168","","2011-01-12 18:24:07","2011-01-12 18:26:15","Android/Java: showDialog with arguments?","<java><android><arguments><showdialog>","1","0","","",""
"4672479","1","","","2011-01-12 18:27:57","7","4932","<p>Right now I can run the lines below to clear the preferences from within my application.  But is there a way to do this outside my code?  A command I can run from Eclipse or the emulator that can accomplish the same thing?</p><pre><code>SharedPreferences settings = getSharedPreferences(PREF_FILE_NAME, 0);Editor e = settings.edit();e.clear(); e.commit();</code></pre>","95956","","","","","2014-03-03 08:24:46","How do I clear SharedPreferences from outside an Android application","<android><android-emulator>","3","0","","",""
"4672507","1","","","2011-01-12 18:30:49","0","519","<p>I seem to get this error message fairly frequently:</p><p>INSTALL_FAILED_INSUFFICIENT_STORAGE</p><p>Do I need to do a rest before hitting run or debug from within Eclipse and reloading the application within my emulator?</p>","95956","","","","","2011-01-12 18:41:38","How do I properly reinstall application in the Android emulator from Eclipse?","<android><android-emulator>","1","1","","",""
"4672571","1","","","2011-01-12 18:37:31","0","104","<p>In the default Android web browser, when the user clicks the 'menu' button, the menu icons slide up from the bottom and the address bar from top.  How would someone implement something similar.  More specifically, how would anyone add view(s) when the menu appears as a consequence of the user pressing the menu button?</p>","481009","","","","","2011-01-12 19:27:00","how would someone add view(s) when the menu appears as a consequence of the user pressing the menu button in android?","<android>","3","0","","",""
"4672774","1","","","2011-01-12 18:53:51","0","4197","<p>I want to make an app with which you can play radio audio streams.</p><p>So far i have this:</p><pre><code>@Override    public void onClick(View v)    {        player = new MediaPlayer();        try {            player.setDataSource(""http://livestreams.omroep.nl/npo/3fm-bb"");            player.prepare();            player.start();        } catch (IllegalArgumentException e) {            e.printStackTrace();        } catch (IllegalStateException e) {            e.printStackTrace();        } catch (IOException e) {            e.printStackTrace();        }    }</code></pre><p>But this aint seem to be working, is it even possible to play an .asx file? or like this? (click on the link and see what i mean)</p>","412932","","","","","2011-02-24 02:53:11","Android Play .asx file with MediaPlayer?","<android><media-player><asx>","2","0","","",""
"4672931","1","","","2011-01-12 19:10:03","0","1788","<p>I've been having issues with eclipse. I had sucessfully created and tested several apps then I upgraded my Java (I can't remember what exactly) and it all went down hill.</p><p>I tried making a hello world app after upgrading and it said can't find .apk so I decided to upgrade my eclipse. Then when I started it up it lost the android ADT so I tried to reinstall it but couldn't add it correctly....so I ran as administrator and it worked, it installed and showed up in Windows > Preferences</p><p>Now all my apps, including new ones say ""Failed to load properties file for project 'Hello World' and I just can't figure it out</p><p>I have tried several versions of eclipse 3.5, 3.6 none seem to work. Any help would be appreciated</p>","573238","","","","","2011-01-12 21:11:59","Android ADT on Windwows 7 64bit","<android><windows-7><eclipse-plugin><adt>","2","1","","",""
"4673142","1","","","2011-01-12 19:30:35","1","2299","<p>I have a ScrollView which I'm adding a number of custom Views to.  After adding the custom Views, I would like to be able to Scroll to a particular one.  But, immediately after adding the custom views, the ScrollView hasn't been resized, so I can not scroll.  Any idea how I can force this resize?  </p><pre><code>for(int i = 0, i &lt; numberOfViews, i++){  scrollView.addView(new MyView(...));}//tried this, doesn't seem to be helpful scrollView.requestLayout();//at this point scrollView dimensions are 0,0,0,0 scrollView.scrollTo(5, 200);</code></pre>","426493","","","","","2012-05-10 09:05:32","Android: how to force ScrollView layout, and then scroll to a point?","<android><scrollview>","2","1","0","",""
"4673147","1","4675387","","2011-01-12 19:31:37","1","1738","<p>I have a couple buttons under an ImageView within a LinearLayout.  I also have a series of images that I want to play through like a flip book to create an animation.  I do not know anything really about animation and I have no clue how I would accomplish this task. Any ideas and suggestions are greatly appreciated.</p><p>I did try to search but my lack of teminology makes it a little difficult..</p><p>Thanks!</p>","573248","","","","","2012-09-18 10:06:23","ImageView slideshow animation","<android>","2","0","","",""
"4673159","1","","","2011-01-12 19:32:33","2","589","<p>I was originally using a ListActivity.  It was managed with a CursorAdapter.</p><p>I overrode the onScroll method to update a UI element based on what is visible to the user as they scroll through the ListView.  My onScroll method accesses the Adapter's Cursor to check some data about the first visible item.</p><p>I've decided to place another ListView on the screen, so I've changed it to an Activity (instead of a ListActivity), given the ListView an +id and created a member variable for it in the Activity.  I changed all references to getListView() to that variable.</p><p>This is working fine except for one thing:  If you click an item in the list it launches a new Activity.  After this new Activity shows up on the screen, the onScroll method for the previous Activity gets called.  It crashes the application.</p><p>It's strange because the first two lines in my overrode onScroll make sure the Cursor is not null, it is open, has a count > 0, and moves to the visible position.  These two lines work fine.  However, when I attempt to pull data from it, the application crashes with the following error:</p><pre><code>01-12 13:22:47.752: ERROR/AndroidRuntime(526): Uncaught handler: thread main exiting due to uncaught exception01-12 13:22:47.922: ERROR/AndroidRuntime(526): android.database.StaleDataException: Access closed cursor01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:217)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.database.CursorWrapper.getString(CursorWrapper.java:135)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at com.myapp.app.activity.ActivityPrepare$4.onScroll(ActivityPrepare.java:160)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:656)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.ListView.layoutChildren(ListView.java:1429)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.AbsListView.onLayout(AbsListView.java:1113)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.view.View.layout(View.java:6830)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.LinearLayout.onLayout(LinearLayout.java:918)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.view.View.layout(View.java:6830)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.view.View.layout(View.java:6830)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.view.View.layout(View.java:6830)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.view.ViewRoot.performTraversals(ViewRoot.java:996)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.os.Handler.dispatchMessage(Handler.java:99)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.os.Looper.loop(Looper.java:123)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at java.lang.reflect.Method.invokeNative(Native Method)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at java.lang.reflect.Method.invoke(Method.java:521)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-12 13:22:47.922: ERROR/AndroidRuntime(526):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I'm supposing there is some sort of race condition, but why is onScroll getting called when the Activity isn't even on the screen?</p><p>Any ideas on how to get around this?</p>","406790","","","","","2011-01-12 19:32:33","onScroll getting called after Activity has left screen","<android><listview>","0","4","","",""
"4673295","1","4673528","","2011-01-12 19:45:38","1","234","<p>In plain english, I have a textview, and when I click on it I want it to expand, and when I click on it again, I want it to compress. How can I do this? I've tried the below, but it warns on the final line about expander might not be initialized on holderFinal.text.setOnClickListener(expander);</p><p>So now the code:</p><pre><code>final View.OnClickListener expander = new View.OnClickListener() {@Override  public void onClick(View v) {    holderFinal.text.setText(textData);    holderFinal.text.setOnClickListener( new View.OnClickListener() {           @Override      public void onClick(View v) {                                            holderFinal.text.setText(shortText);        holderFinal.text.setOnClickListener(expander);      }    }); }};</code></pre>","420259","","","","","2011-01-12 20:10:45","How to make a recursive onClickListener for expanding and collapsing?","<java><android>","3","4","1","",""
"4673362","1","5286664","","2011-01-12 19:52:13","3","1404","<p>I want to play an audiostream from a url that is only valid for a temporary amount of time. This doesn't play very well just by using the built in stagefright streaming functionality because of the buffering mechanism (the url will be dead by the time the buffer is filled for the second time), so I have implemented a proxy stream, similar to what is done in the npr app</p><p><a href=""http://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/StreamProxy.java"" rel=""nofollow"">http://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/StreamProxy.java</a></p><p>This actually works very nicely, with one exception, any seek call effectively breaks the proxy stream. I am having a hard time determining exactly how the seeking works in stagefright. Everytime I seek I get a  message of </p><pre><code>01-12 13:35:57.201: ERROR/(4870): Connection reset by peer01-12 13:35:57.201: ERROR/(4870): java.net.SocketException: Connection reset by peer01-12 13:35:57.201: ERROR/(4870): at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketImpl(Native Method)01-12 13:35:57.201: ERROR/(4870):     at org.apache.harmony.luni.platform.OSNetworkSystem.write(OSNetworkSystem.java:723)01-12 13:35:57.201: ERROR/(4870):     at org.apache.harmony.luni.net.PlainSocketImpl.write(PlainSocketImpl.java:578)01-12 13:35:57.201: ERROR/(4870):     at org.apache.harmony.luni.net.SocketOutputStream.write(SocketOutputStream.java:59)01-12 13:35:57.201: ERROR/(4870):     at com.soundcloud.utils.StreamProxy.processRequest(StreamProxy.java:209)</code></pre><p>Then a pause for a few seconds, thafter which stagefright retries to connect to the same url, and usually throws an error (I would imagine because the proxy stream hasn't been reset). Another potential problem is that it seems as though the proxy stream will always read the data source linearly:</p><pre><code>while (isRunning &amp;&amp; (readBytes = data.read(buff, 0, buff.length)) != -1) </code></pre><p>And I am only guessing, but I would think that in order to support seeking, the proxy would have to be able to provide an offset when reading from the buffer. Is there a way to figure out the requested offset from the socket client (the intended seek position)? </p><p>My experience with sockets is limited. Does anybody have suggestions on implementation here?</p>","415422","","415422","","2011-01-20 16:51:16","2013-01-21 02:46:43","android seeking problem with proxy stream and stagefright player","<android><media-player>","3","0","2","",""
"4673494","1","4673555","","2011-01-12 20:07:53","1","2948","<p>I'm using SAX to read/parse XML documents and I have it working fine except for this particular site where eclipse tells me ""junk after document element"" and I get no data returned</p><p><a href=""http://www.zachblume.com/apis/rhyme.php?format=xml&amp;word=example"" rel=""nofollow"">http://www.zachblume.com/apis/rhyme.php?format=xml&amp;word=example</a></p><p>The site is not mine..just trying to get some data from it. </p>","427377","","","","","2011-01-12 20:13:36","Android java XML junk after document element","<java><android><xml>","2","0","1","",""
"4673577","1","","","2011-01-12 20:15:05","3","912","<p>I'm trying to make a View in a ListView (through a ListAdapter) with full width.Here is the current test code : </p><pre><code>LinearLayout result = new LinearLayout(context);TextView testView = new TextView(context);testView.setText(""Aaah"");TextView test2View = new TextView(context);test2View.setText(""Eeeeh"");result.addView(testView, new LinearLayout.LayoutParams(0,        LayoutParams.WRAP_CONTENT, 1));result.addView(test2View, new LinearLayout.LayoutParams(0,        LayoutParams.WRAP_CONTENT, 1));// To make it easier to see bordersresult.setBackgroundColor(Color.BLUE);</code></pre><p>(It has to be put in the ListAdapter's createView)</p><p>Unfortunately, the two TextViews are small and both stuck on the left.The limiter is actually the result view itself, not taking full width, so the two TextViews simply share this little space.</p><p>Doesn anyone know how to make them take full width ? Thanks ! :)</p><hr><h2>EDIT : simplified (and almost identical) problem :</h2><hr><p>Code :<a href=""http://pastebin.com/6pn1hXnT"" rel=""nofollow"">http://pastebin.com/6pn1hXnT</a></p><p>I want the TextView to be full-sized, and I center the text so I can see when it is full-width and when it is only wrapping content.This code shows the text on the left, so the MATCH_PARENT is not doing anything...</p><p>What should I do ?</p><p>Thanks !</p>","559833","","559833","","2011-01-13 19:40:51","2013-01-29 10:48:57","Make a view full-width with a ListAdapter","<android><listview><android-layout>","2","0","1","",""
"4673582","1","","","2011-01-12 20:15:33","2","3225","<p>Is there a way to do it? I d like to save the canvas screen as a Bitmap object, and then draw it again, to the screen. </p>","472537","","","","","2011-01-13 17:53:30","Android save canvas screen as bitmap","<android><draw>","1","0","","",""
"4673617","1","","","2011-01-12 20:20:07","1","798","<p>Greetings, I am thinking of compiling Libtorrent Rasterbar that is written in C++ into Android using Android NDK so that I can build a torrent client for Android.</p><p>Has anyone did this before? If so did you find some errors and or issues during process?</p><p>Thanks in advance for the help.</p><p>Kaloksi</p>","573304","","","","","2013-05-10 10:43:17","Compile Libtorrent Rasterbar with Android NDK anyone?","<c++><android><sdk><compilation><bittorrent>","1","1","1","",""
"4673629","1","4677301","","2011-01-12 20:21:04","7","10723","<p>Only some drawables are accessible via the <code>&lt;ImageButtonsrc=""@+android:drawable/</code>syntax. For example expander_ic_maximized is not accessible, yet its clearly at <a href=""http://androiddrawableexplorer.appspot.com/"">http://androiddrawableexplorer.appspot.com/</a></p><p>its so frustrating to have to download the drawables and manually put them in my drawables folder....any ideas how to get around this???</p>","420259","","","","","2013-04-17 06:46:31","How can I access all drawables in android?","<android>","5","0","6","",""
"4673695","1","6266547","","2011-01-12 20:29:32","2","1511","<p>I have some files stored in the app's ""internal storage"", which is located on the device here:</p><blockquote>  <p>/data/data//files/</p></blockquote><p>Here's the problem: I want to reference these files from the webview. How do I do this? What should I use as the baseUrl?</p><p>I need something similar to file:///android_asset but for ""internal storage"" instead of for files in the assets directory.</p>","108495","","","","","2013-05-10 12:45:47","How do I reference a file stored in internal storage from a WebView?","<android><webview>","2","0","1","",""
"4673770","1","","","2011-01-12 20:38:04","1","1508","<p>This is my main.xml</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""    android:background=""#FFFFFF""    &gt;&lt;ImageButton android:background=""@null""  android:layout_gravity=""center_vertical|center_horizontal|center"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:src=""@drawable/sample"" android:id=""@+id/pressThisButton"" android:layout_y=""40px"" android:layout_x=""20px""&gt;&lt;/ImageButton&gt;&lt;/FrameLayout&gt;</code></pre><p>In the Framelayout, I have a View v which contains the button pressThisButton. </p><p>When the button is pressed I am able to change the color of the padding background surrounding the button in the view--but not the background of the entire screen--using</p><pre><code>private OnClickListener buttonClickListener = new OnClickListener()     {        public void onClick( View v )        {            v.setBackgroundColor(0xffff0000);</code></pre><p>Is there a way in a FrameLayout to change both the view background and the entire screen color?</p><p>Thank you for your time.</p>","527405","","","","","2011-01-12 21:04:53","Android. How do I dynamically change the color of the entire FrameLayout instead of just the color of the View backround?","<android><view><background><framelayout>","1","0","","",""
"4674057","1","4674278","","2011-01-12 21:04:30","2","8144","<p>I would like to make a TextView to be entirely underlined but I can't use a text resource and <code>&lt;u&gt;</code> tag because it is dynamic text.</p><blockquote>  <p>Related: <a href=""http://stackoverflow.com/questions/2394935/can-i-underline-text-in-an-android-layout"">Can I underline text in an android layout?</a></p></blockquote><p>So far the only way I know to do this is at runtime. Is this really the only way? Is there a way I could do it in the XML files?</p>","463304","","","","","2011-01-26 16:45:48","Android: Statically underline dynamic text in TextView","<android><underline>","3","0","1","",""
"4674174","1","4674374","","2011-01-12 21:18:19","1","8755","<p>This mainly applies to android, but could be used in Java. I have these listeners:</p><pre><code>int year, month, day, hour, minute;// 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) {                year = year;                month = monthOfYear;                day = dayOfMonth;            }        };// the callback received when the user ""sets"" the time in the dialogprivate TimePickerDialog.OnTimeSetListener mTimeSetListener =    new TimePickerDialog.OnTimeSetListener() {        public void onTimeSet(TimePicker view, int hourOfDay, int minute) {            hour = hourOfDay;            minute = minute;        }    };</code></pre><p>How could I convert <code>int year, month, day, hour, minute;</code> to a unix timestamp? Is this possible without the <code>Date</code> class?</p>","200477","","","","","2013-06-09 13:41:16","Convert integer dates/times to unix timestamp in Java?","<java><android><datetime><unix-timestamp>","3","3","2","",""
"4674326","1","4718175","","2011-01-12 21:36:38","3","1474","<p>This is more of a mass answer than a question, I just don't know how to post it as such, moderators if you could inform me if there even is such a thing.</p><p>This question was asked to death, and then I needed to do something similar so I work out this. The answer to this post is how to create a 3x3 Bidirectional Scroll View in android</p>","480691","","480691","","2011-01-17 21:38:24","2011-01-17 21:38:24","Bidircetional scroll for Android","<android><gridview><scroll><gallery><solution>","1","5","0","",""
"4674378","1","4674916","","2011-01-12 21:42:37","0","456","<p>Is there a way to declare a row of buttons in XML so that all the buttons have the same width, which is equal to the wrap_content width of the widest button? I'm familiar with the trick of setting all the widths to 0 and assign them all a weight of 1, but that won't work if the parent layout width is set to wrap_content. I don't want to set the parent width to fill_parent because I don't want the buttons stretched more than necessary.</p><p>The only way I can think of doing this is in code (either with onMeasure logic in each button that communicates with the other buttons or with a custom layout class).</p>","535871","","","","","2011-01-12 23:31:53","Is there a way in Android XML to make a row of buttons with widths set to widest button?","<android><xml><layout><android-linearlayout>","3","0","","",""
"4674391","1","4677047","","2011-01-12 21:45:03","15","15377","<p>In this app I'm developing I need to load/call another app that is already installed on the phone. It's an application for my own personal use only, so no need to check if the other app is installed - I know it is.</p><p>I've googled this problem for hours, but I can't find anything that works. Mostly because the guidelines for finding package name and class name are really bad.</p><p>Via cmd and adb I was able to find that the info regarding the application I'd like to call is:package:/data/app/com.soundcloud.android-1.apk=com.soundcloud.android(that's exactly what it said in the cmd window.)</p><p>I tried something like this:</p><pre><code>Intent i = new Intent();i.setClassName(""/data/app/com.soundcloud.android-1.apk"", ""com.soundcloud.android"");startActivity(i);</code></pre><p>But my app just crashes instead. I used the above code because someone said that this could call an app:</p><pre><code>Intent i = new Intent();i.setClassName(""&lt;package_name&gt;"",""&lt;Class Name(with package name)&gt;"");startActivity(i);</code></pre><p>Does anyone know what to really write?</p><p>P.S.: my own app does not need any information about what's happening in the called app.</p>","554002","","","","","2014-01-26 07:31:33","Calling an app from another app","<android><call>","2","2","8","",""
"4674416","1","","","2011-01-12 21:48:06","3","10861","<p>I'm trying to align a button to the bottom right and bottom left of my screen, using a RelativeLayout.  I want to do this to keep the same relative layout across different screen sizes.  Currently the buttons on my screen move up/down depending on the resolution of the screen.  320x480 puts the buttons higher on the screen versus 480x800.  I'm trying to get my screens to look the same between the two sizes.</p><p>Any information you can provide is greatly appreciated.</p><p>Thanks,MobiKnow.</p>","566132","","","","","2013-07-31 04:51:41","Aligning Android Button To Bottom in RelativeLayout?","<android><button><alignment>","4","1","","",""
"4674431","1","","","2011-01-12 21:49:55","1","71","<p>I have a list and when I do setOnClickListener for an Item I don't have highlight on Items in a List.</p><p>That is not expected behavior because I want to give user a way to see which item was selected on touch.</p><p>Is there some way to make it highlighted?</p><p>tnx.</p>","505160","","","","","2012-10-01 16:18:28","List element hightlight?","<android>","1","0","","",""
"4674529","1","","","2011-01-12 22:05:08","0","772","<p>Im making a button in opengl ES that has an overlay with it, like google maps; I want my button to show the overlay when hit and turn it off when the button is hit again. The problem is if the user hits the button and drags around the image then the overlay still turns off. Is there a way to determine if an ACTION_MOVE was performed during the course of the event? that way i can set it to only turn off/on if ACTION_MOVE wasn't detected. Thanks.</p>","385051","","","","","2011-01-12 23:43:24","check to see if a MotionEvent.ACTION_MOVE was performed","<android><opengl-es><motion-detection>","1","0","","",""
"4674530","1","4675497","","2011-01-12 22:05:11","0","937","<p>I'm trying to use a custom dialog to get user input for a title String, and then if the user clicks OK, it will fire up a new Activity (basically a notepad) with that title String as the title. However, when I try to call the method that fires the new activity inside onClick(), it gives me an error.</p><p>Here's the code</p><pre><code>class NewListDialog extends Dialog implements OnClickListener {        Button search;        EditText text;        public NewListDialog(Context context) {            super(context);            requestWindowFeature(Window.FEATURE_NO_TITLE);            setContentView(R.layout.newlist_dialog);            search = (Button) findViewById(R.id.dialog_confirm);            text = (EditText) findViewById(R.id.dialog_editable);            search.setOnClickListener(this);        }        @Override        public void onClick(View v) {            if (v == search) {                String title_name = text.getText().toString();                       // method for launching new activity               fireListEdit(title_name);              }        }</code></pre><p>}</p><pre><code>void fireListEdit(String title_name) {        Intent i = new Intent(this, ListEdit.class);        i.putExtra(InvenDB.KEY_TITLE, title_name);        startActivityForResult(i, ACTIVITY_CREATE);}</code></pre><p>And I call this dialog with</p><pre><code>@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {    case INSERT_ID:        NewListDialog dialog = new NewListDialog(this);        dialog.show();        return true;    case QUIT_ID:        finish();        return true;    }    return super.onMenuItemSelected(featureId, item);}</code></pre><p>Edit: when I run it on emulator, when I click OK on the custom dialog it just gives me ""the application stopped unexpectly"" error</p><p>EDIT:</p><p>This is the logcat, I'm not really sure what they mean :\</p><p>01-12 17:39:27.668: ERROR/AndroidRuntime(426): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jin.inventoryapp/com.jin.inventoryapp.ListEdit}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0</p>","569421","","569421","","2011-01-12 22:45:10","2011-01-13 00:12:57","Android: Launching new activity from dialog","<android><dialog><activity>","1","5","","",""
"4674549","1","","","2011-01-12 22:07:30","0","3278","<p>hii,</p><p>I want to communicate between an iphone and an android tablet. The tablet as well as the iphone work on different 3g data services. Can any body give me an idea how to communicate and send messages between the devices...</p>","573414","","","","","2013-03-12 08:28:45","Communication between android tablet and iphone","<iphone><android><communication>","1","2","","",""
"4674737","1","5728859","","2011-01-12 22:31:00","7","17652","<p>If I have a file made available to a browser through my webapp, I normally just set the URL to something like <code>http://website.com/webapp/download/89347/image.jpg</code>. I then set the HTTP headers <code>Content-Type: application/octet-stream; filename=image.jpg</code> and <code>Content-Disposition: Attachment</code>.</p><p>However, on the Android. It seems the only way I can get the file to download is to set <code>Content-Type: image/jpg</code>. Otherwise the file name says <code>&lt;Unknown&gt;</code> and an error comes </p><blockquote>  <p><strong>Download unsuccessful</strong><br>  Cannot download. The content is not supported on this phone</p></blockquote><p>Is there any way I can get Android to download and open the file through the browser without keeping a list of mime types?</p>","463304","","","","","2013-11-25 08:07:20","Avoiding content type issues when downloading a file via browser on Android","<android><browser><download><content-type><content-disposition>","5","0","8","",""
"4674751","1","8808304","","2011-01-12 22:32:16","0","814","<p>I'm using an AutoCompleteTextView with an ArrayAdapter which works like supposed.</p><p>The problem is, that I have to change the Array with the Autocomplete-Values. Calling notifyDataSetChanged() doesn't help. No changes are shown. </p><p>Do you know something to get around this problem?</p>","458361","","","","","2012-01-10 18:16:47","AutoCompleteTextView, ArrayAdapter and notifyDataSetChanged()","<android><adapter><android-arrayadapter>","1","0","1","",""
"4674765","1","4675509","","2011-01-12 22:34:36","-1","357","<p>I have a weird issue on an Android 2.2 device.  I have an existingcontact and I do a modify operation on it via:</p><pre><code>ContentProviderOperation.Builder builder =ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)    .withSelection(ContactsContract.Data.CONTACT_ID + ""=? AND "" +    ContactsContract.Data.MIMETYPE + ""=?"",    new String[]{id,    ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE})    .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,displayName)    .withValue(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,familyName)    .withValue(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME,middleName)    .withValue(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME,givenName)    .withValue(ContactsContract.CommonDataKinds.StructuredName.PREFIX,honorificPrefix)   .withValue(ContactsContract.CommonDataKinds.StructuredName.SUFFIX,honorificSuffix);mApp.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);</code></pre><p>The contact gets modified correctly.  All of the new values show upfor the Contacts name.</p><p>However, if I look in my Contacts app there is a new contact called""(Unknown)"" that shows up after I do a modify.  I can insert as manycontacts as I want but every modify creates a new ""(Unknown)"" contact.</p><p>Anyone have any ideas?</p>","41679","","","","","2011-01-13 00:15:26","Why does Android Contact modify have a side effect of created an (Unknown) contact entry?","<android><contact>","1","0","","",""
"4674796","1","4676660","","2011-01-12 22:37:44","0","1814","<p>I originally had two ListActivity classes.</p><p>I'm experimenting with having 1 Activity and, using a ViewFlipper, flipping between the two lists.</p><p>It seems to be working great except for one problem.  If I rotate the emulator, I'll randomly get a crash.  It doesn't happen every time and I can't figure out a specific workflow to trigger it.  This is the error:</p><pre><code>01-12 16:28:58.292: WARN/dalvikvm(877): threadid=3: thread exiting with uncaught exception (group=0x4001b188)01-12 16:28:58.292: ERROR/AndroidRuntime(877): Uncaught handler: thread main exiting due to uncaught exception01-12 16:28:58.312: ERROR/AndroidRuntime(877): java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@43d4445801-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:667)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ApplicationContext.unregisterReceiver(ApplicationContext.java:747)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:321)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.widget.ViewFlipper.onDetachedFromWindow(ViewFlipper.java:104)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.View.dispatchDetachedFromWindow(View.java:5835)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1076)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1074)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1074)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1570)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.ViewRoot.doDie(ViewRoot.java:2556)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.ViewRoot.die(ViewRoot.java:2526)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:218)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:436)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3498)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3599)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ActivityThread.access$2300(ActivityThread.java:119)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1867)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.os.Handler.dispatchMessage(Handler.java:99)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.os.Looper.loop(Looper.java:123)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at android.app.ActivityThread.main(ActivityThread.java:4363)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at java.lang.reflect.Method.invokeNative(Native Method)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at java.lang.reflect.Method.invoke(Method.java:521)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)01-12 16:28:58.312: ERROR/AndroidRuntime(877):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Does anyone have any ideas as to what might be the problem?</p><p>Here is a basic skeleton of my Activity:</p><pre><code>public class ActivityFlipper extends Activity implements OnItemClickListener, OnClickListener {    ViewFlipper flipper;    // query tokens    final int LIST1_MY_QUERY_TOKEN = 42;    final int LIST2_MY_QUERY_TOKEN = 43;    // vars for list1 screen    private List1Adapter mList1Adapter = null;    private Cursor mList1Cursor = null;    List1QueryHandler mList1QueryHandler;    // vars for list2 screen    private List2Adapter mList2Adapter = null;    private Cursor mList2Cursor = null;    List2QueryHandler mList2QueryHandler;    // ui controls for list1 screen    private ListView mList1;    private Button mAdd;    private TextView mList1Header;    // ui controls for list2 screen    private ListView mList2;    private TextView mList2Header;    private Button mSelector;    // ui controls common    private ProgressDialog mScannerProgress;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.layout_flipper);        // set up flipper screen        flipper = (ViewFlipper) findViewById(R.id.flipper);        // set up list1 screen        mList1 = (ListView)findViewById(R.id.list1_list);        mList1.setOnItemClickListener(this);        mAdd = (Button)findViewById(R.id.list1_add);        mAdd.setOnClickListener(this);        mList1Header = (TextView)findViewById(R.id.list1_header);        mList1Header.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                flipper.setInAnimation(inFromRightAnimation());                 flipper.setOutAnimation(outToLeftAnimation());                 flipper.showNext();             }        });        setList1Adapter();        mList1QueryHandler = new List1QueryHandler(this);        registerForContextMenu(mList1);        registerForContextMenu(mAdd);        // set up list2 screen        mList2 = (ListView)findViewById(R.id.list2_list);        mList2Header = (TextView)findViewById(R.id.list2_header);        mList2Header.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                flipper.setInAnimation(inFromLeftAnimation());                 flipper.setOutAnimation(outToRightAnimation());                 flipper.showPrevious();             }        });        mSelector = (Button)findViewById(R.id.list2_changestore);        mSelector.setOnClickListener(this);        setList2Adapter();        mList2QueryHandler = new List2pingQueryHandler(this);        registerForContextMenu(mList2);    }    private void setList1Adapter() {        mList1Adapter = new List1Adapter(ActivityList1.this, null);        mList1.setAdapter(mList1Adapter);    }    private void setList2Adapter() {        mList2Adapter = new List2Adapter(ActivityList1.this, null);        mList2.setAdapter(mList2Adapter);    }    @Override    protected void onPause() {        // remove broadcast listener        unregisterReceiver(onBroadcast);        super.onPause();    }    @Override    protected void onResume() {        super.onResume();        // add broadcast listener        registerReceiver(onBroadcast, new IntentFilter(""listquery""));        // get rid of scanner progress if showing        if (mScannerProgress != null &amp;&amp; mScannerProgress.isShowing()) {            mScannerProgress.dismiss();        }        // get data to populate lists        doList1Query(false);        doList2Query(false);    }    public void onItemClick(AdapterView&lt;?&gt; l, View v, int position, long id) {        if (v.getId() == mList1.getId()) {            // do stuff        }        else if (v.getId() == mList2.getId()) {            // do stuff        }    }    public void onClick(View v) {        if (v.getId() == R.id.list1_add) {            // do stuff        }        else if (v.getId() == R.id.list2_changestore) {            // do stuff        }    }    @Override    public void onActivityResult(int requestCode, int resultCode, Intent data) {        // do stuff    }    Cursor doList1Query(boolean sync) {        // Cancel any pending queries        mList1QueryHandler.cancelOperation(LIST1_MY_QUERY_TOKEN);        if (sync) {            try {                return getContentResolver().query(uri,                                        columns,                                        where,                                        null,                                        order);            }            catch (UnsupportedOperationException ex) {            }        }        else {            setProgressBarIndeterminateVisibility(true);            mList1QueryHandler.startQuery(LIST1_MY_QUERY_TOKEN,                                        null,                                        uri,                                        columns,                                        where,                                        null,                                        order);        }        return null;    }    Cursor doList2Query(boolean sync) {        mList2QueryHandler.cancelOperation(LIST2_MY_QUERY_TOKEN);        if (sync) {            try {                return getContentResolver().query(uri,                                        getDisplayColumns(),                                        where,                                        null,                                        order);            }            catch (UnsupportedOperationException ex) {            }        }        else {            setProgressBarIndeterminateVisibility(true);            mList2QueryHandler.startQuery(LIST2_MY_QUERY_TOKEN,                                        null,                                        uri,                                        columns,                                        where,                                        null,                                        order);        }        return null;    }    private BroadcastReceiver onBroadcast = new BroadcastReceiver() {        @Override        public void onReceive(Context ctxt, Intent i) {            doList1Query(false);            doList2Query(false);        }    };    private Animation inFromRightAnimation() {        Animation inFromRight = new TranslateAnimation(                Animation.RELATIVE_TO_PARENT,  +1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f                );        inFromRight.setDuration(500);        inFromRight.setInterpolator(new AccelerateInterpolator());        return inFromRight;    }    private Animation outToLeftAnimation() {        Animation outtoLeft = new TranslateAnimation(                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  -1.0f,                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f                );        outtoLeft.setDuration(500);        outtoLeft.setInterpolator(new AccelerateInterpolator());        return outtoLeft;    }    private Animation inFromLeftAnimation() {        Animation inFromLeft = new TranslateAnimation(                Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f                );        inFromLeft.setDuration(500);        inFromLeft.setInterpolator(new AccelerateInterpolator());        return inFromLeft;    }    private Animation outToRightAnimation() {        Animation outtoRight = new TranslateAnimation(                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  +1.0f,                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f                );        outtoRight.setDuration(500);        outtoRight.setInterpolator(new AccelerateInterpolator());        return outtoRight;    }}</code></pre>","406790","","406790","","2011-01-12 23:06:16","2011-01-13 04:03:25","Crash when rotating Activity using ViewFlipper","<android><listview><viewflipper>","1","3","2","",""
"4674820","1","4762528","","2011-01-12 22:40:41","3","1142","<p><strong>UPDATE:</strong>I've decided to use the ExpandableListAdapter to accomplish this ...as this code is almost effectively an attempt to engineer what expandable listadapter already does.</p><hr><p>I'm using the standard pattern of ViewHolder in order to make ListView simply work...<code><pre>public View getView(int position, View convertView, ViewGroup parent) {  View vi=convertView;  ViewHolder holder;  if( convertView == null ){            vi = inflater.inflate(R.layout.item, null);            holder=new ViewHolder();            holder.text=(TextView)vi.findViewById(R.id.text);            holder.image=(ImageView)vi.findViewById(R.id.image);            holder.expandButton=(ImageView)vi.findViewById(R.id.expand_button);            vi.setTag(holder);        }        else            holder=(ViewHolder)vi.getTag();</code></pre></p><p>However....I believe that inside of my onClickListener...something is going wrong.</p><p><code><pre> final String textData = texts[position]; final ViewHolder holderFinal = holder; holder.expandButton.setVisibility(View.VISIBLE); holder.expandButton.setOnClickListener(new View.OnClickListener()    @Override   public void onClick(View v) {     holderFinal.expandButton.setImageResource(R.drawable.expander_ic_maximized);     holderFinal.text.setText(textData);</code></pre></p><p>So, everything displays fine when scrolling back and forth....however, whenever one of the listitems is expanded, the final line above contains a textData that belongs to another row. How do I get the correct textData to work INSIDE the onCLick listener?</p>","420259","","420259","","2011-01-21 23:16:20","2011-01-28 17:45:37","How to get ListView to display correctly after onClickListener is clicked?","<android><listview>","4","3","","",""
"4674821","1","4675272","","2011-01-12 22:40:45","1","1465","<p>Hi i have a listview with textview in every row with a text linkified with defined pattern in it , i use this small code to make linkified items can be clickable and call another activity in my app.But before that i am using imaview above the list to make navigation appear on listview , when i added </p><pre><code>    textView.setMovementMethod(LinkMovementMethod.getInstance());    Pattern Matcher = Pattern.compile(""pattern here"");    String Url = ""sth://"";    Linkify.addLinks(entrySpan, Matcher, Url);</code></pre><p>Instead of onClick method of listview on just linkfy clicks are working , but i have to make them work bot</p><p>Here is code that i am using for listview click method but this seems never firing after setting linkify set movement , i am switching back and forth between Visible and Gone after every click.</p><pre><code>getListView().setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                    long arg3) {                // TODO Auto-generated method stub                if(Entry.totalPageNumber&gt;1){                    //if no more than one page exist no need to navigate                    if(show == false){                        findViewById(R.id.back).setVisibility(View.VISIBLE);                        findViewById(R.id.forward).setVisibility(View.VISIBLE);                        findViewById(R.id.start).setVisibility(View.VISIBLE);                        findViewById(R.id.last).setVisibility(View.VISIBLE);                        show=true;                    }else if(show==true){                        findViewById(R.id.back).setVisibility(View.GONE);                        findViewById(R.id.forward).setVisibility(View.GONE);                        findViewById(R.id.start).setVisibility(View.GONE);                        findViewById(R.id.last).setVisibility(View.GONE);                        show=false;                    }                }            }        });</code></pre><p>How to resolve this problem??</p>","155332","","155332","","2011-01-12 23:36:07","2011-01-12 23:52:39","Linkify's clickable method blocks listview click method","<java><android><listview><onclick>","2","0","","",""
"4674885","1","4674948","","2011-01-12 22:47:01","0","4874","<p>I'm trying to use a ListView inside of a RelativeLayout but when I run my app I get a runtimeexception with the message:</p><p>Binary XML file line #2: You must supply a layout_width attribute.</p><p>I tried putting layout_width attributes in every conceivable place in the xml resource files but so far no luck.</p><p>I attempt to populate the listview with this line of code:</p><pre><code>   setListAdapter(new ArrayAdapter(this,           R.layout.tablerow3, R.id.label,           items));</code></pre><p>Here's the tablerow3.xml contents:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""&gt;          android:layout_width=""20dp""          android:layout_height=""5dp""          android:id=""@+id/tablerow01""&gt;      &lt;Label android:id=""@+id/label01""      android:layout_width=""5dp""  android:layout_height=""5dp""      android:textColor=""@color/solid_white""         android:singleLine=""true""/&gt;      &lt;Label android:id=""@+id/label02""      android:layout_width=""5dp""  android:layout_height=""5dp""         android:textColor=""@color/solid_white""         android:singleLine=""true""/&gt;      &lt;/LinearLayout&gt;</code></pre><p>Here's the xml that contains the RelativeLayout(forex2.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;   &lt;Button android:text=""Static Button""      android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""        android:id=""@+id/button_id""&gt;      &lt;/Button&gt;        &lt;Spinner android:id=""@+id/spinner1""            android:layout_width=""match_parent""            android:layout_toRightOf=""@id/button_id""            android:layout_alignParentTop=""true""            android:layout_height=""wrap_content""            android:drawSelectorOnTop=""true""        /&gt;    &lt;ListView android:id=""@android:id/list""   android:layout_width=""5dp""  android:layout_height=""5dp""  android:layout_alignParentBottom=""true""   /&gt;   &lt;!--  android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" --&gt; &lt;/RelativeLayout&gt;</code></pre>","549226","","","","","2012-06-05 22:31:17","Getting message in android app: Binary XML file line #2: You must supply a layout_width attribute","<java><android>","3","0","","",""
