Hello Everyone, Leakcanary gives me the log as bel...
# android
t
Hello Everyone, Leakcanary gives me the log as below. can please some one suggest me to resolve this
k
Your onItemClickListener has a reference to the activity
t
okay..let me check this..
@Karol Ksionek thanks for the help
đź‘Ť 1
@Karol Ksionek can please suggest me the for below error too. i am directly using as TexttoSpeech class in many activity
Copy code
TexttoSpeech(this ,"Starting Object Search Assistance")
k
Are you using Activity context in order to create TexttoSpeech instance? If so, you need to clean it up in Activity’s onDestroy (or earlier), or use application context. Depending on the use case.
t
let me check this.
@Karol Ksionek yes i replaced application context with activity context for creating TexttoSpeech instance. Then there was no memory leak. thanks for the help alot. so please correct me if understanding is wrong. application context handle destroying the instance of all the class through out application
thank you for suggestions :)