Java Code Examples for android.widget.ExpandableListView.setEmptyView()

The following are Jave code examples for showing how to use setEmptyView() of the android.widget.ExpandableListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Huochexing12306   File: A6OrderAty.java   View Source Code Vote up 6 votes
private void initViews() {
	mNavigationIndex = getIntent()
			.getIntExtra(EXTRA_PRE_LOAD_DATA_INDEX, 0);
	llytOperate = (LinearLayout) findViewById(R.id.operate);
	btnCancel = (Button) findViewById(R.id.cancel);
	btnCancel.setOnClickListener(this);
	btnPay = (Button) findViewById(R.id.pay);
	btnPay.setOnClickListener(this);
	tvEmptyView = (TextView) findViewById(R.id.emptyView);
	lvOrders = (ExpandableListView) findViewById(R.id.orders);

	lvOrders.setEmptyView(tvEmptyView);
	LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
	View footerView = inflater.inflate(R.layout.fv_a6_order, null);
	lvOrders.addFooterView(footerView);
	mAdapter = new A6OrderExpandableAdapter(this, mLstODBInfos);
	lvOrders.setAdapter(mAdapter);

	// btnPay.setEnabled(false);
	setPanelGone(true);
}
 
Example 2
Project: Android-DFU-App   File: ExpandableListActivity.java   View Source Code Vote up 6 votes
/**
 * Updates the screen state (current list and other views) when the content changes.
 * 
 * @see android.support.v7.app.AppCompatActivity#onContentChanged()
 */
@Override
public void onContentChanged() {
	super.onContentChanged();
	View emptyView = findViewById(R.id.empty);
	mList = (ExpandableListView) findViewById(R.id.list);
	if (mList == null) {
		throw new RuntimeException(
				"Your content must have a ExpandableListView whose id attribute is " +
						"'R.id.list'");
	}
	if (emptyView != null) {
		mList.setEmptyView(emptyView);
	}
	mList.setOnChildClickListener(this);
	mList.setOnGroupExpandListener(this);
	mList.setOnGroupCollapseListener(this);

	if (mFinishedStart) {
		setListAdapter(mAdapter);
	}
	mFinishedStart = true;
}