What is the purpose of Android – feedreadercontract and how to define internal classes in the openhelper class

public static class FeedReaderContract{

    // Prevents the FeedReaderContract class from being instantiated.
    private FeedReaderContract() {} 

    //The FeedEntry table deFinition
    public static abstract class FeedEntry implements BaseColumns {
        public static final String TABLE_NAME = "entry";
        public static final String COLUMN_NAME_ENTRY_ID = "entryid";
        public static final String COLUMN_NAME_TITLE = "title";
        public static final String COLUMN_NAME_SUBTITLE = "subtitle";
        ...
    }

    //more tables deFinition
}

Therefore, you cannot implement the contract, but you can access all the internal classes constant. The routine shown is as follows:

private static final String sql_CREATE_ENTRIES =
"CREATE TABLE " + FeedReaderContract.FeedEntry.TABLE_NAME + " (" +
FeedReaderContract.FeedEntry._ID + " INTEGER PRIMARY KEY," //continues

Access the feedentry constants (table_name and _id) of the inner class in the feedreadercontract class

I hope I can help you

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>