在我的 Android 应用程序中显示数据(现在保存效果很好)

发布于 2024-10-16 00:59:12 字数 6010 浏览 1 评论 0原文

嘿, 现在我可以将数据保存在数据库中,但它不会显示在数据库活动本身中。

@覆盖 公共无效onCreate(捆绑保存实例状态){ super.onCreate(savedInstanceState); onCreateDBAndDBTabled(); //DB 和 Tables erstellen wenn noch nicht vorhanden setContentView(R.layout.main); 语句

private void onCreateDBAndDBTabled() {
    myDB = this.openOrCreateDatabase(MY_DB_NAME, Context.MODE_PRIVATE, null);
    myDB.execSQL("CREATE TABLE IF NOT EXISTS " + MY_DB_TABLE
                + " ( id integer primary key autoincrement,"+ 
                      "Name varchar(100),"+ 
                      "Comment varchar(128),"+ 
                      "BookingDetails varchar(255),"+ 
                      "CustomerProject integer(3),"+ 
                      "editable varchar(15))"
                +";");

    }


public boolean onCreateOptionsMenu(Menu menu) {
      super.onCreateOptionsMenu(menu);

        menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)
        .setShortcut('1', 'f')
        .setIcon(R.drawable.icon);
         return true;

      }

public boolean onOptionsItemSelected(MenuItem item){
      switch (item.getItemId()) {
      case MENU_PROJECTS:
        Intent iProjects = new Intent(this, Projects.class);
        startActivity(iProjects);
        return true;
      }
      return false;
    }

是插入

{

                        ContentValues cv = new ContentValues(); 
                        cv.put ( "Name", Name.getText().toString() ); 
                        cv.put ( "Comment", Comment.getText().toString() ); 
                        cv.put ( "BookingDetails", BookingDetails.getText().toString() ); 
                        cv.put ( "Project_kind", i ); 
                        cv.put ( "Editable", Editable.getText().toString() ); 
                        myDB.insert ( Projectshome.MY_DB_TABLE , null, cv); 
                    }
                    finish();
                    return true;
this is my manifest:

</manifest> 

这是我点击保存按钮时的 LogCat 输出:

02-09 11:41:53.850: ERROR/Database(719): Error inserting BookingDetails=BookingDetails Project_kind=0 Name=Name Editable=Editable Comment=Comment
02-09 11:41:53.850: ERROR/Database(719): android.database.sqlite.SQLiteException: table projects has no column named Project_kind: , while compiling: INSERT INTO projects(BookingDetails, Project_kind, Name, Editable, Comment) VALUES(?, ?, ?, ?, ?);
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:925)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1300)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1173)
02-09 11:41:53.850: ERROR/Database(719):     at versuch.datenbank.Projects_New.onOptionsItemSelected(Projects_New.java:132)
02-09 11:41:53.850: ERROR/Database(719):     at android.app.Activity.onMenuItemSelected(Activity.java:2085)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:820)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:813)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:519)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.View.onTouchEvent(View.java:3828)
02-09 11:41:53.850: ERROR/Database(719):     at android.widget.TextView.onTouchEvent(TextView.java:6291)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.View.dispatchTouchEvent(View.java:3368)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
02-09 11:41:53.850: ERROR/Database(719):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-09 11:41:53.850: ERROR/Database(719):     at android.os.Looper.loop(Looper.java:123)
02-09 11:41:53.850: ERROR/Database(719):     at android.app.ActivityThread.main(ActivityThread.java:3948)
02-09 11:41:53.850: ERROR/Database(719):     at java.lang.reflect.Method.invokeNative(Native Method)
02-09 11:41:53.850: ERROR/Database(719):     at java.lang.reflect.Method.invoke(Method.java:521)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
02-09 11:41:53.850: ERROR/Database(719):     at dalvik.system.NativeStart.main(Native Method)

希望您能再次帮助我:)

hey,
now i can save data in my db, but it doesn't show up in the database activity itself.

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
onCreateDBAndDBTabled(); //DB und Tables erstellen wenn noch nicht vorhanden
setContentView(R.layout.main);
}

private void onCreateDBAndDBTabled() {
    myDB = this.openOrCreateDatabase(MY_DB_NAME, Context.MODE_PRIVATE, null);
    myDB.execSQL("CREATE TABLE IF NOT EXISTS " + MY_DB_TABLE
                + " ( id integer primary key autoincrement,"+ 
                      "Name varchar(100),"+ 
                      "Comment varchar(128),"+ 
                      "BookingDetails varchar(255),"+ 
                      "CustomerProject integer(3),"+ 
                      "editable varchar(15))"
                +";");

    }


public boolean onCreateOptionsMenu(Menu menu) {
      super.onCreateOptionsMenu(menu);

        menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)
        .setShortcut('1', 'f')
        .setIcon(R.drawable.icon);
         return true;

      }

public boolean onOptionsItemSelected(MenuItem item){
      switch (item.getItemId()) {
      case MENU_PROJECTS:
        Intent iProjects = new Intent(this, Projects.class);
        startActivity(iProjects);
        return true;
      }
      return false;
    }

}

This is the insert statement

{

                        ContentValues cv = new ContentValues(); 
                        cv.put ( "Name", Name.getText().toString() ); 
                        cv.put ( "Comment", Comment.getText().toString() ); 
                        cv.put ( "BookingDetails", BookingDetails.getText().toString() ); 
                        cv.put ( "Project_kind", i ); 
                        cv.put ( "Editable", Editable.getText().toString() ); 
                        myDB.insert ( Projectshome.MY_DB_TABLE , null, cv); 
                    }
                    finish();
                    return true;
this is my manifest:

</manifest> 

here is my LogCat-output the moment i hit the save-button:

02-09 11:41:53.850: ERROR/Database(719): Error inserting BookingDetails=BookingDetails Project_kind=0 Name=Name Editable=Editable Comment=Comment
02-09 11:41:53.850: ERROR/Database(719): android.database.sqlite.SQLiteException: table projects has no column named Project_kind: , while compiling: INSERT INTO projects(BookingDetails, Project_kind, Name, Editable, Comment) VALUES(?, ?, ?, ?, ?);
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.native_compile(Native Method)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.compile(SQLiteProgram.java:110)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:59)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:41)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:925)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1300)
02-09 11:41:53.850: ERROR/Database(719):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1173)
02-09 11:41:53.850: ERROR/Database(719):     at versuch.datenbank.Projects_New.onOptionsItemSelected(Projects_New.java:132)
02-09 11:41:53.850: ERROR/Database(719):     at android.app.Activity.onMenuItemSelected(Activity.java:2085)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:820)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:813)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:519)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.View.onTouchEvent(View.java:3828)
02-09 11:41:53.850: ERROR/Database(719):     at android.widget.TextView.onTouchEvent(TextView.java:6291)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.View.dispatchTouchEvent(View.java:3368)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
02-09 11:41:53.850: ERROR/Database(719):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
02-09 11:41:53.850: ERROR/Database(719):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-09 11:41:53.850: ERROR/Database(719):     at android.os.Looper.loop(Looper.java:123)
02-09 11:41:53.850: ERROR/Database(719):     at android.app.ActivityThread.main(ActivityThread.java:3948)
02-09 11:41:53.850: ERROR/Database(719):     at java.lang.reflect.Method.invokeNative(Native Method)
02-09 11:41:53.850: ERROR/Database(719):     at java.lang.reflect.Method.invoke(Method.java:521)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
02-09 11:41:53.850: ERROR/Database(719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
02-09 11:41:53.850: ERROR/Database(719):     at dalvik.system.NativeStart.main(Native Method)

hope you can help me again :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

柠北森屋 2024-10-23 00:59:12

请提供更多信息。如错误日志中所示。错误可能出现在语句本身中。首先添加 logcat 中的详细信息。它会澄清。

Please provide more information. As in the error log. The error might be in the statement itself.Add the details from the logcat first.It will clarify.

寒江雪… 2024-10-23 00:59:12

我认为插入查询缺少单词“值”。尝试在控制台上打印该查询字符串,通过数据库上的控制台执行相同的操作。这可能会帮助您识别错误。

I think the insert query is missing word 'values'. Try printing that query string on console executing the same through console on db. That may help you identify error.

尽揽少女心 2024-10-23 00:59:12

我有两件事要指出:

SQL 查询中的 i 是什么?它是一个int吗?如果是这样,这可能是问题所在,因为您使用它的方式,它应该是一个String

其次,为什么不使用 SQLiteDatabase 的 insert 便捷功能呢?

ContentValues cv = new ContentValues();
cv.put ( "Name", Name.getText().toString() );
cv.put ( "Comment", Comment.getText().toString() );
cv.put ( "BookingDetails", BookingDetails.getText().toString() );
cv.put ( "Project_kind", i );
cv.put ( "Editable", Editable.getText().toString() );
myDB.insert ( Projectshome.MY_DB_TABLE, null, cv );

这消除了构建 SQL 查询的所有复杂性,不再需要插入行 - 它将确保正确构建查询,您所要做的就是正确构建 ContentValues 映射。

I have two things to point out:

What is i in your SQL query? Is it an int? If so that might be the problem because the way you are using it, it should be a String.

Secondly, why don't you use the insert convenience function of SQLiteDatabase?

ContentValues cv = new ContentValues();
cv.put ( "Name", Name.getText().toString() );
cv.put ( "Comment", Comment.getText().toString() );
cv.put ( "BookingDetails", BookingDetails.getText().toString() );
cv.put ( "Project_kind", i );
cv.put ( "Editable", Editable.getText().toString() );
myDB.insert ( Projectshome.MY_DB_TABLE, null, cv );

This takes all the complexity of building the SQL query out of inserting rows - it will ensure that the query is correctly built, all you have to do is build the ContentValues map properly.

七婞 2024-10-23 00:59:12

好的,我是这样做的:

row.xml (用于列表视图中的每一行):

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="4px"
    >
    <LinearLayout
        android:id="@+id/LinearLayout01"
            android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TextView android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:textStyle="bold"
            android:singleLine="true"
            android:ellipsize="end"
            android:id="@+id/itemDescription"/>
        <TextView
            android:text="@+id/TextView01"
            android:id="@+id/Category"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        </TextView>
    </LinearLayout>
    <LinearLayout
        android:id="@+id/LinearLayout01"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="fill_parent"
            android:text="@+id/TextView01"
            android:gravity="center_vertical"
            android:layout_weight="1"
            android:singleLine="true"
            android:ellipsize="end"
            android:id="@+id/itemManufacturer"
            android:layout_height="wrap_content">
        </TextView>
        <TextView
            android:text="@+id/TextView01"
            android:id="@+id/EAN"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        </TextView>
    </LinearLayout>
</LinearLayout>

我扩展 CursorAdapter 来创建或重新使用现有的 ListActivity 行(由 row.xml 中定义的 ListActivity 提供。如果 Android 希望您重用现有的行资源,则使用 bindView;如果希望您创建新的行资源,则使用 newView

class BarcodeAdapter extends CursorAdapter {
    BarcodeAdapter(Cursor c) {
        super(kitchenListInventoryActivity.this, c);
    }

    @Override
    public void bindView(View row, Context ctxt,
                                             Cursor c) {
        BarcodeHolder holder=(BarcodeHolder)row.getTag();
        holder.populateFrom(c, helper);
    }

    @Override
    public View newView(Context ctxt, Cursor c,
                                             ViewGroup parent) {
        LayoutInflater inflater=getLayoutInflater();
        View row = null;
        row = inflater.inflate(R.layout.row, parent, false);
        BarcodeHolder holder=new BarcodeHolder(row);

        row.setTag(holder);

        return(row);
    }
}

BarcodeHolder 只是一个保存行的 Java 表示形式的便利类,我将其与上面的 setTagListActivity 项关联起来。不一定是最优雅的方式,但它简化了事情。:

    static class BarcodeHolder {
        private TextView description=null;
        private TextView manufacturer=null;
        private TextView EAN = null;
        private TextView category = null;
        private View row=null;

        BarcodeHolder(View row) {
            this.row=row;

            description=(TextView)row.findViewById(R.id.itemDescription);
            manufacturer=(TextView)row.findViewById(R.id.itemManufacturer);
            EAN=(TextView)row.findViewById(R.id.EAN);
            category = ( TextView )row.findViewById(R.id.Category);
        }

        void populateFrom(Cursor c, BarcodeHelper helper) {
            Cursor invCursor = helper.getByInventoryEAN(helper.getBarcode(c));
            Cursor dbCursor = helper.getByEAN(helper.getBarcode(c));
            dbCursor.moveToFirst();
            invCursor.moveToFirst();
            int qty = helper.getQuantity ( invCursor );
            String desc = helper.getDescription(dbCursor) + " (" + String.valueOf( qty ) + ")" ;
            description.setText( desc );
            manufacturer.setText(helper.getManufacturer(dbCursor));
            category.setText(helper.getCategory(dbCursor));
        }
    }

为了将所有这些结合在一起,我在 ListActivityonCreate 中调用 initList

private void initList ( ) {
    if ( model != null ) {
        stopManagingCursor(model);
        model.close();
    }

    model = helper.getAllInventory();
    startManagingCursor(model);
    adapter = new BarcodeAdapter(model);
    setListAdapter(adapter);
}

model 是一个 Cursor,而 adapterBarcodeAdapter 的实例,如我上面所示。我告诉 ListActivity 使用此适配器,以便我可以正确填充行。 getAllInventoryBarcodeHelper 的成员,它重写 SQLiteOpenHelper

public Cursor getAllInventory( ) {
    String sql = "SELECT _id, EAN, quantity FROM Inventory ORDER BY EAN";
    return(getReadableDatabase().rawQuery(sql, null));
}

帮助程序对象仅包含便利函数的集合。

所有这些都基于 CommonsWare 优秀的 Android 教程书,我强烈推荐这本书,但这里应该有足够的内容来帮助您去。

OK, so here's how I do it:

row.xml (Used for each row in the list view):

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="4px"
    >
    <LinearLayout
        android:id="@+id/LinearLayout01"
            android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TextView android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:textStyle="bold"
            android:singleLine="true"
            android:ellipsize="end"
            android:id="@+id/itemDescription"/>
        <TextView
            android:text="@+id/TextView01"
            android:id="@+id/Category"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        </TextView>
    </LinearLayout>
    <LinearLayout
        android:id="@+id/LinearLayout01"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="fill_parent"
            android:text="@+id/TextView01"
            android:gravity="center_vertical"
            android:layout_weight="1"
            android:singleLine="true"
            android:ellipsize="end"
            android:id="@+id/itemManufacturer"
            android:layout_height="wrap_content">
        </TextView>
        <TextView
            android:text="@+id/TextView01"
            android:id="@+id/EAN"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        </TextView>
    </LinearLayout>
</LinearLayout>

I extend CursorAdapter to create or re-use existing ListActivity rows (supplied by the ListActivity) defined in row.xml. bindView is used if Android wants you to re-use an existing row resource, newView is used if it wants you to create a new one:

class BarcodeAdapter extends CursorAdapter {
    BarcodeAdapter(Cursor c) {
        super(kitchenListInventoryActivity.this, c);
    }

    @Override
    public void bindView(View row, Context ctxt,
                                             Cursor c) {
        BarcodeHolder holder=(BarcodeHolder)row.getTag();
        holder.populateFrom(c, helper);
    }

    @Override
    public View newView(Context ctxt, Cursor c,
                                             ViewGroup parent) {
        LayoutInflater inflater=getLayoutInflater();
        View row = null;
        row = inflater.inflate(R.layout.row, parent, false);
        BarcodeHolder holder=new BarcodeHolder(row);

        row.setTag(holder);

        return(row);
    }
}

BarcodeHolder is just a convenience class to hold a Java representation of the row, which I associate with the ListActivity item with setTag above. Not necessarily the most elegant way, but it simplifies things.:

    static class BarcodeHolder {
        private TextView description=null;
        private TextView manufacturer=null;
        private TextView EAN = null;
        private TextView category = null;
        private View row=null;

        BarcodeHolder(View row) {
            this.row=row;

            description=(TextView)row.findViewById(R.id.itemDescription);
            manufacturer=(TextView)row.findViewById(R.id.itemManufacturer);
            EAN=(TextView)row.findViewById(R.id.EAN);
            category = ( TextView )row.findViewById(R.id.Category);
        }

        void populateFrom(Cursor c, BarcodeHelper helper) {
            Cursor invCursor = helper.getByInventoryEAN(helper.getBarcode(c));
            Cursor dbCursor = helper.getByEAN(helper.getBarcode(c));
            dbCursor.moveToFirst();
            invCursor.moveToFirst();
            int qty = helper.getQuantity ( invCursor );
            String desc = helper.getDescription(dbCursor) + " (" + String.valueOf( qty ) + ")" ;
            description.setText( desc );
            manufacturer.setText(helper.getManufacturer(dbCursor));
            category.setText(helper.getCategory(dbCursor));
        }
    }

To bring this all together, I call initList in my onCreate of the ListActivity:

private void initList ( ) {
    if ( model != null ) {
        stopManagingCursor(model);
        model.close();
    }

    model = helper.getAllInventory();
    startManagingCursor(model);
    adapter = new BarcodeAdapter(model);
    setListAdapter(adapter);
}

model is a Cursor, and adapter is an instance of BarcodeAdapter, which I've shown above. I tell the ListActivity to use this adapter so that I can correctly populate the rows. getAllInventory is a member of BarcodeHelper which overrides SQLiteOpenHelper:

public Cursor getAllInventory( ) {
    String sql = "SELECT _id, EAN, quantity FROM Inventory ORDER BY EAN";
    return(getReadableDatabase().rawQuery(sql, null));
}

The helper object just contains a collection of convenience functions.

All of this is based on CommonsWare's excellent Android tutorial book which I cannot recommend enough, but there should be enough here to get you going.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文