I use my custom implementation tabhost. Create a new activity as follows:
public class TabsActivityGroup extends ActivityGroup {
  //
  //...
  //
  private void startGroupActivity(String activityID, Intent activityIntent) {
    final LocalActivityManager localActivityManager = getLocalActivityManager();
    Window window = localActivityManager.startActivity(activityID, activityIntent);
    // after call destroy activity window equals null on android 1.6 (emulator). Why?
    // on android 2.2 window not equal null
    if (window != null) {
     View view = window.getDecorView();
     tabsContentFrameLayout.addView(view, new ViewGroup.LayoutParams(
     ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
    }
  }
  //
  //...
  //
}
But after call destroy activity:
 getLocalActivityManager().destroyActivity(className, true);
I'm trying to make call to start activity, but get window equal null from this code:
Window window = localActivityManager.startActivity(activityID, activityIntent);
On a device with firmware 2.1 (Hero) and 开发者_JAVA百科2.2 (Desire) works all good, but on emulator with android platform not work ;(
Now I am studying source code android platform 2.2, to understand why window equal null.
I will be glad of any help.
Temporary solution:
public static boolean isEmulator(Context context) {                                                                     
 TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);     
 final String deviceId = telephonyManager.getDeviceId();                                                         
 if (deviceId == null) return true;                                                                              
 if (CommonHelper.isNotNull(deviceId) && deviceId.equals(NULL_IMEI)) {return true;} else { return false;}
}
if (!isEmulator(this)) {
     getLocalActivityManager().destroyActivity(className, true);
}
Is the call right for start activity?
I see that startActivity takes only one parameter of Intent..
Kindly check. Also, embed within try/catch to get the exception if any..
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论