same GooglePlus client object in different activities android

keen

I want to create a library for GooglePlus. For this I created multiple classes like login, posting, fetching user profile.

Do I have to implement onConnected, onDisconnected, onConnectionFailed ? Do I have to call plusClient.connect() in every class?

Currently If I connect() in first(login) class and then tries to post on use's account from different activity then it's giving a problem. I have to connect() it again even if i have done this in previous activity.

Is there a solution for this that I can use same plusClient object in multiple activities?

Thanks in advance.

Lee

The PlusClient class is designed to be lightweight so that there is no need to share a PlusClient instances across activity instances. See:

Access google plus client from multiple activities

That said, there is nothing which prevents you from doing this as long as you make sure that PlusClient.connect() and PlusClient.disconnect() are called at appropriate times if you manage your PlusClient as part of a service or application object.

Also, note that PlusClient has now been deprecated in favour of GoogleApiClient. For this discussion though, they are equivalent.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android how to access the same object through different activities

From Dev

Android - Get same intent from different activities

From Dev

Android - Get same intent from different activities

From Dev

same webview for different activities

From Dev

How to use the same ArrayList in different activities (Android and Java)

From Dev

Android LiveData - how to reuse the same ViewModel on different activities?

From Dev

Android - Getting and modifying the same List from two different activities

From Dev

Android tabhost with different activities

From Dev

Android tabhost with different activities

From Java

Same Navigation Drawer in different Activities

From Dev

Using the same ArrayAdapter in different Activities?

From Dev

Use the same object between activities

From Dev

Android Reusing activities with different data

From Dev

Switching Activities with different layouts in Android

From Dev

Android Espresso - Testing on different Activities

From Dev

Object Sharing Between Activities in Android

From Dev

Passing an object through Activities (Android)

From Dev

Different toolbar colors for different activities android

From Dev

How To Use Same LinearLayout In Different Activities

From Dev

Use same Recycler Adapter for inflating different activities

From Dev

Android Same Button and Listview in All Activities

From Dev

How to access the same variable between Activities in Android

From Dev

Android: NavigationDrawer/multiple activities/same menu

From Dev

How to link listview items to different activities in android?

From Dev

How to use different Activities with TabHost Widget in Android?

From Dev

Android - how to return to different previous activities

From Dev

Android GooglePlus API ERROR

From Dev

Android Parcelable Object Between Activities Clone

From Dev

Android Parcelable object not passing properly between activities

Related Related

  1. 1

    Android how to access the same object through different activities

  2. 2

    Android - Get same intent from different activities

  3. 3

    Android - Get same intent from different activities

  4. 4

    same webview for different activities

  5. 5

    How to use the same ArrayList in different activities (Android and Java)

  6. 6

    Android LiveData - how to reuse the same ViewModel on different activities?

  7. 7

    Android - Getting and modifying the same List from two different activities

  8. 8

    Android tabhost with different activities

  9. 9

    Android tabhost with different activities

  10. 10

    Same Navigation Drawer in different Activities

  11. 11

    Using the same ArrayAdapter in different Activities?

  12. 12

    Use the same object between activities

  13. 13

    Android Reusing activities with different data

  14. 14

    Switching Activities with different layouts in Android

  15. 15

    Android Espresso - Testing on different Activities

  16. 16

    Object Sharing Between Activities in Android

  17. 17

    Passing an object through Activities (Android)

  18. 18

    Different toolbar colors for different activities android

  19. 19

    How To Use Same LinearLayout In Different Activities

  20. 20

    Use same Recycler Adapter for inflating different activities

  21. 21

    Android Same Button and Listview in All Activities

  22. 22

    How to access the same variable between Activities in Android

  23. 23

    Android: NavigationDrawer/multiple activities/same menu

  24. 24

    How to link listview items to different activities in android?

  25. 25

    How to use different Activities with TabHost Widget in Android?

  26. 26

    Android - how to return to different previous activities

  27. 27

    Android GooglePlus API ERROR

  28. 28

    Android Parcelable Object Between Activities Clone

  29. 29

    Android Parcelable object not passing properly between activities

HotTag

Archive