mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-26 14:21:16 +00:00
Added workaround for samsung 4.2 crash (fixes #591).
This commit is contained in:
parent
b690ccbdec
commit
a04a05b8e8
1 changed files with 15 additions and 3 deletions
|
@ -3,6 +3,7 @@ package com.nutomic.syncthingandroid.activities;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.R;
|
import com.nutomic.syncthingandroid.R;
|
||||||
|
|
||||||
|
@ -14,15 +15,26 @@ import com.nutomic.syncthingandroid.R;
|
||||||
*/
|
*/
|
||||||
public class ToolbarBindingActivity extends AppCompatActivity {
|
public class ToolbarBindingActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private static final String TAG = "ToolbarBindingActivity";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
super.onPostCreate(savedInstanceState);
|
super.onPostCreate(savedInstanceState);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
if (toolbar != null) {
|
if (toolbar == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
//noinspection ConstantConditions
|
} catch (NoClassDefFoundError e) {
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
// Workaround for crash on Samsung 4.2 devices.
|
||||||
|
// This should be fixed in support library 24.0.0
|
||||||
|
// https://code.google.com/p/android/issues/detail?id=78377#c364
|
||||||
|
// https://github.com/syncthing/syncthing-android/issues/591
|
||||||
|
Log.w(TAG, e);
|
||||||
}
|
}
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue