当前位置: 首页>>代码示例>>Java>>正文


Java LocalActivityManager类代码示例

本文整理汇总了Java中android.app.LocalActivityManager的典型用法代码示例。如果您正苦于以下问题:Java LocalActivityManager类的具体用法?Java LocalActivityManager怎么用?Java LocalActivityManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LocalActivityManager类属于android.app包,在下文中一共展示了LocalActivityManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.app.LocalActivityManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_gos_main);

	context = GosMainActivity.this;
	manager = new LocalActivityManager(this, true);
	manager.dispatchCreate(savedInstanceState);
	instance = this;
	InitImageView();
	initTextView();
	initPagerViewer();
	initHandler();
	
	
	


}
 
开发者ID:gizwits,项目名称:GizOpenSource_AppKit_Android,代码行数:21,代码来源:GosMainActivity.java

示例2: close

import android.app.LocalActivityManager; //导入依赖的package包/类
public void close(String[] args)
{
	LocalActivityManager mgr = ((ActivityGroup) mContext)
			.getLocalActivityManager();
	ViewerActivity viewerActivity = (ViewerActivity) mgr.getActivity(TAG);
	if(viewerActivity != null){
		View view = viewerActivity.getWindow().getDecorView();
		removeViewFromCurrentWindow(view);
		viewerActivity.finish();
		viewerActivity = null;
		view = null;
	}

	
	if(isOpen){
		isOpen=!isOpen;
	}
	
}
 
开发者ID:Git-tl,项目名称:appcan-plugin-pdfreader-android,代码行数:20,代码来源:EUExPdf.java

示例3: finishFromChild

import android.app.LocalActivityManager; //导入依赖的package包/类
/**
   * This is called when a child activity of this one calls its finish method. 
   * This implementation calls {@link LocalActivityManager#destroyActivity} on the child activity
   * and starts the previous activity.
   * If the last child activity just called finish(),this activity (the parent),
   * calls finish to finish the entire group.
   */
@Override
public void finishFromChild(Activity child) {
    LocalActivityManager manager = getLocalActivityManager();
    int index = mIdList.size()-1;
    
    if (index < 1) {
        finish();
        return;
    }
        
    manager.destroyActivity(mIdList.get(index), true);
    mIdList.remove(index); index--;
    String lastId = mIdList.get(index);
    Intent lastIntent = manager.getActivity(lastId).getIntent();
    Window newWindow = manager.startActivity(lastId, lastIntent);
    setContentView(newWindow.getDecorView());
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:25,代码来源:TabGroupActivity.java

示例4: finishFromChild

import android.app.LocalActivityManager; //导入依赖的package包/类
/**
 * This is called when a child activity of this one calls its finish method.
 * This implementation calls {@link LocalActivityManager#destroyActivity} on
 * the child activity and starts the previous activity. If the last child
 * activity just called finish(),this activity (the parent), calls finish to
 * finish the entire group.
 * 
 * @param child
 *            : Instance of the child activity which needs to be finished.
 */
@Override
public void finishFromChild(Activity child) {
	Log.d(SmartConstants.APP_NAME, "SmartActivityGroup->finishFromChild");
	LocalActivityManager manager = getLocalActivityManager();
	int index = mIdList.size() - 1;
	Log.d(SmartConstants.APP_NAME, "SmartActivityGroup->finishFromChild->index:" + index + ",mIdList.get(index):" + mIdList.get(index));

	// TODO remove the boolean flag 'doExitApplication' and instead use a
	// mechanism by which Android system does not call the 'finish()' of the
	// next Activity in the stack

	// The conditions for 'index > 0' and 'index == 0' needed to be
	// separated because in some cases system automatically calls 'finish'
	// for activity at 0th index(even if user hasn't pressed BACK key) and
	// thus the application activity stack gets cleared leading to closing
	// of application

	if (index > 0) {
		manager.destroyActivity(mIdList.get(index), true);
		mIdList.remove(index);
		index--;

		String lastId = mIdList.get(index);
		Intent lastIntent = manager.getActivity(lastId).getIntent();
		Window newWindow = manager.startActivity(lastId, lastIntent);
		setContentView(newWindow.getDecorView());

		// 'doExitApplication' flag helps in exiting application when user
		// wants it to exit and not because of random internal system call
		// for 'finish' leading to unintended finishing of activity. Set by
		// the user in the application

	} else if (index == 0 && this.doExitApplication) {
		finish();
	}

}
 
开发者ID:appez,项目名称:appez-android,代码行数:48,代码来源:SmartActivityGroup.java

示例5: type

import android.app.LocalActivityManager; //导入依赖的package包/类
public static SubjectFactory<LocalActivityManagerSubject, LocalActivityManager> type() {
  return new SubjectFactory<LocalActivityManagerSubject, LocalActivityManager>() {
    @Override
    public LocalActivityManagerSubject getSubject(FailureStrategy fs, LocalActivityManager that) {
      return new LocalActivityManagerSubject(fs, that);
    }
  };
}
 
开发者ID:pkware,项目名称:truth-android,代码行数:9,代码来源:LocalActivityManagerSubject.java

示例6: onCreate

import android.app.LocalActivityManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_gos_main);

	context = GosMainActivity.this;
	manager = new LocalActivityManager(this, true);
	manager.dispatchCreate(savedInstanceState);
	instance = this;
	InitImageView();
	initTextView();
	initPagerViewer();
	initHandler();


	AndPermission.with(this)
			.requestCode(REQUEST_CODE_SETTING)
			.permission(Manifest.permission.ACCESS_FINE_LOCATION).rationale(new RationaleListener() {

		@Override
		public void showRequestPermissionRationale(int arg0, Rationale arg1) {
			AndPermission.rationaleDialog(GosMainActivity.this, arg1).show();
		}
	})
			.send();


}
 
开发者ID:gizwits,项目名称:GOpenSource_AppKit_Android_AS,代码行数:30,代码来源:GosMainActivity.java

示例7: init

import android.app.LocalActivityManager; //导入依赖的package包/类
private void init() {
  LocalActivityManager lam = new LocalActivityManager((Activity) getContext(), true);
  lam.dispatchCreate(null);
  final Window window = lam.startActivity("foo", new Intent(getContext(), InnerActivity.class));
  // Add the decorView's child to this LinearLayout's children.
  final View innerContents = window.getDecorView().findViewById(R.id.lam_inner_contents);
  ((ViewGroup) innerContents.getParent()).removeView(innerContents);
  addView(innerContents);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:10,代码来源:LocalActivityManagerContainer.java

示例8: returnToDefaultActivity

import android.app.LocalActivityManager; //导入依赖的package包/类
public void returnToDefaultActivity()
{
  LocalActivityManager manager = getLocalActivityManager();
  Activity activity = manager.getCurrentActivity();
  if(activity instanceof DispatchActivity)
  {
    if(((DispatchActivity)activity).isNeedToClose())
    {
      String id = manager.getCurrentId();
      manager.destroyActivity(id, false);
      startChildActivity("MessagesActivity", new Intent(this,MessagesActivity.class));
    }
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:15,代码来源:MessagesTabGroupActivity.java

示例9: returnToDefaultActivity

import android.app.LocalActivityManager; //导入依赖的package包/类
public void returnToDefaultActivity()
{
  LocalActivityManager manager = getLocalActivityManager();
  Activity activity = manager.getCurrentActivity();
  if(activity instanceof WorkOrderDetailActivity)
  {
    if(((WorkOrderDetailActivity)activity).isNeedToClose())
    {
      String id = manager.getCurrentId();
      manager.destroyActivity(id, false);
      startChildActivity("WorkOrdersActivity", new Intent(this,WorkOrdersActivity.class));
    }
  }
}
 
开发者ID:Esri,项目名称:route-monitor-for-geoevent,代码行数:15,代码来源:WorkOrdersTabGroupActivity.java

示例10: onCreate

import android.app.LocalActivityManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	setContentView(R.layout.tab_main);
	LocalActivityManager lam = new LocalActivityManager(this, true);  
       lam.dispatchCreate(savedInstanceState);  
       
	thMain = (TabHost)findViewById(android.R.id.tabhost);
	thMain.setup(lam);
	thMain.addTab(newTabSpec(TAB_BOOKSHELF, R.string.tab_bookshelf, R.drawable.tab_bookshelf, new Intent(this,BookshelfActivity.class)));
	thMain.addTab(newTabSpec(TAB_BOOKMARK, R.string.tab_bookmark, R.drawable.tab_bookmark, new Intent(this,BookmarkActivity.class)));
	thMain.addTab(newTabSpec(TAB_BOOK_ONLINE, R.string.tab_book_online, R.drawable.tab_book_online, new Intent(this,MainActivity.class)));
	
	rbtnBookshelf = (RadioButton)findViewById(R.id.radio_button0);
	rbtnbookmark = (RadioButton)findViewById(R.id.radio_button1);
	rbtnBookOnline = (RadioButton)findViewById(R.id.radio_button2);
	
	rbtnBookshelf.setOnCheckedChangeListener(this);
	rbtnbookmark.setOnCheckedChangeListener(this);
	rbtnBookOnline.setOnCheckedChangeListener(this);
	
	File file = new File("/mnt/sdcard/DotcoolReader");
	if(!file.exists()){
		file.mkdir();
	}
	
}
 
开发者ID:dotcool,项目名称:coolreader,代码行数:30,代码来源:MainTabActivity.java

示例11: onCreate

import android.app.LocalActivityManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle state = null;
    if (savedInstanceState != null) {
        state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
    }

    mLocalActivityManager = new LocalActivityManager(getActivity(), true);
    mLocalActivityManager.dispatchCreate(state);
}
 
开发者ID:ais-albania,项目名称:ZalartAndroid,代码行数:13,代码来源:LocalActivityManagerFragment.java

示例12: onCreate

import android.app.LocalActivityManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (DEBUG)
        Log.d(TAG, "onCreate(): " + getClass().getSimpleName());

    Bundle state = null;
    if (savedInstanceState != null) {
        state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
    }

    mLocalActivityManager = new LocalActivityManager(getActivity(), true);
    mLocalActivityManager.dispatchCreate(state);
}
 
开发者ID:pedronveloso,项目名称:AURHelperDroid,代码行数:15,代码来源:LocalActivityManagerFragment.java

示例13: setup

import android.app.LocalActivityManager; //导入依赖的package包/类
@Override
public void setup(LocalActivityManager m) {
    super.setup(m);
    this.localActivityManager = m;
}
 
开发者ID:ma1co,项目名称:OpenMemories-AppStore,代码行数:6,代码来源:TabHost.java

示例14: LocalActivityManagerSubject

import android.app.LocalActivityManager; //导入依赖的package包/类
protected LocalActivityManagerSubject(FailureStrategy failureStrategy, LocalActivityManager subject) {
  super(failureStrategy, subject);
}
 
开发者ID:pkware,项目名称:truth-android,代码行数:4,代码来源:LocalActivityManagerSubject.java

示例15: onCreate

import android.app.LocalActivityManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
		UIHelper.SetTheme(this, R.layout.activity_display_novel_pager);
		UIHelper.SetActionBarDisplayHomeAsUp(this, true);
		setContentView(R.layout.activity_display_novel_pager);
	} else {
		UIHelper.SetTheme(this, R.layout.activity_display_novel_pager_fix);
		UIHelper.SetActionBarDisplayHomeAsUp(this, true);
		setContentView(R.layout.activity_display_novel_pager_fix);
	}
	tabHost = (TabHost) findViewById(android.R.id.tabhost);
	lam = new LocalActivityManager(this, false);
	lam.dispatchCreate(savedInstanceState);
	tabHost.setup(lam);
	isInverted = UIHelper.getColorPreferences(this);

	// First Tab - Normal Novels
	TabSpec firstSpec = tabHost.newTabSpec(MAIN_SPEC);
	firstSpec.setIndicator(MAIN_SPEC);
	Intent firstIntent = new Intent(this, DisplayLightNovelListActivity.class);
	firstIntent.putExtra(Constants.EXTRA_ONLY_WATCHED, false);
	firstSpec.setContent(firstIntent);

	// Second Tab - Teasers
	TabSpec secondSpec = tabHost.newTabSpec(TEASER_SPEC);
	secondSpec.setIndicator(TEASER_SPEC);
	Intent secondIntent = new Intent(this, DisplayTeaserListActivity.class);
	secondSpec.setContent(secondIntent);

	// Third Tab - Original
	TabSpec thirdSpec = tabHost.newTabSpec(ORIGINAL_SPEC);
	thirdSpec.setIndicator(ORIGINAL_SPEC);
	Intent thirdIntent = new Intent(this, DisplayOriginalListActivity.class);
	thirdSpec.setContent(thirdIntent);

	// Adding all TabSpec to TabHost
	tabHost.addTab(firstSpec); // Adding First tab
	tabHost.addTab(secondSpec); // Adding Second tab
	tabHost.addTab(thirdSpec); // Adding third tab
	//setTabColor();

	tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
		public void onTabChanged(String tabId) {
			//setTabColor();
			currentActivity = lam.getActivity(tabId);
		}
	});

	// Cheap preload list hack.
	tabHost.setCurrentTabByTag(TEASER_SPEC);
	tabHost.setCurrentTabByTag(ORIGINAL_SPEC);
	tabHost.setCurrentTabByTag(MAIN_SPEC);

	Log.d(TAG, "Created");
}
 
开发者ID:dotcool,项目名称:coolreader,代码行数:58,代码来源:DisplayNovelPagerActivity.java


注:本文中的android.app.LocalActivityManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。