¡@

Home 

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

android Programming Glossary: notice

Android emulator doesn't take keyboard input - SDK tools rev 20

http://stackoverflow.com/questions/11235370/android-emulator-doesnt-take-keyboard-input-sdk-tools-rev-20

of the more important configuration settings below If you notice that the soft screen based main keys Back Home etc. are missing..

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

to leg.getString end_address Get google's copyright notice tos requirement route.setCopyright jsonRoute.getString copyrights..

How ListView's recycling mechanism works

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

checks.get position return row you will notice in your logcat initially convertview is null for all the visible.. which is already in your recycler in your Logcat you will notice that convetView is not null its because your new item 8 will..

Force an android activity to always use landscape mode

http://stackoverflow.com/questions/2150287/force-an-android-activity-to-always-use-landscape-mode

Also depending on how the activities are coded you may notice that when screen orientation is changed the values that were..

How to implement my very own URI scheme on Android

http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android

as this is required for all implicit intents . Also notice how I added the category BROWSABLE this is not necessary but..

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

a bit of reseach and without getting a good answer I did notice that people were associating this issue with layout issues...

“Conversion to Dalvik format failed with error 1” on external JAR

http://stackoverflow.com/questions/2680827/conversion-to-dalvik-format-failed-with-error-1-on-external-jar

does not show up under the Package Explorer so you don't notice it but it does get counted twice causing the dreaded Dalvik..

Android, ListView IllegalStateException: “The content of the adapter has changed but ListView did not receive a notification”

http://stackoverflow.com/questions/3132021/android-listview-illegalstateexception-the-content-of-the-adapter-has-changed

it was suggested in answer What I got sometimes please notice it happens really rarely once a week for one of 3.5k users ...

Android Launcher label vs. activity title

http://stackoverflow.com/questions/3488664/android-launcher-label-vs-activity-title

be visible to the user for a short time but long enough to notice And please don't answer my question by refering to a custom..

Android VideoView orientation change with buffered video

http://stackoverflow.com/questions/4434027/android-videoview-orientation-change-with-buffered-video

output when resizing properly takes up entire window notice the h 726 12 13 15 37 35.468 1262 1270 I ActivityManager Config.. resizing incorrectly takes up tiny portion of full screen notice the h 480 12 13 15 43 00.085 1262 1270 I ActivityManager Config..

Call method when home button pressed on android [closed]

http://stackoverflow.com/questions/4783960/call-method-when-home-button-pressed-on-android

the BACK button. Take a look at this discussion. You will notice that the home button seems to be implemented as a intent invocation..

Install apps silently, with granted INSTALL_PACKAGES permission

http://stackoverflow.com/questions/5803999/install-apps-silently-with-granted-install-packages-permission

else if v mCancel Cancel and finish finish Then you'll notice that actual installer is located in InstallAppProgress class...

Android - registering a headset button click with BroadcastReceiver

http://stackoverflow.com/questions/6287116/android-registering-a-headset-button-click-with-broadcastreceiver

intent filter receiver .... and I notice in LogCat that when I press the button I get an error from BluetoothIntentReceiver..

android how to work with asynctasks progressdialog

http://stackoverflow.com/questions/6450275/android-how-to-work-with-asynctasks-progressdialog

Context Integer String run intensive processes here notice that the datatype of the first param in the class definition.. super.onPreExecute called from the publish progress notice that the datatype of the second param gets passed to this method.. called as soon as doInBackground method completes notice that the third param gets passed to this method @Override protected..

ViewPager and fragments ??what's the right way to store fragment's state?

http://stackoverflow.com/questions/7951730/viewpager-and-fragments-whats-the-right-way-to-store-fragments-state

that position does not exist. After rotating Android will notice that it already created saved a fragment for this particular.. single time in Activity.onCreate Bundle . As you have noticed when a fragment is added to the FragmentManager it will be..

Starting Activity from Fragment causes NullPointerException

http://stackoverflow.com/questions/8748064/starting-activity-from-fragment-causes-nullpointerexception

f.mUserVisibleHint You should notice that if result is null coming into this code and the first if..

Navigation Drawer (Google+ vs. YouTube)

http://stackoverflow.com/questions/11377472/navigation-drawer-google-vs-youtube

by clicking the G logo in the upper left hand corner. Notice that the entire screen moves from it's position and get's nudged..

Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

http://stackoverflow.com/questions/12090899/android-webview-jellybean-should-not-happen-no-rect-based-test-nodes-found

found return rects Rest of the part is omitted here... Notice that log message there I am guessing this code is for identifying..

How to read contacts on Android 2.0

http://stackoverflow.com/questions/1721279/how-to-read-contacts-on-android-2-0

rv contacts.getString 0 contacts.close return note Notice this time I used not only the contact id but the mime type for..

How to make a nice looking ListView filter on Android [closed]

http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android

line to your onCreate call adapter.getFilter .filter s Notice that you will need to save your ListAdapter to a variable to..

Send SMS until it is successful

http://stackoverflow.com/questions/19083158/send-sms-until-it-is-successful

new String receiver startService i Notice it supports multiple receivers which this method does not demonstrate..

How to animate a slide in notification view that pushes the content view down

http://stackoverflow.com/questions/19098083/how-to-animate-a-slide-in-notification-view-that-pushes-the-content-view-down

onClick clickHandler android text close LinearLayout Notice Both the ListView and the green View could be layouts of any..

How to implement my very own URI scheme on Android

http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android

20test must be handled by my own application or service. Notice that the scheme is myapp and not http or ftp . That is precisely..

Set zoom for Webview

http://stackoverflow.com/questions/2505393/set-zoom-for-webview

.setDefaultZoom WebSettings.ZoomDensity.FAR Notice that although webSettings is available since API Level 1 WebSettings.ZoomDensity..

Declaring a custom android UI element using XML

http://stackoverflow.com/questions/2695646/declaring-a-custom-android-ui-element-using-xml

extraInformation format string declare styleable resources Notice the use of an unqualified name in the declare styleable tag...

Playing multiple sounds using SoundManager

http://stackoverflow.com/questions/3039078/playing-multiple-sounds-using-soundmanager

in my game and each has a very short sound loop 3000ms. Notice when I add a sound below I keep track of the specified index..

android:orientation=“vertical” does not work for TabWidget

http://stackoverflow.com/questions/4149953/androidorientation-vertical-does-not-work-for-tabwidget

in the XML above. TabWidget is itself a LinearLayout . Notice that I did not set the orientation in XML. This because TabWidget..

Android: how to add a custom button state

http://stackoverflow.com/questions/4336060/android-how-to-add-a-custom-button-state

false android drawable @drawable item_raw selector Notice the app prefix whereas with standard android states you would..

Multi-gradient shapes

http://stackoverflow.com/questions/4381033/multi-gradient-shapes

I'd like to create a shape that's like the following image Notice the top half gradients from color 1 to color 2 but theres a..

Android: long click on a button -> perform actions

http://stackoverflow.com/questions/4402740/android-long-click-on-a-button-perform-actions

this view is not long clickable it becomes long clickable. Notice that it requires to return a boolean this should work. share..

What's the “dot” for when registering an Activity

http://stackoverflow.com/questions/4834122/whats-the-dot-for-when-registering-an-activity

a purpose Do I need it I have included an example below. Notice the dot before NewActivity activity android name .NewActivity..

Wifi sleeps, even with Lock

http://stackoverflow.com/questions/5147203/wifi-sleeps-even-with-lock

with WireShark and also the echo server shows the strings. Notice how WiFi and power locks are acquired before starting to send..

ListView reusing views when … I don't want it to

http://stackoverflow.com/questions/6921462/listview-reusing-views-when-i-dont-want-it-to

mToggles.get position return convertView Notice that ViewHolder is a static class we use to recycle that view...

Multiple screen resolution

http://stackoverflow.com/questions/7156752/multiple-screen-resolution

280px android layout_height 300px RelativeLayout Notice I have used px for fixed sized layout's width height because..

Awful background image quality in Android

http://stackoverflow.com/questions/8417608/awful-background-image-quality-in-android

as both the source and destination use 8 bits per color Notice how the resulting artifacts in image 3 already exists in the..

Android emulator doesn't take keyboard input - SDK tools rev 20

http://stackoverflow.com/questions/11235370/android-emulator-doesnt-take-keyboard-input-sdk-tools-rev-20

UI which resolves this issue. I have highlighted some of the more important configuration settings below If you notice that the soft screen based main keys Back Home etc. are missing from your emulator you can set hw.mainKeys no to enable..

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

start end addresses route.setName leg.getString start_address to leg.getString end_address Get google's copyright notice tos requirement route.setCopyright jsonRoute.getString copyrights Get the total length of the route. route.setLength..

How ListView's recycling mechanism works

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

dramaList.get position .getDramaName holder.cbCheck.setChecked checks.get position return row you will notice in your logcat initially convertview is null for all the visible rows because initially there were no view item in recycler.. going to create a new view it will use the view convert view which is already in your recycler in your Logcat you will notice that convetView is not null its because your new item 8 will be drawn using convertview i.e basically it take the item1..

Force an android activity to always use landscape mode

http://stackoverflow.com/questions/2150287/force-an-android-activity-to-always-use-landscape-mode

how the layout were created. You will have to account for that. Also depending on how the activities are coded you may notice that when screen orientation is changed the values that were filled into any input boxes disappear. This also may have to..

How to implement my very own URI scheme on Android

http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android

it could be anything and made sure to add the DEFAULT category as this is required for all implicit intents . Also notice how I added the category BROWSABLE this is not necessary but it will allow your URIs to be openable from the browser a nifty..

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

convertViews coming from when I haven't scrolled yet I did a bit of reseach and without getting a good answer I did notice that people were associating this issue with layout issues. So in case here's the layout that contains the list xml version..

“Conversion to Dalvik format failed with error 1” on external JAR

http://stackoverflow.com/questions/2680827/conversion-to-dalvik-format-failed-with-error-1-on-external-jar

my src folder and THEN added it as a Java Path Library. It does not show up under the Package Explorer so you don't notice it but it does get counted twice causing the dreaded Dalvik error 1. Another possible reason could be package name conflicts...

Android, ListView IllegalStateException: “The content of the adapter has changed but ListView did not receive a notification”

http://stackoverflow.com/questions/3132021/android-listview-illegalstateexception-the-content-of-the-adapter-has-changed

crashes lowered by a factor of 10 but not disappeared. it was suggested in answer What I got sometimes please notice it happens really rarely once a week for one of 3.5k users . But I'd like to get rid of this bug completely. Here is partial..

Android Launcher label vs. activity title

http://stackoverflow.com/questions/3488664/android-launcher-label-vs-activity-title

int method does no good either because the short name will be visible to the user for a short time but long enough to notice And please don't answer my question by refering to a custom titlebar... I do not want to go that long way just because of..

Android VideoView orientation change with buffered video

http://stackoverflow.com/questions/4434027/android-videoview-orientation-change-with-buffered-video

to be the culprit although I have no idea how to fix it Logcat output when resizing properly takes up entire window notice the h 726 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.. 35.561 1262 1268 I Overlay window h 726 Logcat output when resizing incorrectly takes up tiny portion of full screen notice the h 480 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..

Call method when home button pressed on android [closed]

http://stackoverflow.com/questions/4783960/call-method-when-home-button-pressed-on-android

will not let you override its behavior the same way you do the BACK button. Take a look at this discussion. You will notice that the home button seems to be implemented as a intent invocation so you'll end up having to add an intent category to..

Install apps silently, with granted INSTALL_PACKAGES permission

http://stackoverflow.com/questions/5803999/install-apps-silently-with-granted-install-packages-permission

InstallAppProgress.class ... startActivity newIntent finish else if v mCancel Cancel and finish finish Then you'll notice that actual installer is located in InstallAppProgress class. Inspecting that class you'll find that initView is the core..

Android - registering a headset button click with BroadcastReceiver

http://stackoverflow.com/questions/6287116/android-registering-a-headset-button-click-with-broadcastreceiver

intent filter action android name android.intent.action.MEDIA_BUTTON intent filter receiver .... and I notice in LogCat that when I press the button I get an error from BluetoothIntentReceiver saying onReceive Action android.intent.action.MEDIA_BUTTON..

android how to work with asynctasks progressdialog

http://stackoverflow.com/questions/6450275/android-how-to-work-with-asynctasks-progressdialog

sub class of AsyncTask protected class InitTask extends AsyncTask Context Integer String run intensive processes here notice that the datatype of the first param in the class definition matches the param passed to this method and that the datatype.. protected void onPreExecute Log.i makemachine onPreExecute super.onPreExecute called from the publish progress notice that the datatype of the second param gets passed to this method @Override protected void onProgressUpdate Integer... values.. Cancelled _percentField.setTextColor 0xFFFF0000 called as soon as doInBackground method completes notice that the third param gets passed to this method @Override protected void onPostExecute String result super.onPostExecute..

ViewPager and fragments ??what's the right way to store fragment's state?

http://stackoverflow.com/questions/7951730/viewpager-and-fragments-whats-the-right-way-to-store-fragments-state

int position is only called when a fragment for that position does not exist. After rotating Android will notice that it already created saved a fragment for this particular position and so it simply tries to reconnect with it with FragmentManager.findFragmentByTag.. it is not a good idea to create a new fragment every single time in Activity.onCreate Bundle . As you have noticed when a fragment is added to the FragmentManager it will be recreated for you after rotating and there is no need to add..

Starting Activity from Fragment causes NullPointerException

http://stackoverflow.com/questions/8748064/starting-activity-from-fragment-causes-nullpointerexception

it's not the default value result.putBoolean FragmentManagerImpl.USER_VISIBLE_HINT_TAG f.mUserVisibleHint You should notice that if result is null coming into this code and the first if is not triggered you'll get a NullPointerException if we enter..

Navigation Drawer (Google+ vs. YouTube)

http://stackoverflow.com/questions/11377472/navigation-drawer-google-vs-youtube

7 12 You can only go from the first screen to the second screen by clicking the G logo in the upper left hand corner. Notice that the entire screen moves from it's position and get's nudged to the right side of the screen including the action bar..

Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

http://stackoverflow.com/questions/12090899/android-webview-jellybean-should-not-happen-no-rect-based-test-nodes-found

if list.isEmpty LOGE Should not happen no rect based test nodes found return rects Rest of the part is omitted here... Notice that log message there I am guessing this code is for identifying the x and y axis vectors generated on clicks or taps or..

How to read contacts on Android 2.0

http://stackoverflow.com/questions/1721279/how-to-read-contacts-on-android-2-0

How to make a nice looking ListView filter on Android [closed]

http://stackoverflow.com/questions/1737009/how-to-make-a-nice-looking-listview-filter-on-android

. Turns out that is pretty easy. To run a quick test add this line to your onCreate call adapter.getFilter .filter s Notice that you will need to save your ListAdapter to a variable to make this work I have saved my ArrayAdapter String from earlier..

Send SMS until it is successful

http://stackoverflow.com/questions/19083158/send-sms-until-it-is-successful

i.putExtra SMSSender.EXTRA_MESSAGE message i.putExtra SMSSender.EXTRA_RECEIVERS new String receiver startService i Notice it supports multiple receivers which this method does not demonstrate use. Remember in your manifest uses permission android..

How to animate a slide in notification view that pushes the content view down

http://stackoverflow.com/questions/19098083/how-to-animate-a-slide-in-notification-view-that-pushes-the-content-view-down

wrap_content android layout_height wrap_content android onClick clickHandler android text close LinearLayout Notice Both the ListView and the green View could be layouts of any types with any kind of content. And next a proof of concept..

How to implement my very own URI scheme on Android

http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android

that an URI such as myapp path to what i want d This 20is 20a 20test must be handled by my own application or service. Notice that the scheme is myapp and not http or ftp . That is precisely what I intend to define my own URI schema globally for..

Set zoom for Webview

http://stackoverflow.com/questions/2505393/set-zoom-for-webview

improve this question use the webSettings class webview.getSettings .setDefaultZoom WebSettings.ZoomDensity.FAR Notice that although webSettings is available since API Level 1 WebSettings.ZoomDensity is available since API Level 7. Works well..

Declaring a custom android UI element using XML

http://stackoverflow.com/questions/2695646/declaring-a-custom-android-ui-element-using-xml

name android text attr name android textColor attr name extraInformation format string declare styleable resources Notice the use of an unqualified name in the declare styleable tag. Non standard android attributes like extraInformation need..

Playing multiple sounds using SoundManager

http://stackoverflow.com/questions/3039078/playing-multiple-sounds-using-soundmanager

20 streams. I have many guns and bad guys making noise in my game and each has a very short sound loop 3000ms. Notice when I add a sound below I keep track of the specified index in a vector called mAvailibleSounds this way my game can try..

android:orientation=“vertical” does not work for TabWidget

http://stackoverflow.com/questions/4149953/androidorientation-vertical-does-not-work-for-tabwidget

tabs on the right you put the TabWidget after the FrameLayout in the XML above. TabWidget is itself a LinearLayout . Notice that I did not set the orientation in XML. This because TabWidget does it in its own code yes it is hard coded . To counter..

Android: how to add a custom button state

http://stackoverflow.com/questions/4336060/android-how-to-add-a-custom-button-state

item_overcooked item app state_baked false app state_fried false android drawable @drawable item_raw selector Notice the app prefix whereas with standard android states you would have used prefix android . The XML namespace is crucial for..

Multi-gradient shapes

http://stackoverflow.com/questions/4381033/multi-gradient-shapes

gradient shapes I'd like to create a shape that's like the following image Notice the top half gradients from color 1 to color 2 but theres a bottom half that gradients from color 3 to color 4. I know how..

Android: long click on a button -> perform actions

http://stackoverflow.com/questions/4402740/android-long-click-on-a-button-perform-actions

What's the “dot” for when registering an Activity

http://stackoverflow.com/questions/4834122/whats-the-dot-for-when-registering-an-activity

figure out why we need the dot . Does the dot actually server a purpose Do I need it I have included an example below. Notice the dot before NewActivity activity android name .NewActivity activity android android manifest share improve this question..

Wifi sleeps, even with Lock

http://stackoverflow.com/questions/5147203/wifi-sleeps-even-with-lock

string every 100ms . See code below. I can see the traffic with WireShark and also the echo server shows the strings. Notice how WiFi and power locks are acquired before starting to send and released after of course . However when the phone is running..

ListView reusing views when … I don't want it to

http://stackoverflow.com/questions/6921462/listview-reusing-views-when-i-dont-want-it-to

should set the ToggleButton value for this item holder.toggleOk.setChecked mToggles.get position return convertView Notice that ViewHolder is a static class we use to recycle that view. Its properties are the views your list item has. It is declared..

Multiple screen resolution

http://stackoverflow.com/questions/7156752/multiple-screen-resolution

LinearLayout android id @ id mLayout android layout_width 280px android layout_height 300px RelativeLayout Notice I have used px for fixed sized layout's width height because in LayoutParams layoutParams new LayoutParams int width int..

Awful background image quality in Android

http://stackoverflow.com/questions/8417608/awful-background-image-quality-in-android

and code2 in this case the dithering is not really important as both the source and destination use 8 bits per color Notice how the resulting artifacts in image 3 already exists in the original image. Note if anyone knows how to shrink the images..