When you see the default Zoom meeting UI within your Android SDK app, it means that the SDK has launched its own MeetingActivity. Unless you have created a custom UI, this Activity will always be present in the SDK's back stack for as long as you are connected to the meeting.
While the default UI is powerful and maintains feature parity with the Zoom client, there may be some additional desired functionality which requires "behind the scenes" interaction programmatically, but isn't quite heavyweight enough to warrant building out an entirely customized meeting UI. In this case, extending the MeetingActivity is a great option with significantly less technical overhead than building a meeting UI from scratch would require.
Prerequisites
- Android Studio
- An Android device or emulator running API 21+
- An Android app capable of joining or starting a Zoom meeting through the Zoom Android Client SDK
Define an Activity
To get started, we are first going to need to define an Activity which extends the MeetingActivity class. You can use Android Studio's built-in Activity generation tools, but be sure to avoid applying your own layout to the activity. The SDK already has a robust meeting UI built into it. If you would like to create your own meeting UI, please use the custom UI feature.
Kotlin:
class MyMeetingActivity : MeetingActivity() {
Java:
public class MyMeetingActivity extends MeetingActivity {
Optionally, you may also choose to implement Activity lifecycle callbacks, such as onCreate and onDestroy.
Kotlin:
override fun onCreate(savedInstanceState: Bundle) {
super.onCreate(savedInstanceState)
Toast.makeText(this, "MeetingActivity onCreate", Toast.LENGTH_SHORT).show()
}
override fun onDestroy() {
super.onDestroy()
Toast.makeText(this, "MeetingActivity onDestroy", Toast.LENGTH_SHORT).show()
}
Java:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toast.makeText(this, "MeetingActivity onCreate", Toast.LENGTH_SHORT).show();
}
@Override
protected void onDestroy() {
super.onDestroy();
Toast.makeText(this, "MeetingActivity onDestroy", Toast.LENGTH_SHORT).show();
}
Assign a Config Value
After creating your Activity, you will need a way of making the SDK aware of which Activity to use instead of the base MeetingActivity instance. To do this, simply navigate to your AndroidManifest.xml file and locate the activity element associated with the Activity you created in the previous step of this guide. It should look something like this:
<activity
android:name="com.mypackage.projectname.MyMeetingActivity" />
Add a theme attribute to this element of @style/ZMTheme.SubWindow. You should also enable hardware acceleration. Your element should now look something like this:
<activity
android:name="com.mypackage.projectname.MyMeetingActivity"
android:theme="@style/ZMTheme.SubWindow"
android:hardwareAccelerated="true" />
Next, navigate to your app's config.xml file. If you do not already have one in your project, you can create one by adding it to the res/values directory in your project by right-clicking and selecting New -> Values Resource File and entering config.xml as the name. Once the file is created, you will need to make note of the fully qualified name of your Activity. This will probably look something like com.mypackage.projectname.MyMeetingActivity.
Now within the resources element, create a new string element with a name attribute of zm_config_conf_activity. The value of this element should be set to the Activity name we mentioned above.
<resources>
<string name="zm_config_conf_activity">com.mypackage.projectname.MyMeetingActivity</string>
</resources>
Verification
Now that you have setup the Activity and designated it as the meeting Activity through your config.xml, you are ready to test this out! Join or start a Zoom meeting and the Activity you created earlier should start up. If you have added any logs/toasts/snackbars/etc. to the onCreate method of your Activity, they should be triggered as soon as the meeting UI is visible.