connexion20000
connexion20000

Reputation: 335

Fragments or Actvities in applications made by Google

I would like to ask about android applications made by Google. I know in Gmail this main activity with navigation drawer has fragments like labels and mail boxes. But when I click on mail message is it another fragment or another activity. The same for Play Store. Clicking on application card starts new activity or just initializes new fragment?

Upvotes: 1

Views: 163

Answers (2)

pepyakin
pepyakin

Reputation: 2235

You can use adb shell dumpsys activity command to inspect which activities are on current stack.

For example, looking in some app in Google Play (package name com.android.vending) looks like this:

  Stack #1:
    Task id #95
      TaskRecord{431faea0 #95 A=com.android.vending U=0 sz=1}
      Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10304000 cmp=com.android.vending/.AssetBrowserActivity bnds=[328,886][656,1176] }
        Hist #0: ActivityRecord{42bed540 u0 com.android.vending/.AssetBrowserActivity t95}
          Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10304000 cmp=com.android.vending/.AssetBrowserActivity bnds=[328,886][656,1176] }
          ProcessRecord{41ef5608 14444:com.android.vending/u0a16}

Thus all the way used fragments.

Upvotes: 1

prashantwosti
prashantwosti

Reputation: 1010

AFAIK, its just another fragment. You can easily distinguish activity and fragment. If view changes with actionbar its activity, if actionbar remains same and the content of activity changes is probably a fragment. That is my way to distinguish between activity and fragment.

Hope this helps.

Upvotes: 0

Related Questions