tccpg288
tccpg288

Reputation: 3352

Android Studio Not Recognizing Method

Android Studio is giving me a compile error, and I have no idea why. I was working on the app with no issues, now it is saying that one of my methods is never used:

enter image description here

I have created the method and was compiling the app no problem just minutes before. The method is now greyed out as well:

 private void increasePollTotalVoteCounter(int checkedRadioButtonID) {
    mRefAtPollIndexImmediatelyBelowDate.child(VOTE_COUNT_LABEL).runTransaction(new Transaction.Handler() {
        @Override

        public Transaction.Result doTransaction(MutableData mutableData) {
            mutableData.setValue((Long) mutableData.getValue() + 1);
            return Transaction.success(mutableData);

        }

        @Override
        public void onComplete(FirebaseError firebaseError, boolean b, DataSnapshot dataSnapshot) {
            if (firebaseError != null) {
                Toast.makeText(getActivity().getApplicationContext(), firebaseError.getMessage(), Toast.LENGTH_LONG).show();

            }
        }

    });
}

I tried cleaning the project and that approach didn't work either. Any thoughts?

Upvotes: 0

Views: 445

Answers (1)

Bala Raja
Bala Raja

Reputation: 627

Try to make your method public instead of private

Upvotes: 1

Related Questions