Fixed crash reported by play store
This commit is contained in:
parent
3c93974534
commit
26b276d62c
3 changed files with 12 additions and 2 deletions
|
@ -332,6 +332,8 @@ public class LinphoneManager implements SensorEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized Core getCore() {
|
public static synchronized Core getCore() {
|
||||||
|
if (!LinphoneContext.isReady()) return null;
|
||||||
|
|
||||||
if (getInstance().mExited) {
|
if (getInstance().mExited) {
|
||||||
// Can occur if the UI thread play a posted event but in the meantime the
|
// Can occur if the UI thread play a posted event but in the meantime the
|
||||||
// LinphoneManager was destroyed
|
// LinphoneManager was destroyed
|
||||||
|
|
|
@ -419,7 +419,11 @@ public abstract class MainActivity extends LinphoneGenericActivity
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME);
|
intent.setAction(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
try {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
} catch (IllegalStateException ise) {
|
||||||
|
Log.e("[Main Activity] Can't start home activity: ", ise);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void quit() {
|
private void quit() {
|
||||||
|
|
|
@ -89,7 +89,11 @@ public class CallStatsFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
LinphoneManager.getCore().removeListener(mListener);
|
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
core.removeListener(mListener);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDrawer(DrawerLayout drawer, RelativeLayout content) {
|
public void setDrawer(DrawerLayout drawer, RelativeLayout content) {
|
||||||
|
|
Loading…
Reference in a new issue