android.app.Activity.onConfigurationChanged()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中android.app.Activity.onConfigurationChanged()方法的一些代码示例,展示了Activity.onConfigurationChanged()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onConfigurationChanged()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onConfigurationChanged

Activity.onConfigurationChanged介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
public void onConfigurationChanged (Configuration config) {
  super.onConfigurationChanged(config);
  boolean keyboardAvailable = false;
  if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) keyboardAvailable = true;
  input.keyboardAvailable = keyboardAvailable;
}

代码示例来源:origin: libgdx/libgdx

@Override
public void onConfigurationChanged (Configuration config) {
  super.onConfigurationChanged(config);
  boolean keyboardAvailable = false;
  if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) keyboardAvailable = true;
  input.keyboardAvailable = keyboardAvailable;
}

代码示例来源:origin: sephiroth74/ImageViewZoom

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onConfigurationChanged(Configuration newConfig) {
 super.onConfigurationChanged(newConfig);
 LinearLayout container=findViewById(R.id.container);
 if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
  container.setOrientation(LinearLayout.HORIZONTAL);
 }
 else {
  container.setOrientation(LinearLayout.VERTICAL);
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onConfigurationChanged(Configuration newConfig) {
 super.onConfigurationChanged(newConfig);
 toggle.onConfigurationChanged(newConfig);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onConfigurationChanged(Configuration newConfig) {
 super.onConfigurationChanged(newConfig);
 toggle.onConfigurationChanged(newConfig);
}

代码示例来源:origin: jjdxmashl/jjdxm_ijkplayer

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  if (player != null) {
    player.onConfigurationChanged(newConfig);
  }
}

代码示例来源:origin: jjdxmashl/jjdxm_ijkplayer

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  if (player != null) {
    player.onConfigurationChanged(newConfig);
  }
}

代码示例来源:origin: ankidroid/Anki-Android

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  mSoundPlayer.notifyConfigurationChanged(mVideoView);
}
@Override

代码示例来源:origin: daniulive/SmarterStreaming

public void onConfigurationChanged(Configuration newConfig) {
  try {
    super.onConfigurationChanged(newConfig);
    Log.i(TAG, "onConfigurationChanged");
    if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
      if (!isRTSPPublisherRunning && !isPushingRtmp && !isRecording && !isPushingRtsp) {
        int rotation = getWindowManager().getDefaultDisplay().getRotation();
        if (Surface.ROTATION_270 == rotation) {
          Log.i(TAG, "onConfigurationChanged rotation=" + rotation + " LANDSCAPE_LEFT_HOME_KEY");
          currentOrigentation = LANDSCAPE_LEFT_HOME_KEY;
        } else {
          Log.i(TAG, "onConfigurationChanged rotation=" + rotation + " LANDSCAPE");
          currentOrigentation = LANDSCAPE;
        }
      }
    } else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
      if (!isRTSPPublisherRunning && !isPushingRtmp && !isRecording && !isPushingRtsp) {
        currentOrigentation = PORTRAIT;
      }
    }
  } catch (Exception ex) {
  }
}

代码示例来源:origin: robolectric/robolectric

@Override
public void onConfigurationChanged(Configuration newConfig) {
 super.onConfigurationChanged(newConfig);
 transcribeWhilePaused("onConfigurationChanged");
 transcript.add("finishedOnConfigurationChanged");
}

代码示例来源:origin: daniulive/SmarterStreaming

@Override  
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);

代码示例来源:origin: daniulive/SmarterStreaming

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  Log.i(TAG, "Run into onConfigurationChanged++");
  if (null != fFrameLayout) {
    fFrameLayout.removeAllViews();
    fFrameLayout = null;
  }
  if (null != lLayout) {
    lLayout.removeAllViews();
    lLayout = null;
  }
  if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
    Log.i(TAG, "onConfigurationChanged, with LANDSCAPE。。");
    inflateLayout(LinearLayout.HORIZONTAL);
    currentOrigentation = LANDSCAPE;
  } else {
    Log.i(TAG, "onConfigurationChanged, with PORTRAIT。。");
    inflateLayout(LinearLayout.VERTICAL);
    currentOrigentation = PORTRAIT;
  }
  if (!isPlaying)
    return;
  libPlayer.SmartPlayerSetOrientation(playerHandle, currentOrigentation);
  Log.i(TAG, "Run out of onConfigurationChanged--");
}

代码示例来源:origin: Bilibili/DanmakuFlameMaster

@Override
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
      mDanmakuView.getConfig().setDanmakuMargin(20);
    } else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
      mDanmakuView.getConfig().setDanmakuMargin(40);
    }
  }
}

代码示例来源:origin: robolectric/robolectric

shadowMainLooper.runPaused(() -> component.onConfigurationChanged(newConfiguration));

代码示例来源:origin: iqiyi/Neptune

@Override
public void callOnConfigurationChanged(Configuration newConfig) {
  if (null != mPlugin) {
    mPlugin.onConfigurationChanged(newConfig);
  } else if (null != mProxy) {
    mProxy.onConfigurationChanged(newConfig);
  }
}

代码示例来源:origin: ftctechnh/ftc_app

@Override
public void onConfigurationChanged(Configuration newConfig) {
 super.onConfigurationChanged(newConfig);
 // don't destroy assets on screen rotation
 updateMonitorLayout(newConfig);
}

代码示例来源:origin: PopFisher/SmartPopupWindow

public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  // 转屏时直接调用update方法更新位置,现象如下
  // 1. 如果R.layout.activity_screen_change_update_popup中的ListView可见,则update无效
  // 2. 如果R.layout.activity_screen_change_update_popup中的ListView不可见,则update有效
  mCurOrientation = newConfig.orientation;
  // 如果要解决上面的问题就把下面这句话注释掉,并且打开注释掉的initViewListener
  updatePopupPos();
}

代码示例来源:origin: tcking/GiraffePlayer

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  if (player != null) {
    player.onConfigurationChanged(newConfig);
  }
}

代码示例来源:origin: com.google.android/support-v4

/**
 * Dispatch configuration change to all fragments.
 */
@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  mFragments.dispatchConfigurationChanged(newConfig);
}

相关文章

Activity类方法