Can we create component activity within an activity in MIT App Inventor for extension?

Hello, i was wondering if its possible to create a component activity within an activity?

What do you mean exactly? Because if you mean building your own activity and running it as a screen, then yes.

Yesterday a came across an app that was using non native oauth2. I clicked the login with google and custom tab opened and after completing flow it redirected back to app. I was referring to life cycle aware activity.

Can you please provide some code reference from MIT app inventor sources and any code snippet I can use to enhance my knowledge. Thanks

This has nothing to do with AppInventor. Just create a class that extends Activity like you would in Android Studio. Add the appropriate code to that class. Add that Activity to the Manifest. Then you can start that Activity using startActivity from your extension. The ListPicker and BarcodeScanner components do the same.