pla1 / FediPhoto

Post a photo quickly to the Fediverse
GNU General Public License v3.0
11 stars 4 forks source link

creating Bitmap in UI thread #3

Open cataloque opened 4 years ago

cataloque commented 4 years ago

Dear developers, I am analyzing FediPhoto using static analysis. I found some potential slow operations of bitmap displaying in FediPhoto : "BitmapFactory.decodeFile" method was used in create Bitmap : com.fediphoto.WorkerPostStatus: void sendNotification(java.lang.String,java.lang.String,java.lang.String)

But Android documentation says" The BitmapFactory.decode* methods should not be executed on the main UI thread if the source data is read from disk or a network location (or really any source other than memory)." for performance considerations, it is better to move these operations to worker threads (e.g., via AsyncTask). thanks.