編輯:關於Android編程
前言
歡迎大家我分享和推薦好用的代碼段~~
聲明
歡迎轉載,但請保留文章原始出處:
CSDN:http://www.csdn.net
雨季o莫憂離:http://blog.csdn.net/luckkof
正文
點擊Launcher桌面上的圖標,會先有圖標放大的動畫,然後才進入應用。如何去掉動畫效果? 請修改Launcher.java的startActivity方法,如下:
boolean startActivity(View v, Intent intent, Object tag) {
if (LauncherLog.DEBUG) {
LauncherLog.d(TAG, "startActivity v = " + v + ", intent = " + intent + ", tag = " + tag);
}
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
// Only launch using the new animation if the shortcut has not opted out (this is a
// private contract between launcher and may be ignored in the future).
//boolean useLaunchAnimation = (v != null) && //mtk modify
// !intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION); //mtk modify
boolean useLaunchAnimation = false; //mtk add
/// M: add systrace to analyze application launche time.
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "Launcher.startActivity");
if (useLaunchAnimation) {
ActivityOptions opts = ActivityOptions.makeScaleUpAnimation(v, 0, 0,
v.getMeasuredWidth(), v.getMeasuredHeight());
startActivity(intent, opts.toBundle());
} else {
startActivity(intent);
}
/// M: add systrace to analyze application launche time.
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
return true;
} catch (SecurityException e) {
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
Log.e(TAG, "Launcher does not have the permission to launch " + intent +
". Make sure to create a MAIN intent-filter for the corresponding activity " +
"or use the exported attribute for this activity. "
+ "tag=" + tag + " intent=" + intent, e);
}
return false;
}
Android 通知欄Notification的整合 全面學習 (一個DEMO讓你完全了解它)
在android的應用層中,涉及到很多應用框架,例如:Service框架,Activity管理機制,Broadcast機制,對話框框架,標題欄框架,狀態欄框架,通知機制,
寫一個 ButterKnife
ButterKnife 很多人都用過,能節省很多代碼,最多的就是省去了很多 findViewById 語句。接下來自己寫一個,就叫 BBKnife 吧。分析在使用 But
Android應用Loaders全面詳解及源碼淺析
1 背景在Android中任何耗時的操作都不能放在UI主線程中,所以耗時的操作都需要使用異步實現。同樣的,在ContentProvider中也可能存在耗時操作,這時也該使
Android設備管理器漏洞2--阻止用戶取消激活設備管理器
2013年6月,俄羅斯安全廠商卡巴斯基發現了史上最強手機木馬-Obad.A,該木馬利用了一個未知的Android設備管理器漏洞(ANDROID-9067882),已激活設