¡@

Home 

2014/10/16 ¤W¤È 08:27:35

android Programming Glossary: why

How ListView's recycling mechanism works

http://stackoverflow.com/questions/11945563/how-listviews-recycling-mechanism-works

hang of using ListView and GridView so I do not understand why this is happening. One of the main reasons I am making this.. you will see item 8 checkbox is already checked this is why listview is re using the same view not creating a new for you.. inside LinearLayout worked like magic for me. didn't know why 01 01 14 49 36.606 I System.out 13871 getview 0 null 01 01 14..

java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android

http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android

when your activity is destroyed. It's difficult to say why this is without looking at your code. However this article has..

Changing Locale within the app itself

http://stackoverflow.com/questions/2264874/changing-locale-within-the-app-itself

related questions are referencing to this one. That's why I wanted to clarify the issue here. I used this question as..

Focusable EditText inside ListView

http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview

experience. I looked into the code for ListView to see why the two behaviors are so different and came across this from.. such that no child can get focus. This explains why I couldn't just toggle mItemsCanFocus in the ListView's OnItemSelectedListener..

Activity has leaked window that was originally added

http://stackoverflow.com/questions/2850573/activity-has-leaked-window-that-was-originally-added

window that was originally added What is this error and why does it happen 05 17 18 24 57.069 ERROR WindowManager 18850..

How can I put a ListView into a ScrollView without it collapsing?

http://stackoverflow.com/questions/3495890/how-can-i-put-a-listview-into-a-scrollview-without-it-collapsing

a ScrollView . I have yet to see any real explanation for why though. The only reason I can seem to find is that Google doesn't..

Android: Is application running in background?

http://stackoverflow.com/questions/3667022/android-is-application-running-in-background

I strongly recommend to refrain from using it. And here's why. As Dianne Hackborn wrote These APIs are not there for applications..

Synchronise ScrollView scroll positions - android

http://stackoverflow.com/questions/3948934/synchronise-scrollview-scroll-positions-android

never thought that we would need to access it which is why they made it protected and didn't add a setOnScrollChangedListener..

onSaveInstanceState () and onRestoreInstanceState ()

http://stackoverflow.com/questions/4096169/onsaveinstancestate-and-onrestoreinstancestate

onRestoreInstanceState method. Can anyone explain to me why this is android activity states share improve this question..

Android and XMPP: Currently available solutions

http://stackoverflow.com/questions/4769020/android-and-xmpp-currently-available-solutions

. Do you have any other suggestions or can you explain why I should choose one of the above over the rest android xmpp..

Android post JSON using HTTP

http://stackoverflow.com/questions/6218143/android-post-json-using-http

for a step by step process with code and explanation of why you do each step or of what that step does. It doesn't need.. with an explanation of what exactly is happening and why it is done that way. If anyone knows of a good Android book..

When to call activity context OR application context?

http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context

that you only use getApplicationContext when you know why you are using getApplicationContext and only when you need to.. Hackborn also agrees with this position . Here are reasons why not to use getApplicationContext wherever you go It's not a..

Android accelerometer accuracy (Inertial navigation)

http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation

It is useless in practice. Here is an explanation why Google Tech Talk at 23 20 . I highly recommend this video. It..

How to block calls in android

http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android

It is Mission Impossible for the time being. Refer to Why it is impossible to intercept incoming calls on Android for..

Understanding Fragment's setRetainInstance(boolean)

http://stackoverflow.com/questions/11182180/understanding-fragments-setretaininstanceboolean

fragment be destroyed when the user leaves the activity Why doesn't it work with fragments on the back stack Which are the.. the Activity s attached Fragment s will also be destroyed. Why doesn't it work with fragments on the back stack There are probably..

Why retrieving Google Directions for Android using KML data is not working anymore? [duplicate]

http://stackoverflow.com/questions/11745314/why-retrieving-google-directions-for-android-using-kml-data-is-not-working-anymo

retrieving Google Directions for Android using KML data is not..

Android: How to detect double-tap?

http://stackoverflow.com/questions/2217670/android-how-to-detect-double-tap

listview double click share improve this question Why aren't you using a Long Press Or are you using that already..

Why doesn't System.out.println work? (in Android)

http://stackoverflow.com/questions/2220547/why-doesnt-system-out-println-work-in-android

doesn't System.out.println work in Android I want to print..

Changing Locale within the app itself

http://stackoverflow.com/questions/2264874/changing-locale-within-the-app-itself

of my app in French Dutch or any other language ... Why is this working perfectly fine in 1.5 1.6 but NOT in 2.0 anymore..

How to discover memory usage of my application in Android

http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android

more than slightly different than what we saw in meminfo. Why is that Well procrank uses a different kernel mechanism to collect.. meminfo does and they give slightly different results. Why is that Honestly I haven't a clue. I believe procrank may be..

custom listview adapter getView method being called multiple times, and in no coherent order

http://stackoverflow.com/questions/2618272/custom-listview-adapter-getview-method-being-called-multiple-times-and-in-no-co

cycling from 0 3 makes sense. But the rest is a mess Why is getview called for each row three times Where are these convertViews..

How to Read MMS Data in Android?

http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

them in a single thread which are called conversations . Why is it important the content mms sms conversations uri Well that's..

Adding a library/JAR to an Eclipse Android project

http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project

com.github.droidfu.widgets.WebImageView... Why when I get no compilation or linker error in Eclipse does it..

How do you to retrieve dimensions of a view? Getheight() and Getwidth() always return zero

http://stackoverflow.com/questions/4142090/how-do-you-to-retrieve-dimensions-of-a-view-getheight-and-getwidth-always-r

R.id.board vh tl.getHeight getHeight returned 0 Why vw tl.getWidth getWidth returned 0 Why Test 2 used a simple.. returned 0 Why vw tl.getWidth getWidth returned 0 Why Test 2 used a simple dynamically generated view TextView tv.. 20 tv.setWidth 20 vh tv.getHeight getHeight returned 0 Why vw tv.getWidth getWidth returned 0 Why eof method eof class..

getApplication() vs. getApplicationContext()

http://stackoverflow.com/questions/5018545/getapplication-vs-getapplicationcontext

which you obviously experienced with the test framework . Why does getApplicationContext exists in the first place getApplication..

Why not use always android:configChanges=“keyboardHidden|orientation”?

http://stackoverflow.com/questions/7818717/why-not-use-always-androidconfigchanges-keyboardhiddenorientation

not use always android configChanges &ldquo keyboardHidden orientation&rdquo..

Android Activity Life Cycle - What are all these methods for?

http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for

methods for What is the life cycle of an Android activity Why are so many similar sounding methods onCreate onStart onResume..

R cannot be resolved - Android error

http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error

R cannot be resolved on line setContentView R.layout.main Why PS I do have an XML file named main.xml under res layout . ..

Android : Call activity of another application

http://stackoverflow.com/questions/10960709/android-call-activity-of-another-application

only gets the Intent for that first Activity. That's WHY we make a custom Intent... First because we don't really want..

Android TCP does not flush until socket is closed

http://stackoverflow.com/questions/11847092/android-tcp-does-not-flush-until-socket-is-closed

properly as described above any annotations to explain WHY would be greatly appreciated. Links to other similar questions..

EditText causing memory leak

http://stackoverflow.com/questions/14069501/edittext-causing-memory-leak

blocked 30ms Now that's what I want to see WHY Can someone tell my why this is happening I would like to add..

import android.R in Eclipse : Why?

http://stackoverflow.com/questions/15309941/import-android-r-in-eclipse-why

erroneous import statements and delete them. My question WHY Why does eclipse keep on doing this I have been developing Android..

Can not display list with ListView in another activity

http://stackoverflow.com/questions/19995004/can-not-display-list-with-listview-in-another-activity

into the MainActivity everything works fine as well. WHY IT DOES NOT WORK with another Activity android listview android..

Whats the difference between Thread.setPriority() and android.os.Process.setThreadPriority()

http://stackoverflow.com/questions/5198518/whats-the-difference-between-thread-setpriority-and-android-os-process-setthre

r.run IS the android.os.Process way required preferred WHY is the android.os.Process way preferred required if it is This..

SQLiteOpenHelper IllegalStateException : DB Already Closed Error

http://stackoverflow.com/questions/6535908/sqliteopenhelper-illegalstateexception-db-already-closed-error

... 10 more UPDATE I've fixed the problem but not sure WHY this fixed it. So maybe someone out there knows or could explain...

Unity3d integration with android

http://stackoverflow.com/questions/7749841/unity3d-integration-with-android

is that I need to use JNI which is java native interface WHY why do I need to use native code Do I need to create some middle..

How to pass drawable between activities

http://stackoverflow.com/questions/8407336/how-to-pass-drawable-between-activities

image file and passing its reference to another activity WHY to do so taken from http groups.google.com group android developers..

Android Stop Background Music

http://stackoverflow.com/questions/9148615/android-stop-background-music

another EDIT it seems the main question really is WHY DOES PRESSING THE HOME BUTTON NOT CALL onPause or onStop so.. do this actually the BIGGEST QUESTION FOR THIS POST IS WHY DOES PRESSING THE HOME BUTTON NOT CALL onPause or onStop To..

How ListView's recycling mechanism works

http://stackoverflow.com/questions/11945563/how-listviews-recycling-mechanism-works

it puts two in position 8. Now I am still trying to get the hang of using ListView and GridView so I do not understand why this is happening. One of the main reasons I am making this question is to help others who probably don't know about ListView.. has also a checkbox and you checked it so when you scroll down you will see item 8 checkbox is already checked this is why listview is re using the same view not creating a new for you due to performance optimization. Important things 1 .Never.. repeating view call and convert view as putting Listview inside LinearLayout worked like magic for me. didn't know why 01 01 14 49 36.606 I System.out 13871 getview 0 null 01 01 14 49 36.636 I System.out 13871 getview 0 android.widget.RelativeLayout@406082c0..

java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android

http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android

many images it's that your images aren't getting deallocated when your activity is destroyed. It's difficult to say why this is without looking at your code. However this article has some tips that might help http android developers.blogspot.de..

Changing Locale within the app itself

http://stackoverflow.com/questions/2264874/changing-locale-within-the-app-itself

question is not exactly about the locale itself all other locale related questions are referencing to this one. That's why I wanted to clarify the issue here. I used this question as a starting point for my own locale switching code and found..

Focusable EditText inside ListView

http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview

solution but it works for me and gives a pretty solid user experience. I looked into the code for ListView to see why the two behaviors are so different and came across this from ListView.java public void setItemsCanFocus boolean itemsCanFocus.. setItemsCanFocus false it's also setting descendant focusability such that no child can get focus. This explains why I couldn't just toggle mItemsCanFocus in the ListView's OnItemSelectedListener because the ListView was then blocking focus..

Activity has leaked window that was originally added

http://stackoverflow.com/questions/2850573/activity-has-leaked-window-that-was-originally-added

has leaked window that was originally added What is this error and why does it happen 05 17 18 24 57.069 ERROR WindowManager 18850 Activity com.mypkg.myP has leaked window com.android.internal.policy.impl.PhoneWindow..

How can I put a ListView into a ScrollView without it collapsing?

http://stackoverflow.com/questions/3495890/how-can-i-put-a-listview-into-a-scrollview-without-it-collapsing

only answer I can find seems to be don't put a ListView into a ScrollView . I have yet to see any real explanation for why though. The only reason I can seem to find is that Google doesn't think you should want to do that. Well I do so I did...

Android: Is application running in background?

http://stackoverflow.com/questions/3667022/android-is-application-running-in-background

this solution may work and it indeed works most of the time I strongly recommend to refrain from using it. And here's why. As Dianne Hackborn wrote These APIs are not there for applications to base their UI flow on but to do things like show..

Synchronise ScrollView scroll positions - android

http://stackoverflow.com/questions/3948934/synchronise-scrollview-scroll-positions-android

int x int y int oldx int oldy Unfortunately Google never thought that we would need to access it which is why they made it protected and didn't add a setOnScrollChangedListener hook. So we will have to do that for ourselves. First..

onSaveInstanceState () and onRestoreInstanceState ()

http://stackoverflow.com/questions/4096169/onsaveinstancestate-and-onrestoreinstancestate

. The problem is that it never enters the onRestoreInstanceState method. Can anyone explain to me why this is android activity states share improve this question Usually you restore your state in onCreate . It is possible..

Android and XMPP: Currently available solutions

http://stackoverflow.com/questions/4769020/android-and-xmpp-currently-available-solutions

hasn't been updated for quite some time as the site suggests . Do you have any other suggestions or can you explain why I should choose one of the above over the rest android xmpp smack asmack share improve this question I currently use..

Android post JSON using HTTP

http://stackoverflow.com/questions/6218143/android-post-json-using-http

but could someone point me to an actual tutorial I'm looking for a step by step process with code and explanation of why you do each step or of what that step does. It doesn't need to be a complex simple will suffice. Again I know there are.. ton of examples out there I'm just really looking for an example with an explanation of what exactly is happening and why it is done that way. If anyone knows of a good Android book that deals with this please let me know. Thanks again for the..

When to call activity context OR application context?

http://stackoverflow.com/questions/7298731/when-to-call-activity-context-or-application-context

always wrong. Ms. Hackborn among others have been very explicit that you only use getApplicationContext when you know why you are using getApplicationContext and only when you need to use getApplicationContext . To be blunt some programmers use.. a custom Application object and found it to be painful. Ms. Hackborn also agrees with this position . Here are reasons why not to use getApplicationContext wherever you go It's not a complete Context supporting everything that Activity does. Various..

Android accelerometer accuracy (Inertial navigation)

http://stackoverflow.com/questions/7829097/android-accelerometer-accuracy-inertial-navigation

integrating the linear acceleration twice but the error is horrible. It is useless in practice. Here is an explanation why Google Tech Talk at 23 20 . I highly recommend this video. It is not the accelerometer noise that causes the problem but..

How to block calls in android

http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android

Understanding Fragment's setRetainInstance(boolean)

http://stackoverflow.com/questions/11182180/understanding-fragments-setretaininstanceboolean

on configuration change what exactly is retained Will the fragment be destroyed when the user leaves the activity Why doesn't it work with fragments on the back stack Which are the use cases where it makes sense to use this method android.. finish and effectively destroying the Activity all of the Activity s attached Fragment s will also be destroyed. Why doesn't it work with fragments on the back stack There are probably multiple reasons why it's not supported but the most..

Why retrieving Google Directions for Android using KML data is not working anymore? [duplicate]

http://stackoverflow.com/questions/11745314/why-retrieving-google-directions-for-android-using-kml-data-is-not-working-anymo

retrieving Google Directions for Android using KML data is not working anymore duplicate Possible Duplicate Google Maps..

Android: How to detect double-tap?

http://stackoverflow.com/questions/2217670/android-how-to-detect-double-tap

android detect between single tap or double tap for it android listview double click share improve this question Why aren't you using a Long Press Or are you using that already for something else The advantages over a long touch over a double..

Why doesn't System.out.println work? (in Android)

http://stackoverflow.com/questions/2220547/why-doesnt-system-out-println-work-in-android

doesn't System.out.println work in Android I want to print something in console so I can debug it. But for some reason..

Changing Locale within the app itself

http://stackoverflow.com/questions/2264874/changing-locale-within-the-app-itself

want to keep their phone settings in English but read the content of my app in French Dutch or any other language ... Why is this working perfectly fine in 1.5 1.6 but NOT in 2.0 anymore @Override public boolean onOptionsItemSelected MenuItem..

How to discover memory usage of my application in Android

http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android

Interesting thing to note here Pss and Uss are slightly or more than slightly different than what we saw in meminfo. Why is that Well procrank uses a different kernel mechanism to collect its data than meminfo does and they give slightly different.. uses a different kernel mechanism to collect its data than meminfo does and they give slightly different results. Why is that Honestly I haven't a clue. I believe procrank may be the more accurate one... but really this just leave the point..

custom listview adapter getView method being called multiple times, and in no coherent order

http://stackoverflow.com/questions/2618272/custom-listview-adapter-getview-method-being-called-multiple-times-and-in-no-co

app starts with four visible rows at least the position numbers cycling from 0 3 makes sense. But the rest is a mess Why is getview called for each row three times Where are these convertViews coming from when I haven't scrolled yet I did a..

How to Read MMS Data in Android?

http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

to query the MMS and SMS databases at the same time and mix them in a single thread which are called conversations . Why is it important the content mms sms conversations uri Well that's the standard way of getting MMS and SMS messages for instance..

Adding a library/JAR to an Eclipse Android project

http://stackoverflow.com/questions/3642928/adding-a-library-jar-to-an-eclipse-android-project

to consume doesn't exist. Caused by java.lang.ClassNotFoundException com.github.droidfu.widgets.WebImageView... Why when I get no compilation or linker error in Eclipse does it have this problem on the emulator These two questions are rhetorical..

How do you to retrieve dimensions of a view? Getheight() and Getwidth() always return zero

http://stackoverflow.com/questions/4142090/how-do-you-to-retrieve-dimensions-of-a-view-getheight-and-getwidth-always-r

tl TableLayout findViewById R.id.board tl TableLayout findViewById R.id.board vh tl.getHeight getHeight returned 0 Why vw tl.getWidth getWidth returned 0 Why Test 2 used a simple dynamically generated view TextView tv new TextView this tv.setHeight.. tl TableLayout findViewById R.id.board vh tl.getHeight getHeight returned 0 Why vw tl.getWidth getWidth returned 0 Why Test 2 used a simple dynamically generated view TextView tv new TextView this tv.setHeight 20 tv.setWidth 20 vh tv.getHeight.. generated view TextView tv new TextView this tv.setHeight 20 tv.setWidth 20 vh tv.getHeight getHeight returned 0 Why vw tv.getWidth getWidth returned 0 Why eof method eof class android layout android widget lifecycle measure share improve..

getApplication() vs. getApplicationContext()

http://stackoverflow.com/questions/5018545/getapplication-vs-getapplicationcontext

application because it may not be the application instance which you obviously experienced with the test framework . Why does getApplicationContext exists in the first place getApplication is only available on the Activity class and in the Service..

Why not use always android:configChanges=“keyboardHidden|orientation”?

http://stackoverflow.com/questions/7818717/why-not-use-always-androidconfigchanges-keyboardhiddenorientation

not use always android configChanges &ldquo keyboardHidden orientation&rdquo I was wondering why not use android configChanges..

Android Activity Life Cycle - What are all these methods for?

http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for

Activity Life Cycle What are all these methods for What is the life cycle of an Android activity Why are so many similar sounding methods onCreate onStart onResume called during initialization and so many others onPause onStop..

R cannot be resolved - Android error

http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error

setContentView R.layout.main but Eclipse gives me the error R cannot be resolved on line setContentView R.layout.main Why PS I do have an XML file named main.xml under res layout . android eclipse android resources share improve this question..

Android : Call activity of another application

http://stackoverflow.com/questions/10960709/android-call-activity-of-another-application

Well... getLaunchIntentForPackage only gets the Intent for that first Activity. That's WHY we make a custom Intent... First because we don't really want it to be our 3rd Activity to be our start up... And second..

Android TCP does not flush until socket is closed

http://stackoverflow.com/questions/11847092/android-tcp-does-not-flush-until-socket-is-closed

Please post the changes required to get this code working properly as described above any annotations to explain WHY would be greatly appreciated. Links to other similar questions answers would be great to help me learn but i have been looking..

EditText causing memory leak

http://stackoverflow.com/questions/14069501/edittext-causing-memory-leak

9ms total 54ms 12 28 12 22 01.990 D dalvikvm 17934 WAIT_FOR_CONCURRENT_GC blocked 30ms Now that's what I want to see WHY Can someone tell my why this is happening I would like to add that I'm not keeping a reference to these EditText object..

import android.R in Eclipse : Why?

http://stackoverflow.com/questions/15309941/import-android-r-in-eclipse-why

This will cause your make to break. Look out for these erroneous import statements and delete them. My question WHY Why does eclipse keep on doing this I have been developing Android applications using Eclipse for a quite some time now..

Can not display list with ListView in another activity

http://stackoverflow.com/questions/19995004/can-not-display-list-with-listview-in-another-activity

going on Have checked DB everything works fine. When put ListView into the MainActivity everything works fine as well. WHY IT DOES NOT WORK with another Activity android listview android intent manifest share improve this question you forget..

Whats the difference between Thread.setPriority() and android.os.Process.setThreadPriority()

http://stackoverflow.com/questions/5198518/whats-the-difference-between-thread-setpriority-and-android-os-process-setthre

android.os.Process.THREAD_PRIORITY_MORE_FAVORABLE r.run IS the android.os.Process way required preferred WHY is the android.os.Process way preferred required if it is This is not clearly documented as far as I can tell. android..

SQLiteOpenHelper IllegalStateException : DB Already Closed Error

http://stackoverflow.com/questions/6535908/sqliteopenhelper-illegalstateexception-db-already-closed-error

ActivityThread.java 3337 ... 10 more UPDATE I've fixed the problem but not sure WHY this fixed it. So maybe someone out there knows or could explain. When I'm in the 4th activity of the stack of activities..

Unity3d integration with android

http://stackoverflow.com/questions/7749841/unity3d-integration-with-android

it's not the best solution... What I read about the problem is that I need to use JNI which is java native interface WHY why do I need to use native code Do I need to create some middle level code on java which purpose is to communicate with..

How to pass drawable between activities

http://stackoverflow.com/questions/8407336/how-to-pass-drawable-between-activities

R.id.imageView1 image.setImageBitmap bmp 2 Saving image file and passing its reference to another activity WHY to do so taken from http groups.google.com group android developers browse_frm thread 9309931b3f060284# The size limit is..

Android Stop Background Music

http://stackoverflow.com/questions/9148615/android-stop-background-music

music while looking thru the pics and text why is that so difficult another EDIT it seems the main question really is WHY DOES PRESSING THE HOME BUTTON NOT CALL onPause or onStop so i can know when to stop the media player and how do the games.. YES that is pretty simple but why do I have to programattically do this actually the BIGGEST QUESTION FOR THIS POST IS WHY DOES PRESSING THE HOME BUTTON NOT CALL onPause or onStop To put it in onDestroy is not an option because onDestroy is only..