コード例 #1
0
 private void onMachineSelected(IMachine machine) {
   if (_dualPane) {
     _tabSupport.removeAllTabs();
     Bundle b =
         new BundleBuilder()
             .putParcelable(VBoxSvc.BUNDLE, _vmgr)
             .putProxy(IMachine.BUNDLE, machine)
             .create();
     _tabSupport.addTab(new FragmentElement(getString(R.string.tab_info), InfoFragment.class, b));
     _tabSupport.addTab(
         new FragmentElement(getString(R.string.tab_actions), ActionsFragment.class, b));
     _tabSupport.addTab(new FragmentElement(getString(R.string.tab_log), LogFragment.class, b));
     _tabSupport.addTab(
         new FragmentElement(getString(R.string.tab_snapshots), SnapshotFragment.class, b));
   } else {
     Intent intent =
         new Intent(this, MachineActivity.class).putExtra(VBoxSvc.BUNDLE, (Parcelable) _vmgr);
     BundleBuilder.addProxy(intent, IMachine.BUNDLE, machine);
     Utils.launchActivity(this, intent);
   }
 }
コード例 #2
0
 /**
  * Launch activity using custom animations. Uses ActivityOptions if on JellyBean, otherwise
  * overrides transition
  *
  * @param parent parent activity
  * @param intent intent to launch
  */
 public static void launchActivity(Activity parent, Intent intent) {
   launchActivity(parent, intent, R.anim.slide_in_right, R.anim.slide_out_left);
 }