Closed tusharsonawanes closed 3 years ago
@saghul cn you help us with this issue ? Where do we make changes for resolving this ?
I know why you are seeing this, but I don't know how to address it. In the sample app there is an Activity (MainActivity) which launches JitsiMeetActivity, and when you tap the app icon, MainActivity is what you see. The Jitsi Meet app is somewhat special, because its MainActivity is in fact an instance of JitsiMeetActivity, there is just one activity.
@saghul thank you for the quick help. I want to ask, how can we, at our end resolve this issue? If you could give us some examples or give us a hint which will resolve this issue?
Do we need to modify the SDK? Or do we need to change the code to redirect it to JitsiMeetActivity only? If it's not too much, can I share my code with you? I am just stuck on this one issue Thank you once again for the help.
You don't need to modify the SDK for this. I don't know exactly how, but this needs to be solved in your app, by doing something with the intent sent to MainActivity.
Sorted out. Can close the issue :) thanks for the help @saghul
Mind sharing how you solved it? It may help others!
@imrushi share the code. @saghul can we submit a PR ?
@saghul we were actually gonna ask you that ! If we could share. lol
Solution
public static final String met= "met";
public void onButtonClick(View v) {
EditText editText = findViewById(R.id.conferenceName);
String text = editText.getText().toString();
if (text.length() > 0) {
JitsiMeetConferenceOptions options
= new JitsiMeetConferenceOptions.Builder()
.setRoom(text)
.build();
JitsiMeetActivity.launch(this, options);
SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(met,true);
editor.commit();
}
}
when the user goes into the picture in picture mode form page (where take all inputs) goes is on paused state when we clock on the app icon it calls resume state. So in onResume() in MainActivity.java check if the meeting is going on or not if it's going redirect him to the meeting. MainActivity.java
@Override
protected void onResume() {
super.onResume();
SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
//get boolean value from shared preferences which we are store when joining meeting button is clicked
boolean check = sharedpreferences.getBoolean(met,false);
if (check){
//if meeting is going on redirect to meeting
startActivity(new Intent(this, JitsiMeetActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
}
}
when the user leaves the meeting shared preferences should set to false so for that, you should add JitsiMeetViewListener in which onConferenceTerminated() you should add this
@Override
public void onConferenceTerminated(Map<String, Object> map) {
Log.d(TAG, "onConferenceTerminated: set sharedpref false");
SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(bol,false);
editor.commit();
}
@Override
protected void onDestroy() {
super.onDestroy();
SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(bol,false);
editor.commit();
}
I hope this will help and solve everyone's problem.
@imrushi share the code. @saghul can we submit a PR ?
Yeah, a PR would make sense here.
I think you could store a flag in the Application, instead of using shared preferences.
@saghul Yes, we could store a flag in the Application.
@saghul I am getting same error in android by using react-native.I am adding flag but app not redirect to meeting.Please suggest how should I resolve this issue.
Hello, I have cloned the latest Android SDK and I have run both the java and the kotlin version in my android studio. I have the following issue in both the versions.
When I create a meeting, and I minimize it, the pip mode works great, but when I click the app icon, it takes me back to the start page ( where I am asked the meeting name ) when my current meeting is going on.
This doesn't happen in the official Jitsi Meet app. In the official version, if I am in a meeting and I minimize jitsi meet, the pip mode works great and when I click jitsi meet app icon, it takes me to the current ongoing meeting.
@imrushi and I have tried to resolve this but no luck. I have attached a screenshot below for your reference.!