本文整理汇总了Java中android.view.ViewGroup.removeAllViewsInLayout方法的典型用法代码示例。如果您正苦于以下问题:Java ViewGroup.removeAllViewsInLayout方法的具体用法?Java ViewGroup.removeAllViewsInLayout怎么用?Java ViewGroup.removeAllViewsInLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewGroup
的用法示例。
在下文中一共展示了ViewGroup.removeAllViewsInLayout方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateViewForOrientation
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
*
* @param inflater
* @param view
*/
private void populateViewForOrientation(LayoutInflater inflater, ViewGroup view) {
int antennaResId = Integer.MIN_VALUE;
if (antennaView != null && antennaView.getTag() != null) {
antennaResId = (Integer) antennaView.getTag();
}
view.removeAllViewsInLayout();
View v = inflater.inflate(R.layout.title_screen, view);
createView(v, inflater, null);
if (antennaResId != Integer.MIN_VALUE) {
antennaView.setImageResource(antennaResId);
antennaView.setVisibility(View.VISIBLE);
}
//restore all information now:
infoCollector.refresh();
infoCollector.dispatchInfoChangedEvent(InfoCollectorType.DL_TRAFFIC, null, TrafficClassificationEnum.classify(interfaceTrafficGatherer.getRxRate()));
infoCollector.dispatchInfoChangedEvent(InfoCollectorType.UL_TRAFFIC, null, TrafficClassificationEnum.classify(interfaceTrafficGatherer.getTxRate()));
if (startButtonText != null) {
startButtonText.setText(ConfigHelper.isLoopMode(getActivity()) ? R.string.menu_button_loop : R.string.menu_button_start);
}
}
示例2: removeAllViews
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
* remove all views
*
* @param viewGroup
*/
public static void removeAllViews(ViewGroup viewGroup) {
if (viewGroup != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
if (viewGroup.isInLayout()) {
viewGroup.removeAllViewsInLayout();
} else {
viewGroup.removeAllViews();
}
} else {
viewGroup.removeAllViews();
}
}
}
示例3: onConfigurationChanged
import android.view.ViewGroup; //导入方法依赖的package包/类
@Override
public void onConfigurationChanged(final Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ViewGroup viewGroup = (ViewGroup) getView();
if (viewGroup != null) {
viewGroup.removeAllViewsInLayout();
View view = onCreateView(getActivity().getLayoutInflater(), viewGroup, null);
viewGroup.addView(view);
}
}
示例4: fixedStillAttached
import android.view.ViewGroup; //导入方法依赖的package包/类
private void fixedStillAttached() {
// java.lang.Throwable: Error: WebView.destroy() called while still attached!
// at android.webkit.WebViewClassic.destroy(WebViewClassic.java:4142)
// at android.webkit.WebView.destroy(WebView.java:707)
ViewParent parent = getParent();
if (parent instanceof ViewGroup) { // 由于自定义webView构建时传入了该Activity的context对象,因此需要先从父容器中移除webView,然后再销毁webView;
ViewGroup mWebViewContainer = (ViewGroup) getParent();
mWebViewContainer.removeAllViewsInLayout();
}
}
示例5: onCreateView
import android.view.ViewGroup; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
ViewGroup p = (ViewGroup) content.getParent();
if (p != null) {
p.removeAllViewsInLayout();
}
return content;
}
示例6: populateViewForOrientation
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
*
* @param inflater
* @param view
*/
private void populateViewForOrientation(LayoutInflater inflater, ViewGroup view) {
int page = getViewPager().getCurrentItem();
view.removeAllViewsInLayout();
View v = inflater.inflate(R.layout.result_tabhost_pager, view);
createView(v, inflater, page);
}
示例7: loadRealLayout
import android.view.ViewGroup; //导入方法依赖的package包/类
private boolean loadRealLayout() {
ViewGroup root = (ViewGroup) getView();
if (root != null) {
root.removeAllViewsInLayout();
View.inflate(root.getContext(), tabData.layoutId, root);
}
return root != null;
}
示例8: populateViewForOrientation
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
*
* @param inflater
* @param view
*/
private void populateViewForOrientation(LayoutInflater inflater, ViewGroup view) {
view.removeAllViewsInLayout();
View v = inflater.inflate(R.layout.about, view);
createView(v, inflater);
}
示例9: removeAllViews
import android.view.ViewGroup; //导入方法依赖的package包/类
@Override
public void removeAllViews(ViewGroup parent) {
parent.removeAllViewsInLayout();
}