Java Code Examples for android.widget.ListView.measure()

The following are Jave code examples for showing how to use measure() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: yjPlay   File:   Source Code and License Vote up 5 votes
 * Instantiates a new Below view.
 * @param c        the c
 * @param listName the list name
public BelowView(@NonNull Context c, @Nullable List<String> listName) {
    this.convertView = View.inflate(c, R.layout.simple_exo_belowview, null);
    listView = (ListView) convertView.findViewById(;
    if (listName == null) {
        listName = Arrays.asList(c.getResources().getStringArray(R.array.exo_video_switch_text));
    adapter = new SwitchAdapter(c, listName);
   listView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
Example 2
Project: XiaoTianQi   File:   Source Code and License Vote up 5 votes
private void initView() {
    titleView = (TextView) findViewById(;
    listView = (ListView) findViewById(;

    mListViewHeight = listView.getMeasuredHeight();
    mListViewWidth = listView.getMeasuredWidth();