小编Tom*_*ble的帖子

如何以编程方式隐藏android中的一些,但不是全部,查看XML输出中的项目?

我正在尝试在Eclipse上为我的Android手机编写一个光盘高尔夫评分应用程序.我想为最多6名玩家设置它,但大多数人会将其用于游戏.数据存储在sqlite数据库中,我使用SimpleCursorAdapter来填充已经评分过的漏洞的数据.这是代码:

private void fillData() {
    Cursor notesCursor = mDbHelper.fetchAllNotes();
    startManagingCursor(notesCursor);

    // Create an array to specify the fields we want to display in the list (only TITLE)

    String[] from = new String[]{DiscGolfDbAdapter.KEY_HOLE,
            DiscGolfDbAdapter.KEY_PAR,
            DiscGolfDbAdapter.KEY_TOM_HOLE,
            DiscGolfDbAdapter.KEY_TOM_GAME,
            DiscGolfDbAdapter.KEY_CRAIG_HOLE,
            DiscGolfDbAdapter.KEY_CRAIG_GAME,
            DiscGolfDbAdapter.KEY_TOMS_POSITION,
            DiscGolfDbAdapter.KEY_SKIP_PLAYER
    };

    // and an array of the fields we want to bind those fields to (in this case just text1)
    int[] to = new int[]{R.id.schole, R.id.scpar, R.id.scth, R.id.sctg, R.id.scch, R.id.sccg, R.id.sctp,
            R.id.skip};

    // Now create a simple cursor adapter and set …
Run Code Online (Sandbox Code Playgroud)

java xml eclipse android android-layout

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

android-layout ×1

eclipse ×1

java ×1

xml ×1