2016-07-08 23 views
1

DBFlow Content Providerを使用してURIを作成する必要があります。 URIが正しく生成されていません。dbFlow Androidで正しくuriを作成するには

この私のデータベースとコンテンツプロバイダクラス

enter image description here

これは

enter image description here

エンドポイント

私の最初の表であり、これはエンドポイント

enter image description here

私の第二表です0

私はこのようなURIの必要があります。

enter image description here

が、これはDBFlowは、URIを生成する方法である。

enter image description here

私が間違っているのでしょうか? @PathSegment注釈はURIに/*/#を作成する必要があります。

答えて

0

私はあなたにも私は、カーソルローダーでコンテンツプロバイダを使用しているか確認することができ

public static final String ENDPOINT = "PostData"; 
@ContentUri(path = ENDPOINT, type = ContentUri.ContentType.VND_MULTIPLE + ENDPOINT) 
public static final Uri CONTENT_URI = Uri.parse(AppDatabase.BASE_CONTENT_URI + AppDatabase.AUTHORITY 
     + "/" + ENDPOINT); 

そして、私のデータベースクラスは、この

@ContentProvider(authority = AppDatabase.AUTHORITY, 
     database = AppDatabase.class, 
     baseContentUri = AppDatabase.BASE_CONTENT_URI) 
@Database(name = AppDatabase.NAME, version = AppDatabase.VERSION) 
public class AppDatabase { 

    public static final String NAME = "AppDatabase"; // we will add the .db extension 

    public static final int VERSION = 2; 

    public static final String AUTHORITY = "com.hashx19.pristinekashmir.dbflowcontentprovider"; 

    public static final String BASE_CONTENT_URI = "content://"; } 

のように見えるこの方法を使用してCONTENT_URIを生成したhere

関連する問題