user7661245
user7661245

Reputation: 19

Can't initialize quickblox framework in fragment

I use these lines of codes to initialize quickblox framework in activity according to quickblox documentation

QBSettings.getInstance().init(getApplicationContext(), APP_ID, AUTH_KEY, AUTH_SECRET);
QBSettings.getInstance().setAccountKey(ACCOUNT_KEY);

but when i use the same code in fragment replacing getApplicationContext() with getActivity() it stops execution on that line, i have also tried getActivity().getApplicationContext and getActivity().getBaseContext() but not wokring for me

Upvotes: 0

Views: 70

Answers (1)

Rahul Sharma
Rahul Sharma

Reputation: 13593

You have to write these line of code In your Application class. Take a reference from Here

. Hope it will help you out.

Upvotes: 1

Related Questions