2011-01-13 6 views

Antwort

1

Nicht direkt, da Sie kein Activity Objekt haben, auf dem finish() anrufen.

0

eine neue API hinzufügen eine Aktivität zu beenden:

ActivityManagerService.java:

long callingId = Binder.clearCallingIdentity(); 
    ArrayList history = mHistory; 
    try { 
     synchronized (this) { 
      for (int i = history.size() - 1; i >= 0; --i) { 
       HistoryRecord r = (HistoryRecord) history.get(i); 
       if (r.packageName.equals(packageName)) { 
        if (Config.LOGD) 
         Log.d(TAG, " Force finishing activity " 
           + r.intent.getComponent().flattenToShortString()); 
        if (null != r.app) { 
         r.app.removed = true; 
        } 
        r.app = null; 
        finishActivityLocked(r, i, Activity.RESULT_CANCELED, null, "uninstall"); 
       } 
      } 
     } 
    } finally { 
     Binder.restoreCallingIdentity(callingId); 
    } 
Verwandte Themen