¡@

Home 

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

android Programming Glossary: normally

java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk [duplicate]

http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra

rather simple app with a target of 4.2.2. I had it working normally in my device. Then I stopped development for about 1 month...

Eclipse error: R cannot be resolved to a variable [duplicate]

http://stackoverflow.com/questions/16642604/eclipse-error-r-cannot-be-resolved-to-a-variable

by Googling . None of them worked. My project was working normally but not code changes. I see that my code changes does not acting..

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

the ListView. Next create a ListActivity as you would normally but add a setContentView call in the onCreate method so we use..

How to fire onListItemClick in Listactivity with buttons in list?

http://stackoverflow.com/questions/1821871/how-to-fire-onlistitemclick-in-listactivity-with-buttons-in-list

when the list item is clicked. The button still functions normally within the list item but when something besides the button is.. thing implementation of getView shown above is pretty ugly normally you should use ViewHolder pattern to avoid findViewById calls....

Android: Override back button to act like home button

http://stackoverflow.com/questions/2000102/android-override-back-button-to-act-like-home-button

the preferred option should be for an Activity to finish normally and be able to recreate itself e.g. reading the current state..

Is there any way to receive a notification of when a user powers off his/her Android phone?

http://stackoverflow.com/questions/2190126/is-there-any-way-to-receive-a-notification-of-when-a-user-powers-off-his-her-and

is about to shutdown. The documentation says Apps will not normally need to handle this since the foreground activity will be paused..

How to scale an Image in ImageView to keep the aspect ratio

http://stackoverflow.com/questions/2521959/how-to-scale-an-image-in-imageview-to-keep-the-aspect-ratio

For example if you have a rectangular image in what would normally be a square ImageView adjustViewBounds true will make it resize..

Android: Resize a large bitmap file to scaled output file

http://stackoverflow.com/questions/3331527/android-resize-a-large-bitmap-file-to-scaled-output-file

that bitmap to 800x533 and save it to another file. I normally would scale the bitmap by calling Bitmap.createBitmap method..

Defining custom attrs

http://stackoverflow.com/questions/3441396/defining-custom-attrs

color boolean dimension float integer string fraction enum normally implicitly defined flag normally implicitly defined You can.. string fraction enum normally implicitly defined flag normally implicitly defined You can set the format to multiple types.. LinearLayout Finally to access that custom attribute you normally do so in the constructor of your custom view as follows. public..

Update UI from Thread

http://stackoverflow.com/questions/4369537/update-ui-from-thread

immediately after the task is executed. This step is normally used to setup the task for instance by showing a progress bar..

Android VideoView orientation change with buffered video

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

could find of the actual layout This is pretty easy to do normally just specify an alternate layout in layout land and all will..

getApplication() vs. getApplicationContext()

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

cases you shouldn't need to subclass Application There is normally no need to subclass Application . In most situation static singletons..

TelephonyManager.getLine1Number() failing?

http://stackoverflow.com/questions/5134398/telephonymanager-getline1number-failing

is empty string. If I run code on emulatur phone number is normally showed. If I go to Settings About phone Phone identity Phone..

How to connect to my http://localhost web server from Android Emulator in Eclipse

http://stackoverflow.com/questions/5806220/how-to-connect-to-my-http-localhost-web-server-from-android-emulator-in-eclips

says that it didn't found the page while my web server is normally running. android android emulator share improve this question..

The Android emulator is not starting, showing “invalid command-line parameter”

http://stackoverflow.com/questions/6638713/the-android-emulator-is-not-starting-showing-invalid-command-line-parameter

Android Launch 2011 07 10 07 10 24 demo adb is running normally. 2011 07 10 07 10 24 demo Performing com.demo.DemoActivity activity..

Android project using httpclient --> http.client (apache), post/get method

http://stackoverflow.com/questions/874227/android-project-using-httpclient-http-client-apache-post-get-method

and if you just look for HttpClient you will normally end up at the 3.x stuff . Also if you do any number of requests..

Override home and back button is case a boolean is true

http://stackoverflow.com/questions/10025660/override-home-and-back-button-is-case-a-boolean-is-true

the action of the back and home button is some cases. Normally these buttons should just react like they always do but in a..

getActionBar returns null

http://stackoverflow.com/questions/10031180/getactionbar-returns-null

feature must be requested before setting a content view. Normally this is set automatically by your Activity's theme in your manifest...

Why does Intent.createChooser() need a BroadcastReceiver and how to implement?

http://stackoverflow.com/questions/10068954/why-does-intent-createchooser-need-a-broadcastreceiver-and-how-to-implement

and within register it registers itself on the activity. Normally the receiver is unregistered in onStop . However later in onCreate..

Android action bar with two stretched buttons

http://stackoverflow.com/questions/11264808/android-action-bar-with-two-stretched-buttons

let the LinearLayout take up the entire width on its own. Normally you should avoid nesting layouts unnecessarily like this Perhaps..

Further understanding setRetainInstance(true)

http://stackoverflow.com/questions/12640316/further-understanding-setretaininstancetrue

mProgressBar.getMax mProgressBar.setProgress mPosition Normally we would be doing some work but put a kludge here to pretend..

How to fire onListItemClick in Listactivity with buttons in list?

http://stackoverflow.com/questions/1821871/how-to-fire-onlistitemclick-in-listactivity-with-buttons-in-list

a custom ListAdapter to generate the views in the list. Normally the ListAdapter would just fill the views with TextViews but..

Push my apk to /system/app

http://stackoverflow.com/questions/2007024/push-my-apk-to-system-app

that permission. android share improve this question Normally the only way to get access to the system directory is to have..

How can i call Wi-Fi settings screen from my application using Android

http://stackoverflow.com/questions/2318310/how-can-i-call-wi-fi-settings-screen-from-my-application-using-android

Wi Fi settings screen from my application using Android Normally I am getting Wi Fi setting screen on the emulator by clicking..

Android JSON HttpClient to send data to PHP server with HttpResponse

http://stackoverflow.com/questions/2540786/android-json-httpclient-to-send-data-to-php-server-with-httpresponse

new HashMap String String kvPairs.put vehicle j.toString Normally I would pass two more JSONObjects..... HttpResponse re HTTPPoster.doPost..

android: turn off screen when close to face

http://stackoverflow.com/questions/3018716/android-turn-off-screen-when-close-to-face

app allows the user to access their corporate voice mail. Normally durring a phone call when the user holds the device up to their..

Android: retrieving all Drawable resources from Resources object

http://stackoverflow.com/questions/3221603/android-retrieving-all-drawable-resources-from-resources-object

loop through the entire collection of Drawable resources. Normally you can only retrieve a specific resource via its ID using something..

Defining custom attrs

http://stackoverflow.com/questions/3441396/defining-custom-attrs

your attributes. You do this on the root layout element. Normally there is only xmlns android http schemas.android.com apk res..

Android: how to use CursorAdapter?

http://stackoverflow.com/questions/3544913/android-how-to-use-cursoradapter

I want the ListView to update and show this change. Normally it doesn't show this new item until i go to the homescreen and..

SharedPreferences and Thread Safety

http://stackoverflow.com/questions/4693387/sharedpreferences-and-thread-safety

in Android is thread safe but not process safe. Normally your app will run all in the same process but it's possible..

android live wallpaper rescaling

http://stackoverflow.com/questions/5208203/android-live-wallpaper-rescaling

. xStep indicates how many screens your launcher supports. Normally xStep will be 0.25 indicating 5 screens i.e. xOffset 0 0.25..

Does BroadcastReceiver.onReceive always run in the UI thread?

http://stackoverflow.com/questions/5674518/does-broadcastreceiver-onreceive-always-run-in-the-ui-thread

BroadcastReceiver.onReceive always run in the UI thread Normally yes. There is a flavor of registerReceiver that takes a Handler..

Android setting with TextView for Hebrew text?

http://stackoverflow.com/questions/6302221/android-setting-with-textview-for-hebrew-text

text I am setting text in TextView from string resource. Normally Hebrew works in Right To Left format. When I set a text it sets..

How to make an Android Spinner with initial text “Select One”

http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one

likely that it will but it is by no means guaranteed. Normally I wouldn't condone something like this but this question has..

Android ICS: Remove blue divider in ActionBar?

http://stackoverflow.com/questions/8704769/android-ics-remove-blue-divider-in-actionbar

a blue line divider separator as part of the ActionBar. Normally it would be good for consistency but in my case I need to remove..

How to understand the directory structure of android root tree?

http://stackoverflow.com/questions/9046572/how-to-understand-the-directory-structure-of-android-root-tree

such as the source code for the sdk and ndk tools. Normally not a folder you touch when working with the platform for a..

java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk [duplicate]

http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra

to ADT 22 7 answers Some time ago I developed a rather simple app with a target of 4.2.2. I had it working normally in my device. Then I stopped development for about 1 month. After the recent Google I O I decided to come back to development...

Eclipse error: R cannot be resolved to a variable [duplicate]

http://stackoverflow.com/questions/16642604/eclipse-error-r-cannot-be-resolved-to-a-variable

mad. I almost tried everything which suggested as solution by Googling . None of them worked. My project was working normally but not code changes. I see that my code changes does not acting on my app on AVD then I cleaned my project under Project..

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

This will lay everything out properly with a nice EditText above the ListView. Next create a ListActivity as you would normally but add a setContentView call in the onCreate method so we use our recently declared layout. Remember that we ID'ed the..

How to fire onListItemClick in Listactivity with buttons in list?

http://stackoverflow.com/questions/1821871/how-to-fire-onlistitemclick-in-listactivity-with-buttons-in-list

prevents the firing of onListItemClick in the ListActivity when the list item is clicked. The button still functions normally within the list item but when something besides the button is pressed I want onListItemClick to be triggered. How can I.. to OnItemClickListener constructor. And one important thing implementation of getView shown above is pretty ugly normally you should use ViewHolder pattern to avoid findViewById calls.. but you probably already know that. My custom_row.xml file..

Android: Override back button to act like home button

http://stackoverflow.com/questions/2000102/android-override-back-button-to-act-like-home-button

true return true return super.onKeyDown keyCode event I think the preferred option should be for an Activity to finish normally and be able to recreate itself e.g. reading the current state from a Service if needed. But moveTaskToBack can be used as..

Is there any way to receive a notification of when a user powers off his/her Android phone?

http://stackoverflow.com/questions/2190126/is-there-any-way-to-receive-a-notification-of-when-a-user-powers-off-his-her-and

ACTION_SHUTDOWN Intent which is broadcast when the phone is about to shutdown. The documentation says Apps will not normally need to handle this since the foreground activity will be paused as well. In other words if you respond to all the lifecycle..

How to scale an Image in ImageView to keep the aspect ratio

http://stackoverflow.com/questions/2521959/how-to-scale-an-image-in-imageview-to-keep-the-aspect-ratio

make the ImageView resize itself to fit the rescaled image. For example if you have a rectangular image in what would normally be a square ImageView adjustViewBounds true will make it resize the ImageView to be rectangular as well. This then affects..

Android: Resize a large bitmap file to scaled output file

http://stackoverflow.com/questions/3331527/android-resize-a-large-bitmap-file-to-scaled-output-file

a large bitmap say 3888x2592 in a file. Now I want to resize that bitmap to 800x533 and save it to another file. I normally would scale the bitmap by calling Bitmap.createBitmap method but it needs a source bitmap as the first argument which I..

Defining custom attrs

http://stackoverflow.com/questions/3441396/defining-custom-attrs

another resource id e.g @color my_color @layout my_layout color boolean dimension float integer string fraction enum normally implicitly defined flag normally implicitly defined You can set the format to multiple types by using e.g. format reference.. my_color @layout my_layout color boolean dimension float integer string fraction enum normally implicitly defined flag normally implicitly defined You can set the format to multiple types by using e.g. format reference color . enum attributes can be.. gravity center whatever my_custom_attribute Hello world LinearLayout Finally to access that custom attribute you normally do so in the constructor of your custom view as follows. public MyCustomView Context context AttributeSet attrs int defStyle..

Update UI from Thread

http://stackoverflow.com/questions/4369537/update-ui-from-thread

task goes through 4 steps onPreExecute invoked on the UI thread immediately after the task is executed. This step is normally used to setup the task for instance by showing a progress bar in the user interface. doInBackground Params... invoked on..

Android VideoView orientation change with buffered video

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

the randomness of the photos but they were the first pics I could find of the actual layout 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..

getApplication() vs. getApplicationContext()

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

. One more thing the documentation says that it most cases you shouldn't need to subclass Application There is normally no need to subclass Application . In most situation static singletons can provide the same functionality in a more modular..

TelephonyManager.getLine1Number() failing?

http://stackoverflow.com/questions/5134398/telephonymanager-getline1number-failing

my phone HTC Wildfire I can not get phone number all I get is empty string. If I run code on emulatur phone number is normally showed. If I go to Settings About phone Phone identity Phone number phone number is Unknown . Where is the problem Is something..

How to connect to my http://localhost web server from Android Emulator in Eclipse

http://stackoverflow.com/questions/5806220/how-to-connect-to-my-http-localhost-web-server-from-android-emulator-in-eclips

my request like a Google search for localhost or worse it says that it didn't found the page while my web server is normally running. android android emulator share improve this question The localhost refers to the device on which the code..

The Android emulator is not starting, showing “invalid command-line parameter”

http://stackoverflow.com/questions/6638713/the-android-emulator-is-not-starting-showing-invalid-command-line-parameter

output 2011 07 10 07 10 22 demo 2011 07 10 07 10 22 demo Android Launch 2011 07 10 07 10 24 demo adb is running normally. 2011 07 10 07 10 24 demo Performing com.demo.DemoActivity activity launch 2011 07 10 07 10 25 demo Automatic Target Mode..

Android project using httpclient --> http.client (apache), post/get method

http://stackoverflow.com/questions/874227/android-project-using-httpclient-http-client-apache-post-get-method

to find thanks Apache because HttpClient is now part of HttpComponents and if you just look for HttpClient you will normally end up at the 3.x stuff . Also if you do any number of requests you do not want to create the client over and over again...

Override home and back button is case a boolean is true

http://stackoverflow.com/questions/10025660/override-home-and-back-button-is-case-a-boolean-is-true

is case a boolean is true I was wondering if I can override the action of the back and home button is some cases. Normally these buttons should just react like they always do but in a case some setting is true I want to override the buttons and..

getActionBar returns null

http://stackoverflow.com/questions/10031180/getactionbar-returns-null

savedInstanceState The Action Bar is a window feature. The feature must be requested before setting a content view. Normally this is set automatically by your Activity's theme in your manifest. The provided system theme Theme.WithActionBar enables..

Why does Intent.createChooser() need a BroadcastReceiver and how to implement?

http://stackoverflow.com/questions/10068954/why-does-intent-createchooser-need-a-broadcastreceiver-and-how-to-implement

this false mPackageMonitor is a BroadcastReceiver and within register it registers itself on the activity. Normally the receiver is unregistered in onStop . However later in onCreate the code checks how many options the user can choose..

Android action bar with two stretched buttons

http://stackoverflow.com/questions/11264808/android-action-bar-with-two-stretched-buttons

but for some reason the actionbar's own layout refuses to let the LinearLayout take up the entire width on its own. Normally you should avoid nesting layouts unnecessarily like this Perhaps if someone sees this they can point us to a better solution..

Further understanding setRetainInstance(true)

http://stackoverflow.com/questions/12640316/further-understanding-setretaininstancetrue

lock held so it doesn't disappear on us. mPosition max mProgressBar.getMax mProgressBar.setProgress mPosition Normally we would be doing some work but put a kludge here to pretend like we are. synchronized this try wait 50 catch InterruptedException..

How to fire onListItemClick in Listactivity with buttons in list?

http://stackoverflow.com/questions/1821871/how-to-fire-onlistitemclick-in-listactivity-with-buttons-in-list

with buttons in list I have a simple ListActivity that uses a custom ListAdapter to generate the views in the list. Normally the ListAdapter would just fill the views with TextViews but now I want to put a button there as well. It is my understanding..

Push my apk to /system/app

http://stackoverflow.com/questions/2007024/push-my-apk-to-system-app

know that by puting my application there in system app I get that permission. android share improve this question Normally the only way to get access to the system directory is to have a device rooted. I don't exactly know if that is required..

How can i call Wi-Fi settings screen from my application using Android

http://stackoverflow.com/questions/2318310/how-can-i-call-wi-fi-settings-screen-from-my-application-using-android

can i call Wi Fi settings screen from my application using Android Normally I am getting Wi Fi setting screen on the emulator by clicking on the Settings Wireless controls wifi settings . I need to..

Android JSON HttpClient to send data to PHP server with HttpResponse

http://stackoverflow.com/questions/2540786/android-json-httpclient-to-send-data-to-php-server-with-httpresponse

www.myserver.com ServiceMatalan.php Map String String kvPairs new HashMap String String kvPairs.put vehicle j.toString Normally I would pass two more JSONObjects..... HttpResponse re HTTPPoster.doPost url kvPairs String temp EntityUtils.toString re.getEntity..

android: turn off screen when close to face

http://stackoverflow.com/questions/3018716/android-turn-off-screen-when-close-to-face

turn off screen when close to face My app allows the user to access their corporate voice mail. Normally durring a phone call when the user holds the device up to their ear the screen shuts off so they wont accidentally push..

Android: retrieving all Drawable resources from Resources object

http://stackoverflow.com/questions/3221603/android-retrieving-all-drawable-resources-from-resources-object

from Resources object In my Android project I want to loop through the entire collection of Drawable resources. Normally you can only retrieve a specific resource via its ID using something like InputStream is Resources.getSystem .openRawResource..

Defining custom attrs

http://stackoverflow.com/questions/3441396/defining-custom-attrs

do a few things. First you must declare a namespace to find your attributes. You do this on the root layout element. Normally there is only xmlns android http schemas.android.com apk res android . You must now also add xmlns whatever http schemas.android.com..

Android: how to use CursorAdapter?

http://stackoverflow.com/questions/3544913/android-how-to-use-cursoradapter

CursorAdapter . A menu button adds an item to the database. I want the ListView to update and show this change. Normally it doesn't show this new item until i go to the homescreen and reopen the application. I did eventually get it to work by..

SharedPreferences and Thread Safety

http://stackoverflow.com/questions/4693387/sharedpreferences-and-thread-safety

and Threads are different. The SharedPreferences implementation in Android is thread safe but not process safe. Normally your app will run all in the same process but it's possible for you to configure it in the AndroidManifest.xml so say the..

android live wallpaper rescaling

http://stackoverflow.com/questions/5208203/android-live-wallpaper-rescaling

assessment of the data you receive via onOffsetsChanged . xStep indicates how many screens your launcher supports. Normally xStep will be 0.25 indicating 5 screens i.e. xOffset 0 0.25 0.5 0.75 or 1 but it can be any value from 0 to 1 0.5 would..

Does BroadcastReceiver.onReceive always run in the UI thread?

http://stackoverflow.com/questions/5674518/does-broadcastreceiver-onreceive-always-run-in-the-ui-thread

not rely on that android share improve this question Does BroadcastReceiver.onReceive always run in the UI thread Normally yes. There is a flavor of registerReceiver that takes a Handler and using that and a HandlerThread you could get onReceive..

Android setting with TextView for Hebrew text?

http://stackoverflow.com/questions/6302221/android-setting-with-textview-for-hebrew-text

setting with TextView for Hebrew text I am setting text in TextView from string resource. Normally Hebrew works in Right To Left format. When I set a text it sets the text Right To Left format in LG Samsung Sony Phone but..

How to make an Android Spinner with initial text “Select One”

http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one

it's not guaranteed to work in future OS updates. It seems likely that it will but it is by no means guaranteed. Normally I wouldn't condone something like this but this question has been asked enough times and it seems like a reasonable enough..

Android ICS: Remove blue divider in ActionBar?

http://stackoverflow.com/questions/8704769/android-ics-remove-blue-divider-in-actionbar

With the Ice Cream Sandwhich release I see that I get a blue line divider separator as part of the ActionBar. Normally it would be good for consistency but in my case I need to remove the divider. How can I remove or style the divider of the..

How to understand the directory structure of android root tree?

http://stackoverflow.com/questions/9046572/how-to-understand-the-directory-structure-of-android-root-tree

Dalvik Virtual Machine Development projects related to development such as the source code for the sdk and ndk tools. Normally not a folder you touch when working with the platform for a target. Device product specific code for different devices...