本文整理匯總了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();
}