1
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_IDLE)) {
Intent newIntent = new Intent(context, SpeedDialerActivity.class);
intent = new Intent(context, SpeedDialerActivity.class);
context.startActivity(newIntent||intent(received from argument)); // which object is better here.
}
}
使用onReceive方法的參數中收到的意圖還是更好,還是創建和使用Intent類型的新對象類。如果我使用onReceive方法中收到的作爲參數的Intent對象,行爲會變得模糊不清。哪種意圖對象會是更好的選擇以節省內存
allprog - 任何建議或帖子,我可以在線閱讀在android-java的內存優化。請給我很大的幫助...在此先感謝 – LokiDroid
更新了幾個例子的答案 – allprog