当前位置: 首页>>代码示例>>Java>>正文


Java SimpleCursorAdapter.getCount方法代码示例

本文整理汇总了Java中android.widget.SimpleCursorAdapter.getCount方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleCursorAdapter.getCount方法的具体用法?Java SimpleCursorAdapter.getCount怎么用?Java SimpleCursorAdapter.getCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.SimpleCursorAdapter的用法示例。


在下文中一共展示了SimpleCursorAdapter.getCount方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItemViewType

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public int getItemViewType(int position) {
    int type = 1;
    for (Object section : this.sections.keySet()) {
        SimpleCursorAdapter adapter = sections.get(section);
        int size = adapter.getCount() + 1;

        // check if position inside this section
        if (position == 0)
            return TYPE_SECTION_HEADER;
        if (position < size)
            return type + adapter.getItemViewType(position - 1);

        // otherwise jump into next section
        position -= size;
        type += adapter.getViewTypeCount();
    }
    return -1;

}
 
开发者ID:MaKeAppDev,项目名称:Redpin,代码行数:24,代码来源:GroupedListAdapter.java

示例2: getItem

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Object getItem(int position) {
    for (String section : this.sections.keySet()) {
        SimpleCursorAdapter adapter = sections.get(section);
        int size = adapter.getCount() + 1;

        // check if position inside this section
        if (position == 0)
            return section;
        if (position < size)
            return adapter.getItem(position - 1);

        // otherwise jump into next section
        position -= size;
    }
    return null;

}
 
开发者ID:MaKeAppDev,项目名称:Redpin,代码行数:22,代码来源:GroupedListAdapter.java

示例3: getItemId

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public long getItemId(int position) {

    for (String section : this.sections.keySet()) {
        SimpleCursorAdapter adapter = sections.get(section);
        int size = adapter.getCount() + 1;

        // check if position inside this section
        if (position == 0)
            return 0;
        if (position < size)
            return adapter.getItemId(position - 1);

        // otherwise jump into next section
        position -= size;
    }
    return 0;
}
 
开发者ID:MaKeAppDev,项目名称:Redpin,代码行数:22,代码来源:GroupedListAdapter.java

示例4: getView

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    int sectionnum = 0;
    for (Object section : this.sections.keySet()) {
        SimpleCursorAdapter adapter = sections.get(section);
        int size = adapter.getCount() + 1;

        // check if position inside this section
        if (position == 0)
            return maps.getView(sectionnum, convertView, parent);
        if (position < size)
            return adapter.getView(position - 1, convertView, parent);

        // otherwise jump into next section
        position -= size;
        sectionnum++;
    }
    return null;

}
 
开发者ID:MaKeAppDev,项目名称:Redpin,代码行数:24,代码来源:GroupedListAdapter.java

示例5: selectCurrentAccount

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * Select the current account in the accounts dropdown.
 */
private void selectCurrentAccount() {
    Spinner spinner = getAccountsSpinner();
    if (spinner == null) return;

    // find account
    SimpleCursorAdapter adapter = (SimpleCursorAdapter) spinner.getAdapter();
    if (adapter == null) return;

    Cursor cursor = adapter.getCursor();
    int position = Constants.NOT_SET;

    for (int i = 0; i < adapter.getCount(); i++) {
        cursor.moveToPosition(i);
        String accountIdString = cursor.getString(cursor.getColumnIndex(Account.ACCOUNTID));
        int accountId = Integer.parseInt(accountIdString);
        if (accountId == mAccountId) {
            position = i;
            break;
        }
    }

    spinner.setSelection(position);
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:27,代码来源:AccountTransactionListFragment.java

示例6: selectCurrentAccount

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * Select the current account in the accounts dropdown.
 */
private void selectCurrentAccount() {
    Spinner spinner = getAccountsSpinner();
    if (spinner == null) return;

    // find account
    SimpleCursorAdapter adapter = (SimpleCursorAdapter) spinner.getAdapter();
    if (adapter == null) return;

    Cursor cursor = adapter.getCursor();
    int position = Constants.NOT_SET;

    for (int i = 0; i < adapter.getCount(); i++) {
        cursor.moveToPosition(i);
        String accountIdString = cursor.getString(cursor.getColumnIndex(Account.ACCOUNTID));
        int accountId = Integer.parseInt(accountIdString);
        if (accountId == getAccountId()) {
            position = i;
            break;
        }
    }

    spinner.setSelection(position);
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:27,代码来源:WatchlistFragment.java

示例7: getItemViewType

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public int getItemViewType(int position) {
	int type = 1;
	for (Object section : this.sections.keySet()) {
		SimpleCursorAdapter adapter = sections.get(section);
		int size = adapter.getCount() + 1;

		// check if position inside this section
		if (position == 0)
			return TYPE_SECTION_HEADER;
		if (position < size)
			return type + adapter.getItemViewType(position - 1);

		// otherwise jump into next section
		position -= size;
		type += adapter.getViewTypeCount();
	}
	return -1;

}
 
开发者ID:BenjaminMesre,项目名称:UPMCarte,代码行数:24,代码来源:GroupedListAdapter.java

示例8: getItem

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Object getItem(int position) {
	for (String section : this.sections.keySet()) {
		SimpleCursorAdapter adapter = sections.get(section);
		int size = adapter.getCount() + 1;

		// check if position inside this section
		if (position == 0)
			return section;
		if (position < size)
			return adapter.getItem(position - 1);

		// otherwise jump into next section
		position -= size;
	}
	return null;

}
 
开发者ID:BenjaminMesre,项目名称:UPMCarte,代码行数:22,代码来源:GroupedListAdapter.java

示例9: getItemId

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public long getItemId(int position) {

	for (String section : this.sections.keySet()) {
		SimpleCursorAdapter adapter = sections.get(section);
		int size = adapter.getCount() + 1;

		// check if position inside this section
		if (position == 0)
			return 0;
		if (position < size)
			return adapter.getItemId(position - 1);

		// otherwise jump into next section
		position -= size;
	}
	return 0;
}
 
开发者ID:BenjaminMesre,项目名称:UPMCarte,代码行数:22,代码来源:GroupedListAdapter.java

示例10: getView

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	int sectionnum = 0;
	for (Object section : this.sections.keySet()) {
		SimpleCursorAdapter adapter = sections.get(section);
		int size = adapter.getCount() + 1;

		// check if position inside this section
		if (position == 0)
			return maps.getView(sectionnum, convertView, parent);
		if (position < size)
			return adapter.getView(position - 1, convertView, parent);

		// otherwise jump into next section
		position -= size;
		sectionnum++;
	}
	return null;

}
 
开发者ID:BenjaminMesre,项目名称:UPMCarte,代码行数:24,代码来源:GroupedListAdapter.java

示例11: onLoadFinished

import android.widget.SimpleCursorAdapter; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    String[] adapterCols = {TrucksOwnedByUserQuery.PROJECTION[TrucksOwnedByUserQuery.NAME]};
    int[] adapterRowViews = new int[]{android.R.id.text1};
    spinnerAdapter = new SimpleCursorAdapter(getSupportActionBar().getThemedContext(),
            android.R.layout.simple_spinner_item, cursor, adapterCols, adapterRowViews, 0);
    spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    actionBarSpinner.setAdapter(spinnerAdapter);
    if (spinnerAdapter.getCount() > 0) {
        actionBarSpinner.setSelection(0, true);
    }
}
 
开发者ID:TruckMuncher,项目名称:TruckMuncher-Android,代码行数:13,代码来源:VendorHomeActivity.java


注:本文中的android.widget.SimpleCursorAdapter.getCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。