Link
https://tw.voicetube.com/videos/68590?ref=new

HowHow 發表在 痞客邦 留言(0) 人氣()

Link
https://tw.voicetube.com/videos/69743?ref=new

HowHow 發表在 痞客邦 留言(0) 人氣()

Link
https://tw.voicetube.com/videos/70966?ref=new

HowHow 發表在 痞客邦 留言(0) 人氣()

Link:
https://tw.voicetube.com/videos/49446?ref=vt_web_recommended_video_list

HowHow 發表在 痞客邦 留言(0) 人氣()

- Link:
    https://tw.voicetube.com/videos/20454?ref=toeic

HowHow 發表在 痞客邦 留言(0) 人氣()

link:
https://tw.voicetube.com/videos/18348?ref=toeic

HowHow 發表在 痞客邦 留言(0) 人氣()

link:
https://tw.voicetube.com/videos/14476?ref=toeic

HowHow 發表在 痞客邦 留言(0) 人氣()

link:
https://tw.voicetube.com/videos/54542?ref=new

HowHow 發表在 痞客邦 留言(0) 人氣()

public static Bitmap getApkIcon(Context context, String path) {
Bitmap icon = null;
PackageManager pm = context.getPackageManager();
PackageInfo packageInfo = pm.getPackageArchiveInfo(path, 0);
// if the apk file is broken, then packageInfo will be null
if (packageInfo == null) {
return null;
}
ApplicationInfo appInfo = packageInfo.applicationInfo;
//icon = pm.getApplicationLogo(appInfo);

AssetManager assetMgr = reflectionApis.getAssetManagerWithPath(path); // 拿到別的APK的AssetManager
if
(null != assetMgr) {
Resources r = context.getResources(); // 取得一個實作Resource介面的實例後,可使用getFile()、getInputStream()等方式來操作或取得資源檔案的相關資源
Resources res = new Resources(assetMgr, r.getDisplayMetrics(), r.getConfiguration());
if (appInfo.icon > 0) {
Drawable drawable = ResourcesCompat.getDrawable(res, appInfo.icon, context.getTheme()); // 從appInfo中要icon並套用目前主題
if (drawable instanceof BitmapDrawable) { // 若是BitmapDrawable,直接getBitmap
icon = ((BitmapDrawable) drawable).getBitmap();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
&& drawable instanceof AdaptiveIconDrawable) {// 先判斷是否為8.0後版本,以免前面版本不認得AdaptiveIconDrawable造成Crash
  drawable為切成圓形的adaptive icon,若要自己切形狀則用layerDrawable疊起來在處理

int width = drawable.getIntrinsicWidth();
int height = drawable.getIntrinsicHeight();
icon = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(icon);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
} else {
icon = BitmapFactory.decodeResource(res, appInfo.icon);
}
}
assetMgr.close();
}
return icon;
}
}

HowHow 發表在 痞客邦 留言(0) 人氣()

Link:
https://tw.voicetube.com/videos/59676?ref=new

HowHow 發表在 痞客邦 留言(0) 人氣()

AsyncTask用來做background operation,以避免block UI thread造成Application not respond (ANR)
適合做Short operation (Life cycle和Activity綁一起,不會像service在activity destroyed後還在background做)

HowHow 發表在 痞客邦 留言(0) 人氣()


運作/撰寫
運作方式:

HowHow 發表在 痞客邦 留言(0) 人氣()

1 2
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。