recycle

Drag and drop, ListView and item Views that miss the ACTION_DRAG_STARTED event

萝らか妹 提交于 2019-11-27 14:12:22
问题 On Android, I use a ListView and I want to be able to reorder its items using drag and drop. I know there are different implementation of a "drag and drop listview", however I want to use the Drag and Drop framework coming since API level 11 . It started very well until I wanted to scroll my ListView while doing a drag and drop. As it is written in the example below, for now, I check on top of which list element I am, so if its position is not between ListView.getLastVisiblePosition() and

Canvas: trying to use a recycled bitmap android.graphics.Bitmap in Android

走远了吗. 提交于 2019-11-27 11:27:43
问题 I am working on the crop image class, but encounter a recycled bit map problem: 03-02 23:14:10.514: E/AndroidRuntime(16736): FATAL EXCEPTION: Thread-1470 03-02 23:14:10.514: E/AndroidRuntime(16736): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@428e5450 03-02 23:14:10.514: E/AndroidRuntime(16736): at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026) 03-02 23:14:10.514: E/AndroidRuntime(16736): at android.graphics.Canvas.drawBitmap(Canvas

Android ListView updating of Image Thumbnails using AsyncTask Causes View recycling

孤者浪人 提交于 2019-11-27 11:22:47
问题 I have been trying to get thumbnails to work with an AsyncTask for image files in a ListView. I have been having the common problem of Row Recycling, and thus on scrolling thumbnails are being assigned to wrong rows. I have tried adding tags to the ImageView and then confirming the tags in the onPostExecute() in the AsyncTask, but however have been unsuccessful in my attempts. Someone please help! The custom adapter is as follows : public class MySimpleAdapter extends SimpleAdapter { public

IIS Recycle Global.asax

↘锁芯ラ 提交于 2019-11-27 04:42:29
问题 Is it possible to catch an recycle event in the global.asax? I know Application_End will be triggered but is there a way to know that it was triggered by a recycle of the application pool? thx, Lieven Cardoen aka Johlero 回答1: So, here is an idea how this could work. Based on my previous answer (attach to AppDomain.CurrentDomain.ProcessExit) and stephbu's comment: This will trap most structured process teardowns e.g. - but I'm not sure that it will trap all tear downs. e.g. http://blogs.msdn

OutOfMemory: Recycle Images

社会主义新天地 提交于 2019-11-27 04:07:48
问题 I created a photoalbum. I've got 70 activities and in everyone is one Image (jpeg, png). And two arrows to go Back and forth. The Images are saved in drawable-folder. I know there are other ways to create a photo-album but now I want to make it that way. The app crashes after a time, because of a OutOfMemory-Error. It doesn't always stop on the same Point, but sometimes after the 47th activitiy, a other time after 52 activities. If I reduce every Image only to 20KB then the app runs without

Drawable vs Single reusable Bitmap better with memory?

╄→гoц情女王★ 提交于 2019-11-27 00:56:14
问题 As I understand it (not that I'm correct) Drawables are generally correctly removed from memory when the application is finished with them. Bitmaps however need to be manually recycled, and sometimes even have a special class written to handle them properly. My question is, in regards to memory and leaks, is it more beneficial to simply stick with Drawables like such: myView.setBackgroundDrawable(getResources().getDrawable(R.drawable.my_image)); myView1.setBackgroundDrawable(getResources()

Does a replacement for Gallery widget with View recycling exist?

若如初见. 提交于 2019-11-26 19:31:57
问题 The default Gallery widget on Android does not recycle views - everytime the view for a new position is called the widget always calls the getView method of the adapter with convertView set to null. As you scroll backwards and forwards this ends up in lots of views being created, which the recycler component that the Gallery stores them in does not seem to recycle them quickly enough leading to an OOM situation. You can test this easily with a few large-ish images as your gallery items, but

Linux PID recycling

余生颓废 提交于 2019-11-26 17:48:57
Is there any policy in Linux as to the recycling of used PIDs ? I mean, if a PId has been used, how much later will it be used again ? As new processes fork in, PIDs will increase to a system-dependent limit and then wrap around. The kernel will not reuse a PID before this wrap-around happens. The limit (maximum number of pids) is /proc/sys/kernel/pid_max . The manual says: /proc/sys/kernel/pid_max (since Linux 2.5.34) This file specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). The default value for this file, 32768 , results in

Stop IIS 7.5 Application Pool Recycling

痞子三分冷 提交于 2019-11-26 16:55:40
问题 How do stop application pools from recycling in IIS 7.5? I have configured the following settings: ProcessModel -> Idle Time-out (minutes) = 0 Recycling -> Regular Time Intervals (minutes) = 0 Are these settings enought to stop an application pool from recycling? 回答1: Yes, that should be ok assuming you also use Private Memory Limit = 0. There are still reasons an AppPool could recycle, such as when adding a new Global Module, it will require to be recycled so configuration changes take

How to prevent an ASP.NET application restarting when the web.config is modified?

和自甴很熟 提交于 2019-11-26 03:38:08
问题 I\'m hosting the ASP.NET runtime via the ApplicationHost.CreateApplicationHost method. When I modify the web.config while the application is running, i see lots of first chance ThreadAbortException s thrown. This is right before my application comes crashing down. I\'m assuming this is because the runtime has detected changes to the configuration and wants to restart. This isn\'t really a supported scenario for us, so i\'d prefer if I could just switch off the automatic reloading. Does anyone