android列表为空时提示语

列表为空的时候显示给用户的提示语:

TextView emptyView = new TextView(getBaseContext());
emptyView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
emptyView.setGravity(Gravity.CENTER);
emptyView.setTextSize(16);
emptyView.setText(getString(R.string.empty_note));
emptyView.setVisibility(View.GONE);
((ViewGroup) installedListView.getParent()).addView(emptyView);

mListView.setEmptyView(emptyView);

你可能感兴趣的:(android)