當前位置: 首頁>>代碼示例>>Java>>正文


Java DatabaseReference.removeValue方法代碼示例

本文整理匯總了Java中com.google.firebase.database.DatabaseReference.removeValue方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseReference.removeValue方法的具體用法?Java DatabaseReference.removeValue怎麽用?Java DatabaseReference.removeValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.firebase.database.DatabaseReference的用法示例。


在下文中一共展示了DatabaseReference.removeValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: removeUserWithEntityID

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
/**
 *Remove the thread from the given user threads ref.
 **/
public Promise<BThread, BError, Void> removeUserWithEntityID(String entityId){

    final Deferred<BThread, BError, Void>  deferred = new DeferredObject<>();

    BUser user = DaoCore.fetchOrCreateEntityWithEntityID(BUser.class, entityId);

    DatabaseReference ref = FirebasePaths.threadRef(this.entityId).child(BFirebaseDefines.Path.BUsersPath).child(entityId);

    ref.removeValue(new DatabaseReference.CompletionListener() {
        @Override
        public void onComplete(DatabaseError firebaseError, DatabaseReference firebase) {
            if (firebaseError == null)
                deferred.resolve(BThreadWrapper.this.model);
            else
                deferred.reject(getFirebaseError(firebaseError));
        }
    });
    
    return deferred.promise();
}
 
開發者ID:MobileDev418,項目名稱:chat-sdk-android-push-firebase,代碼行數:24,代碼來源:BThreadWrapper.java

示例2: removeThreadWithEntityId

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public Promise<BUserWrapper, DatabaseError, Void> removeThreadWithEntityId(String entityId){

        final Deferred<BUserWrapper, DatabaseError, Void> deferred = new DeferredObject<>();

        DatabaseReference userThreadRef = FirebasePaths.userRef(entityId).child(BFirebaseDefines.Path.BThreadPath).child(entityId);

        userThreadRef.removeValue(new DatabaseReference.CompletionListener() {
            @Override
            public void onComplete(DatabaseError firebaseError, DatabaseReference firebase) {
                if (firebaseError == null)
                {
                    deferred.resolve(BUserWrapper.this);
                }
                else
                {
                    deferred.reject(firebaseError);
                }
            }
        });
        
        return deferred.promise();

    }
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:24,代碼來源:BUserWrapper.java

示例3: recoverPrivateThread

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public Promise<BThread, BError, Void> recoverPrivateThread(){

        if (DEBUG) Timber.v("recoverPrivateThread");
        final Deferred<BThread, BError, Void> deferred = new DeferredObject<>();
        // Removing the deleted value from firebase.
        DatabaseReference threadUserRef = FirebasePaths.threadRef(entityId)
            .child(BFirebaseDefines.Path.BUsersPath)
            .child(BNetworkManager.sharedManager().getNetworkAdapter().currentUserModel().getEntityID())
            .child(BDefines.Keys.BDeleted);

        threadUserRef.removeValue();

        this.getModel().setDeleted(false);
        this.getModel().setType(BThread.Type.Private);
        final BThread toBeUpdated = this.getModel();
        this.loadMessages().done(new DoneCallback<List<BMessage>>() {
            @Override
            public void onDone(List<BMessage> bMessages) {
                toBeUpdated.setMessages(bMessages);
                DaoCore.updateEntity(toBeUpdated);
                deferred.resolve(toBeUpdated);
            }
        }).fail(new FailCallback<Void>() {
            @Override
            public void onFail(Void aVoid) {
                deferred.resolve(toBeUpdated);
            }
        });
        DaoCore.updateEntity(this.model);
        
        return deferred.promise();
        
    }
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:34,代碼來源:BThreadWrapper.java

示例4: unFollowUser

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
@Override
public void unFollowUser(BUser userToUnfollow) {
    if (!BDefines.EnableFollowers)
        throw new IllegalStateException("You need to enable followers in defines before you can use this method.");


    final BUser user = currentUserModel();

    // Remove the current user to the userToFollow "followers" path
    DatabaseReference userToFollowRef = FirebasePaths.userRef(userToUnfollow.getEntityID())
        .child(BFirebaseDefines.Path.FollowerLinks)
        .child(user.getEntityID());

    userToFollowRef.removeValue();

    FollowerLink follows = user.fetchOrCreateFollower(userToUnfollow, FollowerLink.Type.FOLLOWS);

    // Add the user to follow to the current user follow
    DatabaseReference curUserFollowsRef = FirebasePaths.firebaseRef().child(follows.getBPath().getPath());

    curUserFollowsRef.removeValue();

    DaoCore.deleteEntity(follows);
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:25,代碼來源:BChatcatNetworkAdapter.java

示例5: cancel

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public void cancel(View view) {

                showInternetStatus();
                if (!isInternetOn())            return;

                if (null != mCurrentLocation) {

                        if (checkBusSelection != 0) {
                                Log.d(TAG, "cancel fired...");

                                if (pickMeRadioButton != null) {
                                        pickMeRadioButton.setTypeface(Typeface.DEFAULT);
                                        if (checkBusSelection == pickMeRadioButton.getId()){
                                                pickMeRadioButton.setTextColor(getResources().getColor(R.color.primeColor));
                                        }
                                        else {
                                                pickMeRadioButton.setTextColor(Color.BLACK);
                                        }
                                        pickMeRadioButton = null;
                                }

                                floatingButton.setClickable(true);
                                floatingButton.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.primeColor)));
                                //String BUS = "b" + checkBusSelection;
                                Log.d(TAG, "theKey in @cancel = " + theKey);
                                Log.d(TAG, "BUS = " + BUS);
                                if(theKey == null) return;
                                DatabaseReference userDatabase = mDatabase.child(VEHICLE).child(BUS).child(theKey);
                                //String key = userDatabase.push().getKey();
                                Log.d(TAG, "AWESOME @ =  "+userDatabase.toString());
                                userDatabase.removeValue();
                                Log.d(TAG, "AWESOME2 @ =  "+userDatabase.toString());
                                Toast.makeText(MapsActivity.this, "REQUEST ENDED", Toast.LENGTH_SHORT).show();
                                theKey = null;
//                                Button button = (Button) findViewById(R.id.pick_me);

                        }

                } else {
                        Log.d(TAG, "location is null ...............");
                }

        }
 
開發者ID:kuldeep725,項目名稱:GogoNew,代碼行數:44,代碼來源:MapsActivity.java

示例6: deleteIndividual

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Individual deleteIndividual(String id) {
   
    DatabaseReference  DelRef= IndividualRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:IndividualService.java

示例7: deleteLocalization

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Localization deleteLocalization(String id) {
   
    DatabaseReference  DelRef= LocalizationRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:LocalizationService.java

示例8: deleteLocation

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Location deleteLocation(String id) {
   
    DatabaseReference  DelRef= LocationRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:LocationService.java

示例9: deleteOperation_type

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Operation_type deleteOperation_type(String id) {
   
    DatabaseReference  DelRef= Operation_typeRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:Operation_TypeService.java

示例10: deleteProduct_Type

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Product_Type deleteProduct_Type(String id) {
   
    DatabaseReference  DelRef= Product_TypeRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:Product_CategoryService.java

示例11: deleteOperation_State

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Operation_State deleteOperation_State(String id) {
   
    DatabaseReference  DelRef= Operation_StateRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:Operation_StateService.java

示例12: deleteEntrepot

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Entrepot deleteEntrepot(String id) {
   
    DatabaseReference  DelRef= EntrepotRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:EntrepotService.java

示例13: deletePerson

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Person deletePerson(String id) {
   
    DatabaseReference  DelRef= PersonRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:PersonService.java

示例14: deleteAddress

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Address deleteAddress(String id) {
   
    DatabaseReference  DelRef= AddressRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:AddressService.java

示例15: deleteProduct

import com.google.firebase.database.DatabaseReference; //導入方法依賴的package包/類
public static Product deleteProduct(String id) {
   
    DatabaseReference  DelRef= ProductRef.child(id);
    
    DelRef.removeValue();
    

}
 
開發者ID:projets2017cl,項目名稱:vc,代碼行數:9,代碼來源:ProductService.java


注:本文中的com.google.firebase.database.DatabaseReference.removeValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。