當前位置: 首頁>>代碼示例>>Java>>正文


Java InflateException.printStackTrace方法代碼示例

本文整理匯總了Java中android.view.InflateException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java InflateException.printStackTrace方法的具體用法?Java InflateException.printStackTrace怎麽用?Java InflateException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.InflateException的用法示例。


在下文中一共展示了InflateException.printStackTrace方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initInflate

import android.view.InflateException; //導入方法依賴的package包/類
protected void initInflate(Context context) {
    try {
        View.inflate(context, getLayoutId(), this);
    } catch (InflateException e) {
        if (e.toString().contains("GSYImageCover")) {
            Debuger.printfError("********************\n" +
                    "*****   注意   *****" +
                    "********************\n" +
                    "*該版本需要清除布局文件中的GSYImageCover\n" +
                    "****  Attention  ***\n" +
                    "*Please remove GSYImageCover from Layout in this Version\n" +
                    "********************\n");
            e.printStackTrace();
            throw new InflateException("該版本需要清除布局文件中的GSYImageCover,please remove GSYImageCover from your layout");
        } else {
            e.printStackTrace();
        }
    }
}
 
開發者ID:CarGuo,項目名稱:GSYVideoPlayer,代碼行數:20,代碼來源:GSYVideoView.java

示例2: onCreateView

import android.view.InflateException; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	Log.i(CommonUtility.MAP_FRAG_TAG, "onCreateView");

	try {
		Log.i(CommonUtility.MAP_FRAG_TAG, "Inflated");

		rootView = inflater.inflate(R.layout.location_fragment, container,
				false);
	} catch (InflateException e) {
		e.printStackTrace();
	} catch (Exception exc) {
		exc.printStackTrace();
	}

	return rootView;
}
 
開發者ID:levanlevi,項目名稱:AgWeatherNet,代碼行數:19,代碼來源:MapFragment.java

示例3: onCreateView

import android.view.InflateException; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {

	if (group != null) {
		ViewGroup parent = (ViewGroup) group.getParent();
		if (parent != null)
			parent.removeView(group);
	}
	try {
		group = (ViewGroup) inflater.inflate(
				R.layout.layout_fragment_friends, container, false);
		locationPlace = (TextView) group.findViewById(R.id.place_name_text);
		reminderTo = (TextView) group.findViewById(R.id.reminder_to);
	} catch (InflateException e) {
		e.printStackTrace();
	}

	return group;
}
 
開發者ID:leomindez,項目名稱:Geominders,代碼行數:21,代碼來源:FriendFragment.java

示例4: onCreateViewHolder

import android.view.InflateException; //導入方法依賴的package包/類
@Override
public SupportedOrderViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    SupportedOrderViewHolder viewHolder = null;
    try {
        View layoutView = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.cardview_supported_order, null);
        viewHolder = new SupportedOrderViewHolder(layoutView);
    } catch (InflateException e) {
        e.printStackTrace();
    }

    return viewHolder;
}
 
開發者ID:NerdCats,項目名稱:RoboCat,代碼行數:14,代碼來源:SupportedOrderAdapter.java

示例5: onCreateView

import android.view.InflateException; //導入方法依賴的package包/類
/**
 * This method is called when the view is being created as part of the Android activity lifecycle
 * @param inflater
 * @param container
 * @param savedInstanceState
 * @return
 */
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Check if we have created the view already, if we haven't create it.
    if (view != null) {
        ViewGroup parent = (ViewGroup) view.getParent();
        if (parent != null) {
            parent.removeView(view);
        }
    }
    try {
        view = inflater.inflate(R.layout.fragment_record_activity, container, false);
    } catch (InflateException e) {
        e.printStackTrace();
    }

    startButton = (Button) view.findViewById(R.id.startButton);
    pauseButton = (Button) view.findViewById(R.id.pauseButton);
    resumeButton = (Button) view.findViewById(R.id.resumeButton);
    finishButton = (Button) view.findViewById(R.id.finishButton);
    clearButton = (Button) view.findViewById(R.id.clearButton);

    startButton.setOnClickListener(startButtonListener);
    pauseButton.setOnClickListener(pauseButtonListener);
    resumeButton.setOnClickListener(resumeButtonListener);
    finishButton.setOnClickListener(finishButtonListener);
    clearButton.setOnClickListener(clearButtonListener);

    buildGoogleApiClient();

    SupportMapFragment mSupportMapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
    mSupportMapFragment.getMapAsync(this);

    Log.i("Development", "onCreateView");
    return view; // We must return the loaded Layout
}
 
開發者ID:fwtrailsapp,項目名稱:Android,代碼行數:42,代碼來源:RecordActivityFragment.java

示例6: ItemBuilder

import android.view.InflateException; //導入方法依賴的package包/類
public ItemBuilder(Context context, ViewGroup parent, int layoutId) {
    mContext = context;
    mViews = new SparseArray<View>();

    try {
        mConvertView = LayoutInflater.from(mContext).inflate(layoutId, parent, false);
        mConvertView.setTag(this);
    } catch (InflateException e) {
        e.printStackTrace();
    }
    mLayoutId = layoutId;
}
 
開發者ID:xzy2046,項目名稱:FastValueHolder,代碼行數:13,代碼來源:ItemBuilder.java

示例7: getView

import android.view.InflateException; //導入方法依賴的package包/類
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	// TODO Auto-generated method stub
	try{
		
		convertView = LayoutInflater.from(context).inflate(R.layout.griditem_group, null);
		
		ImageView ivIcon = (ImageView) convertView.findViewById(R.id.imageViewIcon);
		ImageView ivMarker = (ImageView) convertView.findViewById(R.id.imageViewMarker);
		TextView tvLabel = (TextView) convertView.findViewById(R.id.textViewLabel);
		TextView tvPadding = (TextView) convertView.findViewById(R.id.textViewPadding);
		
		tvLabel.setText((String)getItem(position));
		
		//ivIcon.setImageBitmap(new GroupPreferences(context).getGroupBitmapByPriority((int)getItemId(position)));
		ivIcon.setImageResource(new GroupPreferences(context).getGroupResIDByPriority((int)getItemId(position)));
		ivMarker.setVisibility(View.INVISIBLE);	

		((TextView) convertView.findViewById(R.id.textViewPadding)).setVisibility(View.INVISIBLE);
		
		int padding = (int) (parent.getMeasuredHeight()/GRID_COLUMNS 
				- parent.getMeasuredWidth()/GRID_COLUMNS
				- tvLabel.getTextSize()
				- tvPadding.getTextSize()
				);
		Log.i(this.getClass().getName(), parent.getMeasuredHeight()+"/"+parent.getMeasuredWidth()+","
				+tvLabel.getTextSize()+"/"+tvPadding.getTextSize()+","+padding);
		if(padding < 0){
			padding = 0;
		}
		( convertView.findViewById(R.id.textViewPadding)).setPadding(0, padding/2, 0, 0);
		tvLabel.setPadding(2, 0, 2, padding/2);
	}
	catch(InflateException e){
		e.printStackTrace();
	}
	
	return convertView;
}
 
開發者ID:pku9104038,項目名稱:apkstore_apk,代碼行數:40,代碼來源:MainGridAdapter.java

示例8: getView

import android.view.InflateException; //導入方法依賴的package包/類
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	if (convertView == null) {
		try {
			convertView = inflater.inflate( R.layout.list_item_caption, parent, false);
		} catch (InflateException e) {
			e.printStackTrace();
			return null;
		}
	}
	TextView time = (TextView) convertView.findViewById(R.id.caption_time);
	TextView text = (TextView) convertView.findViewById(R.id.caption_text);
	
	if (time == null || text == null) {
		// Have seen some inexplicable NPEs somewhere in this method (line
		// number reads 368, which was the last line of this file.)
		return convertView;
	}
	
	Caption caption = getItem(position);
	if (caption != null) {
		time.setText(caption.getTime_string());
		text.setText(caption.getText());
	} else {
		time.setText("");
		text.setText("");
	}
	
	return convertView;
}
 
開發者ID:concentricsky,項目名稱:android-viewer-for-khan-academy,代碼行數:31,代碼來源:CaptionFragment.java


注:本文中的android.view.InflateException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。