Fix potential crashes

This commit is contained in:
tom79 2019-08-04 12:01:55 +02:00
parent 34629f6d35
commit df4b70687b
2 changed files with 6 additions and 9 deletions

View File

@ -157,6 +157,9 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
if( !disableAnimatedEmoji ){
if( tmr == null){
tmr = new Timer();
}
tmr.schedule(new TimerTask() {
@Override
public void run() {

View File

@ -253,6 +253,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
if( !disableAnimatedEmoji ){
if( tmr == null){
tmr = new Timer();
}
tmr.schedule(new TimerTask() {
@Override
public void run() {
@ -272,9 +275,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
this.type = type;
this.targetedId = targetedId;
redraft = false;
if( tmr == null){
tmr = new Timer();
}
lstHolders = new ArrayList<>();
startUpdateTimer();
@ -291,9 +291,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
this.targetedId = targetedId;
redraft = false;
this.tagTimeline = tagTimeline;
if( tmr == null){
tmr = new Timer();
}
lstHolders = new ArrayList<>();
startUpdateTimer();
}
@ -308,9 +305,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
this.conversationPosition = position;
this.targetedId = targetedId;
redraft = false;
if( tmr == null){
tmr = new Timer();
}
lstHolders = new ArrayList<>();
startUpdateTimer();